diff --git a/.changeset/native-windows-route.md b/.changeset/native-windows-route.md deleted file mode 100644 index 32b2b67a4b..0000000000 --- a/.changeset/native-windows-route.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@tanstack/react-nativescript-router': minor -'@tanstack/router-core': minor -'@tanstack/react-router': minor -'@tanstack/react-start': minor -'@tanstack/start-plugin-core': minor -'@tanstack/router-cli': minor -'@tanstack/history': patch -'@tanstack/react-start-client': patch -'@tanstack/start-server-core': patch -'@tanstack/solid-router': patch -'@tanstack/vue-router': patch ---- - -Add the official React NativeScript adapter, native stack navigation contracts, -standalone TanStack Start client compilation, and `tsr native init` scaffolding. diff --git a/.changeset/rsbuild-manifest-module-chunks-once.md b/.changeset/rsbuild-manifest-module-chunks-once.md new file mode 100644 index 0000000000..02febd9d84 --- /dev/null +++ b/.changeset/rsbuild-manifest-module-chunks-once.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Rsbuild: the Start manifest pass that runs after every client compilation (builds and each dev update) reads an imported module's chunks once per compilation and counts the module once per importing chunk, instead of once per import connection. The manifest is unchanged; the pass takes about 40 % less time (on a 333-route app, tens of milliseconds less per HMR update). diff --git a/.changeset/rsbuild-manifest-own-chunks.md b/.changeset/rsbuild-manifest-own-chunks.md new file mode 100644 index 0000000000..04e8e29928 --- /dev/null +++ b/.changeset/rsbuild-manifest-own-chunks.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Rsbuild: a route's client manifest entry lists only its own chunks and CSS. When two routes shared a module in a chunk of its own, each route's entry also listed the other route's chunk as a preload and its stylesheet. diff --git a/.changeset/rsbuild-rule-use-falsy-loaders.md b/.changeset/rsbuild-rule-use-falsy-loaders.md new file mode 100644 index 0000000000..a84a054fbd --- /dev/null +++ b/.changeset/rsbuild-rule-use-falsy-loaders.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +fix: the Rsbuild RSC integration skips falsy entries in a rule's `use` array (Rspack's conditionally disabled loaders) instead of treating them as loaders. diff --git a/.changeset/rsbuild-virtual-modules-build.md b/.changeset/rsbuild-virtual-modules-build.md new file mode 100644 index 0000000000..01a0c5ee6e --- /dev/null +++ b/.changeset/rsbuild-virtual-modules-build.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Rsbuild: fix the Rsbuild plugin build after two changes to its virtual modules crossed. Without this fix the package does not build, so no release could ship it. The Rsbuild dev manifest is written to its virtual module under the app's root. diff --git a/.changeset/rsbuild-virtual-modules-root.md b/.changeset/rsbuild-virtual-modules-root.md new file mode 100644 index 0000000000..427043a712 --- /dev/null +++ b/.changeset/rsbuild-virtual-modules-root.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Rsbuild: Start writes its virtual modules under the app's root, not the working directory. An app built or served from another directory (`rsbuild build --root ` from a monorepo root) no longer fails with "Module not found" on the packages they import, such as RSC's serialization adapters. diff --git a/.changeset/rsc-security-floor.md b/.changeset/rsc-security-floor.md new file mode 100644 index 0000000000..9c828f13b3 --- /dev/null +++ b/.changeset/rsc-security-floor.md @@ -0,0 +1,8 @@ +--- +'@tanstack/react-start-rsc': patch +--- + +Raise the minimum RSC bundler peer dependencies to versions with the React Server Components fixes for GHSA-xqc2-xf4c-x3h3 (CVE-2026-126187, unauthenticated RCE) and GHSA-h3gv-c5rc-p453 (server function DoS): + +- `@vitejs/plugin-rsc` to `>=0.5.38` (GHSA-59pf-q495-3c99), which vendors a fixed `react-server-dom-webpack`. +- `react-server-dom-rspack` to `>=0.1.1`, the first release built from React sources that include the fix. diff --git a/.changeset/start-server-fn-custom-id-check.md b/.changeset/start-server-fn-custom-id-check.md new file mode 100644 index 0000000000..384f0ade06 --- /dev/null +++ b/.changeset/start-server-fn-custom-id-check.md @@ -0,0 +1,7 @@ +--- +'@tanstack/start-plugin-core': minor +--- + +A server function id that a custom `serverFns.generateFunctionId` returns and that never worked over HTTP now fails the build, with an error naming the file, the function and the id: whitespace, a control or non-ASCII character, any of `"`, `#`, `/`, `<`, `>`, `?`, `\`, `^`, `` ` ``, `{`, `}`, the ids `.` and `..`, and a percent-encoding the server reads as another id (`%41`, lowercase hex, `%2E`) or rejects. The client puts the id in the URL unencoded, so a `#` or `?` ended the path and a `/` cut the id short (the call silently ran another server function of the file or none), and the other characters reached the server percent-encoded and matched no function. An id embedding a non-ASCII `functionName` is one of these. One case did work and now fails the build: such an id on a server function only SSR code called. + +Ids with `%` or the other characters URLs allow (such as `:`, `@`, `+`, `=`, `,`, `;`, `!`, `*`, `(`, `)`, `&`, `'`, `|`, `[`, `]`) still build and reach their handler, with a deprecation warning (from the Vite plugin; the Rsbuild plugin does not print compiler warnings yet): the next major version rejects them, since proxies and servers may decode or rewrite them (hash the inputs instead, as the documented example does). An id with `'` no longer breaks the server bundle. diff --git a/.changeset/start-vite-root-library-discovery.md b/.changeset/start-vite-root-library-discovery.md new file mode 100644 index 0000000000..d4e8221c59 --- /dev/null +++ b/.changeset/start-vite-root-library-discovery.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Vite: Start finds the Start libraries it bundles in the SSR build from Vite's root, not the working directory. A `vite build ` run from another directory (a monorepo root, a script) no longer leaves them external and uncompiled, where their server fns returned `undefined`. diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000000..21d884dbeb --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json + +reviews: + request_changes_workflow: false + slop_detection: + enabled: true + +knowledge_base: + code_guidelines: + enabled: true + filePatterns: + - 'CONTRIBUTING.md' diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a33150af03..9dd0def7bd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -4,6 +4,14 @@ body: - type: markdown attributes: value: | + + Thank you for reporting an issue :pray:. This issue tracker is for reporting bugs found in TanStack Router and/or Start. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..a5ef10f1ff --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,22 @@ +## 🎯 Changes + + + +## ✅ Checklist + +- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/router/blob/main/CONTRIBUTING.md). +- [ ] I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request. +- [ ] I fully understand the code in this pull request, including any code generated with AI assistance. + +## 🚀 Release Impact + +- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). +- [ ] This change is docs/CI/dev-only (no release). + + diff --git a/.github/renovate.json b/.github/renovate.json index 01be1ce5c2..6fd5aa1c86 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -21,7 +21,6 @@ "@types/node", "@types/react", "@types/react-dom", - "h3", "node", "react", "react-dom", diff --git a/.github/workflows/client-nav-benchmarks.yml b/.github/workflows/benchmarks.yml similarity index 88% rename from .github/workflows/client-nav-benchmarks.yml rename to .github/workflows/benchmarks.yml index a56bb70334..bbc3a1fa24 100644 --- a/.github/workflows/client-nav-benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -18,9 +18,18 @@ on: pull_request: paths: - 'packages/**' + - '!packages/**/tests/**' + - '!packages/**/__tests__/**' + - '!packages/**/*.test.*' - 'benchmarks/**' + - '.nvmrc' workflow_dispatch: +concurrency: + group: benchmarks-${{ github.ref }} + cancel-in-progress: false + queue: single + permissions: contents: read # required for actions/checkout id-token: write # required for OIDC authentication with CodSpeed @@ -72,7 +81,8 @@ jobs: @benchmarks/${{ matrix.benchmark }}:build:${{ matrix.framework }} - name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark - uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0 + uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1 + timeout-minutes: 20 with: mode: ${{ matrix.mode }} run: >- diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index d0deda36a7..51ffa28e4c 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -8,11 +8,19 @@ on: paths: - 'packages/**' - 'benchmarks/**' + - 'scripts/benchmarks/bundle-size/**' + - '.nvmrc' + - 'package.json' + - 'pnpm-lock.yaml' push: branches: [main] paths: - 'packages/**' - 'benchmarks/**' + - 'scripts/benchmarks/bundle-size/**' + - '.nvmrc' + - 'package.json' + - 'pnpm-lock.yaml' workflow_dispatch: concurrency: @@ -43,7 +51,7 @@ jobs: uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main - name: Measure Bundle Size - run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache + run: pnpm benchmark:bundle-size --outputStyle=stream --skipRemoteCache - name: Capture Benchmark Outputs id: capture @@ -101,6 +109,8 @@ jobs: cat benchmarks/bundle-size/results/pr-comment.md - name: Upsert Sticky PR Comment + # Fork PRs have a read-only GITHUB_TOKEN, so they cannot update comments. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -110,7 +120,7 @@ jobs: benchmark-main: name: Publish Bundle Size History - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'TanStack' + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && github.repository_owner == 'TanStack' runs-on: ubuntu-latest permissions: contents: write @@ -125,7 +135,7 @@ jobs: uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main - name: Measure Bundle Size - run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache + run: pnpm benchmark:bundle-size --outputStyle=stream --skipRemoteCache - name: Publish Benchmark Dashboard uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1 with: diff --git a/.github/workflows/compiler-platforms.yml b/.github/workflows/compiler-platforms.yml new file mode 100644 index 0000000000..ad70e39bb6 --- /dev/null +++ b/.github/workflows/compiler-platforms.yml @@ -0,0 +1,101 @@ +name: Compiler Platforms + +# The main PR workflow only runs on Linux x64 (glibc). The compilers load a +# native Yuku binary per platform and handle platform-specific paths, so run +# their unit tests and a Vite and Rsbuild production build on the other +# platforms we ship to. + +on: + pull_request: + paths: + - 'packages/router-utils/**' + - 'packages/router-generator/**' + - 'packages/router-plugin/**' + - 'packages/start-plugin-core/**' + - 'pnpm-lock.yaml' + - '.github/workflows/compiler-platforms.yml' + schedule: + # Weekly, to catch new Yuku releases and runner image updates + - cron: '0 6 * * 1' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +env: + NX_DAEMON: 'false' + NX_NO_CLOUD: 'true' + +defaults: + run: + shell: bash + +jobs: + compiler: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + # actions/setup-node only ships glibc builds, so musl uses Alpine's Node image + container: ${{ matrix.container }} + strategy: + fail-fast: false + matrix: + include: + - name: Windows x64 + os: windows-latest + - name: macOS arm64 + os: macos-latest + - name: Linux arm64 + os: ubuntu-24.04-arm + - name: Linux x64 musl + os: ubuntu-latest + container: node:24.8.0-alpine3.22@sha256:3e843c608bb5232f39ecb2b25e41214b958b0795914707374c8acc28487dea17 + steps: + - name: Install system packages + if: ${{ matrix.container }} + shell: sh + run: apk add --no-cache bash git + - name: Keep LF line endings + # Snapshots are stored with LF. Windows runners check out CRLF by default, + # and with `* text=auto` disabling autocrlf alone still uses the native eol + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup pnpm + if: ${{ !matrix.container }} + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 + - name: Setup Node + if: ${{ !matrix.container }} + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: .nvmrc + package-manager-cache: false + - name: Setup pnpm (container) + if: ${{ matrix.container }} + run: npm install --global "$(node -p "require('./package.json').packageManager")" + - name: Install dependencies + run: >- + pnpm install --frozen-lockfile + --filter . + --filter "@tanstack/router-utils..." + --filter "@tanstack/router-generator..." + --filter "@tanstack/router-plugin..." + --filter "@tanstack/start-plugin-core..." + --filter "tanstack-react-start-e2e-basic..." + - name: Unit tests + run: >- + pnpm nx run-many --targets=test:unit + --projects=@tanstack/router-utils,@tanstack/router-generator,@tanstack/router-plugin,@tanstack/start-plugin-core + --skip-nx-cache --outputStyle=static + - name: Production builds + run: >- + pnpm nx run-many --targets=build:vite:ssr,build:rsbuild:ssr + --projects=tanstack-react-start-e2e-basic + --skip-nx-cache --outputStyle=static diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d8c779b170..fde1100409 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,6 +9,8 @@ permissions: jobs: labeler: + # Fork PRs have a read-only GITHUB_TOKEN, so they cannot update labels. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest steps: - name: Labeller diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 71026a0a92..ae19b4f0d2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,6 +10,13 @@ concurrency: env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} SERVER_PRESET: 'node-server' + # Enable dynamic task packing for distributed CI. + NX_CLOUD_AGENT_TASK_QUEUE: true + NX_CLOUD_AUTO_TASK_PACKING: true + NX_CLOUD_AGENT_UNCAPPED_GROUP_WORK: true + NX_CLOUD_PACKING_MEM_MULTIPLIER: 1.5 + NX_CLOUD_BUFFER_TASK_COMPLETIONS: true + NX_CLOUD_CONTINUOUS_ASSIGNMENT: true permissions: contents: read @@ -26,8 +33,8 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - name: Start Nx Agents - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" + - name: Start Nx Workers + run: npx nx-cloud start-workers - name: Setup Tools uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main - name: Get base and head commits for `nx affected` @@ -36,9 +43,9 @@ jobs: main-branch-name: main - name: Run Checks run: pnpm run test:pr --parallel=3 - - name: Stop Nx Agents + - name: Stop Nx Workers if: ${{ always() }} - run: npx nx-cloud stop-all-agents + run: npx nx-cloud stop-all-workers preview: name: Preview runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 1699592784..70028b2860 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ nx-cloud.env .nx/workspace-data .nx/polygraph .nx/self-healing +.nx/migrate-runs gpt/db.json diff --git a/.nvmrc b/.nvmrc index b404027604..63f87c20ef 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -24.8.0 +26.12.1 diff --git a/.nx/ci-config.yaml b/.nx/ci-config.yaml new file mode 100644 index 0000000000..2f0783feb4 --- /dev/null +++ b/.nx/ci-config.yaml @@ -0,0 +1,5 @@ +dte: + distribute-on: + small-changeset: 6 linux-medium-js + medium-changeset: 12 linux-medium-js + large-changeset: 18 linux-medium-js diff --git a/.nx/workflows/dynamic-changesets.yaml b/.nx/workflows/dynamic-changesets.yaml deleted file mode 100644 index 786111053d..0000000000 --- a/.nx/workflows/dynamic-changesets.yaml +++ /dev/null @@ -1,4 +0,0 @@ -distribute-on: - small-changeset: 4 linux-medium-js - medium-changeset: 8 linux-medium-js - large-changeset: 14 linux-medium-js diff --git a/.nx/workflows/ultracache-config.yaml b/.nx/workflows/ultracache-config.yaml new file mode 100644 index 0000000000..b3ed223621 --- /dev/null +++ b/.nx/workflows/ultracache-config.yaml @@ -0,0 +1,124 @@ +ignore-reads: + - e2e/.gitignore + - '**/src/routeTree.gen.ts' +ignore-writes: + - '**/src/routeTree.gen.ts' +task-exclusions: + - target: test:build + ignore-reads: + - LICENSE + # HMR tests edit these inputs in place and restore their original contents. + # Keep them out of cached outputs so cache replay never overwrites source. + - project: tanstack-react-start-e2e-deferred-hydration + target: test:e2e + ignore-writes: + - e2e/react-start/deferred-hydration/src/routes/components.tsx + - project: tanstack-react-start-e2e-hmr + target: test:e2e + ignore-writes: &hmr-source-writes + - e2e/react-start/hmr/src/components/AliasedRouteImportChildPanel.tsx + - e2e/react-start/hmr/src/components/AliasedRouteImportParentPanel.tsx + - e2e/react-start/hmr/src/hmr/server-fn-hmr-factory.ts + - e2e/react-start/hmr/src/routes/__root.tsx + - e2e/react-start/hmr/src/routes/child.tsx + - e2e/react-start/hmr/src/routes/component-hmr-inline-error-split.tsx + - e2e/react-start/hmr/src/routes/component-hmr-inline-nosplit.tsx + - e2e/react-start/hmr/src/routes/component-hmr-inline-split.tsx + - e2e/react-start/hmr/src/routes/component-hmr-lowercase-named-split.tsx + - e2e/react-start/hmr/src/routes/component-hmr-named-error-split.tsx + - e2e/react-start/hmr/src/routes/component-hmr-named-nosplit.tsx + - e2e/react-start/hmr/src/routes/component-hmr-named-split.tsx + - e2e/react-start/hmr/src/routes/index.tsx + - e2e/react-start/hmr/src/routes/inputs.tsx + - project: tanstack-react-start-e2e-hmr + target: test:e2e--vite-ssr + ignore-writes: *hmr-source-writes + - project: tanstack-react-start-e2e-hmr + target: test:e2e--vite-ssr--bundled-dev + ignore-writes: *hmr-source-writes + - project: tanstack-react-start-e2e-hmr + target: test:e2e--rsbuild-ssr + ignore-writes: *hmr-source-writes + - project: tanstack-react-start-e2e-rsbuild + target: test:e2e--rsbuild-ssr + ignore-writes: + - e2e/react-start/rsbuild/src/routes/index.tsx + - project: tanstack-react-start-e2e-server-functions + target: test:e2e + ignore-writes: + - e2e/react-start/server-functions/src/routes/consistent.tsx + # Scaffolding tests deliberately populate tracked empty route fixtures. + - project: '@tanstack/router-generator' + target: test:unit + ignore-writes: + - packages/router-generator/tests/generator/custom-scaffolding/routes/__root.tsx + - packages/router-generator/tests/generator/custom-scaffolding/routes/api/bar.tsx + - packages/router-generator/tests/generator/custom-scaffolding/routes/foo.lazy.tsx + - packages/router-generator/tests/generator/custom-scaffolding/routes/index.tsx + # These reads are of scratch files created by the same test invocation. + - project: tanstack-solid-start-e2e-basic-auth + target: test:e2e + ignore-reads: + - e2e/solid-start/basic-auth/.tmp/dev.db + - project: tanstack-vue-start-e2e-basic-auth + target: test:e2e + ignore-reads: + - e2e/vue-start/basic-auth/.tmp/dev.db + - project: '@tanstack/router-generator' + target: test:unit + ignore-reads: + - packages/router-generator/tests/generator/file-modification/routes/[(]test[)]/initiallyEmpty.tsx + - packages/router-generator/tests/generator/file-modification/routes/[(]test[)]/initiallyEmpty.lazy.tsx + # Mutable counters are scratch state, not artifacts to replay from cache. + - project: tanstack-react-start-e2e-basic-tsr-config + target: test:e2e + ignore-reads: + - e2e/react-start/basic-tsr-config/count.txt + ignore-writes: + - e2e/react-start/basic-tsr-config/count.txt + - project: tanstack-solid-start-e2e-basic-tsr-config + target: test:e2e + ignore-reads: + - e2e/solid-start/basic-tsr-config/count.txt + ignore-writes: + - e2e/solid-start/basic-tsr-config/count.txt + - project: tanstack-vue-start-e2e-basic-tsr-config + target: test:e2e + ignore-reads: + - e2e/vue-start/basic-tsr-config/count.txt + ignore-writes: + - e2e/vue-start/basic-tsr-config/count.txt + # Paraglide downloads compiler plugins from the URLs in settings.json. + # Ignore warm-cache reads; the settings remain inputs and cache files outputs. + - project: tanstack-react-start-e2e-i18n-paraglide + target: build + ignore-reads: + - e2e/react-start/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-router-e2e-react-i18n-paraglide + target: build + ignore-reads: + - e2e/react-router/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-react-start-e2e-i18n-paraglide + target: test:e2e + ignore-reads: + - e2e/react-start/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-router-e2e-react-i18n-paraglide + target: test:e2e + ignore-reads: + - e2e/react-router/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-router-i18n-paraglide + target: build + ignore-reads: + - examples/react/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-start-i18n-paraglide + target: build + ignore-reads: + - examples/react/start-i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-router-solid-i18n-paraglide + target: build + ignore-reads: + - examples/solid/i18n-paraglide/project.inlang/cache/plugins/* + - project: tanstack-solid-start-i18n-paraglide + target: build + ignore-reads: + - examples/solid/start-i18n-paraglide/project.inlang/cache/plugins/* diff --git a/.prettierignore b/.prettierignore index 65991e1964..de501452ad 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,4 +17,7 @@ node_modules /.nx/workspace-data **/src/routeTree.gen.ts packages/router-plugin/tests/**/test-files/** -.nx/self-healing \ No newline at end of file +.nx/self-healing + +# Preserve the pinned upstream URL fixtures byte for byte. +packages/router-core/tests/fixtures/wpt-url/urltestdata*.json diff --git a/AGENTS.md b/AGENTS.md index 490cb691d4..f47b5103e1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,177 +1,41 @@ # AGENTS.md -## Project overview +## Scope -TanStack Router is a type-safe router with built-in caching and URL state management for React and Solid applications. This monorepo contains two main products: +- Read applicable nested `AGENTS.md` files before editing or testing a subtree. +- Shared routing belongs in `packages/router-core`; check React, Solid, and Vue bindings for shared changes. Shared Start runtime/build logic lives in `packages/start-*-core`. -- **TanStack Router** - Core routing library with type-safe navigation, search params, and path params -- **TanStack Start** - Full-stack framework built on top of TanStack Router +## Work and validation -## Setup commands +- Start bug fixes with a failing regression test that uses only public APIs to reproduce and assert user- or developer-visible behavior. Do not manufacture bugs by mutating internals. Establish whether real usage can reach the failing state before adding runtime handling; simplify handling of states proven unreachable. +- When removing an API, option, or behavior, delete its tests. Never add tests that assert the removed thing is gone, such as `not.toHaveProperty('oldName')`, a type error for the old call, or a runtime throw. +- For suspected dependency issues, verify the upstream root cause, then propose an upstream fix to the user, including for other `@tanstack/*` packages. **Never implement a workaround in this repository unless the user explicitly authorizes it.** +- During debugging/prototyping, keep fixes aligned with the PR's intended architecture. If making a test pass requires another flag, counter, copied deadline, or duplicate completion authority, stop and consolidate state and ownership. Remove superseded paths instead of accumulating patches and bundle growth. +- Use Node from `.nvmrc` and pnpm from root `package.json`. Install at the root with `CI=1 pnpm install --frozen-lockfile`. +- For sandbox-blocked registry/store access, escalate the same command; report the blocker if unavailable. Do not change stores, delete dependencies/lockfiles, use `--force`/`--ignore-scripts`, or weaken workspace trust/build policies to bypass it. +- Never manually edit `pnpm-lock.yaml` or any `routeTree.gen.ts`. Regenerate the lockfile with `pnpm install --no-frozen-lockfile` after intentional dependency changes; regenerate route trees through app builds/dev servers or the generator fixture harness. +- Always use control-flow braces. Run `pnpm format` before validation. +- Use Nx: workspace imports consume built packages, so direct runners can test stale dependencies. Inspect resolved targets with `pnpm nx show project --json`; some are inferred. +- Run finite validation through `run-many` with explicit projects and targets, including a single project/target. Nx automatically selects `summary` output when it detects an AI agent: omit `--outputStyle` for normal runs. Read the reported full log files for failures; use `--outputStyle=summary` if agent detection is unavailable. +- Use `--outputStyle=static` or `pnpm nx run :` only when diagnosing a task and its full output is needed. Continuous/watch targets may use live output. -- Install deps: `pnpm install` -- Setup e2e testing: `pnpm exec playwright install` -- Build packages: `pnpm build` (affected) or `pnpm build:all` (force all) -- Start dev server: `pnpm dev` -- Run tests: `pnpm test` +```sh +CI=1 NX_DAEMON=false pnpm nx run-many -p -t --skipRemoteCache +``` -## Code style +- Run one Nx command at a time. For a ~20-second startup/graph stall, stop, run `pnpm nx reset`, and retry once, then escalate. Do not apply that timeout to running tests. +- For code changes, run affected packages' `test:unit`, `test:types`, and `test:eslint` where available, including affected consumers; use `test:e2e` for browser/app behavior and `test:build` for exports/build changes. Root `pnpm test` includes the full e2e suite. Published-code changes require `pnpm changeset`. -- TypeScript strict mode with extensive type safety -- Framework-agnostic core logic separated from React/Solid bindings -- Type-safe routing with search params and path params -- Use workspace protocol for internal dependencies (`workspace:*`) -- Always use curly braces for `if`, `else`, loops, and similar control statements. Never write one-line bodies like `if (foo) x = 1`. +## Runtime rules -## Dev environment tips +- Import `isServer` from `@tanstack/router-core/isServer`. Conditional exports select: `development` → `undefined`; server (`workerd`, `worker`, `deno`, `node`, `bun`) → `true` except `NODE_ENV=test` → `undefined`; browser/fallback → `false`. `development` wins; `NODE_ENV=development` alone does not select it. +- Keep `isServer ?? router.isServer` directly in each branch condition for dead-code elimination; negate the whole expression for client branches. Never extract it into a variable (e.g. `const serverRendering = isServer ?? router.isServer`) or helper. Without a router, inline `isServer ?? typeof window === 'undefined'` (or the existing `document` check). Keep the constant first and use `??`, never `||`. +- **Never create UI/router reactivity on the server, including development/tests.** Branch before reactive setup; use direct reads and core non-reactive stores. Required transport listeners are allowed only with request-scoped lifetimes and cleanup. +- Shared route definitions/build metadata must not acquire request/user data. Keep it on the request's Router, context, or QueryClient. +- HMR can replace code while caches and pending work survive. Invalidate derived state or bypass caching in development; reject stale async results while preserving intentional HMR identities/state. +- Gate developer diagnostics and message construction with direct `process.env.NODE_ENV !== 'production'` checks. Preserve required validation/throws in production (e.g. detailed development error, compact `invariant()` failure). `!== 'development'` also enables the guarded code in tests; preserve existing dev-server mode gates. -- This is a pnpm workspace monorepo with packages organized by functionality -- Nx provides caching, affected testing, targeting, and parallel execution for efficiency -- Use `pnpm nx show projects` to list all available packages -- Target specific packages: `pnpm nx run @tanstack/react-router:test:unit` -- Target multiple packages: `pnpm nx run-many --target=test:eslint --projects=@tanstack/history,@tanstack/router-core` -- Run affected tests only: `pnpm nx affected --target=test:unit` -- Exclude patterns: `pnpm nx run-many --target=test:unit --exclude="examples/**,e2e/**"` -- Navigate to examples and run `pnpm dev` to test changes: `cd examples/react/basic && pnpm dev` -- **Granular unit testing through Nx (recommended):** - - Specific files: `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx tests/Scripts.test.tsx` - - Test patterns: `pnpm nx run @tanstack/react-router:test:unit -- tests/ClientOnly.test.tsx -t "should render fallback"` - - Name patterns: `pnpm nx run @tanstack/react-router:test:unit -- -t "navigation"` (all tests with "navigation" in name) - - Exclude patterns: `pnpm nx run @tanstack/react-router:test:unit -- --exclude="**/*link*" tests/` - - List tests: `pnpm nx run @tanstack/react-router:test:unit -- list tests/link.test.tsx` (or `-- list` for all) -- **Available test targets per package:** `test:unit`, `test:types`, `test:eslint`, `test:build`, `test:perf`, `build` -- **Testing strategy:** Package level (nx) → File-level args via nx → Test-level args (`-t`) via nx → Pattern-level args (`--exclude`) via nx -- **Agent execution guardrails (important):** - - Always prefer `pnpm nx ...` over `npx nx ...`. - - Prefer Nx targets over direct test runners so task dependencies (including required builds) remain in the graph. - - In sandbox, run Nx with `CI=1 NX_DAEMON=false pnpm nx run : --outputStyle=stream --skipRemoteCache` - - Run only one Nx command at a time. - - If an Nx command shows no output for ~20 seconds, stop, run `pnpm nx reset` once, and retry once. - - Do not loop retries indefinitely. If it still hangs or sandbox blocks graph/daemon behavior, request escalation immediately. +## Performance and final bundle pass -## Testing instructions - -- **Critical**: Always run unit and type tests during development - do not proceed if they fail -- **Test types:** `pnpm test:unit`, `pnpm test:types`, `pnpm test:eslint`, `pnpm test:e2e`, `pnpm test:build` -- **Full CI suite:** `pnpm test:ci` -- **Fix formatting:** `pnpm format` -- **Efficient targeted testing workflow:** - 1. **Affected only:** `pnpm nx affected --target=test:unit` (compares to main branch) - 2. **Specific packages:** `pnpm nx run @tanstack/react-router:test:unit` - 3. **Specific files:** `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx` - 4. **Specific patterns:** `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx -t "preloading"` -- **Pro tips:** - - Use `pnpm nx run @tanstack/react-router:test:unit -- list` to explore available tests before running - - Use `-t "pattern"` to focus on specific functionality during development - - Use `--exclude` patterns to skip unrelated tests - - Keep all test filtering arguments behind `pnpm nx run ... -- ...` for maximum precision while preserving task dependencies -- **Example workflow:** `pnpm nx run @tanstack/react-router:test:unit` → `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx` → `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx -t "preloading"` - -## PR instructions - -- Always run `pnpm test:eslint`, `pnpm test:types`, and `pnpm test:unit` before committing -- Test changes in relevant example apps: `cd examples/react/basic && pnpm dev` -- Update corresponding documentation in `docs/` directory when adding features -- Add or update tests for any code changes -- Use internal docs links relative to `docs/` folder (e.g., `./guide/data-loading`) - -## Package structure - -**Core packages:** - -- `packages/router-core/` - Framework-agnostic core router logic -- `packages/react-router/`, `packages/solid-router/` - React/Solid bindings and components -- `packages/history/` - Browser history management - -**Tooling:** - -- `packages/router-cli/` - CLI tools for code generation -- `packages/router-generator/` - Route generation utilities -- `packages/router-plugin/` - Universal bundler plugins (Vite, Webpack, ESBuild, Rspack) -- `packages/virtual-file-routes/` - Virtual file routing system - -**Developer experience:** - -- `packages/router-devtools/`, `packages/*-router-devtools/` - Development tools -- `packages/eslint-plugin-router/` - ESLint rules for router - -**Validation adapters:** - -- `packages/zod-adapter/`, `packages/valibot-adapter/`, `packages/arktype-adapter/` - -**Start framework:** - -- `packages/*-start/`, `packages/start-*/` - Full-stack framework packages - -**Examples & testing:** - -- `examples/react/`, `examples/solid/` - Example applications (test changes here) -- `e2e/` - End-to-end tests (requires Playwright) -- `docs/router/`, `docs/start/` - Documentation with React/Solid subdirectories - -**Dependencies:** Uses workspace protocol (`workspace:*`) - core → framework → start packages - -## Common development tasks - -**Adding new routes:** - -- Use file-based routing in `src/routes/` directories -- Or use code-based routing with route definitions -- Run route generation with CLI tools - -**Testing changes:** - -- Build packages: `pnpm build` or `pnpm dev` (watch mode) -- Run example apps to test functionality -- Use devtools for debugging router state - -**Documentation updates:** - -- Update relevant docs in `docs/` directory -- Ensure examples reflect documentation changes -- Test documentation links and references -- Use relative links to `docs/` folder format - -## Framework-specific notes - -**React:** - -- Uses React Router components and hooks -- Supports React Server Components (RSC) -- Examples include React Query integration -- Package: `@tanstack/react-router` - -**Solid:** - -- Uses Solid Router components and primitives -- Supports Solid Start for full-stack applications -- Examples include Solid Query integration -- Package: `@tanstack/solid-router` - -## Environment requirements - -- **Node.js** - Required for development -- **pnpm** - Package manager (required for workspace features) -- **Playwright** - Required for e2e tests (`pnpm exec playwright install`) - -## Key architecture patterns - -- **Type Safety**: Extensive TypeScript for type-safe routing -- **Framework Agnostic**: Core logic separated from framework bindings -- **Plugin Architecture**: Universal bundler plugins using unplugin -- **File-based Routing**: Support for both code-based and file-based routing -- **Search Params**: First-class support for type-safe search parameters - -## Development workflow - -1. **Setup**: `pnpm install` and `pnpm exec playwright install` -2. **Build**: `pnpm build:all` or `pnpm dev` for watch mode -3. **Test**: Make changes and run relevant tests (use nx for targeted testing) -4. **Examples**: Navigate to examples and run `pnpm dev` to test changes -5. **Quality**: Run `pnpm test:eslint`, `pnpm test:types`, `pnpm test:unit` before committing - -## References - -- **Documentation**: https://tanstack.com/router -- **GitHub**: https://github.com/TanStack/router -- **Discord Community**: https://discord.com/invite/WrRKjPJ +- For runtime/memory changes, compare identical baseline/candidate workloads using the relevant [benchmark guide](benchmarks/AGENTS.md): client navigation, Start SSR, or memory. Add coverage for unmeasured mechanisms. +- **Last phase for every change affecting emitted client JavaScript**, including core/build transforms: complete the full [bundle-size-optimization skill](.agents/skills/bundle-size-optimization/SKILL.md) after correctness and performance validation. The full workflow is mandatory. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9e793926f..4b6e808af1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,17 @@ TanStack Router is a community project. Contributions to both TanStack Router an ## Before you start -PRs that require API changes must first be proposed as an issue and receive maintainer sign-off before implementation begins. +- Search the [open and closed issues](https://github.com/TanStack/router/issues?q=is%3Aissue) before reporting a bug. If it has not already been reported, use the [bug report template](https://github.com/TanStack/router/issues/new?template=bug_report.yml). +- Search the [open and closed pull requests](https://github.com/TanStack/router/pulls?q=is%3Apr) before starting work to avoid duplicating an existing contribution. +- Pull requests that require API changes must first be proposed as an issue and receive maintainer sign-off before implementation begins. + +## Pull request guidelines + +Every pull request must follow the [TanStack Router pull request template](.github/pull_request_template.md). Complete its description and checklist without removing or bypassing the required sections. + +- Keep each pull request focused on one change or topic. Pull requests that combine unrelated changes will be closed with a request to split them into separately reviewable contributions. +- Write a concise description that clearly explains what changed and why. Follow the sections in the pull request template; a long, unstructured description makes a contribution harder to review. +- Every change that affects a published package must include a changeset. Create it with `pnpm changeset`; documentation, CI, examples, and development-only changes do not require one. ## Development @@ -132,10 +142,19 @@ pnpm dev ## AI-assisted contributions + + AI tools can be useful for exploring the codebase, drafting changes, and writing tests. They do not replace the contributor's responsibility for the result. 1. **Keep the contribution in your own voice**. Review and rewrite generated code comments, issue reports, and pull request descriptions so they reflect what you actually mean. 2. **Keep ownership of technical decisions**. Understand every change, verify its behavior with the appropriate tests and documentation, and be ready to explain it during review. 3. **Do not paste LLM output verbatim into the codebase or a contribution**. Treat generated text and code as a draft: check its claims, adapt it to the repository, and remove anything you cannot justify. Issues or pull requests that appear to contain unreviewed LLM output may be closed without further review. +4. **Do not mass-submit unrelated or low-quality AI-generated pull requests**. We treat that behavior as spam and may close the pull requests, block the contributor, and report the GitHub account. AI-assisted contributions follow the same standards for correctness, testing, documentation, and review as every other contribution. diff --git a/README.md b/README.md index 8dd7deef41..736715b12a 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,20 @@ - + + + + TanStack Router + ## TanStack Router @@ -23,10 +33,20 @@ A modern router designed for type safety, data‑driven navigation, and seamless - + + + + TanStack Start + ## TanStack Start diff --git a/_artifacts/domain_map.yaml b/_artifacts/domain_map.yaml index 4b5d6f8386..0b2672f0c6 100644 --- a/_artifacts/domain_map.yaml +++ b/_artifacts/domain_map.yaml @@ -147,13 +147,15 @@ skills: context types to not flow into loader. wrong_pattern: | createFileRoute('/posts')({ - loader: ({ context }) => context.queryClient.ensureQueryData(postsQuery), + loader: ({ context }) => + context.queryClient.query({ ...postsQuery, staleTime: 'static' }), beforeLoad: ({ context }) => ({ queryClient: context.queryClient }), }) correct_pattern: | createFileRoute('/posts')({ beforeLoad: ({ context }) => ({ queryClient: context.queryClient }), - loader: ({ context }) => context.queryClient.ensureQueryData(postsQuery), + loader: ({ context }) => + context.queryClient.query({ ...postsQuery, staleTime: 'static' }), }) source: 'docs/router/eslint/create-route-property-order.md' priority: HIGH @@ -536,7 +538,7 @@ skills: - '@tanstack/react-router-ssr-query' covers: - External cache coordination pattern - - queryClient.ensureQueryData in loader + - "queryClient.query with staleTime: 'static' in loader" - useSuspenseQuery in components - setupRouterSsrQueryIntegration - defaultPreloadStaleTime @@ -579,11 +581,11 @@ skills: priority: HIGH status: active - - mistake: 'Awaiting prefetchQuery in loader blocks rendering' + - mistake: 'Awaiting a fire-and-forget query in loader blocks rendering' mechanism: >- - For streaming/deferred patterns, prefetchQuery should NOT - be awaited in the loader — it starts fetching on server - and streams without blocking. Awaiting defeats the purpose. + For streaming/deferred patterns, start a query without awaiting + it and handle failures with catch(noop) — it starts fetching on + the server and streams without blocking. Awaiting defeats the purpose. source: 'docs/router/integrations/query.md' priority: MEDIUM status: active diff --git a/_artifacts/skill_spec.md b/_artifacts/skill_spec.md index 4503afb48a..7eb9554a42 100644 --- a/_artifacts/skill_spec.md +++ b/_artifacts/skill_spec.md @@ -83,11 +83,11 @@ TanStack Router is a type-safe router for React and Solid applications with buil ### external-data-loading (3 failure modes) -| # | Mistake | Priority | Source | Cross-skill? | -| --- | ------------------------------------------------- | -------- | -------------------------------- | ------------ | -| 1 | Not setting defaultPreloadStaleTime to 0 | HIGH | docs/guide/external-data-loading | — | -| 2 | Creating QueryClient outside createRouter for SSR | HIGH | docs/guide/external-data-loading | — | -| 3 | Awaiting prefetchQuery in loader blocks rendering | MEDIUM | docs/integrations/query | — | +| # | Mistake | Priority | Source | Cross-skill? | +| --- | ----------------------------------------------------------- | -------- | -------------------------------- | ------------ | +| 1 | Not setting defaultPreloadStaleTime to 0 | HIGH | docs/guide/external-data-loading | — | +| 2 | Creating QueryClient outside createRouter for SSR | HIGH | docs/guide/external-data-loading | — | +| 3 | Awaiting a fire-and-forget query in loader blocks rendering | MEDIUM | docs/integrations/query | — | ### auth-and-guards (3 failure modes) diff --git a/_artifacts/skill_tree.yaml b/_artifacts/skill_tree.yaml index b5ce76f547..6f7c4c8742 100644 --- a/_artifacts/skill_tree.yaml +++ b/_artifacts/skill_tree.yaml @@ -135,7 +135,6 @@ skills: for auth state. requires: - 'router-core' - - 'router-core/data-loading' sources: - 'TanStack/router:docs/router/guide/authenticated-routes.md' - 'TanStack/router:docs/router/how-to/setup-authentication.md' @@ -247,7 +246,7 @@ skills: package: 'packages/react-router' description: >- Integrating TanStack Router with TanStack Query: queryClient - in router context, ensureQueryData/prefetchQuery in loaders, + in router context, static queries and fire-and-forget queries in loaders, useSuspenseQuery in components, defaultPreloadStaleTime: 0, setupRouterSsrQueryIntegration for SSR dehydration/hydration and streaming, per-request QueryClient isolation. diff --git a/benchmarks/AGENTS.md b/benchmarks/AGENTS.md new file mode 100644 index 0000000000..9d56a2411a --- /dev/null +++ b/benchmarks/AGENTS.md @@ -0,0 +1,15 @@ +# Benchmarks + +Read the relevant README before running benchmarks. Compare baseline and candidate with the same workload and production builds; add a focused case when existing scenarios miss the changed mechanism. Keep workloads and benchmark names stable for historical comparisons. + +| Changed behavior | Guide | Nx project | +| ------------------------------------------ | ---------------------------------- | -------------------------------------------------------- | +| Standalone Router navigation/rendering CPU | [client-nav](client-nav/README.md) | `@benchmarks/client-nav` | +| Start request/SSR CPU | [ssr](ssr/README.md) | `@benchmarks/ssr` | +| Client/server retention and allocations | [memory](memory/README.md) | `@benchmarks/memory-client`, `@benchmarks/memory-server` | + +Use `test:perf:` through Nx. Plain memory runs only smoke-test; memory metrics require CodSpeed. Client navigation benchmarks do not cover Start hydration or client server-function calls. + +Run `vitest bench` directly only with `--mode benchmark`, as the Nx targets do. Vitest 5 otherwise uses Vite's `test` mode, where vite-plugin-solid injects a jest-dom setup file that benchmark packages cannot resolve. + +For bundle-size work, follow the full optimization skill required by the root guide. Full API fixtures are maintained manually: when public hooks/components change, update matching `bundle-size/scenarios/*-full/src/routes/__root.tsx` fixtures. Save baseline results separately because each run overwrites `bundle-size/results/current.json`; report final gzip deltas and explain remaining growth. diff --git a/benchmarks/README.md b/benchmarks/README.md new file mode 100644 index 0000000000..94d2f31802 --- /dev/null +++ b/benchmarks/README.md @@ -0,0 +1,88 @@ +# CPU simulation benchmarks + +`client-nav` measures navigation, mounting, and React/Solid hydration in +Node/jsdom; `ssr` measures server requests. +Both suites run through the CodSpeed Vitest integration in CPU simulation mode. + +## Worker runtime + +Every CPU benchmark project includes `cpuSimulationExecArgv()` from +[`cpu-simulation.ts`](./cpu-simulation.ts). It augments CodSpeed's worker flags +only during CPU simulation, including the legacy `instrumentation` mode. + +The pinned CodSpeed integration supplies `--no-opt`. In Node 24 this is an alias +for `--no-turbofan`, so Maglev can still optimize and inline hot functions. The +additional `--no-maglev` keeps the optimizing compiler out of the simulation. +`--always-sparkplug` compiles baseline code on first use, so warmup does not leave +functions approaching a later tier-up or batch-compilation threshold. The worker +regression test checks that even a once-called function receives baseline code. +The integration also omits the old `--no-scavenge-task` flag on Node 20 and +newer, where V8 renamed it to `--no-minor-gc-task`. Supplying the renamed flag +keeps minor GC tied to allocation pressure instead of scheduled foreground +tasks. Both flags follow the fixes in +[CodSpeed's Node 24 support](https://github.com/CodSpeedHQ/codspeed-node/commit/e3224e7872). + +`--initial-old-space-size=512` fixes the initial/minimum old-generation +allocation budget at 512 MiB. Removing only this override after worker isolation +left two Vue SSR scenarios with same-commit spreads above 2% in five full-suite +repetitions. The paired default-heap comparison with stock incremental-marking +tasks also exceeded 2%. Runtime comparisons and tested alternatives are recorded in +[PR #8248](https://github.com/TanStack/router/pull/8248). + +This is a GC-policy tradeoff. Minor collections and allocation work remain +measured, and CodSpeed still explicitly collects before measurement. However, +V8 can skip automatic full collections below this old-generation budget, so the +benchmark can omit some eventual full-GC CPU cost from increased object +retention. Repeatability does not establish representative production GC +frequency. The flag does not preallocate 512 MiB; the existing 4096 MiB maximum +remains. See [V8's initial/minimum heap configuration](https://github.com/nodejs/node/blob/v24.8.0/deps/v8/src/heap/heap.cc#L5071). + +The configuration preserves CodSpeed's incremental-marking task settings; the +additional `--no-incremental-marking-task` from the initial stabilization proposal +has been removed. + +The flags are intentionally absent from ordinary Vitest timing and walltime runs. + +Changing simulation compiler settings changes the measurement baseline. Compare +repeatability within each configuration before interpreting performance changes +between configurations as router improvements or regressions. + +## Worker isolation + +Keep one SSR workload in each `speed*.bench.ts` file. These projects explicitly +enable Vitest isolation; CodSpeed uses the forks pool, so every file receives a +fresh worker. Multiple workloads in one file share the worker's runtime state, +even though CodSpeed collects before each measurement. Later control cases +remained noisy after the runtime flag corrections. Running the React plain +dehydration and linked-CSS controls alone reduced their observed three-run spreads +to 0.09% and 0.02% respectively. + +Variant files keep their workload names, request counts, concurrency, payloads +and assertions. CodSpeed includes the file path in a benchmark's identity, so +moved variants start a new history. The first workload keeps `speed.bench.ts`; +the additional variants have descriptive file names alongside it. Type-check +includes cover all of these files. + +## Streaming workload + +Deferred payloads in the SSR streaming scenario resolve after two task turns on +Node. A real 1 ms timer lets elapsed host time decide which concurrent requests +resolve together. Counted turns preserve the initial loading render and deferred +payloads; the existing HTML assertions check both. These benchmarks execute in +Node and use `setImmediate` directly. + +## Repeatability checks + +Dispatch the existing `Benchmarks` workflow against an unchanged branch: + +```sh +gh workflow run benchmarks.yml --ref +``` + +Wait for each workflow run to finish before dispatching the next repetition at +the same commit. The workflow also runs memory benchmarks; exclude those results +when assessing CPU repeatability. Check that every repetition has all expected +CPU results (currently 134), rather than inherited results from an earlier run. +Compare each benchmark's minimum and maximum across repetitions; keep input data, +navigation/request counts, builds, dependencies and Node version fixed when +testing runtime configuration changes. diff --git a/benchmarks/bundle-size/.gitignore b/benchmarks/bundle-size/.gitignore index d5ced39aa3..bd05a98cee 100644 --- a/benchmarks/bundle-size/.gitignore +++ b/benchmarks/bundle-size/.gitignore @@ -6,4 +6,6 @@ scenarios/*/src/routeTree.gen.ts results/*.json results/*.md results/*.js +results/*.log +results/runs/ !results/.gitkeep diff --git a/benchmarks/bundle-size/README.md b/benchmarks/bundle-size/README.md index 4d4d3dc2d3..2185d6b43f 100644 --- a/benchmarks/bundle-size/README.md +++ b/benchmarks/bundle-size/README.md @@ -29,29 +29,102 @@ Each package has `minimal` and `full` scenarios: ## Local Run ```bash -pnpm nx run @benchmarks/bundle-size:build +pnpm benchmark:bundle-size:run ``` Run one or more scenarios during local optimization: ```bash -pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal -pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal,react-router.full +pnpm benchmark:bundle-size:run --scenario react-router.minimal +pnpm benchmark:bundle-size:run --scenario react-router.minimal,react-router.full ``` -Filtered runs build only the package projects needed by selected scenarios. Full runs build all package projects needed by all scenarios. If the required packages are already built and unchanged, skip that step: +The runner calls `measure.mjs`, which builds the selected package projects through Nx. Full runs build the package projects for all scenarios. +`pnpm benchmark:bundle-size` uses the Nx build cache for the full benchmark, then generates `current.json` with the current commit, branch, dirty status, and report timestamp. CI uses this command as well. + +Nx caches the bundles, `measurements.json`, and `benchmark-action.json`. Git metadata does not affect the build cache. The report preserves the original `measuredAt` and build duration when measurements come from cache; `generatedAt` records when the report was generated. Running `pnpm nx run @benchmarks/bundle-size:measure` directly produces only the cacheable outputs; run `node scripts/benchmarks/bundle-size/report.mjs` afterward to refresh `current.json`. + +If the required packages are already built and unchanged, skip that step: ```bash -pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal --skip-package-builds +pnpm benchmark:bundle-size:run --scenario react-router.minimal --skip-package-builds ``` This writes: +- `benchmarks/bundle-size/results/measurements.json` - `benchmarks/bundle-size/results/current.json` - `benchmarks/bundle-size/results/benchmark-action.json` +- `benchmarks/bundle-size/results/measure.log` `current.json` includes run status, selected package build projects, per-scenario totals, per-file sizes, and the emitted JS files used for measurement. Dist paths use `scenarioDir`/`outDir`, e.g. `react-router.minimal` maps to `benchmarks/bundle-size/dist/react-router-minimal/`. +The runner sets `CI=1` and `NX_DAEMON=false`. Successful runs print log locations and the existing `query` or `diff` summary. +If a step fails, the runner stops with a nonzero exit code. It prints the last 40 log lines, limited to 8,000 characters. +Full stdout and stderr stay in the log files. A positive bundle-size delta does not cause failure. + +For agent runs, use `pnpm --silent benchmark:bundle-size:run ...` to omit the package-manager command echo. + +### Phase Timings + +To diagnose measurement time, request a fresh run: + +```bash +pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis --timings +``` + +The runner directly executes `measure.mjs` on every invocation, rebuilding the selected scenarios and recording fresh timings in `measure.log`. Its package-build step still uses Nx and may restore cached packages. Use `--skip-package-builds` only when those packages are already built and unchanged. + +`measure.mjs` also accepts `--timings` directly. Alternatively, set `BUNDLE_SIZE_TIMINGS=1`. Timing lines go to stderr with the prefix `[bundle-size:timing]` followed by JSON containing `phase`, `durationMs`, and, for scenario phases, `scenario`. They are diagnostics only and do not add fields to the size metrics. + +The cached `pnpm benchmark:bundle-size` / Nx build path can replay terminal output from an earlier execution, including old timing lines. Setting `BUNDLE_SIZE_TIMINGS=1` does not invalidate that cache or guarantee fresh timings. Use the direct runner above for timing investigations; refreshing `current.json` after a cache hit does not remeasure build time. + +- `package-builds`: elapsed time for the package-build invocation, including Nx startup/cache handling; omitted when package builds are skipped. +- `scenario-build`: elapsed time for each scenario's build and cleanup. +- `manifest-resolution`: manifest discovery, parsing, entry selection, and collection of all/initial JS file lists. +- `gzip` / `brotli`: accumulated codec time across distinct files for each scenario, using Node's default compression settings. File reads and summation are excluded; initial files reuse already measured sizes. +- `analysis`: source attribution, when `--analysis` is enabled. +- `overall`: measurement execution through report/history writing. Module imports, process startup, and the outer runner's tests/report command are excluded. + +Phases that start also report elapsed work on failure; compression reports partial accumulated times before propagating the error. Timing records alone do not indicate success. `overall` contains the other phases, so nested timings must not be added to it. The phase breakdown also excludes overhead such as file reads and result writing, so its sum is not expected to equal `overall`. + +## Compare Optimization Candidates + +Before you change the implementation, save a named baseline: + +```bash +pnpm benchmark:bundle-size:run --name baseline --scenario react-router.minimal,react-router.full +``` + +After you change the implementation, compare a candidate against that baseline: + +```bash +pnpm benchmark:bundle-size:run --name candidate --baseline baseline \ + --scenario react-router.minimal,react-router.full \ + --test-projects @tanstack/router-core,@tanstack/react-router \ + -- tests/path.test.ts tests/link.test.tsx +``` + +`--test-projects` runs the selected Nx unit-test targets before measurement. Arguments after `--` go only to those tests. +Tests and measurement run sequentially. Failed tests stop the runner before measurement, so old results cannot produce a misleading diff. +Without `--test-projects`, the runner only measures bundles. Type tests, performance benchmarks, and e2e tests remain separate commands. + +Named runs store their metrics and logs in `benchmarks/bundle-size/results/runs//`. Existing named results cannot be overwritten. +Without `--name`, runs replace `current.json` and the logs for the steps they run. +Emitted bundles still use the shared `dist/` directory. To retain emitted bundles for a candidate, pass a separate `--dist-dir`. + +`--baseline` accepts a run name or a JSON file path, such as `--baseline ./baseline.json`. +With `--scenario`, the comparison reports only the scenarios measured in the current run, even when the baseline contains more scenarios. Selected scenarios missing from the baseline remain visible with `n/a` for their baseline and deltas. +Without `--scenario`, comparisons include scenarios from either result file. +`--results-dir ` changes the results root, including the location of named runs. +Use the same scenario selection and measurement flags for the baseline and candidate. + +For command reference, run: + +```bash +pnpm benchmark:bundle-size:run --help +``` + ## Local Query Tools ```bash @@ -60,18 +133,22 @@ pnpm benchmark:bundle-size:diff --baseline /tmp/base-current.json --id react-rou pnpm benchmark:bundle-size:history --id react-router.minimal --top-deltas 20 ``` +Use `pnpm benchmark:bundle-size:diff --baseline /tmp/base-current.json --current-only` to compare only scenarios present in the current results. This applies to both text and `--json` output; an explicit `--id` takes precedence. + For source attribution, run an analysis build. This uses hidden source maps and writes source estimates into `current.json`; those estimates are for investigation only, not tracking. ```bash -pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal --analysis +pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis pnpm benchmark:bundle-size:analyze --id react-router.minimal --top-sources 30 ``` +For a named run, pass `--current benchmarks/bundle-size/results/runs//current.json` to `query`, `diff`, or `analyze`. + ## CI Reporting - PR workflow generates a sticky comment with: - - current gzip values - - baseline delta + - current gzip, initial gzip, raw, and Brotli values + - per-metric deltas from the `main` baseline - inline sparkline trend - Pushes to `main` publish historical chart data to GitHub Pages via `benchmark-action/github-action-benchmark`. diff --git a/benchmarks/bundle-size/package.json b/benchmarks/bundle-size/package.json index 65d8d7483b..ca34cd6cd7 100644 --- a/benchmarks/bundle-size/package.json +++ b/benchmarks/bundle-size/package.json @@ -3,17 +3,35 @@ "private": true, "type": "module", "scripts": { - "build": "node ../../scripts/benchmarks/bundle-size/measure.mjs --skip-package-builds", - "test:unit": "node --test ../../scripts/benchmarks/bundle-size/pr-report.test.mjs" + "measure": "node ../../scripts/benchmarks/bundle-size/measure.mjs --skip-package-builds --measurements-only", + "test:unit": "node --test ../../scripts/benchmarks/bundle-size/pr-report.test.mjs ../../scripts/benchmarks/bundle-size/run.test.mjs ../../scripts/benchmarks/bundle-size/report.test.mjs ../../scripts/benchmarks/bundle-size/build.test.mjs ../../scripts/benchmarks/bundle-size/compress.test.mjs ../../scripts/benchmarks/bundle-size/timings.test.mjs" }, "nx": { "targets": { - "build": { - "cache": false, + "measure": { + "cache": true, + "inputs": [ + "buildProduction", + "^buildProduction", + "dependentTaskOutputs", + "{workspaceRoot}/scripts/benchmarks/bundle-size/measure.mjs", + "{workspaceRoot}/scripts/benchmarks/bundle-size/compress.mjs", + "{workspaceRoot}/scripts/benchmarks/bundle-size/timings.mjs", + "{workspaceRoot}/scripts/benchmarks/bundle-size/report.mjs", + { + "runtime": "node --version" + } + ], + "outputs": [ + "{projectRoot}/dist", + "{projectRoot}/results/measurements.json", + "{projectRoot}/results/benchmark-action.json" + ], "dependsOn": [ { "projects": [ "@tanstack/react-router", + "@tanstack/react-router-ssr-query", "@tanstack/react-start", "@tanstack/router-plugin", "@tanstack/solid-router", @@ -26,29 +44,31 @@ ] }, "test:unit": { + "dependsOn": [], "inputs": [ "default", "^production", - "{workspaceRoot}/scripts/benchmarks/bundle-size/pr-report.mjs", - "{workspaceRoot}/scripts/benchmarks/bundle-size/pr-report.test.mjs" + "{workspaceRoot}/scripts/benchmarks/bundle-size/*.mjs" ] } } }, "dependencies": { "@tanstack/react-router": "workspace:^", + "@tanstack/react-router-ssr-query": "workspace:^", "@tanstack/solid-router": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/react-start": "workspace:^", "@tanstack/solid-start": "workspace:^", "@tanstack/vue-start": "workspace:^", + "@tanstack/react-query": "catalog:", "react": "^19.0.0", "react-dom": "^19.0.0", "solid-js": "^1.9.10", "vue": "^3.5.16" }, "devDependencies": { - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tanstack/router-plugin": "workspace:^", "@types/react": "^19.0.8", @@ -56,7 +76,8 @@ "@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts b/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts index 641de56234..349e11bec1 100644 --- a/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts +++ b/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts @@ -6,7 +6,7 @@ const outDir = process.env.BUNDLE_SIZE_DIST_DIR ?? 'dist-rsbuild' export default defineConfig({ logLevel: 'silent', - plugins: [pluginReact({ splitChunks: false }), tanstackStart()], + plugins: [pluginReact(), tanstackStart()], output: { distPath: { root: outDir, diff --git a/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts b/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts index 78752d0190..7d27421d4d 100644 --- a/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts +++ b/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts @@ -16,7 +16,7 @@ const startOptions = clientOutput export default defineConfig({ logLevel: 'silent', - plugins: [pluginReact({ splitChunks: false }), tanstackStart(startOptions)], + plugins: [pluginReact(), tanstackStart(startOptions)], output: { distPath: { root: outDir, diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx new file mode 100644 index 0000000000..93b95f3148 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx @@ -0,0 +1,17 @@ +import { QueryClient } from '@tanstack/react-query' +import { createRouter } from '@tanstack/react-router' +import { setupRouterSsrQueryIntegration } from '@tanstack/react-router-ssr-query' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + const queryClient = new QueryClient() + const router = createRouter({ + routeTree, + context: { queryClient }, + scrollRestoration: true, + }) + + setupRouterSsrQueryIntegration({ router, queryClient }) + + return router +} diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx new file mode 100644 index 0000000000..ff1da4c304 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx @@ -0,0 +1,24 @@ +import { + HeadContent, + Outlet, + Scripts, + createRootRoute, +} from '@tanstack/react-router' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return ( + + + + + + + + + + ) +} diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx new file mode 100644 index 0000000000..76fb363538 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx @@ -0,0 +1,9 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: IndexComponent, +}) + +function IndexComponent() { + return
hello world
+} diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts b/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts new file mode 100644 index 0000000000..d4e4cd980d --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import viteReact from '@vitejs/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' + +export default defineConfig({ + plugins: [tanstackStart(), viteReact()], +}) diff --git a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx index d696063083..0ff40aebfc 100644 --- a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx +++ b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Asset, Await, @@ -45,143 +46,151 @@ import { useTags, } from '@tanstack/vue-router' +const RootComponent = defineComponent({ + setup() { + const router = useRouter() + const [awaited] = useAwaited({ promise: Promise.resolve('ready') }) + const linkProps = useLinkProps({ to: '/' } as any) + const matchRoute = useMatchRoute() + const matches = useMatches() + const parentMatches = useParentMatches() + const childMatches = useChildMatches() + const match = useMatch({ strict: false, shouldThrow: false } as any) + const loaderDeps = useLoaderDeps({ strict: false } as any) + const loaderData = useLoaderData({ strict: false } as any) + const params = useParams({ strict: false } as any) + const search = useSearch({ strict: false } as any) + const routeContext = useRouteContext({ strict: false } as any) + const routerState = useRouterState({ + select: (state) => state.status, + } as any) + const location = useLocation() + const canGoBack = useCanGoBack() + const navigate = useNavigate() + const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' }) + const tags = useTags() + + useBlocker({ + shouldBlockFn: () => false, + disabled: true, + withResolver: false, + }) + + const linkFactoryResult = linkOptions({ to: '/' } as any) + const routeMatchResult = matchRoute({ to: '/' } as any) + const SvgLink = createLink('svg') + + const hooksAndComponents = [ + useAwaited, + useLinkProps, + useMatchRoute, + useMatches, + useParentMatches, + useChildMatches, + useMatch, + useLoaderDeps, + useLoaderData, + useBlocker, + useNavigate, + useParams, + useSearch, + useRouteContext, + useRouter, + useRouterState, + useLocation, + useCanGoBack, + useElementScrollRestoration, + useTags, + Await, + CatchBoundary, + CatchNotFound, + ClientOnly, + DefaultGlobalNotFound, + ErrorComponent, + Link, + Match, + MatchRoute, + Matches, + Navigate, + Outlet, + RouterContextProvider, + ScrollRestoration, + Block, + ScriptOnce, + Asset, + HeadContent, + Scripts, + Body, + Html, + ] + + ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = { + hooksAndComponents, + } + + return () => { + void awaited + void linkFactoryResult + void matches.value + void parentMatches.value + void childMatches.value + void match.value + void loaderDeps.value + void loaderData.value + void params.value + void search.value + void routeContext.value + void routerState.value + void location.value + void canGoBack.value + void navigate + void scrollEntry + void tags() + void routeMatchResult.value + + return ( + <> + + {'window.__tsr_bundle_size = true'} + + home + + + + + {() => } + + }> + + + } + /> + false} disabled withResolver={false}> + {() => } + + }> + + + + + + + + +
+
hello world
+
+ + ) + } + }, +}) + export const Route = createRootRoute({ component: RootComponent, }) - -function RootComponent() { - const router = useRouter() - const [awaited] = useAwaited({ promise: Promise.resolve('ready') }) - const linkProps = useLinkProps({ to: '/' } as any) - const matchRoute = useMatchRoute() - const matches = useMatches() - const parentMatches = useParentMatches() - const childMatches = useChildMatches() - const match = useMatch({ strict: false, shouldThrow: false } as any) - const loaderDeps = useLoaderDeps({ strict: false } as any) - const loaderData = useLoaderData({ strict: false } as any) - const params = useParams({ strict: false } as any) - const search = useSearch({ strict: false } as any) - const routeContext = useRouteContext({ strict: false } as any) - const routerState = useRouterState({ select: (state) => state.status } as any) - const location = useLocation() - const canGoBack = useCanGoBack() - const navigate = useNavigate() - const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' }) - const tags = useTags() - - useBlocker({ - shouldBlockFn: () => false, - disabled: true, - withResolver: false, - }) - - const linkFactoryResult = linkOptions({ to: '/' } as any) - const routeMatchResult = matchRoute({ to: '/' } as any) - const SvgLink = createLink('svg') - - const hooksAndComponents = [ - useAwaited, - useLinkProps, - useMatchRoute, - useMatches, - useParentMatches, - useChildMatches, - useMatch, - useLoaderDeps, - useLoaderData, - useBlocker, - useNavigate, - useParams, - useSearch, - useRouteContext, - useRouter, - useRouterState, - useLocation, - useCanGoBack, - useElementScrollRestoration, - useTags, - Await, - CatchBoundary, - CatchNotFound, - ClientOnly, - DefaultGlobalNotFound, - ErrorComponent, - Link, - Match, - MatchRoute, - Matches, - Navigate, - Outlet, - RouterContextProvider, - ScrollRestoration, - Block, - ScriptOnce, - Asset, - HeadContent, - Scripts, - Body, - Html, - ] - - ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = { - hooksAndComponents, - } - - void awaited - void linkFactoryResult - void matches.value - void parentMatches.value - void childMatches.value - void match.value - void loaderDeps.value - void loaderData.value - void params.value - void search.value - void routeContext.value - void routerState.value - void location.value - void canGoBack.value - void navigate - void scrollEntry - void tags() - void routeMatchResult.value - - return ( - <> - - {'window.__tsr_bundle_size = true'} - - home - - - - {() => } - }> - - - } - /> - false} disabled withResolver={false}> - {() => } - - }> - - - - - - - - -
-
hello world
-
- - ) -} diff --git a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx index aa0539fa1a..8e8870a2ce 100644 --- a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx +++ b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Asset, Await, @@ -68,151 +69,159 @@ const helloServerFn = createServerFn({ method: 'GET' }) return 'hello from server fn' }) +const RootComponent = defineComponent({ + setup() { + const router = useRouter() + const [awaited] = useAwaited({ promise: Promise.resolve('ready') }) + const linkProps = useLinkProps({ to: '/' } as any) + const matchRoute = useMatchRoute() + const matches = useMatches() + const parentMatches = useParentMatches() + const childMatches = useChildMatches() + const match = useMatch({ strict: false, shouldThrow: false } as any) + const loaderDeps = useLoaderDeps({ strict: false } as any) + const loaderData = useLoaderData({ strict: false } as any) + const params = useParams({ strict: false } as any) + const search = useSearch({ strict: false } as any) + const routeContext = useRouteContext({ strict: false } as any) + const routerState = useRouterState({ + select: (state) => state.status, + } as any) + const location = useLocation() + const canGoBack = useCanGoBack() + const navigate = useNavigate() + const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' }) + const tags = useTags() + const invokeServerFn = useServerFn(helloServerFn) + + useBlocker({ + shouldBlockFn: () => false, + disabled: true, + withResolver: false, + }) + + const linkFactoryResult = linkOptions({ to: '/' } as any) + const routeMatchResult = matchRoute({ to: '/' } as any) + const SvgLink = createLink('svg') + + const startSurface = [createMiddleware, createServerFn, useServerFn] + const hooksAndComponents = [ + useAwaited, + useLinkProps, + useMatchRoute, + useMatches, + useParentMatches, + useChildMatches, + useMatch, + useLoaderDeps, + useLoaderData, + useBlocker, + useNavigate, + useParams, + useSearch, + useRouteContext, + useRouter, + useRouterState, + useLocation, + useCanGoBack, + useElementScrollRestoration, + useTags, + Await, + CatchBoundary, + CatchNotFound, + ClientOnly, + DefaultGlobalNotFound, + ErrorComponent, + Link, + Match, + MatchRoute, + Matches, + Navigate, + Outlet, + RouterContextProvider, + ScrollRestoration, + Block, + ScriptOnce, + Asset, + HeadContent, + Scripts, + Body, + Html, + ] + + ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = { + hooksAndComponents, + startSurface, + } + + return () => { + void awaited + void linkFactoryResult + void matches.value + void parentMatches.value + void childMatches.value + void match.value + void loaderDeps.value + void loaderData.value + void params.value + void search.value + void routeContext.value + void routerState.value + void location.value + void canGoBack.value + void navigate + void scrollEntry + void tags() + void routeMatchResult.value + void invokeServerFn + + return ( + + + + + + {'window.__tsr_bundle_size = true'} + + home + + + + + {() => } + + }> + + + } + /> + false} disabled withResolver={false}> + {() => } + + }> + + + + + + + + +
+
hello world
+
+ + + ) + } + }, +}) + export const Route = createRootRoute({ component: RootComponent, }) - -function RootComponent() { - const router = useRouter() - const [awaited] = useAwaited({ promise: Promise.resolve('ready') }) - const linkProps = useLinkProps({ to: '/' } as any) - const matchRoute = useMatchRoute() - const matches = useMatches() - const parentMatches = useParentMatches() - const childMatches = useChildMatches() - const match = useMatch({ strict: false, shouldThrow: false } as any) - const loaderDeps = useLoaderDeps({ strict: false } as any) - const loaderData = useLoaderData({ strict: false } as any) - const params = useParams({ strict: false } as any) - const search = useSearch({ strict: false } as any) - const routeContext = useRouteContext({ strict: false } as any) - const routerState = useRouterState({ select: (state) => state.status } as any) - const location = useLocation() - const canGoBack = useCanGoBack() - const navigate = useNavigate() - const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' }) - const tags = useTags() - const invokeServerFn = useServerFn(helloServerFn) - - useBlocker({ - shouldBlockFn: () => false, - disabled: true, - withResolver: false, - }) - - const linkFactoryResult = linkOptions({ to: '/' } as any) - const routeMatchResult = matchRoute({ to: '/' } as any) - const SvgLink = createLink('svg') - - const startSurface = [createMiddleware, createServerFn, useServerFn] - const hooksAndComponents = [ - useAwaited, - useLinkProps, - useMatchRoute, - useMatches, - useParentMatches, - useChildMatches, - useMatch, - useLoaderDeps, - useLoaderData, - useBlocker, - useNavigate, - useParams, - useSearch, - useRouteContext, - useRouter, - useRouterState, - useLocation, - useCanGoBack, - useElementScrollRestoration, - useTags, - Await, - CatchBoundary, - CatchNotFound, - ClientOnly, - DefaultGlobalNotFound, - ErrorComponent, - Link, - Match, - MatchRoute, - Matches, - Navigate, - Outlet, - RouterContextProvider, - ScrollRestoration, - Block, - ScriptOnce, - Asset, - HeadContent, - Scripts, - Body, - Html, - ] - - ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = { - hooksAndComponents, - startSurface, - } - - void awaited - void linkFactoryResult - void matches.value - void parentMatches.value - void childMatches.value - void match.value - void loaderDeps.value - void loaderData.value - void params.value - void search.value - void routeContext.value - void routerState.value - void location.value - void canGoBack.value - void navigate - void scrollEntry - void tags() - void routeMatchResult.value - void invokeServerFn - - return ( - - - - - - {'window.__tsr_bundle_size = true'} - - home - - - - {() => } - }> - - - } - /> - false} disabled withResolver={false}> - {() => } - - }> - - - - - - - - -
-
hello world
-
- - - ) -} diff --git a/benchmarks/client-nav/README.md b/benchmarks/client-nav/README.md index 6179c7f0b8..ec34ecc0c1 100644 --- a/benchmarks/client-nav/README.md +++ b/benchmarks/client-nav/README.md @@ -9,10 +9,11 @@ Cross-framework client-side CPU benchmarks for: The benchmarks run in jsdom against production builds of real apps, and are tracked in CI by CodSpeed (simulation mode). -> **Scope:** these benchmarks cover the standalone client router only. The -> client side of TanStack Start (hydration of a server-rendered document, -> streamed payload consumption, server-function calls from the client, ...) is -> not covered here; the server side of Start is covered by `benchmarks/ssr`. +> **Scope:** these benchmarks cover the client router. The hydration +> scenarios also cover DOM hydration and the Router state-restoration path +> used by Start. Start-specific entry-point initialization, streamed payload +> arrival and client server-function calls are not included. Server request work +> is covered by `benchmarks/ssr`. ## Layout @@ -38,7 +39,7 @@ scenarios/// routes/ ``` -Scenario apps use file-based routing (`@tanstack/router-plugin`) with a +Navigation scenario apps use file-based routing (`@tanstack/router-plugin`) with a generated `routeTree.gen.ts`, like a regular user app. Each scenario uses one app per framework instead of sharing routes in the baseline app. This keeps route-tree size and router options isolated so one scenario cannot shift @@ -57,9 +58,11 @@ be attributed to a specific feature area. | `control-flow` | Loader-thrown `redirect` (including a 2-hop chain), `notFound()` with `notFoundComponent`, loader errors with `errorComponent`, and boundary reset on recovery navigation. | | `head` | `HeadContent` per-navigation work: nested route `head()` evaluation, title/meta/link dedupe across matches, and head tag DOM updates during navigation. | | `history` | History push/replace/back/forward traversal, location masking, registered-but-never-blocking `useBlocker`, and `useCanGoBack`/`useLocation` subscriptions. | +| `hydration` | Initial DOM hydration: execute the SSR payload, restore `beforeLoad` context and loader data, and hydrate 192 ordinary and eight hash-sensitive Links through their follow-up effects in React and Solid. | +| `link-churn` | Links that depart, stay and mount: 30 `/hub` layout Links stay while 100 `/hub/list` leaf Links leave (alone, or with the layout to `/other`) and remount on return; a search-only change rebuilds updater and `to="."` Links. Unlike `links`, whose root-layout Links never depart. | | `links` | Per-navigation cost of ~200 mounted ``s: link prop building, active-state recompute across `activeOptions` variants, `activeProps` swaps, and `useMatchRoute` probes (the `MatchRoute` component is avoided: vue-router's implementation leaks one subscription per render). | | `loaders` | Client loader dispatch: always-stale re-runs (`staleTime: 0`), cached revisits (re-run once per lap by the `invalidate` step), `loaderDeps`-keyed caching, `router.invalidate()`, and `useLoaderData` selectors. | -| `mount` | Cold start: `createRouter` (route-tree processing) + first render + initial `router.load()` + unmount, with a fresh router per mount. The only scenario measuring router creation. | +| `mount` | Cold start: `createRouter` (route-tree processing) + first render + initial `router.load()` + unmount, with a fresh router per mount. | | `nested-params` | Deep nesting (8 dynamic levels): per-level `params.parse`/`stringify`, `beforeLoad` context accumulation across matches, and per-level `useParams`/`useRouteContext` subscriptions. Param values include characters requiring percent-encoding (as do `route-tree-scale`'s), so segment encode/decode paths run on every navigation. | | `preload` | Intent preloading from hover events, programmatic `router.preloadRoute`, deterministic preload cache behavior (`defaultPreloadStaleTime: 0`), and commit-time cache maintenance. | | `rewrites` | Composed client-side location rewrites: router `basepath` plus a locale input/output rewrite pair, running on every href build and location parse (the client analog of the SSR `rewrites` scenario). | @@ -68,10 +71,14 @@ be attributed to a specific feature area. ## Conventions +The hydration scenario has the separate lifecycle described below. The other +scenarios follow these navigation/mount conventions: + - Apps are built with `NODE_ENV=production` (`minify: false`) into `dist/app.js`; benches import the built bundle, so production package builds and production JSX output are measured, not dev transforms. - Scenarios behave like a real user app: navigation happens through `` clicks dispatched on real anchor elements (unless a scenario specifically measures the imperative API), the router uses the default browser history, and `scrollRestoration` is enabled. - Each benchmark iteration advances a fixed, circular sequence of steps; every step awaits the router's `onRendered` event, so render work is included and steps cannot overlap. No two consecutive steps may target the same location, and the sequence ends back on the initial route. - Setup runs one warm-up lap through the sequence and asserts each step's observable output (e.g. `document.title`), so a scenario that silently stops doing its work fails instead of reporting a fast time. +- Apps are mounted and disposed outside timing by `benchLifecycle` (`benchmarks/cpu-simulation.ts`): CodSpeed measures a single invocation, so every invocation gets a freshly mounted app; plain `vitest bench` keeps one app per warmup/run phase. Bench functions must be `async` functions, because CodSpeed's Vitest 5 provider awaits only `AsyncFunction`s. - Determinism: no wall-clock timers (async work is resolved promises or counted `setTimeout(0)` hops), `staleTime`/`gcTime` only ever `0` or effectively-infinite, no `Math.random`/`Date.now` in the measured loop. Scroll restoration uses `getScrollRestorationKey: (location) => location.pathname` so its cache stays bounded (the default random per-entry key grows one cache entry per push navigation). The `mount` scenario opts out of `scrollRestoration` entirely and destroys its history on unmount — both register page-lifetime globals that would leak across its mount/unmount loop. - Push-only step laps grow jsdom's session-history entry list over a run (jsdom never truncates entries behind the current index). Per-push cost stays O(1) so timings are unaffected; only the `history` scenario needs — and has — a lap that is depth-stationary. - Calibration: pick per-iteration step counts so a bench's `vitest bench` run stays roughly between 8 and 30 seconds (long enough to average out, short enough for CI). @@ -96,7 +103,7 @@ Run a single scenario app manually (after building it through Nx): ```bash CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav--:build:client --outputStyle=stream --skipRemoteCache -cd benchmarks/client-nav && NODE_ENV=production vitest bench --config ./scenarios///vite.config.ts +cd benchmarks/client-nav && NODE_ENV=production vitest bench --mode benchmark --config ./scenarios///vite.config.ts ``` Run framework-specific flame benchmarks (10 second loop, profiled with `@platformatic/flame`, forced to `NODE_ENV=production`): @@ -115,3 +122,186 @@ Typecheck benchmark sources (baseline + scenarios): ```bash CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav:test:types --outputStyle=stream --skipRemoteCache ``` + +## Hydration + +`scenarios/hydration/{react,solid}` provide the same initial-hydration +workload: 192 ordinary Links, eight hash-sensitive Links, and three matched +routes with three `beforeLoad` contexts and two loader results. The server URL +has no fragment; the client URL has `#details`, matching half of the hash-sensitive Links. + +```bash +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:perf --outputStyle=stream --skipRemoteCache +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:unit --outputStyle=stream --skipRemoteCache +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:types:client --outputStyle=stream --skipRemoteCache +``` + +Replace `react` with `solid` to run the other adapter. + +The build generates static HTML and its real Router SSR bootstrap scripts once +with `createRequestHandler` and the adapter's streaming renderer. Generation +fully consumes the response and runs outside the CodSpeed action. The measured +worker only reads these artifacts; it does not import a server renderer or start a server. + +Each invocation uses a fresh jsdom window and a fresh evaluation of the complete +production client bundle in that window's realm. HTML parsing, bundle evaluation, +and the initial document lifecycle finish in untimed setup. This resets module +state as well as the DOM, avoiding cached hydration promises and cross-realm +payload objects. The bundle and bootstrap scripts are compiled once, so this +measures a fresh application with warm code, not JavaScript download/parse cost. + +The timed region executes the serialized payload, creates the router and its +small code-based route tree, calls the public client `hydrate` API, and hydrates +the existing DOM with the framework's native renderer: + +- **React:** a separate completion component signals from its post-hydration + effect, after the same snapshot transition as hash-sensitive Links. The harness + awaits that signal and two idle React scheduler turns, then checks the expected + active links. The window's `performance.now()` is frozen, so React's + scheduler yields only to paint after commits, not after 5 ms of wall time, which CPU + instrumentation stretches by a runner-dependent factor. Each sample therefore + uses the same number of scheduler tasks. `Date.now()` is unchanged. A + 60-second watchdog fails a sample that never settles. +- **Solid:** execute the native hydration bootstrap and retain the server's + component/key hierarchy. Wait for mount, the router's rendered event, active-link + effects, and two idle turns. DOM identity assertions include every workload + element so template fallback cannot silently replace server nodes. + +Solid bounds settlement to 100 turns. Ending at the hydration call or the +first mount would miss post-hydration Link updates. +Timer turns use `setImmediate`; scrolling is a no-op +because this is CPU simulation rather than browser layout/paint measurement. + +Untimed assertions verify restored contexts and every loader row, zero client +`beforeLoad`/loader calls, expected hrefs/active state, original DOM-node identity, +working event handlers, and absence of hydration errors. Root unmount, pending +task cancellation, and window disposal also run outside measurement. Diagnostic +tests count Link renders or reactive evaluations and check they stop before the +measured region ends; counting is disabled in the timed workload. + +The bench's own `beforeEach`/`afterEach` hooks prepare and dispose every +sample outside timing, in both CodSpeed and ordinary Vitest runs. Per-phase +setup would let later iterations reuse an already hydrated document. The +hydration unit tests cover repeated fresh-state setup. + +Each scenario is included in its framework's aggregate build and CodSpeed run. +Land the benchmark independently to establish main's baseline before comparing a +hydration optimization. Regenerate each revision's artifacts with identical +fixture data and dependencies; do not pin an old hydration wire format forever. + +## Isolated route-tree construction + +`scenarios/route-tree-scale` measures navigation over an existing tree, not +construction. `scenarios/mount` includes construction but also rendering and +loading. To isolate initialization, use the core construction benchmark: + +```bash +CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-core:test:unit --outputStyle=stream --skipRemoteCache -- bench tests/route-tree-construction.bench.ts --run --testNamePattern=1000.routes --reporter=json --outputFile=/tmp/route-tree-construction.json +``` + +It covers 100, 1,000, and 10,000 static, dynamic, nested, or mixed routes. +The processing-only case creates fresh route objects in an untimed +`beforeEach`, then measures `processRouteTree` and `route.init`. A separate +case includes route-object creation. Neither case measures first interpolation +or navigation. Remove the name filter to run all sizes. Compare identical +benchmark sources in separate checkouts and repeat fresh processes; a cached +router or repeatedly initialized tree is not a construction baseline. + +## Opt-in React Link performance suite + +`link-performance/` contains additional client-navigation and SSR workloads for +focused Link work. They are **not included** in the regular client-nav/SSR +aggregate projects or their CodSpeed build dependencies; they only run through +the dedicated `@benchmarks/react-link-performance` targets below. Use `-t` to +narrow a run to specific cases. + +```bash +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:client --outputStyle=stream --skipRemoteCache -- --run +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:ssr --outputStyle=stream --skipRemoteCache -- --run + +# Select a feature and save the normal Vitest JSON report. +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:client --outputStyle=stream --skipRemoteCache -- --run -t "updater|optional|splat" --reporter=json --outputFile=/tmp/link-perf.json +``` + +The cases cover repeated versus unique destination params, updater functions, +relative/inherited values, search middleware chains, param stringification, +optional and splat segments, encoding, masks, basepath/rewrites, and active +props with structured search. These exercise different costs: cache hits and +misses, parameter cloning, callbacks, middleware traversal, URI encoding, +building masked/public locations, active-state comparisons, and prop merging. +Existing preload, mount, and route-tree-scale scenarios remain responsible for +those separate workloads. + +- **Client:** 200 persistent measured Links, four control Links, and eight + completed navigations per timed batch. The existing client harness checks + hrefs and active state during its untimed warm-up lap. Control navigations + replace the history entry, keeping history size constant. Post-measurement + assertions also check that the measured anchors stayed mounted. +- **SSR:** four fresh-router requests per timed batch, each rendering 200 + measured Links through `RouterProvider` and `renderToString`. Router creation, + `router.load()`, rendering, and history cleanup are included. This isolates + Router SSR Link work, not Start HTTP handling, dehydration, or streaming. + HTML assertions run outside the timed batch. +- Both use the same code-based workload definitions and production JSX/library + builds. The regular Vitest entry points use at least 100 warm-up iterations, + one second of warm-up time, and five-second measurement windows. The client + and server bundles assert their resolved `isServer` environment. React and + React DOM remain external so comparisons can share the same renderer runtime. + These bundles are Node-hosted (jsdom for client mode), not browser deployments. + +Run the gate tests and typecheck separately: + +```bash +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:unit --outputStyle=stream --skipRemoteCache +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:types --outputStyle=stream --skipRemoteCache +``` + +For before/after comparisons, use identical benchmark files and dependencies +on both refs, build each ref through its Nx targets, and alternate fresh +Vitest processes. Report the actual refs, per-case means and relative margins +of error; rerun noisy or borderline results with `-t` rather than interpreting +a small difference as a proven speedup. Client and SSR times have different +batch units and should not be compared directly. + +### Stable paired comparisons + +For regression decisions, prefer the paired runner over a whole-file Vitest +run. It starts a fresh process for every case and repetition, avoiding JIT +feedback from earlier cases. Inside each process, both revisions share the +same production React installation but have separate router/app modules and +router instances. Initialization order alternates between repetitions. +Built snapshots are staged under `node_modules/.cache` so the TypeScript +harness loader does not transpile their emitted JavaScript a second time. + +```bash +# Build the baseline using these same benchmark sources in its own checkout. +# --baseline points to that checkout's link-performance/dist directory. +pnpm nx run @benchmarks/react-link-performance:test:perf:stable -- \ + --baseline /path/to/baseline/benchmarks/client-nav/link-performance/dist \ + --outputJson /tmp/paired-links.json + +# Narrow a comparison, or increase independent process repetitions. +pnpm nx run @benchmarks/react-link-performance:test:perf:stable -- \ + --baseline /path/to/baseline/benchmarks/client-nav/link-performance/dist \ + --mode ssr -t "middleware|unique-params" --repeats 6 \ + --outputJson /tmp/paired-links-ssr.json +``` + +The runner requires Node with `process.threadCpuUsage` (Node 24 works). +It fixes V8 random/hash seeds, warms each variant for at least two seconds +and 100 batches, then alternates ABBA/BAAB blocks calibrated to roughly 500 ms. +Both variants do exactly the same number of batches per block. It records +main-thread CPU time, wall time, and whole-process CPU time; GC during +measurement is not disabled or discarded. + +The default is four independent process repetitions. Reported 95% intervals +use their paired log-ratios, not the many correlated batches as independent +samples. A faster/slower verdict requires CPU and wall intervals to agree. +Intervals overlapping zero or disagreeing metrics are inconclusive; narrow +intervals entirely inside +/-2% are reported separately. + +An A/A calibration uses the current `dist` directory as `--baseline`. Its +intervals should contain zero before trusting similarly sized A/B differences. +Shared-machine contention can still make small changes unresolved. Do not +interpret a point estimate alone, or an inconclusive result, as proof that +a workload is unchanged. diff --git a/benchmarks/client-nav/link-performance/cases.ts b/benchmarks/client-nav/link-performance/cases.ts new file mode 100644 index 0000000000..a25eac563b --- /dev/null +++ b/benchmarks/client-nav/link-performance/cases.ts @@ -0,0 +1,360 @@ +export const LINK_CASES = [ + { + id: 'shared-params', + label: 'Shared string params', + description: '200 persistent Links reuse 40 string parameter values.', + }, + { + id: 'unique-params', + label: 'Unique string params', + description: '200 distinct parameter values exceed the 128-result cache.', + }, + { + id: 'param-updaters', + label: 'Parameter updaters', + description: 'Parameter functions derive destinations from current params.', + }, + { + id: 'location-updaters', + label: 'Search, hash and state updaters', + description: + 'Functions derive search, hash and history state from the source.', + }, + { + id: 'relative', + label: 'Relative targets', + description: 'Parent and child targets inherit current params and search.', + }, + { + id: 'middleware', + label: 'Search middleware chain', + description: + 'Retain a tenant, strip a default page and normalize a filter.', + }, + { + id: 'numeric-params', + label: 'Numeric params', + description: 'Parse numbers, update them numerically and stringify them.', + }, + { + id: 'optional-params', + label: 'Optional segments', + description: 'Set, inherit and explicitly clear an optional path segment.', + }, + { + id: 'splats', + label: 'Splat params', + description: 'Empty, multi-segment and encoded splat values.', + }, + { + id: 'encoding', + label: 'Allowed path characters', + description: 'Preserve allowed @, : and + while encoding other characters.', + }, + { + id: 'masks', + label: 'Explicit route masks', + description: + 'Build a different public path and search for each destination.', + }, + { + id: 'rewrites', + label: 'Basepath and rewrites', + description: 'Compose /app with input/output locale path rewrites.', + }, + { + id: 'active', + label: 'Active props and structured search', + description: + 'Exact, fuzzy and search matching with props and render children.', + }, +] as const + +export type LinkCaseId = (typeof LINK_CASES)[number]['id'] + +export const LINK_COUNT = 200 +export const NAVIGATION_STATES = [1, 2, 3, 0] as const +export const LOCALES = ['en', 'fr', 'de', 'es'] as const + +export interface Filter { + tag: string + flags: { open: boolean } + tags: Array +} + +export interface LinkSearch { + page?: number + tenant?: string + filter?: Filter +} + +export function sourceFilter(index: number): Filter { + return { + tag: `group-${index}`, + flags: { open: index % 2 === 0 }, + tags: ['links', `state-${index}`], + } +} + +export function sourceSearch( + caseId: LinkCaseId, + stateIndex: number, +): Partial { + switch (caseId) { + case 'location-updaters': + case 'relative': + case 'middleware': + case 'active': + return { + page: stateIndex + 1, + tenant: `tenant-${stateIndex}`, + filter: sourceFilter(stateIndex), + } + case 'rewrites': + return { tenant: LOCALES[stateIndex] } + default: + return {} + } +} + +export function optionalCategory(stateIndex: number) { + return stateIndex % 2 === 0 ? `category-${stateIndex}` : undefined +} + +export function splatValue(index: number) { + switch (index % 4) { + case 0: + return '' + case 1: + return `folder/sub/file-${index % 40}` + case 2: + return 'a b/100%/caf\u00e9?#' + default: + return 'literal%2F/\u{1f680}' + } +} + +export function encodedValue(index: number) { + return `user-${index % 40}@mail.test:tag+value /?#% caf\u00e9` +} + +function url(pathname: string, search: Partial = {}, hash = '') { + const result = new URL(pathname, 'http://localhost') + for (const [key, value] of Object.entries( + search, + )) { + if (value !== undefined) { + result.searchParams.set( + key, + typeof value === 'object' ? JSON.stringify(value) : String(value), + ) + } + } + result.hash = hash + return result.pathname + result.search + result.hash +} + +function sourcePath(caseId: LinkCaseId, stateIndex: number) { + switch (caseId) { + case 'relative': + return `/teams/team-${stateIndex}/item-${stateIndex}` + case 'numeric-params': + return `/numbers/${stateIndex}` + case 'optional-params': { + const category = optionalCategory(stateIndex) + return `/optional/${category ? `${category}/` : ''}item-${stateIndex}` + } + case 'splats': + return `/files/source/state-${stateIndex}` + case 'encoding': + return `/encoded/source-${stateIndex}` + case 'active': + return `/items/item-${stateIndex}/details` + default: + return `/items/item-${stateIndex}` + } +} + +export function getSourceUrl(caseId: LinkCaseId, stateIndex: number): string { + if (!Number.isInteger(stateIndex) || stateIndex < 0 || stateIndex > 3) { + throw new Error(`Invalid Link performance state: ${stateIndex}`) + } + const pathname = sourcePath(caseId, stateIndex) + if (caseId === 'rewrites') { + return `/app/${LOCALES[stateIndex]}${pathname}` + } + return url( + pathname, + sourceSearch(caseId, stateIndex), + caseId === 'location-updaters' ? `source-${stateIndex}` : '', + ) +} + +// These expectations use fixture values and platform encoding, not router APIs. +function expectedHref(caseId: LinkCaseId, stateIndex: number, index: number) { + const itemId = `item-${index % 40}` + switch (caseId) { + case 'shared-params': + return `/items/${itemId}` + case 'unique-params': + return `/items/item-${index}` + case 'param-updaters': + return `/items/item-${stateIndex}-related-${index % 40}` + case 'location-updaters': + return url( + `/items/item-${stateIndex}`, + { + ...sourceSearch(caseId, stateIndex), + page: stateIndex + 2 + (index % 5), + }, + `source-${stateIndex}-link-${index % 5}`, + ) + case 'relative': + return url( + index % 2 === 0 + ? `/teams/team-${stateIndex}` + : `/teams/team-${stateIndex}/item-${stateIndex}/details`, + sourceSearch(caseId, stateIndex), + ) + case 'middleware': + return url(`/filtered/${itemId}`, { + tenant: `tenant-${stateIndex}`, + page: index % 2 === 0 ? undefined : 2, + filter: { ...sourceFilter(index % 4), tag: `LABEL-${index % 40}` }, + }) + case 'numeric-params': + return `/numbers/${stateIndex + (index % 40)}` + case 'optional-params': { + const category = + index % 3 === 0 + ? 'fixed' + : index % 3 === 1 + ? optionalCategory(stateIndex) + : undefined + return `/optional/${category ? `${category}/` : ''}${itemId}` + } + case 'splats': { + const value = splatValue(index) + return `/files${value ? `/${value.split('/').map(encodeURIComponent).join('/')}` : ''}` + } + case 'encoding': { + const value = encodeURIComponent(encodedValue(index)) + .replaceAll('%40', '@') + .replaceAll('%3A', ':') + .replaceAll('%2B', '+') + return `/encoded/${value}` + } + case 'masks': + return url(`/public/display-${index % 40}`, { + tenant: `mask-${index % 4}`, + }) + case 'rewrites': + return url(`/app/${LOCALES[index % 4]}/items/${itemId}`, { + page: (index % 3) + 1, + }) + case 'active': { + const item = Math.floor(index / 5) + const variant = index % 5 + const search = + variant < 3 + ? { filter: sourceFilter(item % 4) } + : { + ...sourceSearch('active', item % 4), + ...(variant === 4 ? { filter: undefined } : {}), + } + return url(`/items/item-${item}${variant < 2 ? '' : '/details'}`, search) + } + } +} + +function assertUrl( + actualHref: string | null, + expectedHref: string, + label: string, +) { + if (actualHref === null) { + throw new Error(`${label}: missing href`) + } + const actual = new URL(actualHref, 'http://localhost') + const expected = new URL(expectedHref, 'http://localhost') + // Query ordering and the platform's '+' versus '%20' are immaterial here. + const query = (value: URL) => + JSON.stringify([...value.searchParams.entries()].sort()) + if ( + actual.origin !== expected.origin || + actual.pathname !== expected.pathname || + actual.hash !== expected.hash || + query(actual) !== query(expected) + ) { + throw new Error( + `${label}: expected ${expectedHref}, received ${actualHref}`, + ) + } +} + +export function assertScenario( + caseId: LinkCaseId, + stateIndex: number, + root: ParentNode, +): void { + const source = root.querySelector('[data-testid="source-path"]') + if (source?.textContent !== sourcePath(caseId, stateIndex)) { + throw new Error( + `${caseId}/${stateIndex}: unexpected source path ${source?.textContent}`, + ) + } + const links = root.querySelectorAll('a[data-perf-link]') + if (links.length !== LINK_COUNT) { + throw new Error( + `${caseId}: expected ${LINK_COUNT} Links, got ${links.length}`, + ) + } + for (const [index, link] of links.entries()) { + const label = `${caseId}/${stateIndex}/link-${index}` + if (link.getAttribute('data-perf-link') !== String(index)) { + throw new Error(`${label}: unexpected Link order`) + } + assertUrl( + link.getAttribute('href'), + expectedHref(caseId, stateIndex, index), + label, + ) + let active: boolean | undefined + if (caseId === 'shared-params') { + active = index % 40 === stateIndex + } else if (caseId === 'unique-params') { + active = index === stateIndex + } else if (caseId === 'active') { + active = + Math.floor(index / 5) === stateIndex && [0, 2, 3].includes(index % 5) + if ( + link.textContent !== `${index}:${active ? 'active' : 'inactive'}` || + link.getAttribute('title') !== (active ? 'active' : 'inactive') || + !link.classList.contains(active ? 'perf-active' : 'perf-inactive') || + link.style.color !== (active ? 'green' : 'gray') || + link.style.opacity !== '0.8' + ) { + throw new Error( + `${label}: active props or render children are incorrect`, + ) + } + } + if ( + active !== undefined && + (link.getAttribute('data-status') === 'active') !== active + ) { + throw new Error(`${label}: expected active=${active}`) + } + } + for (let state = 0; state < 4; state++) { + const control = root.querySelector(`[data-testid="go-state-${state}"]`) + if (!control || control.hasAttribute('data-perf-link')) { + throw new Error(`${caseId}: missing or measured control Link ${state}`) + } + assertUrl( + control.getAttribute('href'), + getSourceUrl(caseId, state), + `${caseId}/control-${state}`, + ) + } +} diff --git a/benchmarks/client-nav/link-performance/client.bench.ts b/benchmarks/client-nav/link-performance/client.bench.ts new file mode 100644 index 0000000000..f819fab52b --- /dev/null +++ b/benchmarks/client-nav/link-performance/client.bench.ts @@ -0,0 +1,30 @@ +import { test } from 'vitest' +import { benchLifecycle } from '../../cpu-simulation' +import { LINK_CASES } from './cases' +import { createClientScenario, samplingOptions } from './scenario' +import type * as App from './src/client' + +const appModulePath = './dist/client/app.js' +const app: typeof App = await import(/* @vite-ignore */ appModulePath) +if (app.serverEnvironment !== false) { + throw new Error('Link client benchmarks must use the production client build') +} + +for (const { id, label } of LINK_CASES) { + test(label, async ({ bench }) => { + const scenario = createClientScenario(app, id) + function finish() { + try { + scenario.check() + } finally { + scenario.teardown() + } + } + + await bench( + `client Links: ${id}`, + benchLifecycle({ before: scenario.setup, after: finish }), + scenario.batch, + ).run(samplingOptions) + }) +} diff --git a/benchmarks/client-nav/link-performance/config.test.ts b/benchmarks/client-nav/link-performance/config.test.ts new file mode 100644 index 0000000000..1a468a3169 --- /dev/null +++ b/benchmarks/client-nav/link-performance/config.test.ts @@ -0,0 +1,42 @@ +import { afterEach, describe, expect, test, vi } from 'vitest' +import { createLinkPerformanceConfig } from './config' + +afterEach(() => vi.unstubAllEnvs()) + +describe.each(['client', 'ssr'] as const)('%s configuration', (target) => { + test('discovers only the requested suite', () => { + const config = createLinkPerformanceConfig(target) + expect(config.test?.benchmark?.include).toEqual([`${target}.bench.ts`]) + }) + + test('builds production code for the correct environment', () => { + const config = createLinkPerformanceConfig(target) + expect(config.define?.['process.env.NODE_ENV']).toBe('"production"') + expect(config.resolve?.conditions).toContain( + target === 'ssr' ? 'node' : 'browser', + ) + expect(config.build?.ssr).toBe(target === 'ssr') + expect(config.build?.outDir).toBe(`./dist/${target}`) + expect(config.build?.rolldownOptions?.platform).toBe('node') + expect(config.build?.rolldownOptions?.external).toEqual([ + 'node:module', + 'module', + /^react(?:\/|$)/, + /^react-dom(?:\/|$)/, + ]) + }) + + test('does not retransform built bundles in the test environment', () => { + vi.stubEnv('VITEST', 'true') + const config = createLinkPerformanceConfig(target) + expect(config.ssr?.noExternal).toBeUndefined() + expect(config.test?.server?.deps?.external).toEqual([ + /\/link-performance\/dist\//, + ]) + }) + + test('bundles router dependencies when building app snapshots', () => { + vi.stubEnv('VITEST', undefined) + expect(createLinkPerformanceConfig(target).ssr?.noExternal).toBe(true) + }) +}) diff --git a/benchmarks/client-nav/link-performance/config.ts b/benchmarks/client-nav/link-performance/config.ts new file mode 100644 index 0000000000..416b027057 --- /dev/null +++ b/benchmarks/client-nav/link-performance/config.ts @@ -0,0 +1,69 @@ +import { fileURLToPath } from 'node:url' +import react from '@vitejs/plugin-react' +import codspeedPlugin from '@codspeed/vitest-plugin' +import type { UserConfig } from 'vite' + +const root = fileURLToPath(new URL('.', import.meta.url)) + +export function createLinkPerformanceConfig( + target: 'client' | 'ssr', +): UserConfig { + const server = target === 'ssr' + + return { + root, + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + react(), + ], + resolve: { + conditions: [server ? 'node' : 'browser', 'production'], + }, + ssr: { + noExternal: process.env.VITEST ? undefined : true, + resolve: { + conditions: ['node', 'production'], + }, + }, + build: { + outDir: `./dist/${target}`, + emptyOutDir: true, + minify: false, + ssr: server, + lib: { + entry: `${root}src/${target}.tsx`, + formats: ['es'], + fileName: 'app', + }, + rolldownOptions: { + platform: 'node', + external: [ + 'node:module', + 'module', + /^react(?:\/|$)/, + /^react-dom(?:\/|$)/, + ], + output: { entryFileNames: 'app.js' }, + }, + }, + test: { + name: `react-link-performance-${target}`, + watch: false, + environment: server ? 'node' : 'jsdom', + setupFiles: server ? [] : ['../vitest.setup.ts'], + server: { + deps: { + external: [/\/link-performance\/dist\//], + }, + }, + include: [], + benchmark: { + include: [`${target}.bench.ts`], + }, + }, + } +} diff --git a/benchmarks/client-nav/link-performance/project.json b/benchmarks/client-nav/link-performance/project.json new file mode 100644 index 0000000000..fd1751c081 --- /dev/null +++ b/benchmarks/client-nav/link-performance/project.json @@ -0,0 +1,103 @@ +{ + "name": "@benchmarks/react-link-performance", + "projectType": "application", + "tags": ["optional-benchmark"], + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { + "projects": ["@tanstack/react-router"], + "target": "build" + } + ], + "options": { + "command": "NODE_ENV=production vite build --config ./link-performance/vite.client.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "build:ssr": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { + "projects": ["@tanstack/react-router"], + "target": "build" + } + ], + "options": { + "command": "NODE_ENV=production vite build --config ./link-performance/vite.ssr.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:perf:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.client.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:perf:ssr": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:ssr"], + "options": { + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.ssr.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:perf:stable": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client", "build:ssr"], + "options": { + "command": "NODE_ENV=production node --import=@swc-node/register/esm-register benchmarks/client-nav/link-performance/stable-runner.ts" + } + }, + "test:unit": { + "executor": "nx:run-commands", + "inputs": [ + "...", + "{workspaceRoot}/benchmarks/client-nav/scenarios/harness.ts", + "{workspaceRoot}/benchmarks/client-nav/scenarios/links/shared.ts", + "{workspaceRoot}/benchmarks/client-nav/setup-helpers.ts", + "{workspaceRoot}/benchmarks/client-nav/tsconfig.json" + ], + "dependsOn": [ + { + "projects": ["@tanstack/history"], + "target": "build" + } + ], + "options": { + "command": "vitest run --config ./link-performance/vitest.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:types": { + "executor": "nx:run-commands", + "inputs": [ + "...", + "{workspaceRoot}/benchmarks/client-nav/jsdom.ts", + "{workspaceRoot}/benchmarks/client-nav/scenarios/harness.ts", + "{workspaceRoot}/benchmarks/client-nav/scenarios/links/shared.ts", + "{workspaceRoot}/benchmarks/client-nav/setup-helpers.ts", + "{workspaceRoot}/benchmarks/client-nav/tsconfig.json", + "{workspaceRoot}/benchmarks/client-nav/vitest.setup.ts" + ], + "dependsOn": [ + { + "projects": ["@tanstack/react-router"], + "target": "build" + } + ], + "options": { + "command": "tsc -p ./link-performance/tsconfig.json --noEmit", + "cwd": "benchmarks/client-nav" + } + } + } +} diff --git a/benchmarks/client-nav/link-performance/scenario.ts b/benchmarks/client-nav/link-performance/scenario.ts new file mode 100644 index 0000000000..f1a3fb6df7 --- /dev/null +++ b/benchmarks/client-nav/link-performance/scenario.ts @@ -0,0 +1,114 @@ +import { JSDOM } from 'jsdom' +import { createScenarioSetup } from '../scenarios/harness' +import { ticksPerIteration } from '../scenarios/links/shared' +import { NAVIGATION_STATES, assertScenario, getSourceUrl } from './cases' +import type { LinkCaseId } from './cases' +import type * as ClientApp from './src/client' +import type * as SsrApp from './src/ssr' + +export interface LinkScenario { + setup: () => Promise + batch: () => Promise + check: () => void + teardown: () => void +} + +export const samplingOptions = { + warmupIterations: 100, + warmupTime: 1_000, + time: 5_000, + throws: true, +} + +export function createClientScenario( + app: typeof ClientApp, + id: LinkCaseId, +): LinkScenario { + let mounted: ReturnType | undefined + let container: HTMLElement | undefined + let anchors: Array = [] + const test = createScenarioSetup({ + frameworkLabel: 'React', + mount: (element, history) => { + container = element + mounted = app.mountTestApp(element, history, id) + return mounted + }, + initialUrl: getSourceUrl(id, 0), + steps: NAVIGATION_STATES.map((state) => `go-state-${state}`), + assertAfterStep: (index, element) => { + assertScenario(id, NAVIGATION_STATES[index]!, element) + if (!mounted) { + throw new Error('Link benchmark app was not mounted') + } + mounted.assertStateUpdates() + }, + }) + + return { + async setup() { + await test.before() + if (!container) { + throw new Error('Link benchmark container was not created') + } + anchors = [...container.querySelectorAll('a[data-perf-link]')] + }, + async batch() { + for (let index = 0; index < ticksPerIteration; index++) { + await test.tick() + } + await test.finishBatch() + }, + check() { + if (!container || !mounted) { + throw new Error('Link benchmark app was not mounted') + } + assertScenario(id, 0, container) + mounted.assertStateUpdates() + if (mounted.router.history.length !== 1) { + throw new Error('Link benchmark history must remain bounded') + } + const current = container.querySelectorAll('a[data-perf-link]') + if (anchors.some((anchor, index) => current[index] !== anchor)) { + throw new Error('Measured Links must stay mounted across navigations') + } + }, + teardown: test.after, + } +} + +export function createSsrScenario( + app: typeof SsrApp, + id: LinkCaseId, +): LinkScenario { + let html = '' + let state = 0 + function check() { + const dom = new JSDOM(html) + try { + assertScenario(id, state, dom.window.document) + } finally { + dom.window.close() + } + } + + return { + async setup() { + for (const nextState of NAVIGATION_STATES) { + state = nextState + html = await app.renderScenario(id, state, true) + check() + } + }, + async batch() { + for (const nextState of NAVIGATION_STATES) { + state = nextState + html = await app.renderScenario(id, state) + } + }, + check, + teardown() { + html = '' + }, + } +} diff --git a/benchmarks/client-nav/link-performance/src/client.tsx b/benchmarks/client-nav/link-performance/src/client.tsx new file mode 100644 index 0000000000..a187ee8c15 --- /dev/null +++ b/benchmarks/client-nav/link-performance/src/client.tsx @@ -0,0 +1,29 @@ +import { RouterProvider } from '@tanstack/react-router' +import { isServer } from '@tanstack/router-core/isServer' +import { createRoot } from 'react-dom/client' +import { assertStateUpdates, createLinkRouter } from './workload' +import type { LinkRouter } from './workload' +import type { RouterHistory } from '@tanstack/history' +import type { LinkCaseId } from '../cases' + +export const serverEnvironment: boolean | undefined = isServer + +export function mountTestApp( + container: HTMLElement, + history: RouterHistory, + caseId: LinkCaseId, +): { + router: LinkRouter + unmount: () => void + assertStateUpdates: () => void +} { + const router = createLinkRouter(caseId, history, false) + const root = createRoot(container) + root.render() + + return { + router, + unmount: () => root.unmount(), + assertStateUpdates: () => assertStateUpdates(router), + } +} diff --git a/benchmarks/client-nav/link-performance/src/ssr.tsx b/benchmarks/client-nav/link-performance/src/ssr.tsx new file mode 100644 index 0000000000..491191b1f9 --- /dev/null +++ b/benchmarks/client-nav/link-performance/src/ssr.tsx @@ -0,0 +1,29 @@ +import { RouterProvider, createMemoryHistory } from '@tanstack/react-router' +import { isServer } from '@tanstack/router-core/isServer' +import { renderToString } from 'react-dom/server' +import { getSourceUrl } from '../cases' +import { assertStateUpdates, createLinkRouter } from './workload' +import type { LinkCaseId } from '../cases' + +export const serverEnvironment: boolean | undefined = isServer + +export async function renderScenario( + caseId: LinkCaseId, + stateIndex: number, + verify = false, +) { + const history = createMemoryHistory({ + initialEntries: [getSourceUrl(caseId, stateIndex)], + }) + const router = createLinkRouter(caseId, history, true) + try { + await router.load() + const html = renderToString() + if (verify) { + assertStateUpdates(router) + } + return html + } finally { + history.destroy() + } +} diff --git a/benchmarks/client-nav/link-performance/src/workload.tsx b/benchmarks/client-nav/link-performance/src/workload.tsx new file mode 100644 index 0000000000..8315b85b8b --- /dev/null +++ b/benchmarks/client-nav/link-performance/src/workload.tsx @@ -0,0 +1,506 @@ +import { + Link, + Outlet, + createRootRouteWithContext, + createRoute, + createRouter, + linkOptions, + retainSearchParams, + stripSearchParams, + useLocation, +} from '@tanstack/react-router' +import { + LINK_COUNT, + LOCALES, + encodedValue, + optionalCategory, + sourceFilter, + sourceSearch, + splatValue, +} from '../cases' +import type { RouterHistory } from '@tanstack/history' +import type { SearchSchemaInput } from '@tanstack/react-router' +import type { Filter, LinkCaseId, LinkSearch } from '../cases' + +interface StateUpdates { + calls: number + verifiedCalls: number + input: number + output: number + offset: number +} + +interface WorkloadContext { + caseId: LinkCaseId + stateUpdates: StateUpdates +} + +function isFilter(value: unknown): value is Filter { + return ( + typeof value === 'object' && + value !== null && + 'tag' in value && + typeof value.tag === 'string' && + 'flags' in value && + typeof value.flags === 'object' && + value.flags !== null && + 'open' in value.flags && + typeof value.flags.open === 'boolean' && + 'tags' in value && + Array.isArray(value.tags) && + value.tags.every((tag: unknown) => typeof tag === 'string') + ) +} + +const rootRoute = createRootRouteWithContext()({ + validateSearch: ( + search: Record & SearchSchemaInput, + ): LinkSearch => ({ + page: typeof search.page === 'number' ? search.page : undefined, + tenant: typeof search.tenant === 'string' ? search.tenant : undefined, + filter: isFilter(search.filter) ? search.filter : undefined, + }), + component: RootLayout, +}) + +const itemsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'items/$itemId', +}) +const detailsRoute = createRoute({ + getParentRoute: () => itemsRoute, + path: 'details', +}) +const teamRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'teams/$teamId', +}) +const teamItemRoute = createRoute({ + getParentRoute: () => teamRoute, + path: '$itemId', +}) +const teamDetailsRoute = createRoute({ + getParentRoute: () => teamItemRoute, + path: 'details', +}) +const filteredRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'filtered/$itemId', + search: { + middlewares: [ + retainSearchParams(['tenant']), + stripSearchParams({ page: 1 }), + ({ search, next }) => { + const result = next(search) + return { + ...result, + filter: result.filter + ? { ...result.filter, tag: result.filter.tag.trim().toUpperCase() } + : undefined, + } + }, + ], + }, +}) +const numericRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'numbers/$number', + params: { + parse: ({ number }) => { + const value = Number(number) + if (!Number.isFinite(value)) { + throw new Error(`Invalid number: ${number}`) + } + return { number: value } + }, + stringify: ({ number }) => ({ number: String(number) }), + }, +}) +const optionalRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'optional/{-$category}/$itemId', +}) +const splatRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'files/$', +}) +const encodedRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'encoded/$value', +}) +const publicRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'public/$itemId', +}) + +const routeTree = rootRoute.addChildren([ + itemsRoute.addChildren([detailsRoute]), + teamRoute.addChildren([teamItemRoute.addChildren([teamDetailsRoute])]), + filteredRoute, + numericRoute, + optionalRoute, + splatRoute, + encodedRoute, + publicRoute, +]) + +const localeRewrite = { + input: ({ url }: { url: URL }) => { + const match = /^\/(en|fr|de|es)(\/.*)$/.exec(url.pathname) + if (match) { + url.pathname = match[2]! + url.searchParams.set('tenant', match[1]!) + } + return url + }, + output: ({ url }: { url: URL }) => { + const locale = url.searchParams.get('tenant') + if (locale) { + url.searchParams.delete('tenant') + url.pathname = `/${locale}${url.pathname}` + } + return url + }, +} + +export function createLinkRouter( + caseId: LinkCaseId, + history: RouterHistory, + isServer: boolean, +) { + const context: WorkloadContext = { + caseId, + stateUpdates: { + calls: 0, + verifiedCalls: 0, + input: 0, + output: 0, + offset: 0, + }, + } + return createRouter({ + routeTree, + history, + isServer, + context, + scrollRestoration: false, + defaultPreload: false, + trailingSlash: 'never', + pathParamsAllowedCharacters: + caseId === 'encoding' ? ['@', ':', '+'] : undefined, + ...(caseId === 'rewrites' + ? { basepath: '/app', rewrite: localeRewrite } + : {}), + }) +} + +export type LinkRouter = ReturnType + +declare module '@tanstack/react-router' { + interface Register { + router: LinkRouter + } +} + +declare module '@tanstack/history' { + interface HistoryState { + linkPerfState?: number + } +} + +// Call alongside DOM assertions, outside the timed loop, after each sample. +export function assertStateUpdates(router: LinkRouter): void { + const { caseId, stateUpdates } = router.options.context + if (caseId !== 'location-updaters') { + return + } + const input = router.state.location.state.linkPerfState ?? 0 + if ( + stateUpdates.calls - stateUpdates.verifiedCalls < LINK_COUNT || + stateUpdates.input !== input || + stateUpdates.output !== input + stateUpdates.offset || + stateUpdates.offset < 1 || + stateUpdates.offset > 40 + ) { + throw new Error( + 'Link history-state updaters did not run with current state', + ) + } + stateUpdates.verifiedCalls = stateUpdates.calls +} + +function sourceOptions(caseId: LinkCaseId, stateIndex: number) { + const itemId = `item-${stateIndex}` + const common = { + search: sourceSearch(caseId, stateIndex), + hash: caseId === 'location-updaters' ? `source-${stateIndex}` : '', + state: { linkPerfState: stateIndex + 10 }, + } + switch (caseId) { + case 'relative': + return linkOptions({ + ...common, + to: '/teams/$teamId/$itemId', + params: { teamId: `team-${stateIndex}`, itemId }, + }) + case 'numeric-params': + return linkOptions({ + ...common, + to: '/numbers/$number', + params: { number: stateIndex }, + }) + case 'optional-params': + return linkOptions({ + ...common, + to: '/optional/{-$category}/$itemId', + params: { category: optionalCategory(stateIndex), itemId }, + }) + case 'splats': + return linkOptions({ + ...common, + to: '/files/$', + params: { _splat: `source/state-${stateIndex}` }, + }) + case 'encoding': + return linkOptions({ + ...common, + to: '/encoded/$value', + params: { value: `source-${stateIndex}` }, + }) + case 'active': + return linkOptions({ + ...common, + to: '/items/$itemId/details', + params: { itemId }, + }) + default: + return linkOptions({ + ...common, + to: '/items/$itemId', + params: { itemId }, + }) + } +} + +const indexes = Array.from({ length: LINK_COUNT }, (_, index) => index) +const controls = [0, 1, 2, 3] as const + +function SourcePath() { + const pathname = useLocation({ select: (location) => location.pathname }) + return {pathname} +} + +function RootLayout() { + const context = rootRoute.useRouteContext() + return ( + <> + + +
+ {indexes.map((index) => measuredLink(context, index))} +
+ + + ) +} + +function measuredLink( + { caseId, stateUpdates }: WorkloadContext, + index: number, +) { + const common = { + key: index, + 'data-perf-link': index, + preload: false, + children: `Link ${index}`, + } as const + const itemId = `item-${index % 40}` + switch (caseId) { + case 'shared-params': + case 'unique-params': + return ( + + ) + case 'param-updaters': + return ( + ({ + itemId: `${previous.itemId}-related-${index % 40}`, + })} + /> + ) + case 'location-updaters': + return ( + ({ + ...previous, + page: (previous.page ?? 1) + 1 + (index % 5), + })} + hash={(previous) => `${previous}-link-${index % 5}`} + state={(previous) => { + const input = previous.linkPerfState ?? 0 + const offset = (index % 40) + 1 + const output = input + offset + stateUpdates.calls++ + stateUpdates.input = input + stateUpdates.output = output + stateUpdates.offset = offset + return { ...previous, linkPerfState: output } + }} + /> + ) + case 'relative': + return ( + + ) + case 'middleware': + return ( + + ) + case 'numeric-params': + return ( + ({ number: previous.number + (index % 40) })} + /> + ) + case 'optional-params': + return ( + + ) + case 'splats': + return ( + + ) + case 'encoding': + return ( + + ) + case 'masks': + return ( + + ) + case 'rewrites': + return ( + + ) + case 'active': { + const item = Math.floor(index / 5) + const variant = index % 5 + return ( + ({ + className: 'perf-active', + title: 'active', + style: { color: 'green' }, + })} + inactiveProps={() => ({ + className: 'perf-inactive', + title: 'inactive', + style: { color: 'gray' }, + })} + > + {({ isActive }) => `${index}:${isActive ? 'active' : 'inactive'}`} + + ) + } + } +} diff --git a/benchmarks/client-nav/link-performance/ssr.bench.ts b/benchmarks/client-nav/link-performance/ssr.bench.ts new file mode 100644 index 0000000000..c30084e510 --- /dev/null +++ b/benchmarks/client-nav/link-performance/ssr.bench.ts @@ -0,0 +1,30 @@ +import { test } from 'vitest' +import { benchLifecycle } from '../../cpu-simulation' +import { LINK_CASES } from './cases' +import { createSsrScenario, samplingOptions } from './scenario' +import type * as App from './src/ssr' + +const appUrl = new URL('./dist/ssr/app.js', import.meta.url).href +const app: typeof App = await import(/* @vite-ignore */ appUrl) +if (app.serverEnvironment !== true) { + throw new Error('Link SSR benchmarks must use the production server build') +} + +for (const { id, label } of LINK_CASES) { + test(label, async ({ bench }) => { + const scenario = createSsrScenario(app, id) + function finish() { + try { + scenario.check() + } finally { + scenario.teardown() + } + } + + await bench( + `SSR Links: ${id}`, + benchLifecycle({ before: scenario.setup, after: finish }), + scenario.batch, + ).run(samplingOptions) + }) +} diff --git a/benchmarks/client-nav/link-performance/stable-runner.ts b/benchmarks/client-nav/link-performance/stable-runner.ts new file mode 100644 index 0000000000..59ccfa3cb4 --- /dev/null +++ b/benchmarks/client-nav/link-performance/stable-runner.ts @@ -0,0 +1,269 @@ +import { fork } from 'node:child_process' +import { createHash } from 'node:crypto' +import { + copyFileSync, + mkdirSync, + readFileSync, + rmSync, + writeFileSync, +} from 'node:fs' +import { dirname, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import { parseArgs } from 'node:util' +import { LINK_CASES } from './cases' +import { createStagingDirectory } from './staging' +import { classify, mean, summarizeRatios } from './statistics' +import type { LinkCaseId } from './cases' +import type { + BlockSample, + Mode, + Variant, + WorkerRequest, + WorkerResponse, +} from './worker-protocol' + +const projectRoot = fileURLToPath(new URL('.', import.meta.url)) +const workspaceRoot = resolve(projectRoot, '../../..') + +function startWorker() { + const child = fork( + fileURLToPath(new URL('./stable-worker.ts', import.meta.url)), + { + cwd: workspaceRoot, + env: { ...process.env, NODE_ENV: 'production' }, + execArgv: [ + '--import=@swc-node/register/esm-register', + '--random-seed=42', + '--hash-seed=42', + ], + stdio: ['ignore', 'ignore', 'pipe', 'ipc'], + }, + ) + let stderr = '' + child.stderr?.on('data', (data: Buffer) => { + stderr = (stderr + data.toString()).slice(-4_096) + }) + + function request(message: WorkerRequest): Promise { + return new Promise((resolveResponse, reject) => { + const timeout = setTimeout(() => { + finish( + new Error(`Sampling worker timed out: ${message.kind}\n${stderr}`), + ) + }, 60_000) + const onExit = (code: number | null) => + finish(new Error(`Sampling worker exited (${code})\n${stderr}`)) + const onError = (error: Error) => finish(error) + const onMessage = (response: WorkerResponse) => { + if (response.kind === 'error') { + finish(new Error(response.message)) + } else { + finish(undefined, response) + } + } + function finish(error?: Error, response?: WorkerResponse) { + clearTimeout(timeout) + child.off('message', onMessage) + child.off('error', onError) + child.off('exit', onExit) + if (error) { + reject(error) + } else if (response) { + resolveResponse(response) + } + } + child.once('message', onMessage) + child.once('error', onError) + child.once('exit', onExit) + child.send(message, (error) => { + if (error) { + finish(error) + } + }) + }) + } + + return { + request, + kill: () => child.kill(), + } +} + +async function sampleReplica( + mode: Mode, + caseId: LinkCaseId, + baseline: string, + current: string, + replica: number, +) { + const worker = startWorker() + const samples: Array> = [[], []] + const ratios: Array<{ cpu: number; wall: number }> = [] + try { + const starts: Array = [] + // Balance module initialization and which variant finishes warming last. + const startupOrder: Array = replica % 2 ? [1, 0] : [0, 1] + for (const index of startupOrder) { + const ready = await worker.request({ + kind: 'init', + mode, + caseId, + bundle: index === 0 ? baseline : current, + variant: index, + }) + if (ready.kind !== 'ready') { + throw new Error('Expected a ready sampling worker') + } + starts[index] = ready.batchMs + } + const iterations = Math.max(1, Math.ceil(500 / Math.min(...starts))) + for (let round = 0; round < 2; round++) { + const block: Array> = [[], []] + const order: Array = + (round + replica) % 2 ? [1, 0, 0, 1] : [0, 1, 1, 0] + for (const index of order) { + const result = await worker.request({ + kind: 'measure', + iterations, + variant: index, + }) + if (result.kind !== 'sample') { + throw new Error('Expected a block measurement') + } + samples[index]!.push(result.sample) + block[index]!.push(result.sample) + } + ratios.push({ + cpu: + mean(block[1]!.map((s) => s.cpuMs)) / + mean(block[0]!.map((s) => s.cpuMs)), + wall: + mean(block[1]!.map((s) => s.wallMs)) / + mean(block[0]!.map((s) => s.wallMs)), + }) + } + const response = await worker.request({ kind: 'stop' }) + if (response.kind !== 'stopped') { + throw new Error('Expected successful post-measurement assertions') + } + return { + iterations, + baseline: samples[0]!, + current: samples[1]!, + cpuRatio: Math.exp(mean(ratios.map((r) => Math.log(r.cpu)))), + wallRatio: Math.exp(mean(ratios.map((r) => Math.log(r.wall)))), + } + } finally { + worker.kill() + } +} + +async function main() { + const { values } = parseArgs({ + options: { + baseline: { type: 'string' }, + current: { type: 'string', default: resolve(projectRoot, 'dist') }, + mode: { type: 'string', default: 'all' }, + repeats: { type: 'string', default: '4' }, + outputJson: { type: 'string' }, + testNamePattern: { type: 'string', short: 't' }, + }, + }) + if (!values.baseline || !values.outputJson) { + throw new Error( + 'Specify --baseline and --outputJson ', + ) + } + const repeats = Number(values.repeats) + if (!Number.isInteger(repeats) || repeats < 3 || repeats > 11) { + throw new Error('--repeats must be an integer between 3 and 11') + } + if (!['all', 'client', 'ssr'].includes(values.mode)) { + throw new Error('--mode must be all, client, or ssr') + } + const modes: Array = + values.mode === 'all' + ? ['client', 'ssr'] + : values.mode === 'client' + ? ['client'] + : ['ssr'] + const pattern = values.testNamePattern + ? new RegExp(values.testNamePattern) + : undefined + const cases = LINK_CASES.filter( + (c) => !pattern || pattern.test(`${c.label} ${c.id}`), + ) + if (!cases.length) { + throw new Error('No Link workloads match the requested pattern') + } + const report: { + protocol: string + node: string + complete: boolean + results: Array<{ + mode: Mode + caseId: LinkCaseId + baselineSha256: string + currentSha256: string + replicas: Array>> + cpu: ReturnType + wall: ReturnType + verdict: ReturnType + }> + } = { + protocol: + 'fresh process per case/replica; shared React runtime; separately loaded router variants; 2 ABBA/BAAB rounds; ~500ms calibrated fixed-work blocks; >=2s/100 batches warmup; main-thread CPU and wall time; fixed V8 random/hash seeds', + node: process.version, + complete: false, + results: [], + } + const output = resolve(values.outputJson) + mkdirSync(dirname(output), { recursive: true }) + const staging = createStagingDirectory() + try { + for (const mode of modes) { + const baselineInput = resolve(values.baseline, mode, 'app.js') + const currentInput = resolve(values.current, mode, 'app.js') + // Both snapshots resolve React from the same package installation. + const baseline = resolve(staging, `baseline-${mode}.mjs`) + const current = resolve(staging, `current-${mode}.mjs`) + copyFileSync(baselineInput, baseline) + copyFileSync(currentInput, current) + const digest = (file: string) => + createHash('sha256').update(readFileSync(file)).digest('hex') + const baselineSha256 = digest(baseline) + const currentSha256 = digest(current) + for (const { id } of cases) { + const replicas = [] + for (let replica = 0; replica < repeats; replica++) { + replicas.push( + await sampleReplica(mode, id, baseline, current, replica), + ) + } + const cpu = summarizeRatios(replicas.map((r) => r.cpuRatio)) + const wall = summarizeRatios(replicas.map((r) => r.wallRatio)) + const verdict = classify(cpu, wall) + report.results.push({ + mode, + caseId: id, + baselineSha256, + currentSha256, + replicas, + cpu, + wall, + verdict, + }) + writeFileSync(output, JSON.stringify(report, null, 2)) + console.log( + `${mode} ${id}: CPU ${cpu.changePercent.toFixed(2)}% [${cpu.low95.toFixed(2)}, ${cpu.high95.toFixed(2)}], wall ${wall.changePercent.toFixed(2)}% [${wall.low95.toFixed(2)}, ${wall.high95.toFixed(2)}] ${verdict}`, + ) + } + } + report.complete = true + writeFileSync(output, JSON.stringify(report, null, 2)) + } finally { + rmSync(staging, { recursive: true }) + } +} + +await main() diff --git a/benchmarks/client-nav/link-performance/stable-worker.test.ts b/benchmarks/client-nav/link-performance/stable-worker.test.ts new file mode 100644 index 0000000000..087b32414a --- /dev/null +++ b/benchmarks/client-nav/link-performance/stable-worker.test.ts @@ -0,0 +1,60 @@ +import { fork } from 'node:child_process' +import { rmdirSync, unlinkSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { expect, test } from 'vitest' +import { createStagingDirectory } from './staging' +import type { WorkerResponse } from './worker-protocol' + +test('loads emitted JavaScript without retranspiling it through SWC', async () => { + const directory = createStagingDirectory() + const bundle = join(directory, 'app.mjs') + const definition = 'function untouched ( ) { return 1 }' + writeFileSync( + bundle, + `${definition}\nawait Promise.resolve()\nthrow new Error(untouched.toString())`, + ) + const worker = fork( + fileURLToPath(new URL('./stable-worker.ts', import.meta.url)), + { + cwd: fileURLToPath(new URL('../../../', import.meta.url)), + execArgv: ['--import=@swc-node/register/esm-register'], + env: { ...process.env, NODE_ENV: 'production' }, + stdio: ['ignore', 'ignore', 'pipe', 'ipc'], + }, + ) + let stderr = '' + worker.stderr?.on('data', (data: Buffer) => { + stderr += data.toString() + }) + let timeout: ReturnType | undefined + try { + const result = new Promise((resolve, reject) => { + worker.once('message', (message: WorkerResponse) => resolve(message)) + worker.once('error', reject) + worker.once('exit', (code) => { + reject(new Error(`Worker exited (${code}): ${stderr}`)) + }) + timeout = setTimeout(() => { + reject(new Error(`Worker timed out: ${stderr}`)) + }, 5_000) + }) + worker.send({ + kind: 'init', + mode: 'ssr', + caseId: 'shared-params', + bundle, + variant: 0, + }) + const response = await result + expect(response.kind).toBe('error') + if (response.kind === 'error') { + expect(response.message).toContain(`Error: ${definition}`) + } + } finally { + clearTimeout(timeout) + worker.kill() + unlinkSync(bundle) + rmdirSync(directory) + } +}) diff --git a/benchmarks/client-nav/link-performance/stable-worker.ts b/benchmarks/client-nav/link-performance/stable-worker.ts new file mode 100644 index 0000000000..d98679dc15 --- /dev/null +++ b/benchmarks/client-nav/link-performance/stable-worker.ts @@ -0,0 +1,112 @@ +import { pathToFileURL } from 'node:url' +import { createClientScenario, createSsrScenario } from './scenario' +import type { LinkScenario } from './scenario' +import type { WorkerRequest, WorkerResponse } from './worker-protocol' +import type * as ClientApp from './src/client' +import type * as SsrApp from './src/ssr' + +const scenarios: Array = [] +const creationOrder: Array = [] +let closeWindow = () => {} + +function reply(response: WorkerResponse) { + if (!process.send) { + throw new Error('The Link sampling worker requires an IPC parent') + } + process.send(response) +} + +async function handle(request: WorkerRequest) { + if (request.kind === 'init') { + if (typeof process.threadCpuUsage !== 'function') { + throw new Error( + 'Stable sampling requires Node.js with process.threadCpuUsage', + ) + } + if (scenarios[request.variant]) { + throw new Error('A worker must only initialize each variant once') + } + let scenario: LinkScenario + const bundleUrl = pathToFileURL(request.bundle) + bundleUrl.searchParams.set('linkPerfVariant', String(request.variant)) + if (request.mode === 'client') { + const { window } = await import('../jsdom') + closeWindow = () => window.close() + const app: typeof ClientApp = await import(bundleUrl.href) + if (app.serverEnvironment !== false) { + throw new Error('Expected a production client bundle') + } + scenario = createClientScenario(app, request.caseId) + } else { + const app: typeof SsrApp = await import(bundleUrl.href) + if (app.serverEnvironment !== true) { + throw new Error('Expected a production SSR bundle') + } + scenario = createSsrScenario(app, request.caseId) + } + scenarios[request.variant] = scenario + creationOrder.push(scenario) + await scenario.setup() + const start = performance.now() + let iterations = 0 + do { + await scenario.batch() + iterations++ + } while (iterations < 100 || performance.now() - start < 2_000) + reply({ + kind: 'ready', + batchMs: (performance.now() - start) / iterations, + }) + return + } + if (request.kind === 'measure') { + const scenario = scenarios[request.variant] + if (!scenario) { + throw new Error('The sampling worker has not been initialized') + } + if (!Number.isInteger(request.iterations) || request.iterations < 1) { + throw new Error('Expected a positive batch count') + } + const cpuStart = process.threadCpuUsage() + const processStart = process.cpuUsage() + const start = performance.now() + for (let index = 0; index < request.iterations; index++) { + await scenario.batch() + } + const wallMs = performance.now() - start + const cpu = process.threadCpuUsage(cpuStart) + const processCpu = process.cpuUsage(processStart) + reply({ + kind: 'sample', + sample: { + iterations: request.iterations, + wallMs: wallMs / request.iterations, + cpuMs: (cpu.user + cpu.system) / 1_000 / request.iterations, + processCpuMs: + (processCpu.user + processCpu.system) / 1_000 / request.iterations, + }, + }) + return + } + try { + for (const scenario of creationOrder) { + scenario.check() + } + } finally { + for (const scenario of creationOrder.reverse()) { + scenario.teardown() + } + closeWindow() + } + reply({ kind: 'stopped' }) +} + +process.on('message', (request: WorkerRequest) => { + void handle(request).catch((error: unknown) => { + reply({ + kind: 'error', + message: + error instanceof Error ? error.stack || error.message : String(error), + }) + }) +}) diff --git a/benchmarks/client-nav/link-performance/staging.ts b/benchmarks/client-nav/link-performance/staging.ts new file mode 100644 index 0000000000..ac07d34c29 --- /dev/null +++ b/benchmarks/client-nav/link-performance/staging.ts @@ -0,0 +1,10 @@ +import { mkdirSync, mkdtempSync } from 'node:fs' +import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +export function createStagingDirectory() { + // SWC skips node_modules, leaving the emitted benchmark JavaScript intact. + const root = fileURLToPath(new URL('./node_modules/.cache/', import.meta.url)) + mkdirSync(root, { recursive: true }) + return mkdtempSync(resolve(root, 'link-performance-')) +} diff --git a/benchmarks/client-nav/link-performance/statistics.test.ts b/benchmarks/client-nav/link-performance/statistics.test.ts new file mode 100644 index 0000000000..8f5f37413b --- /dev/null +++ b/benchmarks/client-nav/link-performance/statistics.test.ts @@ -0,0 +1,36 @@ +import { expect, test } from 'vitest' +import { classify, mean, summarizeRatios } from './statistics' + +test('summarizes multiplicative paired changes across process replicas', () => { + const result = summarizeRatios([0.9, 0.9, 0.9, 0.9]) + expect(result.changePercent).toBeCloseTo(-10) + expect(result.low95).toBeCloseTo(-10) + expect(result.high95).toBeCloseTo(-10) + expect(result.replicas).toBe(4) +}) + +test('does not turn opposite noisy runs into a conclusive result', () => { + const result = summarizeRatios([0.9, 1.1, 0.95, 1.05]) + expect(result.low95).toBeLessThan(0) + expect(result.high95).toBeGreaterThan(0) + expect(classify(result, result)).toBe('inconclusive') +}) + +test('requires CPU and wall time to corroborate a direction', () => { + const slower = summarizeRatios([1.08, 1.09, 1.08, 1.09]) + const faster = summarizeRatios([0.9, 0.91, 0.9, 0.91]) + expect(classify(slower, slower)).toBe('slower') + expect(classify(faster, faster)).toBe('faster') + expect(classify(slower, faster)).toBe('inconclusive') + expect(classify(summarizeRatios([1, 1, 1]), summarizeRatios([1, 1, 1]))).toBe( + 'within-2%', + ) +}) + +test('rejects incomplete or invalid sampling data', () => { + expect(() => summarizeRatios([1])).toThrow() + expect(() => summarizeRatios([0, 1])).toThrow() + expect(() => summarizeRatios([NaN, 1])).toThrow() + expect(() => mean([])).toThrow() + expect(() => mean([Infinity])).toThrow() +}) diff --git a/benchmarks/client-nav/link-performance/statistics.ts b/benchmarks/client-nav/link-performance/statistics.ts new file mode 100644 index 0000000000..469bdaf65a --- /dev/null +++ b/benchmarks/client-nav/link-performance/statistics.ts @@ -0,0 +1,57 @@ +const critical95 = [ + 12.7062, 4.3027, 3.1824, 2.7764, 2.5706, 2.4469, 2.3646, 2.306, 2.2622, + 2.2281, +] + +export function mean(values: ReadonlyArray) { + if (!values.length || values.some((value) => !Number.isFinite(value))) { + throw new Error('Expected finite, nonempty samples') + } + return values.reduce((sum, value) => sum + value, 0) / values.length +} + +export function summarizeRatios(ratios: ReadonlyArray) { + if ( + ratios.length < 2 || + ratios.length > 11 || + ratios.some((value) => value <= 0) + ) { + throw new Error('Expected 2-11 independent positive process-replica ratios') + } + const logs = ratios.map(Math.log) + const center = mean(logs) + const variance = + logs.reduce((sum, value) => sum + (value - center) ** 2, 0) / + (logs.length - 1) + // Replicas, not the many correlated batches inside a worker, are the samples. + const margin = + critical95[logs.length - 2]! * Math.sqrt(variance / logs.length) + const percent = (value: number) => (Math.exp(value) - 1) * 100 + return { + changePercent: percent(center), + low95: percent(center - margin), + high95: percent(center + margin), + replicas: ratios.length, + } +} + +export function classify( + cpu: ReturnType, + wall: ReturnType, +) { + if (cpu.low95 > 0 && wall.low95 > 0) { + return 'slower' + } + if (cpu.high95 < 0 && wall.high95 < 0) { + return 'faster' + } + if ( + cpu.low95 >= -2 && + cpu.high95 <= 2 && + wall.low95 >= -2 && + wall.high95 <= 2 + ) { + return 'within-2%' + } + return 'inconclusive' +} diff --git a/benchmarks/client-nav/link-performance/tsconfig.json b/benchmarks/client-nav/link-performance/tsconfig.json new file mode 100644 index 0000000000..fbf230c977 --- /dev/null +++ b/benchmarks/client-nav/link-performance/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "react", + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": [ + "./**/*.ts", + "./**/*.tsx", + "../scenarios/harness.ts", + "../setup-helpers.ts", + "../vitest.setup.ts" + ] +} diff --git a/benchmarks/client-nav/link-performance/vite.client.config.ts b/benchmarks/client-nav/link-performance/vite.client.config.ts new file mode 100644 index 0000000000..1cd45fc45e --- /dev/null +++ b/benchmarks/client-nav/link-performance/vite.client.config.ts @@ -0,0 +1,3 @@ +import { createLinkPerformanceConfig } from './config' + +export default createLinkPerformanceConfig('client') diff --git a/benchmarks/client-nav/link-performance/vite.ssr.config.ts b/benchmarks/client-nav/link-performance/vite.ssr.config.ts new file mode 100644 index 0000000000..f59148eaf6 --- /dev/null +++ b/benchmarks/client-nav/link-performance/vite.ssr.config.ts @@ -0,0 +1,3 @@ +import { createLinkPerformanceConfig } from './config' + +export default createLinkPerformanceConfig('ssr') diff --git a/benchmarks/client-nav/link-performance/vitest.config.ts b/benchmarks/client-nav/link-performance/vitest.config.ts new file mode 100644 index 0000000000..f8454c819d --- /dev/null +++ b/benchmarks/client-nav/link-performance/vitest.config.ts @@ -0,0 +1,11 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + test: { + watch: false, + environment: 'node', + include: ['*.test.ts'], + }, +}) diff --git a/benchmarks/client-nav/link-performance/worker-protocol.ts b/benchmarks/client-nav/link-performance/worker-protocol.ts new file mode 100644 index 0000000000..474858a529 --- /dev/null +++ b/benchmarks/client-nav/link-performance/worker-protocol.ts @@ -0,0 +1,28 @@ +import type { LinkCaseId } from './cases' + +export type Mode = 'client' | 'ssr' +export type Variant = 0 | 1 + +export type WorkerRequest = + | { + kind: 'init' + mode: Mode + caseId: LinkCaseId + bundle: string + variant: Variant + } + | { kind: 'measure'; iterations: number; variant: Variant } + | { kind: 'stop' } + +export interface BlockSample { + wallMs: number + cpuMs: number + processCpuMs: number + iterations: number +} + +export type WorkerResponse = + | { kind: 'ready'; batchMs: number } + | { kind: 'sample'; sample: BlockSample } + | { kind: 'stopped' } + | { kind: 'error'; message: string } diff --git a/benchmarks/client-nav/package.json b/benchmarks/client-nav/package.json index 701e068b49..1f878adc67 100644 --- a/benchmarks/client-nav/package.json +++ b/benchmarks/client-nav/package.json @@ -9,16 +9,17 @@ "test:flame:react": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./react/speed.flame.ts", "test:flame:solid": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./solid/speed.flame.ts", "test:flame:vue": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./vue/speed.flame.ts", - "test:perf": "NODE_ENV=production vitest bench --config ./vitest.config.ts", - "test:perf:react": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts", - "test:perf:solid": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts", - "test:perf:vue": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts", + "test:perf": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.config.ts", + "test:perf:react": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts", + "test:perf:solid": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts", + "test:perf:vue": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts", "test:types": "pnpm run test:types:react && pnpm run test:types:solid && pnpm run test:types:vue", "test:types:react": "tsc -p ./react/tsconfig.json --noEmit", "test:types:solid": "tsc -p ./solid/tsconfig.json --noEmit", "test:types:vue": "tsc -p ./vue/tsconfig.json --noEmit" }, "dependencies": { + "@tanstack/history": "workspace:^", "@tanstack/react-router": "workspace:^", "@tanstack/router-core": "workspace:^", "@tanstack/solid-router": "workspace:^", @@ -30,17 +31,21 @@ }, "devDependencies": { "@platformatic/flame": "^1.6.0", - "@codspeed/vitest-plugin": "^5.5.0", + "@codspeed/vitest-plugin": "^6.0.1", "@tanstack/router-plugin": "workspace:^", "@testing-library/react": "^16.2.0", "@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "@types/jsdom": "28.0.0", - "typescript": "^6.0.2", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@typescript/native": "npm:typescript@^7.0.2", + "jsdom": "^29.1.1", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11", - "vitest": "^4.1.4" + "vitest": "catalog:" }, "nx": { "targets": { @@ -59,6 +64,8 @@ "@benchmarks/client-nav-control-flow-react", "@benchmarks/client-nav-head-react", "@benchmarks/client-nav-history-react", + "@benchmarks/client-nav-hydration-react", + "@benchmarks/client-nav-link-churn-react", "@benchmarks/client-nav-links-react", "@benchmarks/client-nav-loaders-react", "@benchmarks/client-nav-mount-react", @@ -87,6 +94,8 @@ "@benchmarks/client-nav-control-flow-solid", "@benchmarks/client-nav-head-solid", "@benchmarks/client-nav-history-solid", + "@benchmarks/client-nav-hydration-solid", + "@benchmarks/client-nav-link-churn-solid", "@benchmarks/client-nav-links-solid", "@benchmarks/client-nav-loaders-solid", "@benchmarks/client-nav-mount-solid", @@ -115,6 +124,7 @@ "@benchmarks/client-nav-control-flow-vue", "@benchmarks/client-nav-head-vue", "@benchmarks/client-nav-history-vue", + "@benchmarks/client-nav-link-churn-vue", "@benchmarks/client-nav-links-vue", "@benchmarks/client-nav-loaders-vue", "@benchmarks/client-nav-mount-vue", @@ -173,7 +183,13 @@ ] }, "test:types": { - "cache": false, + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "{workspaceRoot}/benchmarks/cpu-simulation.ts", + "dependentTaskOutputs" + ], "dependsOn": [ "^build", { @@ -190,8 +206,13 @@ "@benchmarks/client-nav-history-react", "@benchmarks/client-nav-history-solid", "@benchmarks/client-nav-history-vue", + "@benchmarks/client-nav-hydration-react", + "@benchmarks/client-nav-hydration-solid", + "@benchmarks/client-nav-link-churn-react", "@benchmarks/client-nav-links-react", + "@benchmarks/client-nav-link-churn-solid", "@benchmarks/client-nav-links-solid", + "@benchmarks/client-nav-link-churn-vue", "@benchmarks/client-nav-links-vue", "@benchmarks/client-nav-loaders-react", "@benchmarks/client-nav-loaders-solid", diff --git a/benchmarks/client-nav/react/speed.bench.ts b/benchmarks/client-nav/react/speed.bench.ts index fcc15b5fbc..944f182734 100644 --- a/benchmarks/client-nav/react/speed.bench.ts +++ b/benchmarks/client-nav/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' import { setup } from './setup' -describe('client-nav', () => { - const test = setup() +test('client-nav', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-side navigation loop (react)', + { beforeAll: scenario.before, afterAll: scenario.after }, async () => { for (let i = 0; i < 10; i++) { - await test.tick() + await scenario.tick() } }, - { - warmupIterations: 100, - time: 10_000, - setup: test.before, - teardown: test.after, - }, - ) + ).run({ + warmupIterations: 100, + time: 10_000, + }) }) diff --git a/benchmarks/client-nav/react/vite.config.ts b/benchmarks/client-nav/react/vite.config.ts index adc31ddd64..7df3f80e71 100644 --- a/benchmarks/client-nav/react/vite.config.ts +++ b/benchmarks/client-nav/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' +import { cpuSimulationExecArgv } from '../../cpu-simulation' // Anchor the project root to the package directory so this config resolves // identically when run directly and as part of an aggregate `projects` config. @@ -28,9 +29,11 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav (react)', watch: false, environment: 'jsdom', setupFiles: [`${rootDir}vitest.setup.ts`], + benchmark: { include: ['react/speed.bench.ts'] }, }, }) diff --git a/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts index 68c5f97c2f..65dab0781e 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-async-pipeline', () => { - const test = setup() +test('client-async-pipeline', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-async-pipeline navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/async-pipeline/react/src/main.tsx b/benchmarks/client-nav/scenarios/async-pipeline/react/src/main.tsx index 4b141859e6..cab86a1272 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/async-pipeline/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -22,8 +24,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts index 7161c9a13d..e36a5244b1 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav async-pipeline (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts index d1f620f447..acef710469 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-async-pipeline', () => { - const test = setup() +test('client-async-pipeline', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-async-pipeline navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx index 92dcc74d0a..4c6d49f501 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -22,8 +24,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts index 7c15baf4e9..27b9498b11 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts @@ -9,25 +9,25 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as NestedRouteImport } from './routes/nested' import { Route as IndexRouteImport } from './routes/index' -import { Route as SlowIdRouteImport } from './routes/slow.$id' -import { Route as NestedIdRouteImport } from './routes/nested.$id' +import { Route as NestedRouteImport } from './routes/nested' import { Route as CtxIdRouteImport } from './routes/ctx.$id' +import { Route as NestedIdRouteImport } from './routes/nested.$id' +import { Route as SlowIdRouteImport } from './routes/slow.$id' -const NestedRoute = NestedRouteImport.update({ - id: '/nested', - path: '/nested', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const SlowIdRoute = SlowIdRouteImport.update({ - id: '/slow/$id', - path: '/slow/$id', +const NestedRoute = NestedRouteImport.update({ + id: '/nested', + path: '/nested', + getParentRoute: () => rootRouteImport, +} as any) +const CtxIdRoute = CtxIdRouteImport.update({ + id: '/ctx/$id', + path: '/ctx/$id', getParentRoute: () => rootRouteImport, } as any) const NestedIdRoute = NestedIdRouteImport.update({ @@ -35,9 +35,9 @@ const NestedIdRoute = NestedIdRouteImport.update({ path: '/$id', getParentRoute: () => NestedRoute, } as any) -const CtxIdRoute = CtxIdRouteImport.update({ - id: '/ctx/$id', - path: '/ctx/$id', +const SlowIdRoute = SlowIdRouteImport.update({ + id: '/slow/$id', + path: '/slow/$id', getParentRoute: () => rootRouteImport, } as any) @@ -80,13 +80,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/nested': { - id: '/nested' - path: '/nested' - fullPath: '/nested' - preLoaderRoute: typeof NestedRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -94,11 +87,18 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/slow/$id': { - id: '/slow/$id' - path: '/slow/$id' - fullPath: '/slow/$id' - preLoaderRoute: typeof SlowIdRouteImport + '/nested': { + id: '/nested' + path: '/nested' + fullPath: '/nested' + preLoaderRoute: typeof NestedRouteImport + parentRoute: typeof rootRouteImport + } + '/ctx/$id': { + id: '/ctx/$id' + path: '/ctx/$id' + fullPath: '/ctx/$id' + preLoaderRoute: typeof CtxIdRouteImport parentRoute: typeof rootRouteImport } '/nested/$id': { @@ -108,11 +108,11 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof NestedIdRouteImport parentRoute: typeof NestedRoute } - '/ctx/$id': { - id: '/ctx/$id' - path: '/ctx/$id' - fullPath: '/ctx/$id' - preLoaderRoute: typeof CtxIdRouteImport + '/slow/$id': { + id: '/slow/$id' + path: '/slow/$id' + fullPath: '/slow/$id' + preLoaderRoute: typeof SlowIdRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts index 5107c1f056..214da8042e 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav async-pipeline (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts index eeb568323c..f0fd3e58df 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-async-pipeline', () => { - const test = setup() +test('client-async-pipeline', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-async-pipeline navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/main.tsx b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/main.tsx index d8e659fb09..e1bfa5965f 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -22,8 +24,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts index ce26dc62d1..66b9efd7aa 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts @@ -9,25 +9,25 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as NestedRouteImport } from './routes/nested' import { Route as IndexRouteImport } from './routes/index' -import { Route as SlowIdRouteImport } from './routes/slow.$id' -import { Route as NestedIdRouteImport } from './routes/nested.$id' +import { Route as NestedRouteImport } from './routes/nested' import { Route as CtxIdRouteImport } from './routes/ctx.$id' +import { Route as NestedIdRouteImport } from './routes/nested.$id' +import { Route as SlowIdRouteImport } from './routes/slow.$id' -const NestedRoute = NestedRouteImport.update({ - id: '/nested', - path: '/nested', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const SlowIdRoute = SlowIdRouteImport.update({ - id: '/slow/$id', - path: '/slow/$id', +const NestedRoute = NestedRouteImport.update({ + id: '/nested', + path: '/nested', + getParentRoute: () => rootRouteImport, +} as any) +const CtxIdRoute = CtxIdRouteImport.update({ + id: '/ctx/$id', + path: '/ctx/$id', getParentRoute: () => rootRouteImport, } as any) const NestedIdRoute = NestedIdRouteImport.update({ @@ -35,9 +35,9 @@ const NestedIdRoute = NestedIdRouteImport.update({ path: '/$id', getParentRoute: () => NestedRoute, } as any) -const CtxIdRoute = CtxIdRouteImport.update({ - id: '/ctx/$id', - path: '/ctx/$id', +const SlowIdRoute = SlowIdRouteImport.update({ + id: '/slow/$id', + path: '/slow/$id', getParentRoute: () => rootRouteImport, } as any) @@ -80,13 +80,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/nested': { - id: '/nested' - path: '/nested' - fullPath: '/nested' - preLoaderRoute: typeof NestedRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -94,11 +87,18 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/slow/$id': { - id: '/slow/$id' - path: '/slow/$id' - fullPath: '/slow/$id' - preLoaderRoute: typeof SlowIdRouteImport + '/nested': { + id: '/nested' + path: '/nested' + fullPath: '/nested' + preLoaderRoute: typeof NestedRouteImport + parentRoute: typeof rootRouteImport + } + '/ctx/$id': { + id: '/ctx/$id' + path: '/ctx/$id' + fullPath: '/ctx/$id' + preLoaderRoute: typeof CtxIdRouteImport parentRoute: typeof rootRouteImport } '/nested/$id': { @@ -108,11 +108,11 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof NestedIdRouteImport parentRoute: typeof NestedRoute } - '/ctx/$id': { - id: '/ctx/$id' - path: '/ctx/$id' - fullPath: '/ctx/$id' - preLoaderRoute: typeof CtxIdRouteImport + '/slow/$id': { + id: '/slow/$id' + path: '/slow/$id' + fullPath: '/slow/$id' + preLoaderRoute: typeof SlowIdRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts index e16a8ee828..ce4fa7318a 100644 --- a/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav async-pipeline (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts index 55a2224d3a..d6f2190be7 100644 --- a/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-control-flow', () => { - const test = setup() +test('client-control-flow', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-control-flow navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/control-flow/react/src/main.tsx b/benchmarks/client-nav/scenarios/control-flow/react/src/main.tsx index 9a0c3d3b50..da9e63d293 100644 --- a/benchmarks/client-nav/scenarios/control-flow/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/control-flow/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) // The scenario intentionally throws loader errors every lap; keep React 19's // default per-caught-error console reporting out of the measured loop. diff --git a/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx b/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx index 2dc4a26486..b11bb845bc 100644 --- a/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx +++ b/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx @@ -12,5 +12,9 @@ export const Route = createFileRoute('/broken')({ }) function BrokenError(props: ErrorComponentProps) { - return
{props.error.message}
+ return ( +
+ {props.error instanceof Error ? props.error.message : String(props.error)} +
+ ) } diff --git a/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts index 1aa2c1fa35..1eefca0fc3 100644 --- a/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav control-flow (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts index abbb85a575..d803d2a313 100644 --- a/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-control-flow', () => { - const test = setup() +test('client-control-flow', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-control-flow navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx b/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts index 44d88e9f8d..cd84f99d5d 100644 --- a/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts @@ -9,26 +9,16 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as TargetRouteImport } from './routes/target' -import { Route as Hop2RouteImport } from './routes/hop2' -import { Route as Hop1RouteImport } from './routes/hop1' -import { Route as BrokenRouteImport } from './routes/broken' import { Route as IndexRouteImport } from './routes/index' +import { Route as BrokenRouteImport } from './routes/broken' +import { Route as Hop1RouteImport } from './routes/hop1' +import { Route as Hop2RouteImport } from './routes/hop2' +import { Route as TargetRouteImport } from './routes/target' import { Route as MissingIdRouteImport } from './routes/missing.$id' -const TargetRoute = TargetRouteImport.update({ - id: '/target', - path: '/target', - getParentRoute: () => rootRouteImport, -} as any) -const Hop2Route = Hop2RouteImport.update({ - id: '/hop2', - path: '/hop2', - getParentRoute: () => rootRouteImport, -} as any) -const Hop1Route = Hop1RouteImport.update({ - id: '/hop1', - path: '/hop1', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const BrokenRoute = BrokenRouteImport.update({ @@ -36,9 +26,19 @@ const BrokenRoute = BrokenRouteImport.update({ path: '/broken', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const Hop1Route = Hop1RouteImport.update({ + id: '/hop1', + path: '/hop1', + getParentRoute: () => rootRouteImport, +} as any) +const Hop2Route = Hop2RouteImport.update({ + id: '/hop2', + path: '/hop2', + getParentRoute: () => rootRouteImport, +} as any) +const TargetRoute = TargetRouteImport.update({ + id: '/target', + path: '/target', getParentRoute: () => rootRouteImport, } as any) const MissingIdRoute = MissingIdRouteImport.update({ @@ -98,25 +98,11 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/target': { - id: '/target' - path: '/target' - fullPath: '/target' - preLoaderRoute: typeof TargetRouteImport - parentRoute: typeof rootRouteImport - } - '/hop2': { - id: '/hop2' - path: '/hop2' - fullPath: '/hop2' - preLoaderRoute: typeof Hop2RouteImport - parentRoute: typeof rootRouteImport - } - '/hop1': { - id: '/hop1' - path: '/hop1' - fullPath: '/hop1' - preLoaderRoute: typeof Hop1RouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/broken': { @@ -126,11 +112,25 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof BrokenRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/hop1': { + id: '/hop1' + path: '/hop1' + fullPath: '/hop1' + preLoaderRoute: typeof Hop1RouteImport + parentRoute: typeof rootRouteImport + } + '/hop2': { + id: '/hop2' + path: '/hop2' + fullPath: '/hop2' + preLoaderRoute: typeof Hop2RouteImport + parentRoute: typeof rootRouteImport + } + '/target': { + id: '/target' + path: '/target' + fullPath: '/target' + preLoaderRoute: typeof TargetRouteImport parentRoute: typeof rootRouteImport } '/missing/$id': { diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts index 1c6244d3d1..f4fa916154 100644 --- a/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav control-flow (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts index 551b88e68f..8a019945c7 100644 --- a/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-control-flow', () => { - const test = setup() +test('client-control-flow', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-control-flow navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/src/main.tsx b/benchmarks/client-nav/scenarios/control-flow/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/control-flow/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/control-flow/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts index 60fc846f89..6b53a6a203 100644 --- a/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts @@ -9,26 +9,16 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as TargetRouteImport } from './routes/target' -import { Route as Hop2RouteImport } from './routes/hop2' -import { Route as Hop1RouteImport } from './routes/hop1' -import { Route as BrokenRouteImport } from './routes/broken' import { Route as IndexRouteImport } from './routes/index' +import { Route as BrokenRouteImport } from './routes/broken' +import { Route as Hop1RouteImport } from './routes/hop1' +import { Route as Hop2RouteImport } from './routes/hop2' +import { Route as TargetRouteImport } from './routes/target' import { Route as MissingIdRouteImport } from './routes/missing.$id' -const TargetRoute = TargetRouteImport.update({ - id: '/target', - path: '/target', - getParentRoute: () => rootRouteImport, -} as any) -const Hop2Route = Hop2RouteImport.update({ - id: '/hop2', - path: '/hop2', - getParentRoute: () => rootRouteImport, -} as any) -const Hop1Route = Hop1RouteImport.update({ - id: '/hop1', - path: '/hop1', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const BrokenRoute = BrokenRouteImport.update({ @@ -36,9 +26,19 @@ const BrokenRoute = BrokenRouteImport.update({ path: '/broken', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const Hop1Route = Hop1RouteImport.update({ + id: '/hop1', + path: '/hop1', + getParentRoute: () => rootRouteImport, +} as any) +const Hop2Route = Hop2RouteImport.update({ + id: '/hop2', + path: '/hop2', + getParentRoute: () => rootRouteImport, +} as any) +const TargetRoute = TargetRouteImport.update({ + id: '/target', + path: '/target', getParentRoute: () => rootRouteImport, } as any) const MissingIdRoute = MissingIdRouteImport.update({ @@ -98,25 +98,11 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/target': { - id: '/target' - path: '/target' - fullPath: '/target' - preLoaderRoute: typeof TargetRouteImport - parentRoute: typeof rootRouteImport - } - '/hop2': { - id: '/hop2' - path: '/hop2' - fullPath: '/hop2' - preLoaderRoute: typeof Hop2RouteImport - parentRoute: typeof rootRouteImport - } - '/hop1': { - id: '/hop1' - path: '/hop1' - fullPath: '/hop1' - preLoaderRoute: typeof Hop1RouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/broken': { @@ -126,11 +112,25 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof BrokenRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/hop1': { + id: '/hop1' + path: '/hop1' + fullPath: '/hop1' + preLoaderRoute: typeof Hop1RouteImport + parentRoute: typeof rootRouteImport + } + '/hop2': { + id: '/hop2' + path: '/hop2' + fullPath: '/hop2' + preLoaderRoute: typeof Hop2RouteImport + parentRoute: typeof rootRouteImport + } + '/target': { + id: '/target' + path: '/target' + fullPath: '/target' + preLoaderRoute: typeof TargetRouteImport parentRoute: typeof rootRouteImport } '/missing/$id': { diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts index 4694cf69c8..3c2750d2a6 100644 --- a/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav control-flow (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/harness.ts b/benchmarks/client-nav/scenarios/harness.ts index 7b993d0ed8..cf3c39c7e6 100644 --- a/benchmarks/client-nav/scenarios/harness.ts +++ b/benchmarks/client-nav/scenarios/harness.ts @@ -1,3 +1,9 @@ +import { + createBrowserHistory, + createMemoryHistory, + type RouterHistory, +} from '@tanstack/history' +import { JSDOM } from 'jsdom' import { getRequiredLink, waitForRequiredLink } from '../setup-helpers' export interface ScenarioRouter { @@ -76,6 +82,16 @@ async function settle(hops: number) { } const MAX_SETTLE_HOPS = 100 +const BATCH_SETTLE_HOPS = 4 + +/** + * Close the batch at a deterministic macrotask boundary. Four fixed hops give + * framework passive effects and scheduler callbacks time to run without + * changing the amount of navigation work in the batch. + */ +async function finishBatch() { + await settle(BATCH_SETTLE_HOPS) +} async function settleUntil(isSettled: () => boolean, label: string) { for (let i = 0; i < MAX_SETTLE_HOPS; i++) { @@ -101,14 +117,19 @@ async function settleUntil(isSettled: () => boolean, label: string) { * conventions already forbid real-delay timers in measured code; non-zero * delays are passed through untouched. */ -function patchZeroDelayTimeouts() { - const originalSetTimeout = window.setTimeout.bind(window) - const originalClearTimeout = window.clearTimeout.bind(window) +interface TimerWindow { + setTimeout: typeof window.setTimeout + clearTimeout: typeof window.clearTimeout +} + +function patchZeroDelayTimeouts(targetWindow: TimerWindow) { + const originalSetTimeout = targetWindow.setTimeout.bind(targetWindow) + const originalClearTimeout = targetWindow.clearTimeout.bind(targetWindow) const immediates = new Map() // Negative ids cannot collide with real jsdom timer ids. let nextImmediateId = -2 - window.setTimeout = (( + targetWindow.setTimeout = (( handler: (...handlerArgs: Array) => void, delay?: number, ...args: Array @@ -125,9 +146,9 @@ function patchZeroDelayTimeouts() { return id } return originalSetTimeout(handler, delay, ...args) - }) as typeof window.setTimeout + }) as typeof targetWindow.setTimeout - window.clearTimeout = ((id: number) => { + targetWindow.clearTimeout = ((id: number) => { const immediate = immediates.get(id) if (immediate) { clearImmediate(immediate) @@ -135,17 +156,119 @@ function patchZeroDelayTimeouts() { return } originalClearTimeout(id) - }) as typeof window.clearTimeout + }) as typeof targetWindow.clearTimeout return () => { - window.setTimeout = originalSetTimeout as typeof window.setTimeout - window.clearTimeout = originalClearTimeout as typeof window.clearTimeout + targetWindow.setTimeout = + originalSetTimeout as typeof targetWindow.setTimeout + targetWindow.clearTimeout = + originalClearTimeout as typeof targetWindow.clearTimeout + } +} + +interface ListenerTarget { + addEventListener: ( + type: string, + listener: EventListenerOrEventListenerObject | null, + options?: boolean | AddEventListenerOptions, + ) => void + removeEventListener: ( + type: string, + listener: EventListenerOrEventListenerObject | null, + options?: boolean | EventListenerOptions, + ) => void +} + +/** + * Scroll restoration installs page-lifetime listeners without a public router + * dispose operation. Capture just those listeners while the router is created + * so per-invocation routers do not remain reachable after teardown. + */ +function captureScrollRestorationListeners() { + const captured: Array<{ + target: ListenerTarget + type: string + listener: EventListenerOrEventListenerObject | null + options?: boolean | AddEventListenerOptions + }> = [] + const patches: Array<{ + target: ListenerTarget + addEventListener: ListenerTarget['addEventListener'] + }> = [] + + const patch = (target: ListenerTarget, capturedType: string) => { + const originalAddEventListener = target.addEventListener + patches.push({ target, addEventListener: originalAddEventListener }) + + target.addEventListener = function (type, listener, options) { + if (type === capturedType) { + captured.push({ target, type, listener, options }) + } + originalAddEventListener.call(target, type, listener, options) + } + } + + patch(document as unknown as ListenerTarget, 'scroll') + patch(globalThis as unknown as ListenerTarget, 'pagehide') + + let stopped = false + const stop = () => { + if (stopped) { + return + } + stopped = true + for (const entry of patches) { + entry.target.addEventListener = entry.addEventListener + } + } + + return { + stop, + cleanup() { + stop() + for (const { target, type, listener, options } of captured) { + target.removeEventListener(type, listener, options) + } + }, + } +} + +interface ScenarioHistoryResource { + history: RouterHistory + timeoutWindow?: TimerWindow + dispose: () => void +} + +function createScenarioHistory( + mode: NonNullable, + initialUrl: string, +): ScenarioHistoryResource { + if (mode === 'browser') { + const dom = new JSDOM('', { + url: new URL(initialUrl, 'http://localhost').href, + }) + const history = createBrowserHistory({ window: dom.window }) + + return { + history, + timeoutWindow: dom.window as unknown as TimerWindow, + dispose() { + history.destroy() + dom.window.close() + }, + } + } + + const history = createMemoryHistory({ initialEntries: [initialUrl] }) + return { + history, + dispose: history.destroy, } } export interface ScenarioSetupOptions { frameworkLabel: string - mount: (container: HTMLElement) => MountedScenarioApp + mount: (container: HTMLElement, history: RouterHistory) => MountedScenarioApp /** * Circular sequence of steps advanced by `tick()`. Link steps must target * links rendered from the start (e.g. in the root layout), no two @@ -156,13 +279,22 @@ export interface ScenarioSetupOptions { */ steps: ReadonlyArray /** Sanity check run once per step during the warm-up lap in `before()`. */ - assertAfterStep?: (stepIndex: number, container: HTMLElement) => void + assertAfterStep?: ( + stepIndex: number, + container: HTMLElement, + history: RouterHistory, + ) => void /** - * URL the window is reset to before mounting (default '/'). Scenarios whose - * router uses a `basepath` or an input rewrite must start on an external - * URL that maps to their initial route. + * URL used to initialize the fresh history before mounting (default '/'). + * Scenarios whose router uses a `basepath` or an input rewrite must start on + * an external URL that maps to their initial route. */ initialUrl?: string + /** + * Browser history is reserved for the scenario that explicitly measures + * browser history traversal. All other scenarios use fresh memory history. + */ + historyMode?: 'memory' | 'browser' } function warnAboutDevMode(frameworkLabel: string) { @@ -185,18 +317,41 @@ export function createScenarioSetup(options: ScenarioSetupOptions) { let unmount: (() => void) | undefined = undefined let unsub = () => {} let restoreTimeouts = () => {} + let cleanupScrollRestorationListeners = () => {} + let historyResource: ScenarioHistoryResource | undefined = undefined let stepIndex = 0 let next: () => Promise = () => Promise.reject(new Error('Benchmark not initialized')) async function before() { stepIndex = 0 - restoreTimeouts = patchZeroDelayTimeouts() - window.history.replaceState(null, '', options.initialUrl ?? '/') + historyResource = createScenarioHistory( + options.historyMode ?? 'memory', + options.initialUrl ?? '/', + ) + + const restoreGlobalTimeouts = patchZeroDelayTimeouts(window) + const restoreHistoryTimeouts = historyResource.timeoutWindow + ? patchZeroDelayTimeouts(historyResource.timeoutWindow) + : () => {} + restoreTimeouts = () => { + restoreHistoryTimeouts() + restoreGlobalTimeouts() + } + container = document.createElement('div') document.body.append(container) - const { router, unmount: dispose } = options.mount(container) + const capturedListeners = captureScrollRestorationListeners() + let mounted: MountedScenarioApp + try { + mounted = options.mount(container, historyResource.history) + } finally { + capturedListeners.stop() + cleanupScrollRestorationListeners = capturedListeners.cleanup + } + + const { router, unmount: dispose } = mounted unmount = dispose let resolveRendered: () => void = () => {} @@ -294,8 +449,9 @@ export function createScenarioSetup(options: ScenarioSetupOptions) { // ending back on the initial route so measurement starts from a known state. for (const [index, step] of options.steps.entries()) { await runStep(step) - options.assertAfterStep?.(index, container) + options.assertAfterStep?.(index, container, historyResource.history) } + await finishBatch() next = () => { const step = options.steps[stepIndex % options.steps.length]! @@ -308,10 +464,14 @@ export function createScenarioSetup(options: ScenarioSetupOptions) { unmount?.() container?.remove() unsub() + cleanupScrollRestorationListeners() restoreTimeouts() + historyResource?.dispose() restoreTimeouts = () => {} + cleanupScrollRestorationListeners = () => {} unmount = undefined container = undefined + historyResource = undefined } function tick() { @@ -321,13 +481,14 @@ export function createScenarioSetup(options: ScenarioSetupOptions) { return { before, tick, + finishBatch, after, } } export interface MountLoopSetupOptions { frameworkLabel: string - mount: (container: HTMLElement) => MountedScenarioApp + mount: (container: HTMLElement, history: RouterHistory) => MountedScenarioApp /** Test id that must appear in the container before a mount counts as done. */ readyTestId: string assertReady?: (container: HTMLElement) => void @@ -342,11 +503,11 @@ export function createMountLoopSetup(options: MountLoopSetupOptions) { warnAboutDevMode(options.frameworkLabel) async function tick() { - window.history.replaceState(null, '', '/') const container = document.createElement('div') document.body.append(container) + const history = createMemoryHistory({ initialEntries: ['/'] }) - const { router, unmount } = options.mount(container) + const { router, unmount } = options.mount(container, history) try { await router.load() @@ -359,6 +520,7 @@ export function createMountLoopSetup(options: MountLoopSetupOptions) { options.assertReady?.(container) } finally { unmount() + history.destroy() container.remove() } } @@ -366,6 +528,7 @@ export function createMountLoopSetup(options: MountLoopSetupOptions) { return { before: async () => {}, tick, + finishBatch, after: () => {}, } } diff --git a/benchmarks/client-nav/scenarios/head/react/speed.bench.ts b/benchmarks/client-nav/scenarios/head/react/speed.bench.ts index c71b426c56..d0d731a09f 100644 --- a/benchmarks/client-nav/scenarios/head/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/head/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-head', () => { - const test = setup() +test('client-head', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-head navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/head/react/src/main.tsx b/benchmarks/client-nav/scenarios/head/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/head/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/head/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/head/react/vite.config.ts b/benchmarks/client-nav/scenarios/head/react/vite.config.ts index 086bd60bb4..7c8d6d4c15 100644 --- a/benchmarks/client-nav/scenarios/head/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/head/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav head (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts index ea0a5ca818..ca156c950b 100644 --- a/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-head', () => { - const test = setup() +test('client-head', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-head navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/head/solid/src/main.tsx b/benchmarks/client-nav/scenarios/head/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/head/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/head/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts index ead6a4436a..b6f217e527 100644 --- a/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts @@ -9,15 +9,15 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as SettingsRouteImport } from './routes/settings' -import { Route as DocsRouteImport } from './routes/docs' import { Route as IndexRouteImport } from './routes/index' -import { Route as DocsSectionRouteImport } from './routes/docs.$section' +import { Route as DocsRouteImport } from './routes/docs' +import { Route as SettingsRouteImport } from './routes/settings' import { Route as ArticlesIdRouteImport } from './routes/articles.$id' +import { Route as DocsSectionRouteImport } from './routes/docs.$section' -const SettingsRoute = SettingsRouteImport.update({ - id: '/settings', - path: '/settings', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const DocsRoute = DocsRouteImport.update({ @@ -25,9 +25,14 @@ const DocsRoute = DocsRouteImport.update({ path: '/docs', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const SettingsRoute = SettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => rootRouteImport, +} as any) +const ArticlesIdRoute = ArticlesIdRouteImport.update({ + id: '/articles/$id', + path: '/articles/$id', getParentRoute: () => rootRouteImport, } as any) const DocsSectionRoute = DocsSectionRouteImport.update({ @@ -35,11 +40,6 @@ const DocsSectionRoute = DocsSectionRouteImport.update({ path: '/$section', getParentRoute: () => DocsRoute, } as any) -const ArticlesIdRoute = ArticlesIdRouteImport.update({ - id: '/articles/$id', - path: '/articles/$id', - getParentRoute: () => rootRouteImport, -} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -86,11 +86,11 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/settings': { - id: '/settings' - path: '/settings' - fullPath: '/settings' - preLoaderRoute: typeof SettingsRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/docs': { @@ -100,11 +100,18 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof DocsRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/settings': { + id: '/settings' + path: '/settings' + fullPath: '/settings' + preLoaderRoute: typeof SettingsRouteImport + parentRoute: typeof rootRouteImport + } + '/articles/$id': { + id: '/articles/$id' + path: '/articles/$id' + fullPath: '/articles/$id' + preLoaderRoute: typeof ArticlesIdRouteImport parentRoute: typeof rootRouteImport } '/docs/$section': { @@ -114,13 +121,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof DocsSectionRouteImport parentRoute: typeof DocsRoute } - '/articles/$id': { - id: '/articles/$id' - path: '/articles/$id' - fullPath: '/articles/$id' - preLoaderRoute: typeof ArticlesIdRouteImport - parentRoute: typeof rootRouteImport - } } } diff --git a/benchmarks/client-nav/scenarios/head/solid/vite.config.ts b/benchmarks/client-nav/scenarios/head/solid/vite.config.ts index 7b5a1e22b4..986b2de2b0 100644 --- a/benchmarks/client-nav/scenarios/head/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/head/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav head (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts index 3630032e44..d188a9dd7a 100644 --- a/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-head', () => { - const test = setup() +test('client-head', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-head navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/head/vue/src/main.tsx b/benchmarks/client-nav/scenarios/head/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/head/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/head/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts index b115854c26..161f99a65c 100644 --- a/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts @@ -9,15 +9,15 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as SettingsRouteImport } from './routes/settings' -import { Route as DocsRouteImport } from './routes/docs' import { Route as IndexRouteImport } from './routes/index' -import { Route as DocsSectionRouteImport } from './routes/docs.$section' +import { Route as DocsRouteImport } from './routes/docs' +import { Route as SettingsRouteImport } from './routes/settings' import { Route as ArticlesIdRouteImport } from './routes/articles.$id' +import { Route as DocsSectionRouteImport } from './routes/docs.$section' -const SettingsRoute = SettingsRouteImport.update({ - id: '/settings', - path: '/settings', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const DocsRoute = DocsRouteImport.update({ @@ -25,9 +25,14 @@ const DocsRoute = DocsRouteImport.update({ path: '/docs', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const SettingsRoute = SettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => rootRouteImport, +} as any) +const ArticlesIdRoute = ArticlesIdRouteImport.update({ + id: '/articles/$id', + path: '/articles/$id', getParentRoute: () => rootRouteImport, } as any) const DocsSectionRoute = DocsSectionRouteImport.update({ @@ -35,11 +40,6 @@ const DocsSectionRoute = DocsSectionRouteImport.update({ path: '/$section', getParentRoute: () => DocsRoute, } as any) -const ArticlesIdRoute = ArticlesIdRouteImport.update({ - id: '/articles/$id', - path: '/articles/$id', - getParentRoute: () => rootRouteImport, -} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -86,11 +86,11 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/settings': { - id: '/settings' - path: '/settings' - fullPath: '/settings' - preLoaderRoute: typeof SettingsRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/docs': { @@ -100,11 +100,18 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof DocsRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/settings': { + id: '/settings' + path: '/settings' + fullPath: '/settings' + preLoaderRoute: typeof SettingsRouteImport + parentRoute: typeof rootRouteImport + } + '/articles/$id': { + id: '/articles/$id' + path: '/articles/$id' + fullPath: '/articles/$id' + preLoaderRoute: typeof ArticlesIdRouteImport parentRoute: typeof rootRouteImport } '/docs/$section': { @@ -114,13 +121,6 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof DocsSectionRouteImport parentRoute: typeof DocsRoute } - '/articles/$id': { - id: '/articles/$id' - path: '/articles/$id' - fullPath: '/articles/$id' - preLoaderRoute: typeof ArticlesIdRouteImport - parentRoute: typeof rootRouteImport - } } } diff --git a/benchmarks/client-nav/scenarios/head/vue/vite.config.ts b/benchmarks/client-nav/scenarios/head/vue/vite.config.ts index 0ad2067925..bb1126d85f 100644 --- a/benchmarks/client-nav/scenarios/head/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/head/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav head (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/history/react/setup.ts b/benchmarks/client-nav/scenarios/history/react/setup.ts index 130583b190..c26b7ffd08 100644 --- a/benchmarks/client-nav/scenarios/history/react/setup.ts +++ b/benchmarks/client-nav/scenarios/history/react/setup.ts @@ -11,6 +11,7 @@ export function setup() { return createScenarioSetup({ frameworkLabel: 'React', mount: mountTestApp, + historyMode: 'browser', steps, assertAfterStep: assertStepResult, }) diff --git a/benchmarks/client-nav/scenarios/history/react/speed.bench.ts b/benchmarks/client-nav/scenarios/history/react/speed.bench.ts index df2c951c03..6ec7031857 100644 --- a/benchmarks/client-nav/scenarios/history/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/history/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-history', () => { - const test = setup() +test('client-history', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-history navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/history/react/src/main.tsx b/benchmarks/client-nav/scenarios/history/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/history/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/history/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/history/react/vite.config.ts b/benchmarks/client-nav/scenarios/history/react/vite.config.ts index 61a1b2feef..bdbde9c668 100644 --- a/benchmarks/client-nav/scenarios/history/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/history/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav history (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/history/shared.ts b/benchmarks/client-nav/scenarios/history/shared.ts index 9ddfa6c104..be6096cea8 100644 --- a/benchmarks/client-nav/scenarios/history/shared.ts +++ b/benchmarks/client-nav/scenarios/history/shared.ts @@ -8,6 +8,7 @@ * forward tail and the session history never grows past 4 entries. */ import type { ScenarioStep } from '../harness' +import type { RouterHistory } from '@tanstack/history' export const pageIds = ['1', '2', '3'] as const export const maskedPhotoId = '42' @@ -27,7 +28,7 @@ interface HistoryStepExpectation { step: ScenarioStep /** Expected router location pathname (the REAL location, even when masked). */ pathname: string - /** Expected window.location pathname when it differs (location masking). */ + /** Expected browser-history pathname when it differs (location masking). */ windowPathname?: string /** Marker test id that must be present in the container after the step. */ marker?: string @@ -52,7 +53,11 @@ export const stepExpectations: ReadonlyArray = [ export const steps = stepExpectations.map((expectation) => expectation.step) -export function assertStepResult(stepIndex: number, container: HTMLElement) { +export function assertStepResult( + stepIndex: number, + container: HTMLElement, + history: RouterHistory, +) { const expected = stepExpectations[stepIndex]! const loc = container.querySelector('[data-testid="loc"]')?.textContent @@ -63,9 +68,9 @@ export function assertStepResult(stepIndex: number, container: HTMLElement) { } const windowPathname = expected.windowPathname ?? expected.pathname - if (window.location.pathname !== windowPathname) { + if (history.location.pathname !== windowPathname) { throw new Error( - `Expected window.location.pathname to be "${windowPathname}" after step ${stepIndex}, received "${window.location.pathname}"`, + `Expected history.location.pathname to be "${windowPathname}" after step ${stepIndex}, received "${history.location.pathname}"`, ) } diff --git a/benchmarks/client-nav/scenarios/history/solid/setup.ts b/benchmarks/client-nav/scenarios/history/solid/setup.ts index 6a46971603..4adf55d6df 100644 --- a/benchmarks/client-nav/scenarios/history/solid/setup.ts +++ b/benchmarks/client-nav/scenarios/history/solid/setup.ts @@ -11,6 +11,7 @@ export function setup() { return createScenarioSetup({ frameworkLabel: 'Solid', mount: mountTestApp, + historyMode: 'browser', steps, assertAfterStep: assertStepResult, }) diff --git a/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts index 8e814bc133..56af035b2b 100644 --- a/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-history', () => { - const test = setup() +test('client-history', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-history navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/history/solid/src/main.tsx b/benchmarks/client-nav/scenarios/history/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/history/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/history/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts index a6ab2a4fc8..af253f4a15 100644 --- a/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts @@ -9,24 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as GalleryRouteImport } from './routes/gallery' import { Route as IndexRouteImport } from './routes/index' -import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId' +import { Route as GalleryRouteImport } from './routes/gallery' import { Route as PagesNRouteImport } from './routes/pages.$n' +import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId' -const GalleryRoute = GalleryRouteImport.update({ - id: '/gallery', - path: '/gallery', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({ - id: '/photos/$photoId', - path: '/photos/$photoId', +const GalleryRoute = GalleryRouteImport.update({ + id: '/gallery', + path: '/gallery', getParentRoute: () => rootRouteImport, } as any) const PagesNRoute = PagesNRouteImport.update({ @@ -34,6 +29,11 @@ const PagesNRoute = PagesNRouteImport.update({ path: '/pages/$n', getParentRoute: () => rootRouteImport, } as any) +const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({ + id: '/photos/$photoId', + path: '/photos/$photoId', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -71,13 +71,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/gallery': { - id: '/gallery' - path: '/gallery' - fullPath: '/gallery' - preLoaderRoute: typeof GalleryRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -85,11 +78,11 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/photos/$photoId': { - id: '/photos/$photoId' - path: '/photos/$photoId' - fullPath: '/photos/$photoId' - preLoaderRoute: typeof PhotosPhotoIdRouteImport + '/gallery': { + id: '/gallery' + path: '/gallery' + fullPath: '/gallery' + preLoaderRoute: typeof GalleryRouteImport parentRoute: typeof rootRouteImport } '/pages/$n': { @@ -99,6 +92,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof PagesNRouteImport parentRoute: typeof rootRouteImport } + '/photos/$photoId': { + id: '/photos/$photoId' + path: '/photos/$photoId' + fullPath: '/photos/$photoId' + preLoaderRoute: typeof PhotosPhotoIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/client-nav/scenarios/history/solid/vite.config.ts b/benchmarks/client-nav/scenarios/history/solid/vite.config.ts index de0eda543c..4da589ff0e 100644 --- a/benchmarks/client-nav/scenarios/history/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/history/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav history (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/history/vue/setup.ts b/benchmarks/client-nav/scenarios/history/vue/setup.ts index 97b74b3892..df689964e4 100644 --- a/benchmarks/client-nav/scenarios/history/vue/setup.ts +++ b/benchmarks/client-nav/scenarios/history/vue/setup.ts @@ -11,6 +11,7 @@ export function setup() { return createScenarioSetup({ frameworkLabel: 'Vue', mount: mountTestApp, + historyMode: 'browser', steps, assertAfterStep: assertStepResult, }) diff --git a/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts index be2956bd85..3d36ac4cfa 100644 --- a/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-history', () => { - const test = setup() +test('client-history', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-history navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/history/vue/src/main.tsx b/benchmarks/client-nav/scenarios/history/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/history/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/history/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts index cee1b68870..519aef7c8f 100644 --- a/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts @@ -9,24 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as GalleryRouteImport } from './routes/gallery' import { Route as IndexRouteImport } from './routes/index' -import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId' +import { Route as GalleryRouteImport } from './routes/gallery' import { Route as PagesNRouteImport } from './routes/pages.$n' +import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId' -const GalleryRoute = GalleryRouteImport.update({ - id: '/gallery', - path: '/gallery', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({ - id: '/photos/$photoId', - path: '/photos/$photoId', +const GalleryRoute = GalleryRouteImport.update({ + id: '/gallery', + path: '/gallery', getParentRoute: () => rootRouteImport, } as any) const PagesNRoute = PagesNRouteImport.update({ @@ -34,6 +29,11 @@ const PagesNRoute = PagesNRouteImport.update({ path: '/pages/$n', getParentRoute: () => rootRouteImport, } as any) +const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({ + id: '/photos/$photoId', + path: '/photos/$photoId', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -71,13 +71,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/gallery': { - id: '/gallery' - path: '/gallery' - fullPath: '/gallery' - preLoaderRoute: typeof GalleryRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -85,11 +78,11 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/photos/$photoId': { - id: '/photos/$photoId' - path: '/photos/$photoId' - fullPath: '/photos/$photoId' - preLoaderRoute: typeof PhotosPhotoIdRouteImport + '/gallery': { + id: '/gallery' + path: '/gallery' + fullPath: '/gallery' + preLoaderRoute: typeof GalleryRouteImport parentRoute: typeof rootRouteImport } '/pages/$n': { @@ -99,6 +92,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof PagesNRouteImport parentRoute: typeof rootRouteImport } + '/photos/$photoId': { + id: '/photos/$photoId' + path: '/photos/$photoId' + fullPath: '/photos/$photoId' + preLoaderRoute: typeof PhotosPhotoIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/client-nav/scenarios/history/vue/vite.config.ts b/benchmarks/client-nav/scenarios/history/vue/vite.config.ts index 58986d6526..c5f1ca9807 100644 --- a/benchmarks/client-nav/scenarios/history/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/history/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav history (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/hydration/react/fixture.ts b/benchmarks/client-nav/scenarios/hydration/react/fixture.ts new file mode 100644 index 0000000000..950c870a1c --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/fixture.ts @@ -0,0 +1,31 @@ +export const ordinaryLinkCount = 192 +export const hashLinkCount = 8 +export const serverUrl = '/teams/team-7/items/item-42?view=summary' +export const clientUrl = `${serverUrl}#details` + +export interface Diagnostics { + beforeLoads: number + loaders: number + mounted: boolean + clicks: number + ordinaryRenders: number + hashRenders: number + countRenders: boolean +} + +export function createDiagnostics(countRenders = false): Diagnostics { + return { + beforeLoads: 0, + loaders: 0, + mounted: false, + clicks: 0, + ordinaryRenders: 0, + hashRenders: 0, + countRenders, + } +} + +export interface FixtureArtifact { + html: string + scripts: Array +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs b/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs new file mode 100644 index 0000000000..fbc67c5a08 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs @@ -0,0 +1,23 @@ +import assert from 'node:assert/strict' +import { writeFile } from 'node:fs/promises' +import { JSDOM } from 'jsdom' + +if (process.env.NODE_ENV !== 'production') { + throw new Error('Generate the hydration fixture in production mode') +} +const { renderFixture } = await import('./dist/server/server.js') +const html = await renderFixture() +const dom = new JSDOM(html) +try { + const scriptElements = [...dom.window.document.querySelectorAll('script')] + assert.ok(scriptElements.length > 0) + assert.ok(scriptElements.every((script) => !script.src)) + const scripts = scriptElements.map((script) => script.textContent) + assert.ok(scripts.some((script) => script.includes('$_TSR'))) + await writeFile( + new URL('./dist/fixture.json', import.meta.url), + JSON.stringify({ html, scripts }), + ) +} finally { + dom.window.close() +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts b/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts new file mode 100644 index 0000000000..7e466cbaed --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts @@ -0,0 +1,93 @@ +import { expect, test } from 'vitest' +import { hashLinkCount, ordinaryLinkCount } from './fixture' +import { setup } from './setup' +import { settleHydration } from './settle' + +const turn = () => new Promise((resolve) => setImmediate(resolve)) + +test('restores data and context into fresh DOMs and includes follow-up renders', async () => { + const scenario = setup({ countRenders: true }) + const schedulerTasks = new Set() + for (let iteration = 0; iteration < 3; iteration++) { + await scenario.before() + try { + expect(scenario.snapshot().diagnostics.mounted).toBe(false) + expect(scenario.snapshot().matches).toBeUndefined() + await scenario.run() + schedulerTasks.add(scenario.schedulerTasks()) + const completed = scenario.snapshot() + // Supports both main's extra Link update and the optimized snapshot. + expect([ordinaryLinkCount, ordinaryLinkCount * 2]).toContain( + completed.diagnostics.ordinaryRenders, + ) + expect(completed.diagnostics.hashRenders).toBeGreaterThanOrEqual( + hashLinkCount + hashLinkCount / 2, + ) + for (let index = 0; index < 4; index++) { + await turn() + } + expect(scenario.snapshot()).toEqual(completed) + await expect(scenario.run()).rejects.toThrow('newly prepared sample') + } finally { + await scenario.after() + } + } + // React yields on its pinned clock, never on wall time spent hydrating. + expect(schedulerTasks.size).toBe(1) +}) + +test('rejects an empty measurement and still releases its sample', async () => { + const scenario = setup() + await scenario.before() + await expect(scenario.after()).rejects.toThrow( + 'Hydration sample was not completed', + ) + await scenario.before() + try { + await scenario.run() + } finally { + await scenario.after() + } +}) + +test('waits for a commit and scheduler work lasting more than 100 turns', async () => { + let committed = false + const commit = (async () => { + for (let index = 0; index < 150; index++) { + await turn() + } + committed = true + })() + let remainingCallbacks = 150 + await settleHydration( + commit, + () => { + expect(committed).toBe(true) + return remainingCallbacks-- <= 0 + }, + () => 'delayed commit', + ) + expect(remainingCallbacks).toBeLessThan(0) +}) + +test('retains a watchdog for a commit that never completes', async () => { + await expect( + settleHydration( + new Promise(() => {}), + () => true, + () => 'commit pending', + 10, + ), + ).rejects.toThrow('Hydration did not settle within 10ms: commit pending') +}) + +test('retains a watchdog when scheduler work never becomes idle', async () => { + await expect( + settleHydration( + Promise.resolve(), + () => false, + () => 'callbacks pending', + 10, + ), + ).rejects.toThrow('Hydration did not settle within 10ms: callbacks pending') +}) diff --git a/benchmarks/client-nav/scenarios/hydration/react/project.json b/benchmarks/client-nav/scenarios/hydration/react/project.json new file mode 100644 index 0000000000..ca23838c0f --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/project.json @@ -0,0 +1,40 @@ +{ + "name": "@benchmarks/client-nav-hydration-react", + "projectType": "application", + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { "projects": ["@tanstack/react-router"], "target": "build" } + ], + "options": { + "command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts" + } + }, + "test:unit": { + "executor": "nx:run-commands", + "dependsOn": ["build:client"], + "options": { + "command": "vitest run --config ./scenarios/hydration/react/vite.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:perf": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production vitest bench --mode benchmark --run --config ./scenarios/hydration/react/vite.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:types:client": { + "executor": "nx:run-commands", + "dependsOn": [ + { "projects": ["@tanstack/react-router"], "target": "build" } + ], + "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" } + } + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/settle.ts b/benchmarks/client-nav/scenarios/hydration/react/settle.ts new file mode 100644 index 0000000000..cc4c09a72d --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/settle.ts @@ -0,0 +1,35 @@ +const turn = () => new Promise((resolve) => setImmediate(resolve)) + +export async function settleHydration( + committed: Promise, + isIdle: () => boolean, + describeProgress: () => string, + timeoutMs = 60_000, +) { + let timeoutError: Error | undefined + let watchdog: ReturnType | undefined + const timeout = new Promise((_, reject) => { + watchdog = setTimeout(() => { + timeoutError = new Error( + `Hydration did not settle within ${timeoutMs}ms: ${describeProgress()}`, + ) + reject(timeoutError) + }, timeoutMs) + }) + try { + // Concurrent hydration can need many more scheduler turns under CPU + // instrumentation. Await its commit instead of limiting successful work + // to an arbitrary number of event-loop polls. + await Promise.race([committed, timeout]) + let idleTurns = 0 + while (idleTurns < 2) { + await turn() + if (timeoutError) { + throw timeoutError + } + idleTurns = isIdle() ? idleTurns + 1 : 0 + } + } finally { + clearTimeout(watchdog) + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/setup.ts b/benchmarks/client-nav/scenarios/hydration/react/setup.ts new file mode 100644 index 0000000000..7c588af3fd --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/setup.ts @@ -0,0 +1,316 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { fileURLToPath } from 'node:url' +import { Script } from 'node:vm' +import { JSDOM, VirtualConsole } from 'jsdom' +import { clientUrl, hashLinkCount, ordinaryLinkCount } from './fixture' +import { settleHydration } from './settle' +import type { FixtureArtifact } from './fixture' +import type * as Client from './src/client' + +type ClientApp = typeof Client +const turn = () => new Promise((resolve) => setImmediate(resolve)) + +// React's scheduler ends a time slice once performance.now() has advanced 5 ms. +// Under CodSpeed's CPU simulation the wall clock advances much further per +// instruction, by a runner-dependent factor, so real time turned identical +// samples into different numbers of yields, scheduler tasks and event-loop +// turns. With a frozen clock React yields only to paint after a commit, as on +// a fast host. 1 s is past React's initial 300 ms fallback throttle. Only the +// window's performance clock is pinned: Date.now(), which the Router uses for +// match timestamps, is unchanged. +const schedulerTime = 1_000 + +export function setup({ countRenders = false } = {}) { + // Compile once, outside measurement. Evaluation below creates fresh objects + // in each window's realm; neither the payload nor module state is reused. + const artifact: FixtureArtifact = JSON.parse( + readFileSync(new URL('./dist/fixture.json', import.meta.url), 'utf8'), + ) + const clientPath = new URL('./dist/client/client.js', import.meta.url) + const clientScript = new Script(readFileSync(clientPath, 'utf8'), { + filename: fileURLToPath(clientPath), + }) + const bootstrapScripts = artifact.scripts.map( + (source, index) => + new Script(source, { + filename: `hydration-bootstrap-${index}.js`, + }), + ) + let current: Awaited> | undefined + + async function prepare() { + const errors: Array = [] + const virtualConsole = new VirtualConsole() + virtualConsole.on('jsdomError', (error) => errors.push(String(error))) + virtualConsole.on('error', (...args) => + errors.push(args.map(String).join(' ')), + ) + const dom = new JSDOM(artifact.html, { + url: `http://localhost${clientUrl}`, + runScripts: 'outside-only', + virtualConsole, + }) + const immediates = new Set() + const scheduler = { tasks: 0 } + try { + Object.assign(dom.window, { + TextEncoder, + TextDecoder, + ReadableStream, + WritableStream, + TransformStream, + // Let React's production scheduler use the same task-turn primitive as + // the existing Node client benchmarks, without a real-delay timer. + setImmediate( + callback: (...args: Array) => void, + ...args: Array + ) { + scheduler.tasks++ + const handle = setImmediate(() => { + immediates.delete(handle) + callback(...args) + }) + immediates.add(handle) + return handle + }, + clearImmediate(handle: NodeJS.Immediate) { + immediates.delete(handle) + clearImmediate(handle) + }, + fetch() { + throw new Error('Hydration attempted a network request') + }, + scrollTo() {}, + }) + dom.window.performance.now = () => schedulerTime + const context = dom.getInternalVMContext() + // jsdom has no layout/scroll implementation; only hydration CPU is measured. + dom.window.HTMLElement.prototype.scrollIntoView = () => {} + clientScript.runInContext(context) + const app = (dom.window as unknown as { HydrationBenchmark: ClientApp }) + .HydrationBenchmark + assert.equal(app.serverEnvironment, false) + const anchors = Array.from(dom.window.document.querySelectorAll('a')) + const scriptElements = Array.from( + dom.window.document.querySelectorAll('script'), + ) + const executingScript = { current: null as HTMLScriptElement | null } + Object.defineProperty(dom.window.document, 'currentScript', { + configurable: true, + get: () => executingScript.current, + }) + assert.equal(anchors.length, ordinaryLinkCount + hashLinkCount) + const content = dom.window.document.getElementById('hydration-content') + assert.ok(content) + // Finish jsdom's initial document lifecycle before opening the measure. + await turn() + assert.equal(dom.window.document.readyState, 'complete') + assert.equal(app.ready(), false) + return { + dom, + context, + app, + anchors, + content, + scriptElements, + executingScript, + immediates, + scheduler, + errors, + started: false, + completed: false, + failed: false, + } + } catch (error) { + for (const handle of immediates) { + clearImmediate(handle) + } + dom.window.close() + throw error + } + } + + async function before() { + if (current) { + throw new Error('Previous hydration sample was not disposed') + } + current = await prepare() + } + + async function run() { + const sample = current + if (!sample || sample.started) { + throw new Error('Hydration requires a newly prepared sample') + } + sample.started = true + try { + // HTML parsing/module evaluation are already done. Payload execution, + // router initialization/restoration and React hydration are measured. + for (let index = 0; index < bootstrapScripts.length; index++) { + // SSR bootstrap scripts remove their own script element after running. + sample.executingScript.current = sample.scriptElements[index]! + try { + bootstrapScripts[index]!.runInContext(sample.context) + } finally { + sample.executingScript.current = null + } + } + await settleHydration( + sample.app.start(countRenders), + () => sample.immediates.size === 0, + () => { + const progress = sample.app.snapshot() + return JSON.stringify({ + diagnostics: progress.diagnostics, + errors: [...sample.errors, ...progress.errors], + restoredMatches: progress.matches?.length, + pendingSchedulerCallbacks: sample.immediates.size, + }) + }, + ) + if (sample.errors.length) { + throw new Error(sample.errors.join('\n')) + } + assert.ok( + sample.app.ready(), + 'Hydration committed without the expected active links', + ) + sample.completed = true + } catch (error) { + sample.failed = true + throw error + } + } + + function snapshot() { + if (!current) { + throw new Error('No hydration sample') + } + // Normalize realm prototypes only for untimed assertions. + return JSON.parse(JSON.stringify(current.app.snapshot())) as ReturnType< + ClientApp['snapshot'] + > + } + + function schedulerTasks() { + if (!current) { + throw new Error('No hydration sample') + } + return current.scheduler.tasks + } + + function validate() { + assert.ok(current?.started) + const { dom, anchors, content, errors } = current + const doc = dom.window.document + const result = snapshot() + assert.deepEqual(errors, []) + assert.deepEqual(result.errors, []) + assert.equal(result.diagnostics.beforeLoads, 0) + assert.equal(result.diagnostics.loaders, 0) + assert.equal(result.diagnostics.mounted, true) + assert.equal(result.location, clientUrl) + assert.equal(result.matches?.length, 3) + for (const match of result.matches) { + assert.equal(match.status, 'success') + assert.deepEqual(match.context.viewer, { + id: 'viewer-3', + name: 'Ada', + role: 'editor', + }) + } + assert.deepEqual(result.matches[1]!.context.team, { + id: 'team-7', + member: 'viewer-3', + }) + assert.deepEqual(result.matches[2]!.context.permissions, { edit: true }) + assert.deepEqual(result.matches[1]!.loaderData, { + title: 'Team team-7', + categories: ['open', 'closed'], + }) + const data = result.matches[2]!.loaderData as { + owner: string + selected: string + rows: Array<{ + id: string + label: string + details: { score: number; open: boolean } + }> + } + assert.equal(data.owner, 'viewer-3') + assert.equal(data.selected, 'item-42') + assert.equal(data.rows.length, ordinaryLinkCount) + assert.equal(doc.getElementById('hydration-content'), content) + assert.equal(doc.querySelectorAll('a').length, anchors.length) + assert.equal(doc.getElementById('viewer')?.textContent, 'Ada') + assert.equal(doc.getElementById('permission')?.textContent, 'Editable') + for (const anchor of anchors) { + assert.equal(doc.getElementById(anchor.id), anchor) + } + for (let index = 0; index < ordinaryLinkCount; index++) { + const anchor = doc.getElementById(`ordinary-item-${index}`)! + assert.equal( + anchor.getAttribute('href'), + `/teams/team-7/items/item-${index}?view=summary`, + ) + assert.equal(anchor.textContent, `Item ${index}`) + assert.equal( + anchor.getAttribute('data-status'), + index === 42 ? 'active' : null, + ) + assert.deepEqual(data.rows[index], { + id: `item-${index}`, + label: `Item ${index}`, + details: { score: index * 3, open: index % 2 === 0 }, + }) + } + for (let index = 0; index < hashLinkCount; index++) { + assert.equal( + doc.getElementById(`hash-${index}`)?.getAttribute('data-status'), + index % 2 === 0 ? 'active' : null, + ) + } + doc + .getElementById('interactive')! + .dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true })) + assert.equal( + current.app.snapshot().diagnostics.clicks, + result.diagnostics.clicks + 1, + ) + } + + async function after() { + const sample = current + if (!sample) { + return + } + try { + if (!sample.failed) { + assert.ok(sample.completed, 'Hydration sample was not completed') + validate() + } + } finally { + current = undefined + try { + sample.app.dispose() + // Unmount work and its scheduled effects stay outside the measure. + await turn() + await turn() + } finally { + for (const handle of sample.immediates) { + clearImmediate(handle) + } + sample.dom.window.close() + } + } + } + + return { + before, + run, + after, + snapshot, + schedulerTasks, + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts b/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts new file mode 100644 index 0000000000..643877760e --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts @@ -0,0 +1,19 @@ +import { test } from 'vitest' +import { setup } from './setup' + +test('client-hydration', async ({ bench }) => { + const scenario = setup() + + await bench( + 'hydrate restored route state and mixed Links (react)', + { beforeEach: scenario.before, afterEach: scenario.after }, + async () => { + await scenario.run() + }, + ).run({ + time: 5000, + warmupTime: 1000, + warmupIterations: 20, + throws: true, + }) +}) diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx new file mode 100644 index 0000000000..e9797f71fa --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx @@ -0,0 +1,216 @@ +import { useEffect } from 'react' +import { + HeadContent, + Link, + Outlet, + Scripts, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + useHydrated, +} from '@tanstack/react-router' +import { + clientUrl, + hashLinkCount, + ordinaryLinkCount, + serverUrl, +} from '../fixture' +import type { ReactNode } from 'react' +import type { Diagnostics } from '../fixture' + +export function createFixtureRouter( + server: boolean, + diagnostics: Diagnostics, + onHydrated: () => void = () => {}, +) { + function beforeLoad() { + diagnostics.beforeLoads++ + if (!server) { + throw new Error('Hydration reran beforeLoad instead of restoring context') + } + } + + function loader() { + diagnostics.loaders++ + if (!server) { + throw new Error('Hydration reran a loader instead of restoring data') + } + } + + const root = createRootRoute({ + beforeLoad: () => { + beforeLoad() + return { viewer: { id: 'viewer-3', name: 'Ada', role: 'editor' } } + }, + head: () => ({ + meta: [{ charSet: 'utf-8' }, { title: 'Hydration benchmark' }], + }), + shellComponent: Document, + }) + const team = createRoute({ + getParentRoute: () => root, + path: '/teams/$teamId', + beforeLoad: ({ context, params }) => { + beforeLoad() + return { team: { id: params.teamId, member: context.viewer.id } } + }, + loader: ({ context }) => { + loader() + return { + title: `Team ${context.team.id}`, + categories: ['open', 'closed'], + } + }, + component: Team, + }) + const items = createRoute({ + getParentRoute: () => team, + path: 'items/$itemId', + validateSearch: (search: Record) => ({ + view: search.view === 'details' ? 'details' : 'summary', + }), + beforeLoad: ({ context }) => { + beforeLoad() + return { permissions: { edit: context.viewer.role === 'editor' } } + }, + loader: ({ context, params }) => { + loader() + return { + selected: params.itemId, + owner: context.team.member, + rows: Array.from({ length: ordinaryLinkCount }, (_, index) => ({ + id: `item-${index}`, + label: `Item ${index}`, + details: { score: index * 3, open: index % 2 === 0 }, + })), + } + }, + component: Items, + }) + + function Document({ children }: { children: ReactNode }) { + return ( + + + + + + {children} + + + + ) + } + + function Team() { + const context = team.useRouteContext() + const data = team.useLoaderData() + return ( +
+

{data.title}

+

{context.viewer.name}

+ +
+ ) + } + + function Items() { + const data = items.useLoaderData() + const context = items.useRouteContext() + useEffect(() => { + diagnostics.mounted = true + }, []) + return ( + <> +

+ {context.permissions.edit ? 'Editable' : 'Read only'} +

+ + + + {data.rows.map((row) => ( + + + + + + ))} + +
{row.id}{row.details.score} + + {diagnostics.countRenders + ? () => { + diagnostics.ordinaryRenders++ + return row.label + } + : row.label} + +
+ +
Details
+ + + ) + } + + function HydrationComplete() { + const hydrated = useHydrated() + useEffect(() => { + if (hydrated) { + onHydrated() + } + }, [hydrated]) + return null + } + + return createRouter({ + routeTree: root.addChildren([team.addChildren([items])]), + history: createMemoryHistory({ + initialEntries: [server ? serverUrl : clientUrl], + }), + isServer: server, + scrollRestoration: false, + defaultHashScrollIntoView: false, + defaultPreload: false, + }) +} + +declare module '@tanstack/react-router' { + interface Register { + router: ReturnType + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx new file mode 100644 index 0000000000..42c5a5104e --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx @@ -0,0 +1,83 @@ +import { startTransition } from 'react' +import { hydrateRoot } from 'react-dom/client' +import { RouterProvider } from '@tanstack/react-router' +import { hydrate } from '@tanstack/react-router/ssr/client' +import { isServer } from '@tanstack/router-core/isServer' +import { createDiagnostics, hashLinkCount } from '../fixture' +import { createFixtureRouter } from './app' + +export const serverEnvironment = isServer +let router: ReturnType | undefined +let root: ReturnType | undefined +let diagnostics = createDiagnostics() +const errors: Array = [] + +export async function start(countRenders = false) { + if (router) { + throw new Error('A hydration sample must use a fresh client realm') + } + if (!window.$_TSR?.router) { + throw new Error('Missing SSR hydration payload') + } + diagnostics = createDiagnostics(countRenders) + let resolveHydrated!: () => void + let rejectHydrated!: (error: unknown) => void + const hydrated = new Promise((resolve, reject) => { + resolveHydrated = resolve + rejectHydrated = reject + }) + router = createFixtureRouter(false, diagnostics, resolveHydrated) + // This is the same restoration path used by Start, without a module-cached + // RouterClient/StartClient promise or a live server in the worker. + await hydrate(router) + window.$_TSR.h() + startTransition(() => { + root = hydrateRoot(document, , { + onRecoverableError: (error) => { + errors.push(String(error)) + rejectHydrated(error) + }, + onUncaughtError: (error) => { + errors.push(String(error)) + rejectHydrated(error) + }, + }) + }) + await hydrated +} + +export function ready() { + if (!diagnostics.mounted) { + return false + } + // Matching hash Links only become active in the follow-up hydration commit. + // Ending at the first mount effect would miss the work this scenario targets. + for (let index = 0; index < hashLinkCount; index += 2) { + if ( + document.getElementById(`hash-${index}`)?.getAttribute('data-status') !== + 'active' + ) { + return false + } + } + return true +} + +export function snapshot() { + const matches = router?.stores.matches.get() + return { + diagnostics: { ...diagnostics }, + errors: [...errors], + location: router?.stores.location.get().href, + matches: matches?.map((match) => ({ + status: match.status, + context: match.context, + loaderData: match.loaderData, + })), + } +} + +export function dispose() { + root?.unmount() + router?.history.destroy() +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx new file mode 100644 index 0000000000..713b0a77f2 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx @@ -0,0 +1,29 @@ +import { + createRequestHandler, + defaultStreamHandler, +} from '@tanstack/react-router/ssr/server' +import { isServer } from '@tanstack/router-core/isServer' +import { createDiagnostics, serverUrl } from '../fixture' +import { createFixtureRouter } from './app' + +export async function renderFixture() { + if ((isServer as boolean | undefined) !== true) { + throw new Error('Fixture generation requires the production server build') + } + const diagnostics = createDiagnostics() + const response = await createRequestHandler({ + createRouter: () => createFixtureRouter(true, diagnostics), + request: new Request(`http://localhost${serverUrl}`), + })(defaultStreamHandler) + const html = await response.text() + if ( + response.status !== 200 || + diagnostics.beforeLoads !== 3 || + diagnostics.loaders !== 2 + ) { + throw new Error( + 'SSR fixture did not execute its beforeLoad and loader functions', + ) + } + return html +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json new file mode 100644 index 0000000000..23dd08de8b --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "react", + "allowImportingTsExtensions": true, + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": ["./*.ts", "./src/**/*"] +} diff --git a/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts b/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts new file mode 100644 index 0000000000..62ab87115b --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts @@ -0,0 +1,36 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' +import react from '@vitejs/plugin-react' +import codspeedPlugin from '@codspeed/vitest-plugin' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + define: { 'process.env.NODE_ENV': JSON.stringify('production') }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + react(), + ], + resolve: { conditions: ['browser', 'production'] }, + build: { + outDir: './dist/client', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/client.tsx', + name: 'HydrationBenchmark', + formats: ['iife'], + fileName: () => 'client.js', + }, + }, + test: { + execArgv: cpuSimulationExecArgv(), + name: '@benchmarks/client-nav hydration (react)', + watch: false, + environment: 'node', + isolate: true, + include: ['hydration.test.ts'], + benchmark: { include: ['speed.bench.ts'] }, + }, +}) diff --git a/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts b/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts new file mode 100644 index 0000000000..fbf6a149b9 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts @@ -0,0 +1,26 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + define: { 'process.env.NODE_ENV': JSON.stringify('production') }, + plugins: [react()], + resolve: { conditions: ['node', 'production'] }, + ssr: { noExternal: true }, + build: { + ssr: true, + outDir: './dist/server', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/server.tsx', + formats: ['es'], + fileName: () => 'server.js', + }, + rolldownOptions: { + platform: 'node', + external: [/^node:/, /^react(?:\/|$)/, /^react-dom(?:\/|$)/], + }, + }, +}) diff --git a/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts b/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts new file mode 100644 index 0000000000..4c86d0e2f4 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts @@ -0,0 +1,35 @@ +export { + clientUrl, + hashLinkCount, + ordinaryLinkCount, + serverUrl, +} from '../react/fixture' +export type { FixtureArtifact } from '../react/fixture' + +export interface Diagnostics { + beforeLoads: number + loaders: number + mounted: boolean + rendered: number + clicks: number + countUpdates: boolean + ordinaryEvaluations: number + hashEvaluations: number + initialHashStates: Array + hashStates: Array +} + +export function createDiagnostics(countUpdates = false): Diagnostics { + return { + beforeLoads: 0, + loaders: 0, + mounted: false, + rendered: 0, + clicks: 0, + countUpdates, + ordinaryEvaluations: 0, + hashEvaluations: 0, + initialHashStates: [], + hashStates: [], + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs b/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs new file mode 100644 index 0000000000..63647e1be7 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs @@ -0,0 +1,30 @@ +import assert from 'node:assert/strict' +import { writeFile } from 'node:fs/promises' +import { JSDOM } from 'jsdom' + +if (process.env.NODE_ENV !== 'production') { + throw new Error('Generate the hydration fixture in production mode') +} +const { renderFixture } = await import('./dist/server/server.js') +const html = await renderFixture() +const dom = new JSDOM(html) +try { + const doc = dom.window.document + const scriptElements = [...doc.querySelectorAll('script')] + assert.ok(scriptElements.length > 0) + assert.ok(scriptElements.every((script) => !script.src)) + const scripts = scriptElements.map((script) => script.textContent) + assert.ok(scripts.some((script) => script.includes('$_TSR'))) + assert.ok(scripts.some((script) => script.includes('_$HY'))) + assert.ok(doc.documentElement.hasAttribute('data-hk')) + assert.ok(doc.getElementById('hydration-content')?.hasAttribute('data-hk')) + assert.ok( + [...doc.querySelectorAll('a')].every((a) => a.hasAttribute('data-hk')), + ) + await writeFile( + new URL('./dist/fixture.json', import.meta.url), + JSON.stringify({ html, scripts }), + ) +} finally { + dom.window.close() +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts b/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts new file mode 100644 index 0000000000..4e5f3208ca --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts @@ -0,0 +1,81 @@ +import { expect, test } from 'vitest' +import { hashLinkCount, ordinaryLinkCount } from './fixture' +import { setup } from './setup' + +const turn = () => new Promise((resolve) => setImmediate(resolve)) + +test('restores fresh DOMs and route state and completes hash-link reactivity', async () => { + const scenario = setup({ countUpdates: true }) + let previous: ReturnType | undefined + for (let iteration = 0; iteration < 3; iteration++) { + await scenario.before() + try { + const initial = scenario.snapshot() + expect(initial.matches).toBeUndefined() + expect(initial.diagnostics.mounted).toBe(false) + expect(initial.diagnostics.rendered).toBe(0) + expect(initial.diagnostics.clicks).toBe(0) + expect(initial.diagnostics.ordinaryEvaluations).toBe(0) + expect(initial.diagnostics.hashEvaluations).toBe(0) + expect(initial.diagnostics.initialHashStates).toEqual([]) + await scenario.run() + const completed = scenario.snapshot() + expect(completed.diagnostics.ordinaryEvaluations).toBeGreaterThanOrEqual( + ordinaryLinkCount, + ) + expect(completed.diagnostics.initialHashStates).toEqual( + Array.from({ length: hashLinkCount }, () => false), + ) + expect(completed.diagnostics.hashStates).toEqual( + Array.from({ length: hashLinkCount }, (_, index) => index % 2 === 0), + ) + expect(completed.diagnostics.hashEvaluations).toBeGreaterThanOrEqual( + hashLinkCount + hashLinkCount / 2, + ) + expect(completed.hydrating).toBe(false) + for (let index = 0; index < 4; index++) { + await turn() + } + expect(scenario.snapshot()).toEqual(completed) + if (previous) { + expect(completed).toEqual(previous) + } + previous = completed + await expect(scenario.run()).rejects.toThrow('newly prepared sample') + } finally { + // Untimed assertions include DOM identity, all restored data/context, + // native event handling, and the absence of hydration diagnostics. + await scenario.after() + } + } +}) + +test('prepares every sample without counting diagnostics', async () => { + const scenario = setup() + for (let iteration = 0; iteration < 2; iteration++) { + await scenario.before() + try { + expect(scenario.snapshot().diagnostics.mounted).toBe(false) + expect(scenario.snapshot().diagnostics.clicks).toBe(0) + await scenario.run() + expect(scenario.snapshot().diagnostics.hashEvaluations).toBe(0) + } finally { + await scenario.after() + } + } +}) + +test('rejects an empty measurement and still releases its sample', async () => { + const scenario = setup() + await scenario.before() + await expect(scenario.after()).rejects.toThrow( + 'Hydration sample was not completed', + ) + await scenario.before() + try { + await expect(scenario.before()).rejects.toThrow('was not disposed') + await scenario.run() + } finally { + await scenario.after() + } +}) diff --git a/benchmarks/client-nav/scenarios/hydration/solid/project.json b/benchmarks/client-nav/scenarios/hydration/solid/project.json new file mode 100644 index 0000000000..1fa162771b --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/project.json @@ -0,0 +1,40 @@ +{ + "name": "@benchmarks/client-nav-hydration-solid", + "projectType": "application", + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { "projects": ["@tanstack/solid-router"], "target": "build" } + ], + "options": { + "command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts" + } + }, + "test:unit": { + "executor": "nx:run-commands", + "dependsOn": ["build:client"], + "options": { + "command": "vitest run --config ./scenarios/hydration/solid/vite.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:perf": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production vitest bench --mode benchmark --run --config ./scenarios/hydration/solid/vite.config.ts", + "cwd": "benchmarks/client-nav" + } + }, + "test:types:client": { + "executor": "nx:run-commands", + "dependsOn": [ + { "projects": ["@tanstack/solid-router"], "target": "build" } + ], + "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" } + } + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/setup.ts b/benchmarks/client-nav/scenarios/hydration/solid/setup.ts new file mode 100644 index 0000000000..ebdbc8e9b2 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/setup.ts @@ -0,0 +1,326 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { fileURLToPath } from 'node:url' +import { Script } from 'node:vm' +import { JSDOM, VirtualConsole } from 'jsdom' +import { clientUrl, hashLinkCount, ordinaryLinkCount } from './fixture' +import type { FixtureArtifact } from './fixture' +import type * as Client from './src/client' + +type ClientApp = typeof Client +const turn = () => new Promise((resolve) => setImmediate(resolve)) +const maxSettleTurns = 100 + +export function setup({ countUpdates = false } = {}) { + // Compile once, outside measurement; evaluate the entire production bundle + // anew in every window, including Solid's module-level hydration state. + const artifact: FixtureArtifact = JSON.parse( + readFileSync(new URL('./dist/fixture.json', import.meta.url), 'utf8'), + ) + const clientPath = new URL('./dist/client/client.js', import.meta.url) + const clientScript = new Script(readFileSync(clientPath, 'utf8'), { + filename: fileURLToPath(clientPath), + }) + const bootstrapScripts = artifact.scripts.map( + (source, index) => + new Script(source, { + filename: `solid-hydration-bootstrap-${index}.js`, + }), + ) + let current: Awaited> | undefined + + async function prepare() { + const errors: Array = [] + const virtualConsole = new VirtualConsole() + virtualConsole.on('jsdomError', (error) => errors.push(String(error))) + for (const event of ['error', 'warn'] as const) { + virtualConsole.on(event, (...args) => + errors.push(args.map(String).join(' ')), + ) + } + const dom = new JSDOM(artifact.html, { + url: `http://localhost${clientUrl}`, + runScripts: 'outside-only', + virtualConsole, + }) + const immediates = new Set() + try { + Object.assign(dom.window, { + TextEncoder, + TextDecoder, + ReadableStream, + WritableStream, + TransformStream, + setImmediate( + callback: (...args: Array) => void, + ...args: Array + ) { + const handle = setImmediate(() => { + immediates.delete(handle) + callback(...args) + }) + immediates.add(handle) + return handle + }, + clearImmediate(handle: NodeJS.Immediate) { + immediates.delete(handle) + clearImmediate(handle) + }, + fetch() { + throw new Error('Hydration attempted a network request') + }, + scrollTo() {}, + }) + dom.window.addEventListener('unhandledrejection', (event) => { + errors.push(String(event.reason)) + }) + dom.window.HTMLElement.prototype.scrollIntoView = () => {} + const context = dom.getInternalVMContext() + clientScript.runInContext(context) + const app = (dom.window as unknown as { HydrationBenchmark: ClientApp }) + .HydrationBenchmark + assert.equal(app.serverEnvironment, false) + assert.equal(app.solidServerEnvironment, false) + const doc = dom.window.document + const anchors = Array.from(doc.querySelectorAll('a')) + const scriptElements = Array.from(doc.querySelectorAll('script')) + assert.equal(scriptElements.length, bootstrapScripts.length) + const executingScript = { current: null as HTMLScriptElement | null } + Object.defineProperty(doc, 'currentScript', { + configurable: true, + get: () => executingScript.current, + }) + assert.equal(anchors.length, ordinaryLinkCount + hashLinkCount) + const content = doc.getElementById('hydration-content') + assert.ok(content) + assert.ok(content.hasAttribute('data-hk')) + assert.ok(anchors.every((anchor) => anchor.hasAttribute('data-hk'))) + for (let index = 0; index < hashLinkCount; index++) { + assert.equal( + doc.getElementById(`hash-${index}`)?.getAttribute('data-status'), + null, + ) + } + // Production Solid can fall back to templates for missing hydration keys. + // Retain every workload element, not only the parent and the anchors. + const elements = Array.from(content.querySelectorAll('*')) + const documentElement = doc.documentElement + await turn() + assert.equal(doc.readyState, 'complete') + assert.equal(app.ready(), false) + assert.deepEqual(errors, []) + return { + dom, + context, + app, + anchors, + content, + elements, + documentElement, + scriptElements, + executingScript, + immediates, + errors, + started: false, + completed: false, + failed: false, + } + } catch (error) { + for (const handle of immediates) { + clearImmediate(handle) + } + dom.window.close() + throw error + } + } + + async function before() { + if (current) { + throw new Error('Previous hydration sample was not disposed') + } + current = await prepare() + } + + async function run() { + const sample = current + if (!sample || sample.started) { + throw new Error('Hydration requires a newly prepared sample') + } + sample.started = true + try { + // Parsing/evaluation are done. Execute both native Solid bootstrap and + // Router payload, then create/restore the router and hydrate the DOM. + for (let index = 0; index < bootstrapScripts.length; index++) { + // Router scripts remove document.currentScript. Keep the original + // script nodes and order, including Solid's bootstrap and markers. + sample.executingScript.current = sample.scriptElements[index]! + try { + bootstrapScripts[index]!.runInContext(sample.context) + } finally { + sample.executingScript.current = null + } + } + await sample.app.start(countUpdates) + let idleTurns = 0 + for (let index = 0; index < maxSettleTurns; index++) { + await turn() + if (sample.errors.length) { + throw new Error(sample.errors.join('\n')) + } + if (sample.app.ready() && sample.immediates.size === 0) { + if (++idleTurns === 2) { + sample.completed = true + return + } + } else { + idleTurns = 0 + } + } + throw new Error( + `Hydration did not settle: ${JSON.stringify(sample.app.snapshot())}`, + ) + } catch (error) { + sample.failed = true + throw error + } + } + + function snapshot() { + if (!current) { + throw new Error('No hydration sample') + } + // Normalize realm prototypes only for untimed assertions. + return JSON.parse(JSON.stringify(current.app.snapshot())) as ReturnType< + ClientApp['snapshot'] + > + } + + function validate() { + assert.ok(current?.started) + const { dom, anchors, content, elements, documentElement, errors } = current + const doc = dom.window.document + const result = snapshot() + assert.deepEqual(errors, []) + assert.equal(result.diagnostics.beforeLoads, 0) + assert.equal(result.diagnostics.loaders, 0) + assert.equal(result.diagnostics.mounted, true) + assert.ok(result.diagnostics.rendered > 0) + assert.equal(result.hydrating, false) + assert.equal(result.location, clientUrl) + assert.equal(result.resolvedLocation, clientUrl) + assert.equal(result.matches?.length, 3) + for (const match of result.matches) { + assert.equal(match.status, 'success') + assert.deepEqual(match.context.viewer, { + id: 'viewer-3', + name: 'Ada', + role: 'editor', + }) + } + const teamContext = { id: 'team-7', member: 'viewer-3' } + assert.deepEqual(result.matches[1]!.context.team, teamContext) + assert.deepEqual(result.matches[2]!.context.team, teamContext) + assert.deepEqual(result.matches[2]!.context.permissions, { edit: true }) + assert.deepEqual(result.matches[1]!.loaderData, { + title: 'Team team-7', + categories: ['open', 'closed'], + }) + const data = result.matches[2]!.loaderData as { + owner: string + selected: string + rows: Array<{ + id: string + label: string + details: { score: number; open: boolean } + }> + } + assert.equal(data.owner, 'viewer-3') + assert.equal(data.selected, 'item-42') + assert.equal(data.rows.length, ordinaryLinkCount) + assert.equal(doc.documentElement, documentElement) + assert.equal(doc.getElementById('hydration-content'), content) + const hydratedElements = Array.from(content.querySelectorAll('*')) + assert.equal(hydratedElements.length, elements.length) + elements.forEach((element, index) => { + assert.equal(hydratedElements[index], element) + }) + assert.equal(doc.querySelectorAll('a').length, anchors.length) + assert.equal(doc.title, 'Hydration benchmark') + assert.equal(content.querySelector('h1')?.textContent, 'Team team-7') + assert.equal(doc.getElementById('viewer')?.textContent, 'Ada') + assert.equal(doc.getElementById('permission')?.textContent, 'Editable') + for (const anchor of anchors) { + assert.equal(doc.getElementById(anchor.id), anchor) + } + for (let index = 0; index < ordinaryLinkCount; index++) { + const anchor = doc.getElementById(`ordinary-item-${index}`)! + assert.equal( + anchor.getAttribute('href'), + `/teams/team-7/items/item-${index}?view=summary`, + ) + assert.equal(anchor.textContent, `Item ${index}`) + assert.equal( + anchor.getAttribute('data-status'), + index === 42 ? 'active' : null, + ) + assert.deepEqual(data.rows[index], { + id: `item-${index}`, + label: `Item ${index}`, + details: { score: index * 3, open: index % 2 === 0 }, + }) + } + for (let index = 0; index < hashLinkCount; index++) { + const anchor = doc.getElementById(`hash-${index}`)! + assert.equal( + anchor.getAttribute('data-status'), + index % 2 === 0 ? 'active' : null, + ) + assert.equal( + anchor.getAttribute('href'), + `/teams/team-7/items/item-42?view=summary#${index % 2 === 0 ? 'details' : 'other'}`, + ) + assert.equal(anchor.textContent, `Section ${index}`) + } + assert.equal(result.diagnostics.clicks, 0) + doc + .getElementById('interactive')! + .dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true })) + assert.equal(current.app.snapshot().diagnostics.clicks, 1) + assert.deepEqual(errors, []) + } + + async function after() { + const sample = current + if (!sample) { + return + } + try { + if (!sample.failed) { + assert.ok(sample.completed, 'Hydration sample was not completed') + validate() + } + } finally { + current = undefined + try { + sample.app.dispose() + await turn() + await turn() + if (!sample.failed) { + assert.deepEqual(sample.errors, []) + } + } finally { + for (const handle of sample.immediates) { + clearImmediate(handle) + } + sample.dom.window.close() + } + } + } + + return { + before, + run, + after, + snapshot, + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts new file mode 100644 index 0000000000..b386cb8215 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts @@ -0,0 +1,19 @@ +import { test } from 'vitest' +import { setup } from './setup' + +test('client-hydration', async ({ bench }) => { + const scenario = setup() + + await bench( + 'hydrate restored route state and mixed Links (solid)', + { beforeEach: scenario.before, afterEach: scenario.after }, + async () => { + await scenario.run() + }, + ).run({ + time: 5000, + warmupTime: 1000, + warmupIterations: 20, + throws: true, + }) +}) diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx new file mode 100644 index 0000000000..cb772d6b5b --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx @@ -0,0 +1,213 @@ +import { For, onMount } from 'solid-js' +import { HydrationScript } from 'solid-js/web' +import { + HeadContent, + Link, + Outlet, + Scripts, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '@tanstack/solid-router' +import { + clientUrl, + hashLinkCount, + ordinaryLinkCount, + serverUrl, +} from '../fixture' +import type { JSX } from 'solid-js' +import type { Diagnostics } from '../fixture' + +export function createFixtureRouter(server: boolean, diagnostics: Diagnostics) { + function beforeLoad() { + diagnostics.beforeLoads++ + if (!server) { + throw new Error('Hydration reran beforeLoad instead of restoring context') + } + } + + function loader() { + diagnostics.loaders++ + if (!server) { + throw new Error('Hydration reran a loader instead of restoring data') + } + } + + const root = createRootRoute({ + beforeLoad: () => { + beforeLoad() + return { viewer: { id: 'viewer-3', name: 'Ada', role: 'editor' } } + }, + head: () => ({ + meta: [{ charset: 'utf-8' }, { title: 'Hydration benchmark' }], + }), + shellComponent: Document, + }) + const team = createRoute({ + getParentRoute: () => root, + path: '/teams/$teamId', + beforeLoad: ({ context, params }) => { + beforeLoad() + return { team: { id: params.teamId, member: context.viewer.id } } + }, + loader: ({ context }) => { + loader() + return { + title: `Team ${context.team.id}`, + categories: ['open', 'closed'], + } + }, + component: Team, + }) + const items = createRoute({ + getParentRoute: () => team, + path: 'items/$itemId', + validateSearch: (search: Record) => ({ + view: search.view === 'details' ? 'details' : 'summary', + }), + beforeLoad: ({ context }) => { + beforeLoad() + return { permissions: { edit: context.viewer.role === 'editor' } } + }, + loader: ({ context, params }) => { + loader() + return { + selected: params.itemId, + owner: context.team.member, + rows: Array.from({ length: ordinaryLinkCount }, (_, index) => ({ + id: `item-${index}`, + label: `Item ${index}`, + details: { score: index * 3, open: index % 2 === 0 }, + })), + } + }, + component: Items, + }) + + function Document(props: { children: JSX.Element }) { + return ( + + + + + + + {props.children} + + + + ) + } + + function Team() { + const context = team.useRouteContext() + const data = team.useLoaderData() + return ( +
+

{data().title}

+

{context().viewer.name}

+ +
+ ) + } + + function Items() { + const data = items.useLoaderData() + const context = items.useRouteContext() + onMount(() => { + diagnostics.mounted = true + }) + return ( + <> +

+ {context().permissions.edit ? 'Editable' : 'Read only'} +

+ + + + + {(row) => ( + + + + + + )} + + +
{row.id}{row.details.score} + + {diagnostics.countUpdates + ? (state) => { + // Read the getter so this unit-only probe observes + // Link reactivity, rather than component execution. + void state.isActive + diagnostics.ordinaryEvaluations++ + return row.label + } + : row.label} + +
+ +
Details
+ + ) + } + + return createRouter({ + routeTree: root.addChildren([team.addChildren([items])]), + history: createMemoryHistory({ + initialEntries: [server ? serverUrl : clientUrl], + }), + isServer: server, + scrollRestoration: false, + defaultHashScrollIntoView: false, + defaultPreload: false, + }) +} + +declare module '@tanstack/solid-router' { + interface Register { + router: ReturnType + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx new file mode 100644 index 0000000000..ef0f5268d6 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx @@ -0,0 +1,91 @@ +import { sharedConfig } from 'solid-js' +import { hydrate as hydrateDOM, isServer as solidIsServer } from 'solid-js/web' +import { RouterProvider } from '@tanstack/solid-router' +import { hydrate } from '@tanstack/router-core/ssr/client' +import { isServer } from '@tanstack/router-core/isServer' +import { createDiagnostics, hashLinkCount } from '../fixture' +import { createFixtureRouter } from './app' + +export const serverEnvironment = isServer +export const solidServerEnvironment = solidIsServer +let router: ReturnType | undefined +let disposeRoot: (() => void) | undefined +let unsubscribe: (() => void) | undefined +let diagnostics = createDiagnostics() + +type HydrationWindow = Window & { + _$HY?: { done?: boolean; events?: Array; r: object } +} + +export async function start(countUpdates = false) { + if (router) { + throw new Error('A hydration sample must use a fresh client realm') + } + if (!window.$_TSR?.router) { + throw new Error('Missing SSR hydration payload') + } + const bootstrap = (window as HydrationWindow)._$HY + if (!bootstrap || bootstrap.done || sharedConfig.context) { + throw new Error('Missing or already consumed Solid hydration bootstrap') + } + diagnostics = createDiagnostics(countUpdates) + router = createFixtureRouter(false, diagnostics) + unsubscribe = router.subscribe('onRendered', () => { + diagnostics.rendered++ + }) + // Solid's RouterClient uses this core restoration API. Await it directly so + // the shell has the same component/key hierarchy as the server provider. + await hydrate(router) + window.$_TSR.h() + disposeRoot = hydrateDOM(() => , document) +} + +export function ready() { + if ( + !diagnostics.mounted || + !diagnostics.rendered || + sharedConfig.context || + router?.stores.status.get() === 'pending' + ) { + return false + } + // Each Link's onMount updates its hydration signal. Solid updates attributes + // through fine-grained effects, without rerendering the route components. + for (let index = 0; index < hashLinkCount; index++) { + const anchor = document.getElementById(`hash-${index}`) + if ( + !anchor || + anchor.getAttribute('data-status') !== (index % 2 === 0 ? 'active' : null) + ) { + return false + } + } + return true +} + +export function snapshot() { + return { + diagnostics: { + ...diagnostics, + initialHashStates: [...diagnostics.initialHashStates], + hashStates: [...diagnostics.hashStates], + }, + hydrating: !!sharedConfig.context, + location: router?.stores.location.get().href, + resolvedLocation: router?.stores.resolvedLocation.get()?.href, + matches: router?.stores.matches.get().map((match) => ({ + status: match.status, + context: match.context, + loaderData: match.loaderData, + })), + } +} + +export function dispose() { + try { + disposeRoot?.() + } finally { + unsubscribe?.() + router?.history.destroy() + } +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx new file mode 100644 index 0000000000..6052c48eac --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx @@ -0,0 +1,40 @@ +import { RouterProvider } from '@tanstack/solid-router' +import { + createRequestHandler, + renderRouterToStream, +} from '@tanstack/solid-router/ssr/server' +import { isServer } from '@tanstack/router-core/isServer' +import { isServer as solidIsServer } from 'solid-js/web' +import { createDiagnostics, serverUrl } from '../fixture' +import { createFixtureRouter } from './app' + +export async function renderFixture() { + if ((isServer as boolean | undefined) !== true || !solidIsServer) { + throw new Error('Fixture generation requires the production server build') + } + const diagnostics = createDiagnostics() + const response = await createRequestHandler({ + createRouter: () => createFixtureRouter(true, diagnostics), + request: new Request(`http://localhost${serverUrl}`), + })(({ request, router, responseHeaders }) => + renderRouterToStream({ + request, + router, + responseHeaders, + // The route shell owns the document, as in Solid Start. Using the same + // provider tree on both sides preserves Solid's hydration key sequence. + children: () => , + }), + ) + const html = await response.text() + if ( + response.status !== 200 || + diagnostics.beforeLoads !== 3 || + diagnostics.loaders !== 2 + ) { + throw new Error( + 'SSR fixture did not execute its beforeLoad and loader functions', + ) + } + return html +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json new file mode 100644 index 0000000000..daf27ddf12 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "jsx": "preserve", + "jsxImportSource": "solid-js", + "allowImportingTsExtensions": true, + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": ["./*.ts", "./src/**/*"] +} diff --git a/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts b/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts new file mode 100644 index 0000000000..16e5ff95aa --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts @@ -0,0 +1,38 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' +import solid from 'vite-plugin-solid' +import codspeedPlugin from '@codspeed/vitest-plugin' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + define: { 'process.env.NODE_ENV': JSON.stringify('production') }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + // The Node worker evaluates the prebuilt bundle and needs no JSX transform + // or browser test setup injected by vite-plugin-solid. + !process.env.VITEST && solid({ ssr: true, hot: false, dev: false }), + ], + resolve: { conditions: ['solid', 'browser', 'production'] }, + build: { + outDir: './dist/client', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/client.tsx', + name: 'HydrationBenchmark', + formats: ['iife'], + fileName: () => 'client.js', + }, + }, + test: { + execArgv: cpuSimulationExecArgv(), + name: '@benchmarks/client-nav hydration (solid)', + watch: false, + environment: 'node', + isolate: true, + include: ['hydration.test.ts'], + benchmark: { include: ['speed.bench.ts'] }, + }, +}) diff --git a/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts b/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts new file mode 100644 index 0000000000..9787cbb4e2 --- /dev/null +++ b/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts @@ -0,0 +1,29 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vite' +import solid from 'vite-plugin-solid' + +export default defineConfig({ + root: fileURLToPath(new URL('.', import.meta.url)), + define: { 'process.env.NODE_ENV': JSON.stringify('production') }, + plugins: [solid({ ssr: true, hot: false, dev: false })], + resolve: { conditions: ['solid', 'node', 'production'] }, + ssr: { + noExternal: true, + resolve: { conditions: ['solid', 'node', 'production'] }, + }, + build: { + ssr: true, + outDir: './dist/server', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/server.tsx', + formats: ['es'], + fileName: () => 'server.js', + }, + rolldownOptions: { + platform: 'node', + external: [/^node:/], + }, + }, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/react/project.json b/benchmarks/client-nav/scenarios/link-churn/react/project.json new file mode 100644 index 0000000000..1606b2c456 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/project.json @@ -0,0 +1,40 @@ +{ + "name": "@benchmarks/client-nav-link-churn-react", + "projectType": "application", + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { + "projects": ["@tanstack/react-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts" + } + }, + "test:types:client": { + "executor": "nx:run-commands", + "dependsOn": [ + { + "projects": ["@tanstack/react-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" + } + }, + "test:flame": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/react/speed.flame.ts", + "cwd": "benchmarks/client-nav" + } + } + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/setup.ts b/benchmarks/client-nav/scenarios/link-churn/react/setup.ts new file mode 100644 index 0000000000..59221603da --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/setup.ts @@ -0,0 +1,18 @@ +import { createScenarioSetup } from '../../harness' +import { assertStepResult, initialUrl, scenarioSteps } from '../shared' +import type * as App from './src/main' + +const appModulePath = './dist/app.js' +const { mountTestApp } = (await import( + /* @vite-ignore */ appModulePath +)) as typeof App + +export function setup() { + return createScenarioSetup({ + frameworkLabel: 'React', + mount: mountTestApp, + steps: scenarioSteps, + assertAfterStep: assertStepResult, + initialUrl, + }) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts new file mode 100644 index 0000000000..ca0b370528 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts @@ -0,0 +1,19 @@ +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' +import { benchOptions, ticksPerIteration } from '../shared' +import { setup } from './setup' + +test('client-link-churn', async ({ bench }) => { + const scenario = setup() + + await bench( + 'client-link-churn navigation loop (react)', + benchLifecycle(scenario), + async () => { + for (let i = 0; i < ticksPerIteration; i++) { + await scenario.tick() + } + await scenario.finishBatch() + }, + ).run(benchOptions) +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts new file mode 100644 index 0000000000..f4a0b4e6ff --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts @@ -0,0 +1,18 @@ +import { window } from '../../../jsdom.ts' +import { setup } from './setup.ts' + +const DURATION_MS = 10_000 + +const test = setup() + +try { + await test.before() + + const startedAt = performance.now() + while (performance.now() - startedAt < DURATION_MS) { + await test.tick() + } +} finally { + test.after() + window.close() +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx new file mode 100644 index 0000000000..5febd6f795 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx @@ -0,0 +1,37 @@ +import type { RouterHistory } from '@tanstack/history' +import { RouterProvider, createRouter } from '@tanstack/react-router' +import { createRoot } from 'react-dom/client' +import { routeTree } from './routeTree.gen' + +export function createTestRouter(history: RouterHistory) { + return createRouter({ + routeTree, + history, + scrollRestoration: true, + // Key the scroll-restoration cache by pathname instead of the default + // random per-entry location key: with push navigations the default mints + // a fresh key per navigation and the module-level cache grows one entry + // per push for the whole run, which is non-stationary. + getScrollRestorationKey: (location) => location.pathname, + }) +} + +declare module '@tanstack/react-router' { + interface Register { + router: ReturnType + } +} + +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) + + const reactRoot = createRoot(container) + reactRoot.render() + + return { + router, + unmount() { + reactRoot.unmount() + }, + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts new file mode 100644 index 0000000000..4535430b61 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as HubRouteImport } from './routes/hub' +import { Route as OtherRouteImport } from './routes/other' +import { Route as HubListRouteImport } from './routes/hub.list' +import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id' + +const HubRoute = HubRouteImport.update({ + id: '/hub', + path: '/hub', + getParentRoute: () => rootRouteImport, +} as any) +const OtherRoute = OtherRouteImport.update({ + id: '/other', + path: '/other', + getParentRoute: () => rootRouteImport, +} as any) +const HubListRoute = HubListRouteImport.update({ + id: '/list', + path: '/list', + getParentRoute: () => HubRoute, +} as any) +const HubDetailIdRoute = HubDetailIdRouteImport.update({ + id: '/detail/$id', + path: '/detail/$id', + getParentRoute: () => HubRoute, +} as any) + +export interface FileRoutesByFullPath { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesByTo { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesByTo: FileRoutesByTo + to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + HubRoute: typeof HubRouteWithChildren + OtherRoute: typeof OtherRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/hub': { + id: '/hub' + path: '/hub' + fullPath: '/hub' + preLoaderRoute: typeof HubRouteImport + parentRoute: typeof rootRouteImport + } + '/other': { + id: '/other' + path: '/other' + fullPath: '/other' + preLoaderRoute: typeof OtherRouteImport + parentRoute: typeof rootRouteImport + } + '/hub/list': { + id: '/hub/list' + path: '/list' + fullPath: '/hub/list' + preLoaderRoute: typeof HubListRouteImport + parentRoute: typeof HubRoute + } + '/hub/detail/$id': { + id: '/hub/detail/$id' + path: '/detail/$id' + fullPath: '/hub/detail/$id' + preLoaderRoute: typeof HubDetailIdRouteImport + parentRoute: typeof HubRoute + } + } +} + +interface HubRouteChildren { + HubListRoute: typeof HubListRoute + HubDetailIdRoute: typeof HubDetailIdRoute +} + +const HubRouteChildren: HubRouteChildren = { + HubListRoute: HubListRoute, + HubDetailIdRoute: HubDetailIdRoute, +} + +const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren) + +const rootRouteChildren: RootRouteChildren = { + HubRoute: HubRouteWithChildren, + OtherRoute: OtherRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx new file mode 100644 index 0000000000..199cf1ff73 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx @@ -0,0 +1,39 @@ +import { Link, Outlet, createRootRoute } from '@tanstack/react-router' +import { sortedSearch } from '../../../shared' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return ( + <> + + + + ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx new file mode 100644 index 0000000000..143cb39a7a --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx @@ -0,0 +1,21 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import { detailMarker } from '../../../shared' + +export const Route = createFileRoute('/hub/detail/$id')({ + component: DetailPage, +}) + +function DetailPage() { + const params = Route.useParams() + + return ( +
+

{detailMarker(params.id)}

+ Back to list + + Next + + Elsewhere +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx new file mode 100644 index 0000000000..5aa37b20a7 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx @@ -0,0 +1,65 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import { + listItemIds, + listMarker, + listRelativeTestId, + listSortedMarker, +} from '../../../shared' + +export const Route = createFileRoute('/hub/list')({ + component: ListPage, +}) + +const ascSearch = { sort: 'asc' } as const + +// List Links depart whenever the list leaf is left. +function ListLinks() { + return ( +
    + {listItemIds.map((id) => { + const page = Number(id) + return ( +
  • + + {`Item ${id}`} + + + {`Item ${id} asc`} + + + {`Item ${id} exact`} + + ({ ...prev, page })}> + {`Page ${id}`} + + ({ ...prev, page, sort: 'asc' as const })} + data-testid={id === '1' ? listRelativeTestId : undefined} + > + {`Page ${id} asc`} + +
  • + ) + })} +
+ ) +} + +function ListPage() { + const sort = Route.useSearch({ select: (search) => search.sort }) + + return ( +
+

+ {sort === 'desc' ? listSortedMarker : listMarker} +

+ +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx new file mode 100644 index 0000000000..ac12eae2da --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx @@ -0,0 +1,64 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' +import { + hubItemIds, + hubRelativeTestId, + validateHubSearch, +} from '../../../shared' + +export const Route = createFileRoute('/hub')({ + validateSearch: validateHubSearch, + component: HubLayout, +}) + +// Layout Links stay mounted while the hub leaves change. +function HubLinks() { + return ( +
+ {hubItemIds.map((id) => { + const page = Number(id) + return ( +
+ + {`Detail ${id}`} + + + {`Detail ${id} exact`} + + + {`List page ${id}`} + + ({ ...prev, page })}> + {`List keep ${id}`} + + ({ ...prev, page })} + data-testid={id === '1' ? hubRelativeTestId : undefined} + > + {`Here page ${id}`} + +
+ ) + })} +
+ ) +} + +function HubLayout() { + return ( +
+ + +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx new file mode 100644 index 0000000000..1f146b789f --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx @@ -0,0 +1,14 @@ +import { createFileRoute } from '@tanstack/react-router' +import { otherMarker } from '../../../shared' + +export const Route = createFileRoute('/other')({ + component: OtherPage, +}) + +function OtherPage() { + return ( +
+

{otherMarker}

+
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json new file mode 100644 index 0000000000..1d59cbb450 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "react", + "allowImportingTsExtensions": true, + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": [ + "speed.bench.ts", + "speed.flame.ts", + "setup.ts", + "vite.config.ts", + "../shared.ts", + "../../harness.ts", + "../../../setup-helpers.ts", + "../../../jsdom.ts", + "../../../vitest.setup.ts", + "./src/**/*" + ] +} diff --git a/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts new file mode 100644 index 0000000000..344974ebf9 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts @@ -0,0 +1,42 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' +import react from '@vitejs/plugin-react' +import codspeedPlugin from '@codspeed/vitest-plugin' +import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' + +const rootDir = fileURLToPath(new URL('.', import.meta.url)) + +export default defineConfig({ + root: rootDir, + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + tanstackRouter({ + target: 'react', + routesDirectory: `${rootDir}src/routes`, + generatedRouteTree: `${rootDir}src/routeTree.gen.ts`, + }), + react(), + ], + build: { + outDir: './dist', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/main.tsx', + formats: ['es'], + fileName: 'app', + }, + }, + test: { + execArgv: cpuSimulationExecArgv(), + name: '@benchmarks/client-nav link-churn (react)', + watch: false, + environment: 'jsdom', + setupFiles: ['../../../vitest.setup.ts'], + }, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/shared.ts b/benchmarks/client-nav/scenarios/link-churn/shared.ts new file mode 100644 index 0000000000..d936af35cc --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/shared.ts @@ -0,0 +1,178 @@ +/** + * Shared definition of the `link-churn` scenario: Links that leave, stay and + * arrive across navigations. A `/hub` layout renders Links that stay mounted + * while its leaves change; the `/hub/list` leaf renders Links that depart when + * leaving it and mount again when returning; `/other` sits outside the layout + * so leaving the list there unmounts layout and leaf Links together. The + * existing `links` scenario keeps all its Links in the root layout, so none of + * them ever departs or remounts. The three framework apps consume these + * constants so the workload is identical modulo the rendering layer. + */ +import type { ScenarioStep } from '../harness' + +// Layout (staying) Links: HUB_ITEM_COUNT ids x 5 variants. +export const HUB_ITEM_COUNT = 6 +// List leaf (departing) Links: LIST_ITEM_COUNT ids x 5 variants. +export const LIST_ITEM_COUNT = 20 + +const ids = (count: number) => + Array.from({ length: count }, (_, index) => String(index + 1)) + +export const hubItemIds = ids(HUB_ITEM_COUNT) +export const listItemIds = ids(LIST_ITEM_COUNT) + +export interface HubSearch { + page?: number + sort?: 'asc' | 'desc' +} + +/** Search validation of the `/hub` layout, inherited by its leaves. */ +export function validateHubSearch(search: Record): HubSearch { + const result: HubSearch = {} + if (typeof search.page === 'number') { + result.page = search.page + } + if (search.sort === 'asc' || search.sort === 'desc') { + result.sort = search.sort + } + return result +} + +export const sortedSearch = { sort: 'desc' } as const + +export function detailMarker(id: string) { + return `detail-${id}` +} + +export const listMarker = 'list' +export const listSortedMarker = 'list-desc' +export const otherMarker = 'other' + +// Sampled Links whose href depends on the current location: the first layout +// `to="."` updater Link and the first list `to="."` updater Link. +export const hubRelativeTestId = 'hub-relative-1' +export const listRelativeTestId = 'list-relative-1' + +interface StepDef { + testId: string + marker: string + /** Expected number of `.active-link` elements after the step. */ + activeCount: number + /** Expected href of the sampled layout updater Link (null: not mounted). */ + hubRelativeHref: string | null + /** Expected href of the sampled list updater Link (null: not mounted). */ + listRelativeHref: string | null +} + +// On the list, every layout `includeSearch: false` Link to the list is active. +const listActiveCount = HUB_ITEM_COUNT + +export const stepDefs: ReadonlyArray = [ + // 1. list -> detail/1: list Links depart, layout Links stay and update. + { + testId: 'go-detail-1', + marker: detailMarker('1'), + activeCount: 1, + hubRelativeHref: '/hub/detail/1?page=1', + listRelativeHref: null, + }, + // 2. detail/1 -> detail/2: same route, new param; every Link stays. + { + testId: 'go-detail-2', + marker: detailMarker('2'), + activeCount: 1, + hubRelativeHref: '/hub/detail/2?page=1', + listRelativeHref: null, + }, + // 3. detail/2 -> list: list Links mount. + { + testId: 'go-list', + marker: listMarker, + activeCount: listActiveCount, + hubRelativeHref: '/hub/list?page=1', + listRelativeHref: '/hub/list?page=1&sort=asc', + }, + // 4. list -> other: layout and list Links depart together. + { + testId: 'go-other', + marker: otherMarker, + activeCount: 0, + hubRelativeHref: null, + listRelativeHref: null, + }, + // 5. other -> list: layout and list Links all mount. + { + testId: 'go-list', + marker: listMarker, + activeCount: listActiveCount, + hubRelativeHref: '/hub/list?page=1', + listRelativeHref: '/hub/list?page=1&sort=asc', + }, + // 6a. list -> list?sort=desc: nothing departs, updater Links rebuild. + { + testId: 'go-list-sorted', + marker: listSortedMarker, + activeCount: listActiveCount, + hubRelativeHref: '/hub/list?sort=desc&page=1', + listRelativeHref: '/hub/list?sort=asc&page=1', + }, + // 6b. back to the plain list so the lap ends on the initial location. + { + testId: 'go-list', + marker: listMarker, + activeCount: listActiveCount, + hubRelativeHref: '/hub/list?page=1', + listRelativeHref: '/hub/list?page=1&sort=asc', + }, +] + +export const initialUrl = '/hub/list' + +export const scenarioSteps: ReadonlyArray = stepDefs.map( + (step) => step.testId, +) + +function assertHref( + container: HTMLElement, + testId: string, + expected: string | null, + stepIndex: number, +) { + const link = container.querySelector(`[data-testid="${testId}"]`) + const href = link ? link.getAttribute('href') : null + if (href !== expected) { + throw new Error( + `Expected "${testId}" href ${JSON.stringify(expected)} after step ${stepIndex}, received ${JSON.stringify(href)}`, + ) + } +} + +export function assertStepResult(stepIndex: number, container: HTMLElement) { + const step = stepDefs[stepIndex]! + + const marker = container.querySelector('[data-testid="page-state"]') + if (marker?.textContent !== step.marker) { + throw new Error( + `Expected page marker "${step.marker}" after step ${stepIndex}, received "${marker?.textContent}"`, + ) + } + + const activeLinks = container.querySelectorAll('a.active-link') + if (activeLinks.length !== step.activeCount) { + throw new Error( + `Expected ${step.activeCount} active link(s) after step ${stepIndex}, received ${activeLinks.length}`, + ) + } + + assertHref(container, hubRelativeTestId, step.hubRelativeHref, stepIndex) + assertHref(container, listRelativeTestId, step.listRelativeHref, stepIndex) +} + +// One lap through the 7-step sequence per benchmark iteration. +export const ticksPerIteration = stepDefs.length + +export const benchOptions = { + warmupIterations: 50, + time: 10_000, + throws: true, +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/project.json b/benchmarks/client-nav/scenarios/link-churn/solid/project.json new file mode 100644 index 0000000000..4e46143b32 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/project.json @@ -0,0 +1,40 @@ +{ + "name": "@benchmarks/client-nav-link-churn-solid", + "projectType": "application", + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { + "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts" + } + }, + "test:types:client": { + "executor": "nx:run-commands", + "dependsOn": [ + { + "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" + } + }, + "test:flame": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/solid/speed.flame.ts", + "cwd": "benchmarks/client-nav" + } + } + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts b/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts new file mode 100644 index 0000000000..a2a024341d --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts @@ -0,0 +1,18 @@ +import { createScenarioSetup } from '../../harness' +import { assertStepResult, initialUrl, scenarioSteps } from '../shared' +import type * as App from './src/main' + +const appModulePath = './dist/app.js' +const { mountTestApp } = (await import( + /* @vite-ignore */ appModulePath +)) as typeof App + +export function setup() { + return createScenarioSetup({ + frameworkLabel: 'Solid', + mount: mountTestApp, + steps: scenarioSteps, + assertAfterStep: assertStepResult, + initialUrl, + }) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts new file mode 100644 index 0000000000..80c4aaa6fd --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts @@ -0,0 +1,19 @@ +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' +import { benchOptions, ticksPerIteration } from '../shared' +import { setup } from './setup' + +test('client-link-churn', async ({ bench }) => { + const scenario = setup() + + await bench( + 'client-link-churn navigation loop (solid)', + benchLifecycle(scenario), + async () => { + for (let i = 0; i < ticksPerIteration; i++) { + await scenario.tick() + } + await scenario.finishBatch() + }, + ).run(benchOptions) +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts new file mode 100644 index 0000000000..f4a0b4e6ff --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts @@ -0,0 +1,18 @@ +import { window } from '../../../jsdom.ts' +import { setup } from './setup.ts' + +const DURATION_MS = 10_000 + +const test = setup() + +try { + await test.before() + + const startedAt = performance.now() + while (performance.now() - startedAt < DURATION_MS) { + await test.tick() + } +} finally { + test.after() + window.close() +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx new file mode 100644 index 0000000000..fa9d239418 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx @@ -0,0 +1,34 @@ +import type { RouterHistory } from '@tanstack/history' +import { render } from 'solid-js/web' +import { RouterProvider, createRouter } from '@tanstack/solid-router' +import { routeTree } from './routeTree.gen' + +export function createTestRouter(history: RouterHistory) { + return createRouter({ + routeTree, + history, + scrollRestoration: true, + // Key the scroll-restoration cache by pathname instead of the default + // random per-entry location key: with push navigations the default mints + // a fresh key per navigation and the module-level cache grows one entry + // per push for the whole run, which is non-stationary. + getScrollRestorationKey: (location) => location.pathname, + }) +} + +declare module '@tanstack/solid-router' { + interface Register { + router: ReturnType + } +} + +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) + + const unmount = render(() => , container) + + return { + router, + unmount, + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts new file mode 100644 index 0000000000..e3cb546963 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as HubRouteImport } from './routes/hub' +import { Route as OtherRouteImport } from './routes/other' +import { Route as HubListRouteImport } from './routes/hub.list' +import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id' + +const HubRoute = HubRouteImport.update({ + id: '/hub', + path: '/hub', + getParentRoute: () => rootRouteImport, +} as any) +const OtherRoute = OtherRouteImport.update({ + id: '/other', + path: '/other', + getParentRoute: () => rootRouteImport, +} as any) +const HubListRoute = HubListRouteImport.update({ + id: '/list', + path: '/list', + getParentRoute: () => HubRoute, +} as any) +const HubDetailIdRoute = HubDetailIdRouteImport.update({ + id: '/detail/$id', + path: '/detail/$id', + getParentRoute: () => HubRoute, +} as any) + +export interface FileRoutesByFullPath { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesByTo { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesByTo: FileRoutesByTo + to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + HubRoute: typeof HubRouteWithChildren + OtherRoute: typeof OtherRoute +} + +declare module '@tanstack/solid-router' { + interface FileRoutesByPath { + '/hub': { + id: '/hub' + path: '/hub' + fullPath: '/hub' + preLoaderRoute: typeof HubRouteImport + parentRoute: typeof rootRouteImport + } + '/other': { + id: '/other' + path: '/other' + fullPath: '/other' + preLoaderRoute: typeof OtherRouteImport + parentRoute: typeof rootRouteImport + } + '/hub/list': { + id: '/hub/list' + path: '/list' + fullPath: '/hub/list' + preLoaderRoute: typeof HubListRouteImport + parentRoute: typeof HubRoute + } + '/hub/detail/$id': { + id: '/hub/detail/$id' + path: '/detail/$id' + fullPath: '/hub/detail/$id' + preLoaderRoute: typeof HubDetailIdRouteImport + parentRoute: typeof HubRoute + } + } +} + +interface HubRouteChildren { + HubListRoute: typeof HubListRoute + HubDetailIdRoute: typeof HubDetailIdRoute +} + +const HubRouteChildren: HubRouteChildren = { + HubListRoute: HubListRoute, + HubDetailIdRoute: HubDetailIdRoute, +} + +const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren) + +const rootRouteChildren: RootRouteChildren = { + HubRoute: HubRouteWithChildren, + OtherRoute: OtherRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx new file mode 100644 index 0000000000..a9de4ea356 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx @@ -0,0 +1,39 @@ +import { Link, Outlet, createRootRoute } from '@tanstack/solid-router' +import { sortedSearch } from '../../../shared' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return ( + <> + + + + ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx new file mode 100644 index 0000000000..7aca4a9935 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx @@ -0,0 +1,24 @@ +import { Link, createFileRoute } from '@tanstack/solid-router' +import { detailMarker } from '../../../shared' + +export const Route = createFileRoute('/hub/detail/$id')({ + component: DetailPage, +}) + +function DetailPage() { + const params = Route.useParams() + + return ( +
+

{detailMarker(params().id)}

+ Back to list + + Next + + Elsewhere +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx new file mode 100644 index 0000000000..5796a50b02 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx @@ -0,0 +1,68 @@ +import { For } from 'solid-js' +import { Link, createFileRoute } from '@tanstack/solid-router' +import { + listItemIds, + listMarker, + listRelativeTestId, + listSortedMarker, +} from '../../../shared' + +export const Route = createFileRoute('/hub/list')({ + component: ListPage, +}) + +const ascSearch = { sort: 'asc' } as const + +// List Links depart whenever the list leaf is left. +function ListLinks() { + return ( +
    + + {(id) => { + const page = Number(id) + return ( +
  • + + {`Item ${id}`} + + + {`Item ${id} asc`} + + + {`Item ${id} exact`} + + ({ ...prev, page })}> + {`Page ${id}`} + + ({ ...prev, page, sort: 'asc' as const })} + data-testid={id === '1' ? listRelativeTestId : undefined} + > + {`Page ${id} asc`} + +
  • + ) + }} +
    +
+ ) +} + +function ListPage() { + const sort = Route.useSearch({ select: (search) => search.sort }) + + return ( +
+

+ {sort() === 'desc' ? listSortedMarker : listMarker} +

+ +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx new file mode 100644 index 0000000000..4682f85aae --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx @@ -0,0 +1,67 @@ +import { For } from 'solid-js' +import { Link, Outlet, createFileRoute } from '@tanstack/solid-router' +import { + hubItemIds, + hubRelativeTestId, + validateHubSearch, +} from '../../../shared' + +export const Route = createFileRoute('/hub')({ + validateSearch: validateHubSearch, + component: HubLayout, +}) + +// Layout Links stay mounted while the hub leaves change. +function HubLinks() { + return ( +
+ + {(id) => { + const page = Number(id) + return ( +
+ + {`Detail ${id}`} + + + {`Detail ${id} exact`} + + + {`List page ${id}`} + + ({ ...prev, page })}> + {`List keep ${id}`} + + ({ ...prev, page })} + data-testid={id === '1' ? hubRelativeTestId : undefined} + > + {`Here page ${id}`} + +
+ ) + }} +
+
+ ) +} + +function HubLayout() { + return ( +
+ + +
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx new file mode 100644 index 0000000000..2606089113 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx @@ -0,0 +1,14 @@ +import { createFileRoute } from '@tanstack/solid-router' +import { otherMarker } from '../../../shared' + +export const Route = createFileRoute('/other')({ + component: OtherPage, +}) + +function OtherPage() { + return ( +
+

{otherMarker}

+
+ ) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json new file mode 100644 index 0000000000..98d76ad6b8 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "jsx": "preserve", + "jsxImportSource": "solid-js", + "allowImportingTsExtensions": true, + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": [ + "speed.bench.ts", + "speed.flame.ts", + "setup.ts", + "vite.config.ts", + "../shared.ts", + "../../harness.ts", + "../../../setup-helpers.ts", + "../../../jsdom.ts", + "../../../vitest.setup.ts", + "./src/**/*" + ] +} diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts new file mode 100644 index 0000000000..37718a2d6a --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts @@ -0,0 +1,50 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' +import solid from 'vite-plugin-solid' +import codspeedPlugin from '@codspeed/vitest-plugin' +import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' + +const rootDir = fileURLToPath(new URL('.', import.meta.url)) + +export default defineConfig({ + root: rootDir, + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + tanstackRouter({ + target: 'solid', + routesDirectory: `${rootDir}src/routes`, + generatedRouteTree: `${rootDir}src/routeTree.gen.ts`, + }), + solid({ hot: false, dev: false }), + ], + build: { + outDir: './dist', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/main.tsx', + formats: ['es'], + fileName: 'app', + }, + }, + resolve: { + conditions: ['solid', 'browser'], + }, + test: { + execArgv: cpuSimulationExecArgv(), + name: '@benchmarks/client-nav link-churn (solid)', + watch: false, + environment: 'jsdom', + setupFiles: ['../../../vitest.setup.ts'], + server: { + deps: { + inline: [/@solidjs/, /@tanstack\/solid-store/], + }, + }, + }, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/project.json b/benchmarks/client-nav/scenarios/link-churn/vue/project.json new file mode 100644 index 0000000000..fb890ddfb8 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/project.json @@ -0,0 +1,40 @@ +{ + "name": "@benchmarks/client-nav-link-churn-vue", + "projectType": "application", + "targets": { + "build:client": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": [ + { + "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts" + } + }, + "test:types:client": { + "executor": "nx:run-commands", + "dependsOn": [ + { + "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"], + "target": "build" + } + ], + "options": { + "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" + } + }, + "test:flame": { + "executor": "nx:run-commands", + "cache": false, + "dependsOn": ["build:client"], + "options": { + "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/vue/speed.flame.ts", + "cwd": "benchmarks/client-nav" + } + } + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts b/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts new file mode 100644 index 0000000000..95cacb9ea8 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts @@ -0,0 +1,18 @@ +import { createScenarioSetup } from '../../harness' +import { assertStepResult, initialUrl, scenarioSteps } from '../shared' +import type * as App from './src/main' + +const appModulePath = './dist/app.js' +const { mountTestApp } = (await import( + /* @vite-ignore */ appModulePath +)) as typeof App + +export function setup() { + return createScenarioSetup({ + frameworkLabel: 'Vue', + mount: mountTestApp, + steps: scenarioSteps, + assertAfterStep: assertStepResult, + initialUrl, + }) +} diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts new file mode 100644 index 0000000000..dea511c24c --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts @@ -0,0 +1,19 @@ +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' +import { benchOptions, ticksPerIteration } from '../shared' +import { setup } from './setup' + +test('client-link-churn', async ({ bench }) => { + const scenario = setup() + + await bench( + 'client-link-churn navigation loop (vue)', + benchLifecycle(scenario), + async () => { + for (let i = 0; i < ticksPerIteration; i++) { + await scenario.tick() + } + await scenario.finishBatch() + }, + ).run(benchOptions) +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts new file mode 100644 index 0000000000..f4a0b4e6ff --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts @@ -0,0 +1,18 @@ +import { window } from '../../../jsdom.ts' +import { setup } from './setup.ts' + +const DURATION_MS = 10_000 + +const test = setup() + +try { + await test.before() + + const startedAt = performance.now() + while (performance.now() - startedAt < DURATION_MS) { + await test.tick() + } +} finally { + test.after() + window.close() +} diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx new file mode 100644 index 0000000000..cae9b54f1d --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx @@ -0,0 +1,41 @@ +import type { RouterHistory } from '@tanstack/history' +import * as Vue from 'vue' +import { RouterProvider, createRouter } from '@tanstack/vue-router' +import { routeTree } from './routeTree.gen' + +export function createTestRouter(history: RouterHistory) { + return createRouter({ + routeTree, + history, + scrollRestoration: true, + // Key the scroll-restoration cache by pathname instead of the default + // random per-entry location key: with push navigations the default mints + // a fresh key per navigation and the module-level cache grows one entry + // per push for the whole run, which is non-stationary. + getScrollRestorationKey: (location) => location.pathname, + }) +} + +declare module '@tanstack/vue-router' { + interface Register { + router: ReturnType + } +} + +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) + + const component = + const app = Vue.createApp({ + render: () => component, + }) + + app.mount(container) + + return { + router, + unmount() { + app.unmount() + }, + } +} diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts new file mode 100644 index 0000000000..9327bbc01d --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as HubRouteImport } from './routes/hub' +import { Route as OtherRouteImport } from './routes/other' +import { Route as HubListRouteImport } from './routes/hub.list' +import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id' + +const HubRoute = HubRouteImport.update({ + id: '/hub', + path: '/hub', + getParentRoute: () => rootRouteImport, +} as any) +const OtherRoute = OtherRouteImport.update({ + id: '/other', + path: '/other', + getParentRoute: () => rootRouteImport, +} as any) +const HubListRoute = HubListRouteImport.update({ + id: '/list', + path: '/list', + getParentRoute: () => HubRoute, +} as any) +const HubDetailIdRoute = HubDetailIdRouteImport.update({ + id: '/detail/$id', + path: '/detail/$id', + getParentRoute: () => HubRoute, +} as any) + +export interface FileRoutesByFullPath { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesByTo { + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/hub': typeof HubRouteWithChildren + '/other': typeof OtherRoute + '/hub/list': typeof HubListRoute + '/hub/detail/$id': typeof HubDetailIdRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesByTo: FileRoutesByTo + to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + HubRoute: typeof HubRouteWithChildren + OtherRoute: typeof OtherRoute +} + +declare module '@tanstack/vue-router' { + interface FileRoutesByPath { + '/hub': { + id: '/hub' + path: '/hub' + fullPath: '/hub' + preLoaderRoute: typeof HubRouteImport + parentRoute: typeof rootRouteImport + } + '/other': { + id: '/other' + path: '/other' + fullPath: '/other' + preLoaderRoute: typeof OtherRouteImport + parentRoute: typeof rootRouteImport + } + '/hub/list': { + id: '/hub/list' + path: '/list' + fullPath: '/hub/list' + preLoaderRoute: typeof HubListRouteImport + parentRoute: typeof HubRoute + } + '/hub/detail/$id': { + id: '/hub/detail/$id' + path: '/detail/$id' + fullPath: '/hub/detail/$id' + preLoaderRoute: typeof HubDetailIdRouteImport + parentRoute: typeof HubRoute + } + } +} + +interface HubRouteChildren { + HubListRoute: typeof HubListRoute + HubDetailIdRoute: typeof HubDetailIdRoute +} + +const HubRouteChildren: HubRouteChildren = { + HubListRoute: HubListRoute, + HubDetailIdRoute: HubDetailIdRoute, +} + +const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren) + +const rootRouteChildren: RootRouteChildren = { + HubRoute: HubRouteWithChildren, + OtherRoute: OtherRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx new file mode 100644 index 0000000000..a4f7985c5a --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx @@ -0,0 +1,46 @@ +import * as Vue from 'vue' +import { Link, Outlet, createRootRoute } from '@tanstack/vue-router' +import { sortedSearch } from '../../../shared' + +const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + <> + + + + ) + }, +}) + +export const Route = createRootRoute({ + component: RootComponent, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx new file mode 100644 index 0000000000..4701ab44eb --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx @@ -0,0 +1,27 @@ +import * as Vue from 'vue' +import { Link, createFileRoute } from '@tanstack/vue-router' +import { detailMarker } from '../../../shared' + +const DetailPage = Vue.defineComponent({ + setup() { + const params = Route.useParams() + + return () => ( +
+

{detailMarker(params.value.id)}

+ Back to list + + Next + + Elsewhere +
+ ) + }, +}) + +export const Route = createFileRoute('/hub/detail/$id')({ + component: DetailPage, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx new file mode 100644 index 0000000000..02abd6db1b --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx @@ -0,0 +1,74 @@ +import * as Vue from 'vue' +import { Link, createFileRoute } from '@tanstack/vue-router' +import { + listItemIds, + listMarker, + listRelativeTestId, + listSortedMarker, +} from '../../../shared' + +const ascSearch = { sort: 'asc' } as const + +// List Links depart whenever the list leaf is left. +const ListLinks = Vue.defineComponent({ + setup() { + return () => ( +
    + {listItemIds.map((id) => { + const page = Number(id) + return ( +
  • + + {`Item ${id}`} + + + {`Item ${id} asc`} + + + {`Item ${id} exact`} + + ({ ...prev, page })}> + {`Page ${id}`} + + ({ + ...prev, + page, + sort: 'asc' as const, + })} + data-testid={id === '1' ? listRelativeTestId : undefined} + > + {`Page ${id} asc`} + +
  • + ) + })} +
+ ) + }, +}) + +const ListPage = Vue.defineComponent({ + setup() { + const sort = Route.useSearch({ select: (search) => search.sort }) + + return () => ( +
+

+ {sort.value === 'desc' ? listSortedMarker : listMarker} +

+ +
+ ) + }, +}) + +export const Route = createFileRoute('/hub/list')({ + component: ListPage, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx new file mode 100644 index 0000000000..5be17f3350 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx @@ -0,0 +1,69 @@ +import * as Vue from 'vue' +import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' +import { + hubItemIds, + hubRelativeTestId, + validateHubSearch, +} from '../../../shared' + +// Layout Links stay mounted while the hub leaves change. +const HubLinks = Vue.defineComponent({ + setup() { + return () => ( +
+ {hubItemIds.map((id) => { + const page = Number(id) + return ( +
+ + {`Detail ${id}`} + + + {`Detail ${id} exact`} + + + {`List page ${id}`} + + ({ ...prev, page })}> + {`List keep ${id}`} + + ({ ...prev, page })} + data-testid={id === '1' ? hubRelativeTestId : undefined} + > + {`Here page ${id}`} + +
+ ) + })} +
+ ) + }, +}) + +const HubLayout = Vue.defineComponent({ + setup() { + return () => ( +
+ + +
+ ) + }, +}) + +export const Route = createFileRoute('/hub')({ + validateSearch: validateHubSearch, + component: HubLayout, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx new file mode 100644 index 0000000000..08dec586fa --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx @@ -0,0 +1,17 @@ +import * as Vue from 'vue' +import { createFileRoute } from '@tanstack/vue-router' +import { otherMarker } from '../../../shared' + +const OtherPage = Vue.defineComponent({ + setup() { + return () => ( +
+

{otherMarker}

+
+ ) + }, +}) + +export const Route = createFileRoute('/other')({ + component: OtherPage, +}) diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json new file mode 100644 index 0000000000..7786fc3da9 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "jsx": "preserve", + "jsxImportSource": "vue", + "allowImportingTsExtensions": true, + "types": ["node", "vite/client", "vitest/globals"] + }, + "include": [ + "speed.bench.ts", + "speed.flame.ts", + "setup.ts", + "vite.config.ts", + "../shared.ts", + "../../harness.ts", + "../../../setup-helpers.ts", + "../../../jsdom.ts", + "../../../vitest.setup.ts", + "./src/**/*" + ] +} diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts new file mode 100644 index 0000000000..8f56734e04 --- /dev/null +++ b/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts @@ -0,0 +1,44 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' +import codspeedPlugin from '@codspeed/vitest-plugin' +import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' + +const rootDir = fileURLToPath(new URL('.', import.meta.url)) + +export default defineConfig({ + root: rootDir, + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, + plugins: [ + !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) && + codspeedPlugin(), + tanstackRouter({ + target: 'vue', + routesDirectory: `${rootDir}src/routes`, + generatedRouteTree: `${rootDir}src/routeTree.gen.ts`, + }), + vue(), + vueJsx(), + ], + build: { + outDir: './dist', + emptyOutDir: true, + minify: false, + lib: { + entry: './src/main.tsx', + formats: ['es'], + fileName: 'app', + }, + }, + test: { + execArgv: cpuSimulationExecArgv(), + name: '@benchmarks/client-nav link-churn (vue)', + watch: false, + environment: 'jsdom', + setupFiles: ['../../../vitest.setup.ts'], + }, +}) diff --git a/benchmarks/client-nav/scenarios/links/react/speed.bench.ts b/benchmarks/client-nav/scenarios/links/react/speed.bench.ts index 68bb869182..75f5f725d4 100644 --- a/benchmarks/client-nav/scenarios/links/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/links/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-links', () => { - const test = setup() +test('client-links', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-links navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/links/react/src/main.tsx b/benchmarks/client-nav/scenarios/links/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/links/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/links/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/links/react/vite.config.ts b/benchmarks/client-nav/scenarios/links/react/vite.config.ts index 9e9cd48895..69de10b5b7 100644 --- a/benchmarks/client-nav/scenarios/links/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/links/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav links (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts index beba86fb6c..fc7f3e71e7 100644 --- a/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-links', () => { - const test = setup() +test('client-links', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-links navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/links/solid/src/main.tsx b/benchmarks/client-nav/scenarios/links/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/links/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/links/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts index b61431e40d..0da70513e8 100644 --- a/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts @@ -9,20 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as AboutRouteImport } from './routes/about' import { Route as IndexRouteImport } from './routes/index' +import { Route as AboutRouteImport } from './routes/about' import { Route as ItemsIdRouteImport } from './routes/items.$id' -const AboutRoute = AboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) +const AboutRoute = AboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => rootRouteImport, +} as any) const ItemsIdRoute = ItemsIdRouteImport.update({ id: '/items/$id', path: '/items/$id', @@ -61,13 +61,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/about': { - id: '/about' - path: '/about' - fullPath: '/about' - preLoaderRoute: typeof AboutRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -75,6 +68,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/about': { + id: '/about' + path: '/about' + fullPath: '/about' + preLoaderRoute: typeof AboutRouteImport + parentRoute: typeof rootRouteImport + } '/items/$id': { id: '/items/$id' path: '/items/$id' diff --git a/benchmarks/client-nav/scenarios/links/solid/vite.config.ts b/benchmarks/client-nav/scenarios/links/solid/vite.config.ts index 9a5b3d138b..e37342ffc3 100644 --- a/benchmarks/client-nav/scenarios/links/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/links/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav links (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts index 54b99d1273..2ace7a8409 100644 --- a/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-links', () => { - const test = setup() +test('client-links', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-links navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/links/vue/src/main.tsx b/benchmarks/client-nav/scenarios/links/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/links/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/links/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts index cee64be43c..7d2b1e9bbb 100644 --- a/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts @@ -9,20 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as AboutRouteImport } from './routes/about' import { Route as IndexRouteImport } from './routes/index' +import { Route as AboutRouteImport } from './routes/about' import { Route as ItemsIdRouteImport } from './routes/items.$id' -const AboutRoute = AboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) +const AboutRoute = AboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => rootRouteImport, +} as any) const ItemsIdRoute = ItemsIdRouteImport.update({ id: '/items/$id', path: '/items/$id', @@ -61,13 +61,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/about': { - id: '/about' - path: '/about' - fullPath: '/about' - preLoaderRoute: typeof AboutRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -75,6 +68,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/about': { + id: '/about' + path: '/about' + fullPath: '/about' + preLoaderRoute: typeof AboutRouteImport + parentRoute: typeof rootRouteImport + } '/items/$id': { id: '/items/$id' path: '/items/$id' diff --git a/benchmarks/client-nav/scenarios/links/vue/vite.config.ts b/benchmarks/client-nav/scenarios/links/vue/vite.config.ts index d1cf9f561d..ad89a49d70 100644 --- a/benchmarks/client-nav/scenarios/links/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/links/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav links (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts index 7c44f1a0f7..8bcc53b88e 100644 --- a/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-loaders', () => { - const test = setup() +test('client-loaders', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-loaders navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/loaders/react/src/main.tsx b/benchmarks/client-nav/scenarios/loaders/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/loaders/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/loaders/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts index 6fa28bcd35..818b224130 100644 --- a/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav loaders (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts index 4c97823d11..953a17b31a 100644 --- a/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-loaders', () => { - const test = setup() +test('client-loaders', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-loaders navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx b/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts index bdec400237..fa5d032141 100644 --- a/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts @@ -9,24 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as DepsRouteImport } from './routes/deps' import { Route as IndexRouteImport } from './routes/index' -import { Route as FreshIdRouteImport } from './routes/fresh.$id' +import { Route as DepsRouteImport } from './routes/deps' import { Route as CachedIdRouteImport } from './routes/cached.$id' +import { Route as FreshIdRouteImport } from './routes/fresh.$id' -const DepsRoute = DepsRouteImport.update({ - id: '/deps', - path: '/deps', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const FreshIdRoute = FreshIdRouteImport.update({ - id: '/fresh/$id', - path: '/fresh/$id', +const DepsRoute = DepsRouteImport.update({ + id: '/deps', + path: '/deps', getParentRoute: () => rootRouteImport, } as any) const CachedIdRoute = CachedIdRouteImport.update({ @@ -34,6 +29,11 @@ const CachedIdRoute = CachedIdRouteImport.update({ path: '/cached/$id', getParentRoute: () => rootRouteImport, } as any) +const FreshIdRoute = FreshIdRouteImport.update({ + id: '/fresh/$id', + path: '/fresh/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -71,13 +71,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/deps': { - id: '/deps' - path: '/deps' - fullPath: '/deps' - preLoaderRoute: typeof DepsRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -85,11 +78,11 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/fresh/$id': { - id: '/fresh/$id' - path: '/fresh/$id' - fullPath: '/fresh/$id' - preLoaderRoute: typeof FreshIdRouteImport + '/deps': { + id: '/deps' + path: '/deps' + fullPath: '/deps' + preLoaderRoute: typeof DepsRouteImport parentRoute: typeof rootRouteImport } '/cached/$id': { @@ -99,6 +92,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof CachedIdRouteImport parentRoute: typeof rootRouteImport } + '/fresh/$id': { + id: '/fresh/$id' + path: '/fresh/$id' + fullPath: '/fresh/$id' + preLoaderRoute: typeof FreshIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts index ea913ac578..90584d3b7e 100644 --- a/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav loaders (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts index eeb9cefaeb..1ae2f89a56 100644 --- a/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-loaders', () => { - const test = setup() +test('client-loaders', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-loaders navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/loaders/vue/src/main.tsx b/benchmarks/client-nav/scenarios/loaders/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/loaders/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/loaders/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts index 25a82df477..10cb8f2aca 100644 --- a/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts @@ -9,24 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as DepsRouteImport } from './routes/deps' import { Route as IndexRouteImport } from './routes/index' -import { Route as FreshIdRouteImport } from './routes/fresh.$id' +import { Route as DepsRouteImport } from './routes/deps' import { Route as CachedIdRouteImport } from './routes/cached.$id' +import { Route as FreshIdRouteImport } from './routes/fresh.$id' -const DepsRoute = DepsRouteImport.update({ - id: '/deps', - path: '/deps', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const FreshIdRoute = FreshIdRouteImport.update({ - id: '/fresh/$id', - path: '/fresh/$id', +const DepsRoute = DepsRouteImport.update({ + id: '/deps', + path: '/deps', getParentRoute: () => rootRouteImport, } as any) const CachedIdRoute = CachedIdRouteImport.update({ @@ -34,6 +29,11 @@ const CachedIdRoute = CachedIdRouteImport.update({ path: '/cached/$id', getParentRoute: () => rootRouteImport, } as any) +const FreshIdRoute = FreshIdRouteImport.update({ + id: '/fresh/$id', + path: '/fresh/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -71,13 +71,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/deps': { - id: '/deps' - path: '/deps' - fullPath: '/deps' - preLoaderRoute: typeof DepsRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -85,11 +78,11 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/fresh/$id': { - id: '/fresh/$id' - path: '/fresh/$id' - fullPath: '/fresh/$id' - preLoaderRoute: typeof FreshIdRouteImport + '/deps': { + id: '/deps' + path: '/deps' + fullPath: '/deps' + preLoaderRoute: typeof DepsRouteImport parentRoute: typeof rootRouteImport } '/cached/$id': { @@ -99,6 +92,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof CachedIdRouteImport parentRoute: typeof rootRouteImport } + '/fresh/$id': { + id: '/fresh/$id' + path: '/fresh/$id' + fullPath: '/fresh/$id' + preLoaderRoute: typeof FreshIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts index 350fadf387..ecf4cce139 100644 --- a/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav loaders (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts index 8f7967c42c..6c3a64b026 100644 --- a/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-mount', () => { - const test = setup() +test('client-mount', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-mount loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/mount/react/src/main.tsx b/benchmarks/client-nav/scenarios/mount/react/src/main.tsx index 78fe2082aa..4e45ed7ef3 100644 --- a/benchmarks/client-nav/scenarios/mount/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/mount/react/src/main.tsx @@ -1,19 +1,12 @@ -import { - RouterProvider, - createBrowserHistory, - createRouter, -} from '@tanstack/react-router' +import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -import type { RouterHistory } from '@tanstack/react-router' +import type { RouterHistory } from '@tanstack/history' /** * Unlike the other scenarios, this app is mounted and unmounted in a loop, so * it must not register page-lifetime globals that have no dispose path: - * - the history is created explicitly and `destroy()`ed on unmount — the - * default per-router `createBrowserHistory()` monkey-patches - * `window.history.pushState`/`replaceState`, chaining one wrapper per - * router and degrading every later mount; + * - the harness injects and destroys a fresh memory history per mount; * - `scrollRestoration` stays off — enabling it registers per-router * document/window listeners that retain every router ever created. */ @@ -30,8 +23,7 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const history = createBrowserHistory() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { const router = createTestRouter(history) const reactRoot = createRoot(container) @@ -41,7 +33,6 @@ export function mountTestApp(container: HTMLElement) { router, unmount() { reactRoot.unmount() - history.destroy() }, } } diff --git a/benchmarks/client-nav/scenarios/mount/react/vite.config.ts b/benchmarks/client-nav/scenarios/mount/react/vite.config.ts index 68ee46738a..e197d33a9e 100644 --- a/benchmarks/client-nav/scenarios/mount/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/mount/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav mount (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts index 1bce4c6750..236f875f57 100644 --- a/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-mount', () => { - const test = setup() +test('client-mount', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-mount loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx b/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx index ae03b145ca..2586872f5c 100644 --- a/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx @@ -1,19 +1,12 @@ import { render } from 'solid-js/web' -import { - RouterProvider, - createBrowserHistory, - createRouter, -} from '@tanstack/solid-router' +import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -import type { RouterHistory } from '@tanstack/solid-router' +import type { RouterHistory } from '@tanstack/history' /** * Unlike the other scenarios, this app is mounted and unmounted in a loop, so * it must not register page-lifetime globals that have no dispose path: - * - the history is created explicitly and `destroy()`ed on unmount — the - * default per-router `createBrowserHistory()` monkey-patches - * `window.history.pushState`/`replaceState`, chaining one wrapper per - * router and degrading every later mount; + * - the harness injects and destroys a fresh memory history per mount; * - `scrollRestoration` stays off — enabling it registers per-router * document/window listeners that retain every router ever created. */ @@ -30,8 +23,7 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const history = createBrowserHistory() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { const router = createTestRouter(history) const dispose = render(() => , container) @@ -40,7 +32,6 @@ export function mountTestApp(container: HTMLElement) { router, unmount() { dispose() - history.destroy() }, } } diff --git a/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts index dc0acc183d..30247636dd 100644 --- a/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts @@ -9,35 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as ShopRouteImport } from './routes/shop' -import { Route as SettingsRouteImport } from './routes/settings' -import { Route as SearchRouteImport } from './routes/search' -import { Route as BlogRouteImport } from './routes/blog' -import { Route as AboutRouteImport } from './routes/about' import { Route as IndexRouteImport } from './routes/index' -import { Route as ShopIndexRouteImport } from './routes/shop.index' +import { Route as AboutRouteImport } from './routes/about' +import { Route as BlogRouteImport } from './routes/blog' +import { Route as SearchRouteImport } from './routes/search' +import { Route as SettingsRouteImport } from './routes/settings' +import { Route as ShopRouteImport } from './routes/shop' import { Route as BlogIndexRouteImport } from './routes/blog.index' -import { Route as ShopProductIdRouteImport } from './routes/shop.$productId' import { Route as BlogSlugRouteImport } from './routes/blog.$slug' +import { Route as ShopIndexRouteImport } from './routes/shop.index' +import { Route as ShopProductIdRouteImport } from './routes/shop.$productId' -const ShopRoute = ShopRouteImport.update({ - id: '/shop', - path: '/shop', - getParentRoute: () => rootRouteImport, -} as any) -const SettingsRoute = SettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => rootRouteImport, -} as any) -const SearchRoute = SearchRouteImport.update({ - id: '/search', - path: '/search', - getParentRoute: () => rootRouteImport, -} as any) -const BlogRoute = BlogRouteImport.update({ - id: '/blog', - path: '/blog', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const AboutRoute = AboutRouteImport.update({ @@ -45,31 +30,46 @@ const AboutRoute = AboutRouteImport.update({ path: '/about', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const BlogRoute = BlogRouteImport.update({ + id: '/blog', + path: '/blog', getParentRoute: () => rootRouteImport, } as any) -const ShopIndexRoute = ShopIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => ShopRoute, +const SearchRoute = SearchRouteImport.update({ + id: '/search', + path: '/search', + getParentRoute: () => rootRouteImport, +} as any) +const SettingsRoute = SettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => rootRouteImport, +} as any) +const ShopRoute = ShopRouteImport.update({ + id: '/shop', + path: '/shop', + getParentRoute: () => rootRouteImport, } as any) const BlogIndexRoute = BlogIndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => BlogRoute, } as any) -const ShopProductIdRoute = ShopProductIdRouteImport.update({ - id: '/$productId', - path: '/$productId', - getParentRoute: () => ShopRoute, -} as any) const BlogSlugRoute = BlogSlugRouteImport.update({ id: '/$slug', path: '/$slug', getParentRoute: () => BlogRoute, } as any) +const ShopIndexRoute = ShopIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => ShopRoute, +} as any) +const ShopProductIdRoute = ShopProductIdRouteImport.update({ + id: '/$productId', + path: '/$productId', + getParentRoute: () => ShopRoute, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -154,32 +154,11 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/shop': { - id: '/shop' - path: '/shop' - fullPath: '/shop' - preLoaderRoute: typeof ShopRouteImport - parentRoute: typeof rootRouteImport - } - '/settings': { - id: '/settings' - path: '/settings' - fullPath: '/settings' - preLoaderRoute: typeof SettingsRouteImport - parentRoute: typeof rootRouteImport - } - '/search': { - id: '/search' - path: '/search' - fullPath: '/search' - preLoaderRoute: typeof SearchRouteImport - parentRoute: typeof rootRouteImport - } - '/blog': { - id: '/blog' - path: '/blog' - fullPath: '/blog' - preLoaderRoute: typeof BlogRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/about': { @@ -189,19 +168,33 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof AboutRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/blog': { + id: '/blog' + path: '/blog' + fullPath: '/blog' + preLoaderRoute: typeof BlogRouteImport parentRoute: typeof rootRouteImport } - '/shop/': { - id: '/shop/' - path: '/' - fullPath: '/shop/' - preLoaderRoute: typeof ShopIndexRouteImport - parentRoute: typeof ShopRoute + '/search': { + id: '/search' + path: '/search' + fullPath: '/search' + preLoaderRoute: typeof SearchRouteImport + parentRoute: typeof rootRouteImport + } + '/settings': { + id: '/settings' + path: '/settings' + fullPath: '/settings' + preLoaderRoute: typeof SettingsRouteImport + parentRoute: typeof rootRouteImport + } + '/shop': { + id: '/shop' + path: '/shop' + fullPath: '/shop' + preLoaderRoute: typeof ShopRouteImport + parentRoute: typeof rootRouteImport } '/blog/': { id: '/blog/' @@ -210,13 +203,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof BlogIndexRouteImport parentRoute: typeof BlogRoute } - '/shop/$productId': { - id: '/shop/$productId' - path: '/$productId' - fullPath: '/shop/$productId' - preLoaderRoute: typeof ShopProductIdRouteImport - parentRoute: typeof ShopRoute - } '/blog/$slug': { id: '/blog/$slug' path: '/$slug' @@ -224,6 +210,20 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof BlogSlugRouteImport parentRoute: typeof BlogRoute } + '/shop/': { + id: '/shop/' + path: '/' + fullPath: '/shop/' + preLoaderRoute: typeof ShopIndexRouteImport + parentRoute: typeof ShopRoute + } + '/shop/$productId': { + id: '/shop/$productId' + path: '/$productId' + fullPath: '/shop/$productId' + preLoaderRoute: typeof ShopProductIdRouteImport + parentRoute: typeof ShopRoute + } } } diff --git a/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts b/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts index 910d332f9c..5b586dd128 100644 --- a/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav mount (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts index d2e4b72c84..d9268ba91b 100644 --- a/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts @@ -1,34 +1,15 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-mount', () => { - const test = setup() +test('client-mount', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( - 'client-mount loop (vue)', - async () => { - for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() - } - }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + await bench('client-mount loop (vue)', benchLifecycle(scenario), async () => { + for (let i = 0; i < ticksPerIteration; i++) { + await scenario.tick() + } + await scenario.finishBatch() + }).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/mount/vue/src/main.tsx b/benchmarks/client-nav/scenarios/mount/vue/src/main.tsx index 6d238e2832..fc493c10a5 100644 --- a/benchmarks/client-nav/scenarios/mount/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/mount/vue/src/main.tsx @@ -1,19 +1,12 @@ import * as Vue from 'vue' -import { - RouterProvider, - createBrowserHistory, - createRouter, -} from '@tanstack/vue-router' +import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -import type { RouterHistory } from '@tanstack/vue-router' +import type { RouterHistory } from '@tanstack/history' /** * Unlike the other scenarios, this app is mounted and unmounted in a loop, so * it must not register page-lifetime globals that have no dispose path: - * - the history is created explicitly and `destroy()`ed on unmount — the - * default per-router `createBrowserHistory()` monkey-patches - * `window.history.pushState`/`replaceState`, chaining one wrapper per - * router and degrading every later mount; + * - the harness injects and destroys a fresh memory history per mount; * - `scrollRestoration` stays off — enabling it registers per-router * document/window listeners that retain every router ever created. */ @@ -30,8 +23,7 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const history = createBrowserHistory() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { const router = createTestRouter(history) const component = @@ -45,7 +37,6 @@ export function mountTestApp(container: HTMLElement) { router, unmount() { app.unmount() - history.destroy() }, } } diff --git a/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts index 98643d63c9..cd27c917e1 100644 --- a/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts @@ -9,35 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as ShopRouteImport } from './routes/shop' -import { Route as SettingsRouteImport } from './routes/settings' -import { Route as SearchRouteImport } from './routes/search' -import { Route as BlogRouteImport } from './routes/blog' -import { Route as AboutRouteImport } from './routes/about' import { Route as IndexRouteImport } from './routes/index' -import { Route as ShopIndexRouteImport } from './routes/shop.index' +import { Route as AboutRouteImport } from './routes/about' +import { Route as BlogRouteImport } from './routes/blog' +import { Route as SearchRouteImport } from './routes/search' +import { Route as SettingsRouteImport } from './routes/settings' +import { Route as ShopRouteImport } from './routes/shop' import { Route as BlogIndexRouteImport } from './routes/blog.index' -import { Route as ShopProductIdRouteImport } from './routes/shop.$productId' import { Route as BlogSlugRouteImport } from './routes/blog.$slug' +import { Route as ShopIndexRouteImport } from './routes/shop.index' +import { Route as ShopProductIdRouteImport } from './routes/shop.$productId' -const ShopRoute = ShopRouteImport.update({ - id: '/shop', - path: '/shop', - getParentRoute: () => rootRouteImport, -} as any) -const SettingsRoute = SettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => rootRouteImport, -} as any) -const SearchRoute = SearchRouteImport.update({ - id: '/search', - path: '/search', - getParentRoute: () => rootRouteImport, -} as any) -const BlogRoute = BlogRouteImport.update({ - id: '/blog', - path: '/blog', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const AboutRoute = AboutRouteImport.update({ @@ -45,31 +30,46 @@ const AboutRoute = AboutRouteImport.update({ path: '/about', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const BlogRoute = BlogRouteImport.update({ + id: '/blog', + path: '/blog', getParentRoute: () => rootRouteImport, } as any) -const ShopIndexRoute = ShopIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => ShopRoute, +const SearchRoute = SearchRouteImport.update({ + id: '/search', + path: '/search', + getParentRoute: () => rootRouteImport, +} as any) +const SettingsRoute = SettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => rootRouteImport, +} as any) +const ShopRoute = ShopRouteImport.update({ + id: '/shop', + path: '/shop', + getParentRoute: () => rootRouteImport, } as any) const BlogIndexRoute = BlogIndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => BlogRoute, } as any) -const ShopProductIdRoute = ShopProductIdRouteImport.update({ - id: '/$productId', - path: '/$productId', - getParentRoute: () => ShopRoute, -} as any) const BlogSlugRoute = BlogSlugRouteImport.update({ id: '/$slug', path: '/$slug', getParentRoute: () => BlogRoute, } as any) +const ShopIndexRoute = ShopIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => ShopRoute, +} as any) +const ShopProductIdRoute = ShopProductIdRouteImport.update({ + id: '/$productId', + path: '/$productId', + getParentRoute: () => ShopRoute, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -154,32 +154,11 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/shop': { - id: '/shop' - path: '/shop' - fullPath: '/shop' - preLoaderRoute: typeof ShopRouteImport - parentRoute: typeof rootRouteImport - } - '/settings': { - id: '/settings' - path: '/settings' - fullPath: '/settings' - preLoaderRoute: typeof SettingsRouteImport - parentRoute: typeof rootRouteImport - } - '/search': { - id: '/search' - path: '/search' - fullPath: '/search' - preLoaderRoute: typeof SearchRouteImport - parentRoute: typeof rootRouteImport - } - '/blog': { - id: '/blog' - path: '/blog' - fullPath: '/blog' - preLoaderRoute: typeof BlogRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/about': { @@ -189,19 +168,33 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof AboutRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/blog': { + id: '/blog' + path: '/blog' + fullPath: '/blog' + preLoaderRoute: typeof BlogRouteImport parentRoute: typeof rootRouteImport } - '/shop/': { - id: '/shop/' - path: '/' - fullPath: '/shop/' - preLoaderRoute: typeof ShopIndexRouteImport - parentRoute: typeof ShopRoute + '/search': { + id: '/search' + path: '/search' + fullPath: '/search' + preLoaderRoute: typeof SearchRouteImport + parentRoute: typeof rootRouteImport + } + '/settings': { + id: '/settings' + path: '/settings' + fullPath: '/settings' + preLoaderRoute: typeof SettingsRouteImport + parentRoute: typeof rootRouteImport + } + '/shop': { + id: '/shop' + path: '/shop' + fullPath: '/shop' + preLoaderRoute: typeof ShopRouteImport + parentRoute: typeof rootRouteImport } '/blog/': { id: '/blog/' @@ -210,13 +203,6 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof BlogIndexRouteImport parentRoute: typeof BlogRoute } - '/shop/$productId': { - id: '/shop/$productId' - path: '/$productId' - fullPath: '/shop/$productId' - preLoaderRoute: typeof ShopProductIdRouteImport - parentRoute: typeof ShopRoute - } '/blog/$slug': { id: '/blog/$slug' path: '/$slug' @@ -224,6 +210,20 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof BlogSlugRouteImport parentRoute: typeof BlogRoute } + '/shop/': { + id: '/shop/' + path: '/' + fullPath: '/shop/' + preLoaderRoute: typeof ShopIndexRouteImport + parentRoute: typeof ShopRoute + } + '/shop/$productId': { + id: '/shop/$productId' + path: '/$productId' + fullPath: '/shop/$productId' + preLoaderRoute: typeof ShopProductIdRouteImport + parentRoute: typeof ShopRoute + } } } diff --git a/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts b/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts index 107e1037b6..8d4005f339 100644 --- a/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav mount (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts index 321b1ad230..fa5809c1fd 100644 --- a/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-nested-params', () => { - const test = setup() +test('client-nested-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-nested-params navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/nested-params/react/src/main.tsx b/benchmarks/client-nav/scenarios/nested-params/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/nested-params/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/nested-params/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts index 672b1850ff..a99060bf1c 100644 --- a/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav nested-params (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts index d35980f612..2c64d9a221 100644 --- a/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-nested-params', () => { - const test = setup() +test('client-nested-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-nested-params navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts index f5c9e13c0f..9897e2c199 100644 --- a/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav nested-params (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts index fac8703c34..bd3e82e070 100644 --- a/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-nested-params', () => { - const test = setup() +test('client-nested-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-nested-params navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/nested-params/vue/src/main.tsx b/benchmarks/client-nav/scenarios/nested-params/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/nested-params/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/nested-params/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts index 59a4af48ef..0d74eb7a7c 100644 --- a/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav nested-params (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts index c869ebdcfb..5c210b2fd7 100644 --- a/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-preload', () => { - const test = setup() +test('client-preload', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-preload interaction loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/preload/react/src/main.tsx b/benchmarks/client-nav/scenarios/preload/react/src/main.tsx index 6f8942c118..395867f674 100644 --- a/benchmarks/client-nav/scenarios/preload/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/preload/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -23,8 +25,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/preload/react/vite.config.ts b/benchmarks/client-nav/scenarios/preload/react/vite.config.ts index ff51686959..8a41fc8707 100644 --- a/benchmarks/client-nav/scenarios/preload/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/preload/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav preload (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts index ff2771985b..f835b4a7b9 100644 --- a/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-preload', () => { - const test = setup() +test('client-preload', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-preload interaction loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx b/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx index 72e414c0a0..3791156c64 100644 --- a/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -23,8 +25,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts index 645d925238..97e215b6da 100644 --- a/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts @@ -9,20 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as DocsRouteImport } from './routes/docs' import { Route as IndexRouteImport } from './routes/index' +import { Route as DocsRouteImport } from './routes/docs' import { Route as SectionsSectionRouteImport } from './routes/sections.$section' -const DocsRoute = DocsRouteImport.update({ - id: '/docs', - path: '/docs', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) +const DocsRoute = DocsRouteImport.update({ + id: '/docs', + path: '/docs', + getParentRoute: () => rootRouteImport, +} as any) const SectionsSectionRoute = SectionsSectionRouteImport.update({ id: '/sections/$section', path: '/sections/$section', @@ -61,13 +61,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/docs': { - id: '/docs' - path: '/docs' - fullPath: '/docs' - preLoaderRoute: typeof DocsRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -75,6 +68,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/docs': { + id: '/docs' + path: '/docs' + fullPath: '/docs' + preLoaderRoute: typeof DocsRouteImport + parentRoute: typeof rootRouteImport + } '/sections/$section': { id: '/sections/$section' path: '/sections/$section' diff --git a/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts b/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts index b542834469..07014e6124 100644 --- a/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav preload (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts index 2e790e9240..e0ec83619b 100644 --- a/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-preload', () => { - const test = setup() +test('client-preload', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-preload interaction loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/preload/vue/src/main.tsx b/benchmarks/client-nav/scenarios/preload/vue/src/main.tsx index 1e325392a4..3da20b2cbf 100644 --- a/benchmarks/client-nav/scenarios/preload/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/preload/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -23,8 +25,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts index 05a751060b..5f95d09da0 100644 --- a/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts @@ -9,20 +9,20 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as DocsRouteImport } from './routes/docs' import { Route as IndexRouteImport } from './routes/index' +import { Route as DocsRouteImport } from './routes/docs' import { Route as SectionsSectionRouteImport } from './routes/sections.$section' -const DocsRoute = DocsRouteImport.update({ - id: '/docs', - path: '/docs', - getParentRoute: () => rootRouteImport, -} as any) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) +const DocsRoute = DocsRouteImport.update({ + id: '/docs', + path: '/docs', + getParentRoute: () => rootRouteImport, +} as any) const SectionsSectionRoute = SectionsSectionRouteImport.update({ id: '/sections/$section', path: '/sections/$section', @@ -61,13 +61,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/docs': { - id: '/docs' - path: '/docs' - fullPath: '/docs' - preLoaderRoute: typeof DocsRouteImport - parentRoute: typeof rootRouteImport - } '/': { id: '/' path: '/' @@ -75,6 +68,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/docs': { + id: '/docs' + path: '/docs' + fullPath: '/docs' + preLoaderRoute: typeof DocsRouteImport + parentRoute: typeof rootRouteImport + } '/sections/$section': { id: '/sections/$section' path: '/sections/$section' diff --git a/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts b/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts index 25e64b5bef..8d00e66378 100644 --- a/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav preload (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts index 9b77a79838..dd1b6f3686 100644 --- a/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-rewrites', () => { - const test = setup() +test('client-rewrites', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-rewrites navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/rewrites/react/src/main.tsx b/benchmarks/client-nav/scenarios/rewrites/react/src/main.tsx index 47746bb0fb..28020ce373 100644 --- a/benchmarks/client-nav/scenarios/rewrites/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/rewrites/react/src/main.tsx @@ -1,11 +1,13 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' import { basepath, localeRewrite } from '../../shared' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, basepath, rewrite: localeRewrite, scrollRestoration: true, @@ -23,8 +25,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts index 8c07cff4fb..e79e8522e9 100644 --- a/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav rewrites (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/rewrites/shared.ts b/benchmarks/client-nav/scenarios/rewrites/shared.ts index c45b15d503..0ca0a7ceb9 100644 --- a/benchmarks/client-nav/scenarios/rewrites/shared.ts +++ b/benchmarks/client-nav/scenarios/rewrites/shared.ts @@ -8,6 +8,7 @@ * parsing the committed location. */ import type { ScenarioStep } from '../harness' +import type { RouterHistory } from '@tanstack/history' export const basepath = '/app' export const defaultLocale = 'en' @@ -51,7 +52,7 @@ interface StepDef { testId: string /** Internal router pathname expected after the step. */ routerPath: string - /** External window.location pathname expected after the step. */ + /** External history pathname expected after the step. */ windowPath: string } @@ -70,7 +71,11 @@ export const steps: ReadonlyArray = stepDefs.map( (step) => step.testId, ) -export function assertStepResult(stepIndex: number, container: HTMLElement) { +export function assertStepResult( + stepIndex: number, + container: HTMLElement, + history: RouterHistory, +) { const expected = stepDefs[stepIndex]! const marker = container.querySelector('[data-testid="loc"]') const routerPath = marker?.textContent @@ -81,9 +86,9 @@ export function assertStepResult(stepIndex: number, container: HTMLElement) { ) } - if (window.location.pathname !== expected.windowPath) { + if (history.location.pathname !== expected.windowPath) { throw new Error( - `Expected window pathname "${expected.windowPath}" after step ${stepIndex}, received "${window.location.pathname}"`, + `Expected history pathname "${expected.windowPath}" after step ${stepIndex}, received "${history.location.pathname}"`, ) } } diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts index 30d3436071..9c4313e2ff 100644 --- a/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-rewrites', () => { - const test = setup() +test('client-rewrites', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-rewrites navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx b/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx index a80de580fb..31f1d07650 100644 --- a/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx @@ -1,11 +1,13 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' import { basepath, localeRewrite } from '../../shared' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, basepath, rewrite: localeRewrite, scrollRestoration: true, @@ -23,8 +25,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts index 41613c2ad4..c9e99b7d60 100644 --- a/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav rewrites (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts index c10b8723bb..e96aff39eb 100644 --- a/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-rewrites', () => { - const test = setup() +test('client-rewrites', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-rewrites navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/src/main.tsx b/benchmarks/client-nav/scenarios/rewrites/vue/src/main.tsx index 83e430038d..6695e82dbb 100644 --- a/benchmarks/client-nav/scenarios/rewrites/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/rewrites/vue/src/main.tsx @@ -1,11 +1,13 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' import { basepath, localeRewrite } from '../../shared' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, basepath, rewrite: localeRewrite, scrollRestoration: true, @@ -23,8 +25,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts index 39e22b6c3e..1a795a4e1d 100644 --- a/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav rewrites (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts index 50cc26d5d6..6f4b448775 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-route-tree-scale', () => { - const test = setup() +test('client-route-tree-scale', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-route-tree-scale navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/react/src/main.tsx b/benchmarks/client-nav/scenarios/route-tree-scale/react/src/main.tsx index ef0b99555c..5febd6f795 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/route-tree-scale/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts index 686907a506..0f588fda53 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav route-tree-scale (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts index 3d7a22a027..9244ef1350 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-route-tree-scale', () => { - const test = setup() +test('client-route-tree-scale', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-route-tree-scale navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx index 817045bd02..fa9d239418 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts index 20b4af6146..e6f3596562 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts @@ -9,68 +9,52 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as SecFRouteImport } from './routes/sec-f' -import { Route as SecERouteImport } from './routes/sec-e' -import { Route as SecDRouteImport } from './routes/sec-d' -import { Route as SecCRouteImport } from './routes/sec-c' -import { Route as SecBRouteImport } from './routes/sec-b' -import { Route as SecARouteImport } from './routes/sec-a' -import { Route as LayoutRouteImport } from './routes/_layout' import { Route as IndexRouteImport } from './routes/index' -import { Route as SecFIndexRouteImport } from './routes/sec-f.index' -import { Route as SecEIndexRouteImport } from './routes/sec-e.index' -import { Route as SecDIndexRouteImport } from './routes/sec-d.index' -import { Route as SecCIndexRouteImport } from './routes/sec-c.index' -import { Route as SecBIndexRouteImport } from './routes/sec-b.index' -import { Route as SecAIndexRouteImport } from './routes/sec-a.index' -import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings' -import { Route as SecFAboutRouteImport } from './routes/sec-f.about' -import { Route as SecFIdRouteImport } from './routes/sec-f.$id' -import { Route as SecESettingsRouteImport } from './routes/sec-e.settings' -import { Route as SecEAboutRouteImport } from './routes/sec-e.about' -import { Route as SecEIdRouteImport } from './routes/sec-e.$id' -import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings' -import { Route as SecDAboutRouteImport } from './routes/sec-d.about' -import { Route as SecDIdRouteImport } from './routes/sec-d.$id' -import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings' -import { Route as SecCAboutRouteImport } from './routes/sec-c.about' -import { Route as SecCIdRouteImport } from './routes/sec-c.$id' -import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings' -import { Route as SecBAboutRouteImport } from './routes/sec-b.about' -import { Route as SecBIdRouteImport } from './routes/sec-b.$id' -import { Route as SecASettingsRouteImport } from './routes/sec-a.settings' -import { Route as SecAAboutRouteImport } from './routes/sec-a.about' -import { Route as SecAIdRouteImport } from './routes/sec-a.$id' -import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}' -import { Route as FilesSplatRouteImport } from './routes/files.$' -import { Route as LayoutBetaRouteImport } from './routes/_layout.beta' -import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha' -import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo' +import { Route as LayoutRouteImport } from './routes/_layout' +import { Route as SecARouteImport } from './routes/sec-a' +import { Route as SecBRouteImport } from './routes/sec-b' +import { Route as SecCRouteImport } from './routes/sec-c' +import { Route as SecDRouteImport } from './routes/sec-d' +import { Route as SecERouteImport } from './routes/sec-e' +import { Route as SecFRouteImport } from './routes/sec-f' import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing' +import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo' +import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha' +import { Route as LayoutBetaRouteImport } from './routes/_layout.beta' +import { Route as FilesSplatRouteImport } from './routes/files.$' +import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}' +import { Route as SecAIndexRouteImport } from './routes/sec-a.index' +import { Route as SecAIdRouteImport } from './routes/sec-a.$id' +import { Route as SecAAboutRouteImport } from './routes/sec-a.about' +import { Route as SecASettingsRouteImport } from './routes/sec-a.settings' +import { Route as SecBIndexRouteImport } from './routes/sec-b.index' +import { Route as SecBIdRouteImport } from './routes/sec-b.$id' +import { Route as SecBAboutRouteImport } from './routes/sec-b.about' +import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings' +import { Route as SecCIndexRouteImport } from './routes/sec-c.index' +import { Route as SecCIdRouteImport } from './routes/sec-c.$id' +import { Route as SecCAboutRouteImport } from './routes/sec-c.about' +import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings' +import { Route as SecDIndexRouteImport } from './routes/sec-d.index' +import { Route as SecDIdRouteImport } from './routes/sec-d.$id' +import { Route as SecDAboutRouteImport } from './routes/sec-d.about' +import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings' +import { Route as SecEIndexRouteImport } from './routes/sec-e.index' +import { Route as SecEIdRouteImport } from './routes/sec-e.$id' +import { Route as SecEAboutRouteImport } from './routes/sec-e.about' +import { Route as SecESettingsRouteImport } from './routes/sec-e.settings' +import { Route as SecFIndexRouteImport } from './routes/sec-f.index' +import { Route as SecFIdRouteImport } from './routes/sec-f.$id' +import { Route as SecFAboutRouteImport } from './routes/sec-f.about' +import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings' -const SecFRoute = SecFRouteImport.update({ - id: '/sec-f', - path: '/sec-f', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) -const SecERoute = SecERouteImport.update({ - id: '/sec-e', - path: '/sec-e', - getParentRoute: () => rootRouteImport, -} as any) -const SecDRoute = SecDRouteImport.update({ - id: '/sec-d', - path: '/sec-d', - getParentRoute: () => rootRouteImport, -} as any) -const SecCRoute = SecCRouteImport.update({ - id: '/sec-c', - path: '/sec-c', - getParentRoute: () => rootRouteImport, -} as any) -const SecBRoute = SecBRouteImport.update({ - id: '/sec-b', - path: '/sec-b', +const LayoutRoute = LayoutRouteImport.update({ + id: '/_layout', getParentRoute: () => rootRouteImport, } as any) const SecARoute = SecARouteImport.update({ @@ -78,134 +62,55 @@ const SecARoute = SecARouteImport.update({ path: '/sec-a', getParentRoute: () => rootRouteImport, } as any) -const LayoutRoute = LayoutRouteImport.update({ - id: '/_layout', +const SecBRoute = SecBRouteImport.update({ + id: '/sec-b', + path: '/sec-b', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const SecCRoute = SecCRouteImport.update({ + id: '/sec-c', + path: '/sec-c', getParentRoute: () => rootRouteImport, } as any) -const SecFIndexRoute = SecFIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecFRoute, +const SecDRoute = SecDRouteImport.update({ + id: '/sec-d', + path: '/sec-d', + getParentRoute: () => rootRouteImport, } as any) -const SecEIndexRoute = SecEIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecERoute, +const SecERoute = SecERouteImport.update({ + id: '/sec-e', + path: '/sec-e', + getParentRoute: () => rootRouteImport, } as any) -const SecDIndexRoute = SecDIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecDRoute, +const SecFRoute = SecFRouteImport.update({ + id: '/sec-f', + path: '/sec-f', + getParentRoute: () => rootRouteImport, } as any) -const SecCIndexRoute = SecCIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecCRoute, +const marketingPricingRoute = marketingPricingRouteImport.update({ + id: '/(marketing)/pricing', + path: '/pricing', + getParentRoute: () => rootRouteImport, } as any) -const SecBIndexRoute = SecBIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecBRoute, +const marketingPromoRoute = marketingPromoRouteImport.update({ + id: '/(marketing)/promo', + path: '/promo', + getParentRoute: () => rootRouteImport, } as any) -const SecAIndexRoute = SecAIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecARoute, +const LayoutAlphaRoute = LayoutAlphaRouteImport.update({ + id: '/alpha', + path: '/alpha', + getParentRoute: () => LayoutRoute, } as any) -const SecFSettingsRoute = SecFSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecFRoute, +const LayoutBetaRoute = LayoutBetaRouteImport.update({ + id: '/beta', + path: '/beta', + getParentRoute: () => LayoutRoute, } as any) -const SecFAboutRoute = SecFAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecFRoute, -} as any) -const SecFIdRoute = SecFIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecFRoute, -} as any) -const SecESettingsRoute = SecESettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecERoute, -} as any) -const SecEAboutRoute = SecEAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecERoute, -} as any) -const SecEIdRoute = SecEIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecERoute, -} as any) -const SecDSettingsRoute = SecDSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecDRoute, -} as any) -const SecDAboutRoute = SecDAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecDRoute, -} as any) -const SecDIdRoute = SecDIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecDRoute, -} as any) -const SecCSettingsRoute = SecCSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecCRoute, -} as any) -const SecCAboutRoute = SecCAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecCRoute, -} as any) -const SecCIdRoute = SecCIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecCRoute, -} as any) -const SecBSettingsRoute = SecBSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecBRoute, -} as any) -const SecBAboutRoute = SecBAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecBRoute, -} as any) -const SecBIdRoute = SecBIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecBRoute, -} as any) -const SecASettingsRoute = SecASettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecARoute, -} as any) -const SecAAboutRoute = SecAAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecARoute, -} as any) -const SecAIdRoute = SecAIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecARoute, +const FilesSplatRoute = FilesSplatRouteImport.update({ + id: '/files/$', + path: '/files/$', + getParentRoute: () => rootRouteImport, } as any) const ReleaseVChar123versionChar125Route = ReleaseVChar123versionChar125RouteImport.update({ @@ -213,30 +118,125 @@ const ReleaseVChar123versionChar125Route = path: '/release/v{$version}', getParentRoute: () => rootRouteImport, } as any) -const FilesSplatRoute = FilesSplatRouteImport.update({ - id: '/files/$', - path: '/files/$', - getParentRoute: () => rootRouteImport, +const SecAIndexRoute = SecAIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecARoute, } as any) -const LayoutBetaRoute = LayoutBetaRouteImport.update({ - id: '/beta', - path: '/beta', - getParentRoute: () => LayoutRoute, +const SecAIdRoute = SecAIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecARoute, } as any) -const LayoutAlphaRoute = LayoutAlphaRouteImport.update({ - id: '/alpha', - path: '/alpha', - getParentRoute: () => LayoutRoute, +const SecAAboutRoute = SecAAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecARoute, } as any) -const marketingPromoRoute = marketingPromoRouteImport.update({ - id: '/(marketing)/promo', - path: '/promo', - getParentRoute: () => rootRouteImport, +const SecASettingsRoute = SecASettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecARoute, } as any) -const marketingPricingRoute = marketingPricingRouteImport.update({ - id: '/(marketing)/pricing', - path: '/pricing', - getParentRoute: () => rootRouteImport, +const SecBIndexRoute = SecBIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecBRoute, +} as any) +const SecBIdRoute = SecBIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecBRoute, +} as any) +const SecBAboutRoute = SecBAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecBRoute, +} as any) +const SecBSettingsRoute = SecBSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecBRoute, +} as any) +const SecCIndexRoute = SecCIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecCRoute, +} as any) +const SecCIdRoute = SecCIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecCRoute, +} as any) +const SecCAboutRoute = SecCAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecCRoute, +} as any) +const SecCSettingsRoute = SecCSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecCRoute, +} as any) +const SecDIndexRoute = SecDIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecDRoute, +} as any) +const SecDIdRoute = SecDIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecDRoute, +} as any) +const SecDAboutRoute = SecDAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecDRoute, +} as any) +const SecDSettingsRoute = SecDSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecDRoute, +} as any) +const SecEIndexRoute = SecEIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecERoute, +} as any) +const SecEIdRoute = SecEIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecERoute, +} as any) +const SecEAboutRoute = SecEAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecERoute, +} as any) +const SecESettingsRoute = SecESettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecERoute, +} as any) +const SecFIndexRoute = SecFIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecFRoute, +} as any) +const SecFIdRoute = SecFIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecFRoute, +} as any) +const SecFAboutRoute = SecFAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecFRoute, +} as any) +const SecFSettingsRoute = SecFSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecFRoute, } as any) export interface FileRoutesByFullPath { @@ -484,46 +484,11 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/sec-f': { - id: '/sec-f' - path: '/sec-f' - fullPath: '/sec-f' - preLoaderRoute: typeof SecFRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-e': { - id: '/sec-e' - path: '/sec-e' - fullPath: '/sec-e' - preLoaderRoute: typeof SecERouteImport - parentRoute: typeof rootRouteImport - } - '/sec-d': { - id: '/sec-d' - path: '/sec-d' - fullPath: '/sec-d' - preLoaderRoute: typeof SecDRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-c': { - id: '/sec-c' - path: '/sec-c' - fullPath: '/sec-c' - preLoaderRoute: typeof SecCRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-b': { - id: '/sec-b' - path: '/sec-b' - fullPath: '/sec-b' - preLoaderRoute: typeof SecBRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-a': { - id: '/sec-a' - path: '/sec-a' - fullPath: '/sec-a' - preLoaderRoute: typeof SecARouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/_layout': { @@ -533,47 +498,89 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof LayoutRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/sec-a': { + id: '/sec-a' + path: '/sec-a' + fullPath: '/sec-a' + preLoaderRoute: typeof SecARouteImport parentRoute: typeof rootRouteImport } - '/sec-f/': { - id: '/sec-f/' - path: '/' - fullPath: '/sec-f/' - preLoaderRoute: typeof SecFIndexRouteImport - parentRoute: typeof SecFRoute + '/sec-b': { + id: '/sec-b' + path: '/sec-b' + fullPath: '/sec-b' + preLoaderRoute: typeof SecBRouteImport + parentRoute: typeof rootRouteImport } - '/sec-e/': { - id: '/sec-e/' - path: '/' - fullPath: '/sec-e/' - preLoaderRoute: typeof SecEIndexRouteImport - parentRoute: typeof SecERoute + '/sec-c': { + id: '/sec-c' + path: '/sec-c' + fullPath: '/sec-c' + preLoaderRoute: typeof SecCRouteImport + parentRoute: typeof rootRouteImport } - '/sec-d/': { - id: '/sec-d/' - path: '/' - fullPath: '/sec-d/' - preLoaderRoute: typeof SecDIndexRouteImport - parentRoute: typeof SecDRoute + '/sec-d': { + id: '/sec-d' + path: '/sec-d' + fullPath: '/sec-d' + preLoaderRoute: typeof SecDRouteImport + parentRoute: typeof rootRouteImport } - '/sec-c/': { - id: '/sec-c/' - path: '/' - fullPath: '/sec-c/' - preLoaderRoute: typeof SecCIndexRouteImport - parentRoute: typeof SecCRoute + '/sec-e': { + id: '/sec-e' + path: '/sec-e' + fullPath: '/sec-e' + preLoaderRoute: typeof SecERouteImport + parentRoute: typeof rootRouteImport } - '/sec-b/': { - id: '/sec-b/' - path: '/' - fullPath: '/sec-b/' - preLoaderRoute: typeof SecBIndexRouteImport - parentRoute: typeof SecBRoute + '/sec-f': { + id: '/sec-f' + path: '/sec-f' + fullPath: '/sec-f' + preLoaderRoute: typeof SecFRouteImport + parentRoute: typeof rootRouteImport + } + '/(marketing)/pricing': { + id: '/(marketing)/pricing' + path: '/pricing' + fullPath: '/pricing' + preLoaderRoute: typeof marketingPricingRouteImport + parentRoute: typeof rootRouteImport + } + '/(marketing)/promo': { + id: '/(marketing)/promo' + path: '/promo' + fullPath: '/promo' + preLoaderRoute: typeof marketingPromoRouteImport + parentRoute: typeof rootRouteImport + } + '/_layout/alpha': { + id: '/_layout/alpha' + path: '/alpha' + fullPath: '/alpha' + preLoaderRoute: typeof LayoutAlphaRouteImport + parentRoute: typeof LayoutRoute + } + '/_layout/beta': { + id: '/_layout/beta' + path: '/beta' + fullPath: '/beta' + preLoaderRoute: typeof LayoutBetaRouteImport + parentRoute: typeof LayoutRoute + } + '/files/$': { + id: '/files/$' + path: '/files/$' + fullPath: '/files/$' + preLoaderRoute: typeof FilesSplatRouteImport + parentRoute: typeof rootRouteImport + } + '/release/v{$version}': { + id: '/release/v{$version}' + path: '/release/v{$version}' + fullPath: '/release/v{$version}' + preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport + parentRoute: typeof rootRouteImport } '/sec-a/': { id: '/sec-a/' @@ -582,125 +589,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof SecAIndexRouteImport parentRoute: typeof SecARoute } - '/sec-f/settings': { - id: '/sec-f/settings' - path: '/settings' - fullPath: '/sec-f/settings' - preLoaderRoute: typeof SecFSettingsRouteImport - parentRoute: typeof SecFRoute - } - '/sec-f/about': { - id: '/sec-f/about' - path: '/about' - fullPath: '/sec-f/about' - preLoaderRoute: typeof SecFAboutRouteImport - parentRoute: typeof SecFRoute - } - '/sec-f/$id': { - id: '/sec-f/$id' - path: '/$id' - fullPath: '/sec-f/$id' - preLoaderRoute: typeof SecFIdRouteImport - parentRoute: typeof SecFRoute - } - '/sec-e/settings': { - id: '/sec-e/settings' - path: '/settings' - fullPath: '/sec-e/settings' - preLoaderRoute: typeof SecESettingsRouteImport - parentRoute: typeof SecERoute - } - '/sec-e/about': { - id: '/sec-e/about' - path: '/about' - fullPath: '/sec-e/about' - preLoaderRoute: typeof SecEAboutRouteImport - parentRoute: typeof SecERoute - } - '/sec-e/$id': { - id: '/sec-e/$id' - path: '/$id' - fullPath: '/sec-e/$id' - preLoaderRoute: typeof SecEIdRouteImport - parentRoute: typeof SecERoute - } - '/sec-d/settings': { - id: '/sec-d/settings' - path: '/settings' - fullPath: '/sec-d/settings' - preLoaderRoute: typeof SecDSettingsRouteImport - parentRoute: typeof SecDRoute - } - '/sec-d/about': { - id: '/sec-d/about' - path: '/about' - fullPath: '/sec-d/about' - preLoaderRoute: typeof SecDAboutRouteImport - parentRoute: typeof SecDRoute - } - '/sec-d/$id': { - id: '/sec-d/$id' - path: '/$id' - fullPath: '/sec-d/$id' - preLoaderRoute: typeof SecDIdRouteImport - parentRoute: typeof SecDRoute - } - '/sec-c/settings': { - id: '/sec-c/settings' - path: '/settings' - fullPath: '/sec-c/settings' - preLoaderRoute: typeof SecCSettingsRouteImport - parentRoute: typeof SecCRoute - } - '/sec-c/about': { - id: '/sec-c/about' - path: '/about' - fullPath: '/sec-c/about' - preLoaderRoute: typeof SecCAboutRouteImport - parentRoute: typeof SecCRoute - } - '/sec-c/$id': { - id: '/sec-c/$id' - path: '/$id' - fullPath: '/sec-c/$id' - preLoaderRoute: typeof SecCIdRouteImport - parentRoute: typeof SecCRoute - } - '/sec-b/settings': { - id: '/sec-b/settings' - path: '/settings' - fullPath: '/sec-b/settings' - preLoaderRoute: typeof SecBSettingsRouteImport - parentRoute: typeof SecBRoute - } - '/sec-b/about': { - id: '/sec-b/about' - path: '/about' - fullPath: '/sec-b/about' - preLoaderRoute: typeof SecBAboutRouteImport - parentRoute: typeof SecBRoute - } - '/sec-b/$id': { - id: '/sec-b/$id' - path: '/$id' - fullPath: '/sec-b/$id' - preLoaderRoute: typeof SecBIdRouteImport - parentRoute: typeof SecBRoute - } - '/sec-a/settings': { - id: '/sec-a/settings' - path: '/settings' - fullPath: '/sec-a/settings' - preLoaderRoute: typeof SecASettingsRouteImport - parentRoute: typeof SecARoute - } - '/sec-a/about': { - id: '/sec-a/about' - path: '/about' - fullPath: '/sec-a/about' - preLoaderRoute: typeof SecAAboutRouteImport - parentRoute: typeof SecARoute - } '/sec-a/$id': { id: '/sec-a/$id' path: '/$id' @@ -708,47 +596,159 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof SecAIdRouteImport parentRoute: typeof SecARoute } - '/release/v{$version}': { - id: '/release/v{$version}' - path: '/release/v{$version}' - fullPath: '/release/v{$version}' - preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport - parentRoute: typeof rootRouteImport + '/sec-a/about': { + id: '/sec-a/about' + path: '/about' + fullPath: '/sec-a/about' + preLoaderRoute: typeof SecAAboutRouteImport + parentRoute: typeof SecARoute } - '/files/$': { - id: '/files/$' - path: '/files/$' - fullPath: '/files/$' - preLoaderRoute: typeof FilesSplatRouteImport - parentRoute: typeof rootRouteImport + '/sec-a/settings': { + id: '/sec-a/settings' + path: '/settings' + fullPath: '/sec-a/settings' + preLoaderRoute: typeof SecASettingsRouteImport + parentRoute: typeof SecARoute } - '/_layout/beta': { - id: '/_layout/beta' - path: '/beta' - fullPath: '/beta' - preLoaderRoute: typeof LayoutBetaRouteImport - parentRoute: typeof LayoutRoute + '/sec-b/': { + id: '/sec-b/' + path: '/' + fullPath: '/sec-b/' + preLoaderRoute: typeof SecBIndexRouteImport + parentRoute: typeof SecBRoute } - '/_layout/alpha': { - id: '/_layout/alpha' - path: '/alpha' - fullPath: '/alpha' - preLoaderRoute: typeof LayoutAlphaRouteImport - parentRoute: typeof LayoutRoute + '/sec-b/$id': { + id: '/sec-b/$id' + path: '/$id' + fullPath: '/sec-b/$id' + preLoaderRoute: typeof SecBIdRouteImport + parentRoute: typeof SecBRoute } - '/(marketing)/promo': { - id: '/(marketing)/promo' - path: '/promo' - fullPath: '/promo' - preLoaderRoute: typeof marketingPromoRouteImport - parentRoute: typeof rootRouteImport + '/sec-b/about': { + id: '/sec-b/about' + path: '/about' + fullPath: '/sec-b/about' + preLoaderRoute: typeof SecBAboutRouteImport + parentRoute: typeof SecBRoute } - '/(marketing)/pricing': { - id: '/(marketing)/pricing' - path: '/pricing' - fullPath: '/pricing' - preLoaderRoute: typeof marketingPricingRouteImport - parentRoute: typeof rootRouteImport + '/sec-b/settings': { + id: '/sec-b/settings' + path: '/settings' + fullPath: '/sec-b/settings' + preLoaderRoute: typeof SecBSettingsRouteImport + parentRoute: typeof SecBRoute + } + '/sec-c/': { + id: '/sec-c/' + path: '/' + fullPath: '/sec-c/' + preLoaderRoute: typeof SecCIndexRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/$id': { + id: '/sec-c/$id' + path: '/$id' + fullPath: '/sec-c/$id' + preLoaderRoute: typeof SecCIdRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/about': { + id: '/sec-c/about' + path: '/about' + fullPath: '/sec-c/about' + preLoaderRoute: typeof SecCAboutRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/settings': { + id: '/sec-c/settings' + path: '/settings' + fullPath: '/sec-c/settings' + preLoaderRoute: typeof SecCSettingsRouteImport + parentRoute: typeof SecCRoute + } + '/sec-d/': { + id: '/sec-d/' + path: '/' + fullPath: '/sec-d/' + preLoaderRoute: typeof SecDIndexRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/$id': { + id: '/sec-d/$id' + path: '/$id' + fullPath: '/sec-d/$id' + preLoaderRoute: typeof SecDIdRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/about': { + id: '/sec-d/about' + path: '/about' + fullPath: '/sec-d/about' + preLoaderRoute: typeof SecDAboutRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/settings': { + id: '/sec-d/settings' + path: '/settings' + fullPath: '/sec-d/settings' + preLoaderRoute: typeof SecDSettingsRouteImport + parentRoute: typeof SecDRoute + } + '/sec-e/': { + id: '/sec-e/' + path: '/' + fullPath: '/sec-e/' + preLoaderRoute: typeof SecEIndexRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/$id': { + id: '/sec-e/$id' + path: '/$id' + fullPath: '/sec-e/$id' + preLoaderRoute: typeof SecEIdRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/about': { + id: '/sec-e/about' + path: '/about' + fullPath: '/sec-e/about' + preLoaderRoute: typeof SecEAboutRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/settings': { + id: '/sec-e/settings' + path: '/settings' + fullPath: '/sec-e/settings' + preLoaderRoute: typeof SecESettingsRouteImport + parentRoute: typeof SecERoute + } + '/sec-f/': { + id: '/sec-f/' + path: '/' + fullPath: '/sec-f/' + preLoaderRoute: typeof SecFIndexRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/$id': { + id: '/sec-f/$id' + path: '/$id' + fullPath: '/sec-f/$id' + preLoaderRoute: typeof SecFIdRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/about': { + id: '/sec-f/about' + path: '/about' + fullPath: '/sec-f/about' + preLoaderRoute: typeof SecFAboutRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/settings': { + id: '/sec-f/settings' + path: '/settings' + fullPath: '/sec-f/settings' + preLoaderRoute: typeof SecFSettingsRouteImport + parentRoute: typeof SecFRoute } } } diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts index dd0bd234e0..542ede131b 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -38,6 +39,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav route-tree-scale (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts index a767b8d220..331e8e008f 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-route-tree-scale', () => { - const test = setup() +test('client-route-tree-scale', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-route-tree-scale navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/main.tsx b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/main.tsx index c96d3f3a2e..cae9b54f1d 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -20,8 +22,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts index a03c051a79..a12f981bb4 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts @@ -9,68 +9,52 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as SecFRouteImport } from './routes/sec-f' -import { Route as SecERouteImport } from './routes/sec-e' -import { Route as SecDRouteImport } from './routes/sec-d' -import { Route as SecCRouteImport } from './routes/sec-c' -import { Route as SecBRouteImport } from './routes/sec-b' -import { Route as SecARouteImport } from './routes/sec-a' -import { Route as LayoutRouteImport } from './routes/_layout' import { Route as IndexRouteImport } from './routes/index' -import { Route as SecFIndexRouteImport } from './routes/sec-f.index' -import { Route as SecEIndexRouteImport } from './routes/sec-e.index' -import { Route as SecDIndexRouteImport } from './routes/sec-d.index' -import { Route as SecCIndexRouteImport } from './routes/sec-c.index' -import { Route as SecBIndexRouteImport } from './routes/sec-b.index' -import { Route as SecAIndexRouteImport } from './routes/sec-a.index' -import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings' -import { Route as SecFAboutRouteImport } from './routes/sec-f.about' -import { Route as SecFIdRouteImport } from './routes/sec-f.$id' -import { Route as SecESettingsRouteImport } from './routes/sec-e.settings' -import { Route as SecEAboutRouteImport } from './routes/sec-e.about' -import { Route as SecEIdRouteImport } from './routes/sec-e.$id' -import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings' -import { Route as SecDAboutRouteImport } from './routes/sec-d.about' -import { Route as SecDIdRouteImport } from './routes/sec-d.$id' -import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings' -import { Route as SecCAboutRouteImport } from './routes/sec-c.about' -import { Route as SecCIdRouteImport } from './routes/sec-c.$id' -import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings' -import { Route as SecBAboutRouteImport } from './routes/sec-b.about' -import { Route as SecBIdRouteImport } from './routes/sec-b.$id' -import { Route as SecASettingsRouteImport } from './routes/sec-a.settings' -import { Route as SecAAboutRouteImport } from './routes/sec-a.about' -import { Route as SecAIdRouteImport } from './routes/sec-a.$id' -import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}' -import { Route as FilesSplatRouteImport } from './routes/files.$' -import { Route as LayoutBetaRouteImport } from './routes/_layout.beta' -import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha' -import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo' +import { Route as LayoutRouteImport } from './routes/_layout' +import { Route as SecARouteImport } from './routes/sec-a' +import { Route as SecBRouteImport } from './routes/sec-b' +import { Route as SecCRouteImport } from './routes/sec-c' +import { Route as SecDRouteImport } from './routes/sec-d' +import { Route as SecERouteImport } from './routes/sec-e' +import { Route as SecFRouteImport } from './routes/sec-f' import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing' +import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo' +import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha' +import { Route as LayoutBetaRouteImport } from './routes/_layout.beta' +import { Route as FilesSplatRouteImport } from './routes/files.$' +import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}' +import { Route as SecAIndexRouteImport } from './routes/sec-a.index' +import { Route as SecAIdRouteImport } from './routes/sec-a.$id' +import { Route as SecAAboutRouteImport } from './routes/sec-a.about' +import { Route as SecASettingsRouteImport } from './routes/sec-a.settings' +import { Route as SecBIndexRouteImport } from './routes/sec-b.index' +import { Route as SecBIdRouteImport } from './routes/sec-b.$id' +import { Route as SecBAboutRouteImport } from './routes/sec-b.about' +import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings' +import { Route as SecCIndexRouteImport } from './routes/sec-c.index' +import { Route as SecCIdRouteImport } from './routes/sec-c.$id' +import { Route as SecCAboutRouteImport } from './routes/sec-c.about' +import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings' +import { Route as SecDIndexRouteImport } from './routes/sec-d.index' +import { Route as SecDIdRouteImport } from './routes/sec-d.$id' +import { Route as SecDAboutRouteImport } from './routes/sec-d.about' +import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings' +import { Route as SecEIndexRouteImport } from './routes/sec-e.index' +import { Route as SecEIdRouteImport } from './routes/sec-e.$id' +import { Route as SecEAboutRouteImport } from './routes/sec-e.about' +import { Route as SecESettingsRouteImport } from './routes/sec-e.settings' +import { Route as SecFIndexRouteImport } from './routes/sec-f.index' +import { Route as SecFIdRouteImport } from './routes/sec-f.$id' +import { Route as SecFAboutRouteImport } from './routes/sec-f.about' +import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings' -const SecFRoute = SecFRouteImport.update({ - id: '/sec-f', - path: '/sec-f', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) -const SecERoute = SecERouteImport.update({ - id: '/sec-e', - path: '/sec-e', - getParentRoute: () => rootRouteImport, -} as any) -const SecDRoute = SecDRouteImport.update({ - id: '/sec-d', - path: '/sec-d', - getParentRoute: () => rootRouteImport, -} as any) -const SecCRoute = SecCRouteImport.update({ - id: '/sec-c', - path: '/sec-c', - getParentRoute: () => rootRouteImport, -} as any) -const SecBRoute = SecBRouteImport.update({ - id: '/sec-b', - path: '/sec-b', +const LayoutRoute = LayoutRouteImport.update({ + id: '/_layout', getParentRoute: () => rootRouteImport, } as any) const SecARoute = SecARouteImport.update({ @@ -78,134 +62,55 @@ const SecARoute = SecARouteImport.update({ path: '/sec-a', getParentRoute: () => rootRouteImport, } as any) -const LayoutRoute = LayoutRouteImport.update({ - id: '/_layout', +const SecBRoute = SecBRouteImport.update({ + id: '/sec-b', + path: '/sec-b', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const SecCRoute = SecCRouteImport.update({ + id: '/sec-c', + path: '/sec-c', getParentRoute: () => rootRouteImport, } as any) -const SecFIndexRoute = SecFIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecFRoute, +const SecDRoute = SecDRouteImport.update({ + id: '/sec-d', + path: '/sec-d', + getParentRoute: () => rootRouteImport, } as any) -const SecEIndexRoute = SecEIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecERoute, +const SecERoute = SecERouteImport.update({ + id: '/sec-e', + path: '/sec-e', + getParentRoute: () => rootRouteImport, } as any) -const SecDIndexRoute = SecDIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecDRoute, +const SecFRoute = SecFRouteImport.update({ + id: '/sec-f', + path: '/sec-f', + getParentRoute: () => rootRouteImport, } as any) -const SecCIndexRoute = SecCIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecCRoute, +const marketingPricingRoute = marketingPricingRouteImport.update({ + id: '/(marketing)/pricing', + path: '/pricing', + getParentRoute: () => rootRouteImport, } as any) -const SecBIndexRoute = SecBIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecBRoute, +const marketingPromoRoute = marketingPromoRouteImport.update({ + id: '/(marketing)/promo', + path: '/promo', + getParentRoute: () => rootRouteImport, } as any) -const SecAIndexRoute = SecAIndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => SecARoute, +const LayoutAlphaRoute = LayoutAlphaRouteImport.update({ + id: '/alpha', + path: '/alpha', + getParentRoute: () => LayoutRoute, } as any) -const SecFSettingsRoute = SecFSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecFRoute, +const LayoutBetaRoute = LayoutBetaRouteImport.update({ + id: '/beta', + path: '/beta', + getParentRoute: () => LayoutRoute, } as any) -const SecFAboutRoute = SecFAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecFRoute, -} as any) -const SecFIdRoute = SecFIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecFRoute, -} as any) -const SecESettingsRoute = SecESettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecERoute, -} as any) -const SecEAboutRoute = SecEAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecERoute, -} as any) -const SecEIdRoute = SecEIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecERoute, -} as any) -const SecDSettingsRoute = SecDSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecDRoute, -} as any) -const SecDAboutRoute = SecDAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecDRoute, -} as any) -const SecDIdRoute = SecDIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecDRoute, -} as any) -const SecCSettingsRoute = SecCSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecCRoute, -} as any) -const SecCAboutRoute = SecCAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecCRoute, -} as any) -const SecCIdRoute = SecCIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecCRoute, -} as any) -const SecBSettingsRoute = SecBSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecBRoute, -} as any) -const SecBAboutRoute = SecBAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecBRoute, -} as any) -const SecBIdRoute = SecBIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecBRoute, -} as any) -const SecASettingsRoute = SecASettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => SecARoute, -} as any) -const SecAAboutRoute = SecAAboutRouteImport.update({ - id: '/about', - path: '/about', - getParentRoute: () => SecARoute, -} as any) -const SecAIdRoute = SecAIdRouteImport.update({ - id: '/$id', - path: '/$id', - getParentRoute: () => SecARoute, +const FilesSplatRoute = FilesSplatRouteImport.update({ + id: '/files/$', + path: '/files/$', + getParentRoute: () => rootRouteImport, } as any) const ReleaseVChar123versionChar125Route = ReleaseVChar123versionChar125RouteImport.update({ @@ -213,30 +118,125 @@ const ReleaseVChar123versionChar125Route = path: '/release/v{$version}', getParentRoute: () => rootRouteImport, } as any) -const FilesSplatRoute = FilesSplatRouteImport.update({ - id: '/files/$', - path: '/files/$', - getParentRoute: () => rootRouteImport, +const SecAIndexRoute = SecAIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecARoute, } as any) -const LayoutBetaRoute = LayoutBetaRouteImport.update({ - id: '/beta', - path: '/beta', - getParentRoute: () => LayoutRoute, +const SecAIdRoute = SecAIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecARoute, } as any) -const LayoutAlphaRoute = LayoutAlphaRouteImport.update({ - id: '/alpha', - path: '/alpha', - getParentRoute: () => LayoutRoute, +const SecAAboutRoute = SecAAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecARoute, } as any) -const marketingPromoRoute = marketingPromoRouteImport.update({ - id: '/(marketing)/promo', - path: '/promo', - getParentRoute: () => rootRouteImport, +const SecASettingsRoute = SecASettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecARoute, } as any) -const marketingPricingRoute = marketingPricingRouteImport.update({ - id: '/(marketing)/pricing', - path: '/pricing', - getParentRoute: () => rootRouteImport, +const SecBIndexRoute = SecBIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecBRoute, +} as any) +const SecBIdRoute = SecBIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecBRoute, +} as any) +const SecBAboutRoute = SecBAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecBRoute, +} as any) +const SecBSettingsRoute = SecBSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecBRoute, +} as any) +const SecCIndexRoute = SecCIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecCRoute, +} as any) +const SecCIdRoute = SecCIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecCRoute, +} as any) +const SecCAboutRoute = SecCAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecCRoute, +} as any) +const SecCSettingsRoute = SecCSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecCRoute, +} as any) +const SecDIndexRoute = SecDIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecDRoute, +} as any) +const SecDIdRoute = SecDIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecDRoute, +} as any) +const SecDAboutRoute = SecDAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecDRoute, +} as any) +const SecDSettingsRoute = SecDSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecDRoute, +} as any) +const SecEIndexRoute = SecEIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecERoute, +} as any) +const SecEIdRoute = SecEIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecERoute, +} as any) +const SecEAboutRoute = SecEAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecERoute, +} as any) +const SecESettingsRoute = SecESettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecERoute, +} as any) +const SecFIndexRoute = SecFIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => SecFRoute, +} as any) +const SecFIdRoute = SecFIdRouteImport.update({ + id: '/$id', + path: '/$id', + getParentRoute: () => SecFRoute, +} as any) +const SecFAboutRoute = SecFAboutRouteImport.update({ + id: '/about', + path: '/about', + getParentRoute: () => SecFRoute, +} as any) +const SecFSettingsRoute = SecFSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => SecFRoute, } as any) export interface FileRoutesByFullPath { @@ -484,46 +484,11 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/sec-f': { - id: '/sec-f' - path: '/sec-f' - fullPath: '/sec-f' - preLoaderRoute: typeof SecFRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-e': { - id: '/sec-e' - path: '/sec-e' - fullPath: '/sec-e' - preLoaderRoute: typeof SecERouteImport - parentRoute: typeof rootRouteImport - } - '/sec-d': { - id: '/sec-d' - path: '/sec-d' - fullPath: '/sec-d' - preLoaderRoute: typeof SecDRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-c': { - id: '/sec-c' - path: '/sec-c' - fullPath: '/sec-c' - preLoaderRoute: typeof SecCRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-b': { - id: '/sec-b' - path: '/sec-b' - fullPath: '/sec-b' - preLoaderRoute: typeof SecBRouteImport - parentRoute: typeof rootRouteImport - } - '/sec-a': { - id: '/sec-a' - path: '/sec-a' - fullPath: '/sec-a' - preLoaderRoute: typeof SecARouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/_layout': { @@ -533,47 +498,89 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof LayoutRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/sec-a': { + id: '/sec-a' + path: '/sec-a' + fullPath: '/sec-a' + preLoaderRoute: typeof SecARouteImport parentRoute: typeof rootRouteImport } - '/sec-f/': { - id: '/sec-f/' - path: '/' - fullPath: '/sec-f/' - preLoaderRoute: typeof SecFIndexRouteImport - parentRoute: typeof SecFRoute + '/sec-b': { + id: '/sec-b' + path: '/sec-b' + fullPath: '/sec-b' + preLoaderRoute: typeof SecBRouteImport + parentRoute: typeof rootRouteImport } - '/sec-e/': { - id: '/sec-e/' - path: '/' - fullPath: '/sec-e/' - preLoaderRoute: typeof SecEIndexRouteImport - parentRoute: typeof SecERoute + '/sec-c': { + id: '/sec-c' + path: '/sec-c' + fullPath: '/sec-c' + preLoaderRoute: typeof SecCRouteImport + parentRoute: typeof rootRouteImport } - '/sec-d/': { - id: '/sec-d/' - path: '/' - fullPath: '/sec-d/' - preLoaderRoute: typeof SecDIndexRouteImport - parentRoute: typeof SecDRoute + '/sec-d': { + id: '/sec-d' + path: '/sec-d' + fullPath: '/sec-d' + preLoaderRoute: typeof SecDRouteImport + parentRoute: typeof rootRouteImport } - '/sec-c/': { - id: '/sec-c/' - path: '/' - fullPath: '/sec-c/' - preLoaderRoute: typeof SecCIndexRouteImport - parentRoute: typeof SecCRoute + '/sec-e': { + id: '/sec-e' + path: '/sec-e' + fullPath: '/sec-e' + preLoaderRoute: typeof SecERouteImport + parentRoute: typeof rootRouteImport } - '/sec-b/': { - id: '/sec-b/' - path: '/' - fullPath: '/sec-b/' - preLoaderRoute: typeof SecBIndexRouteImport - parentRoute: typeof SecBRoute + '/sec-f': { + id: '/sec-f' + path: '/sec-f' + fullPath: '/sec-f' + preLoaderRoute: typeof SecFRouteImport + parentRoute: typeof rootRouteImport + } + '/(marketing)/pricing': { + id: '/(marketing)/pricing' + path: '/pricing' + fullPath: '/pricing' + preLoaderRoute: typeof marketingPricingRouteImport + parentRoute: typeof rootRouteImport + } + '/(marketing)/promo': { + id: '/(marketing)/promo' + path: '/promo' + fullPath: '/promo' + preLoaderRoute: typeof marketingPromoRouteImport + parentRoute: typeof rootRouteImport + } + '/_layout/alpha': { + id: '/_layout/alpha' + path: '/alpha' + fullPath: '/alpha' + preLoaderRoute: typeof LayoutAlphaRouteImport + parentRoute: typeof LayoutRoute + } + '/_layout/beta': { + id: '/_layout/beta' + path: '/beta' + fullPath: '/beta' + preLoaderRoute: typeof LayoutBetaRouteImport + parentRoute: typeof LayoutRoute + } + '/files/$': { + id: '/files/$' + path: '/files/$' + fullPath: '/files/$' + preLoaderRoute: typeof FilesSplatRouteImport + parentRoute: typeof rootRouteImport + } + '/release/v{$version}': { + id: '/release/v{$version}' + path: '/release/v{$version}' + fullPath: '/release/v{$version}' + preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport + parentRoute: typeof rootRouteImport } '/sec-a/': { id: '/sec-a/' @@ -582,125 +589,6 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof SecAIndexRouteImport parentRoute: typeof SecARoute } - '/sec-f/settings': { - id: '/sec-f/settings' - path: '/settings' - fullPath: '/sec-f/settings' - preLoaderRoute: typeof SecFSettingsRouteImport - parentRoute: typeof SecFRoute - } - '/sec-f/about': { - id: '/sec-f/about' - path: '/about' - fullPath: '/sec-f/about' - preLoaderRoute: typeof SecFAboutRouteImport - parentRoute: typeof SecFRoute - } - '/sec-f/$id': { - id: '/sec-f/$id' - path: '/$id' - fullPath: '/sec-f/$id' - preLoaderRoute: typeof SecFIdRouteImport - parentRoute: typeof SecFRoute - } - '/sec-e/settings': { - id: '/sec-e/settings' - path: '/settings' - fullPath: '/sec-e/settings' - preLoaderRoute: typeof SecESettingsRouteImport - parentRoute: typeof SecERoute - } - '/sec-e/about': { - id: '/sec-e/about' - path: '/about' - fullPath: '/sec-e/about' - preLoaderRoute: typeof SecEAboutRouteImport - parentRoute: typeof SecERoute - } - '/sec-e/$id': { - id: '/sec-e/$id' - path: '/$id' - fullPath: '/sec-e/$id' - preLoaderRoute: typeof SecEIdRouteImport - parentRoute: typeof SecERoute - } - '/sec-d/settings': { - id: '/sec-d/settings' - path: '/settings' - fullPath: '/sec-d/settings' - preLoaderRoute: typeof SecDSettingsRouteImport - parentRoute: typeof SecDRoute - } - '/sec-d/about': { - id: '/sec-d/about' - path: '/about' - fullPath: '/sec-d/about' - preLoaderRoute: typeof SecDAboutRouteImport - parentRoute: typeof SecDRoute - } - '/sec-d/$id': { - id: '/sec-d/$id' - path: '/$id' - fullPath: '/sec-d/$id' - preLoaderRoute: typeof SecDIdRouteImport - parentRoute: typeof SecDRoute - } - '/sec-c/settings': { - id: '/sec-c/settings' - path: '/settings' - fullPath: '/sec-c/settings' - preLoaderRoute: typeof SecCSettingsRouteImport - parentRoute: typeof SecCRoute - } - '/sec-c/about': { - id: '/sec-c/about' - path: '/about' - fullPath: '/sec-c/about' - preLoaderRoute: typeof SecCAboutRouteImport - parentRoute: typeof SecCRoute - } - '/sec-c/$id': { - id: '/sec-c/$id' - path: '/$id' - fullPath: '/sec-c/$id' - preLoaderRoute: typeof SecCIdRouteImport - parentRoute: typeof SecCRoute - } - '/sec-b/settings': { - id: '/sec-b/settings' - path: '/settings' - fullPath: '/sec-b/settings' - preLoaderRoute: typeof SecBSettingsRouteImport - parentRoute: typeof SecBRoute - } - '/sec-b/about': { - id: '/sec-b/about' - path: '/about' - fullPath: '/sec-b/about' - preLoaderRoute: typeof SecBAboutRouteImport - parentRoute: typeof SecBRoute - } - '/sec-b/$id': { - id: '/sec-b/$id' - path: '/$id' - fullPath: '/sec-b/$id' - preLoaderRoute: typeof SecBIdRouteImport - parentRoute: typeof SecBRoute - } - '/sec-a/settings': { - id: '/sec-a/settings' - path: '/settings' - fullPath: '/sec-a/settings' - preLoaderRoute: typeof SecASettingsRouteImport - parentRoute: typeof SecARoute - } - '/sec-a/about': { - id: '/sec-a/about' - path: '/about' - fullPath: '/sec-a/about' - preLoaderRoute: typeof SecAAboutRouteImport - parentRoute: typeof SecARoute - } '/sec-a/$id': { id: '/sec-a/$id' path: '/$id' @@ -708,47 +596,159 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof SecAIdRouteImport parentRoute: typeof SecARoute } - '/release/v{$version}': { - id: '/release/v{$version}' - path: '/release/v{$version}' - fullPath: '/release/v{$version}' - preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport - parentRoute: typeof rootRouteImport + '/sec-a/about': { + id: '/sec-a/about' + path: '/about' + fullPath: '/sec-a/about' + preLoaderRoute: typeof SecAAboutRouteImport + parentRoute: typeof SecARoute } - '/files/$': { - id: '/files/$' - path: '/files/$' - fullPath: '/files/$' - preLoaderRoute: typeof FilesSplatRouteImport - parentRoute: typeof rootRouteImport + '/sec-a/settings': { + id: '/sec-a/settings' + path: '/settings' + fullPath: '/sec-a/settings' + preLoaderRoute: typeof SecASettingsRouteImport + parentRoute: typeof SecARoute } - '/_layout/beta': { - id: '/_layout/beta' - path: '/beta' - fullPath: '/beta' - preLoaderRoute: typeof LayoutBetaRouteImport - parentRoute: typeof LayoutRoute + '/sec-b/': { + id: '/sec-b/' + path: '/' + fullPath: '/sec-b/' + preLoaderRoute: typeof SecBIndexRouteImport + parentRoute: typeof SecBRoute } - '/_layout/alpha': { - id: '/_layout/alpha' - path: '/alpha' - fullPath: '/alpha' - preLoaderRoute: typeof LayoutAlphaRouteImport - parentRoute: typeof LayoutRoute + '/sec-b/$id': { + id: '/sec-b/$id' + path: '/$id' + fullPath: '/sec-b/$id' + preLoaderRoute: typeof SecBIdRouteImport + parentRoute: typeof SecBRoute } - '/(marketing)/promo': { - id: '/(marketing)/promo' - path: '/promo' - fullPath: '/promo' - preLoaderRoute: typeof marketingPromoRouteImport - parentRoute: typeof rootRouteImport + '/sec-b/about': { + id: '/sec-b/about' + path: '/about' + fullPath: '/sec-b/about' + preLoaderRoute: typeof SecBAboutRouteImport + parentRoute: typeof SecBRoute } - '/(marketing)/pricing': { - id: '/(marketing)/pricing' - path: '/pricing' - fullPath: '/pricing' - preLoaderRoute: typeof marketingPricingRouteImport - parentRoute: typeof rootRouteImport + '/sec-b/settings': { + id: '/sec-b/settings' + path: '/settings' + fullPath: '/sec-b/settings' + preLoaderRoute: typeof SecBSettingsRouteImport + parentRoute: typeof SecBRoute + } + '/sec-c/': { + id: '/sec-c/' + path: '/' + fullPath: '/sec-c/' + preLoaderRoute: typeof SecCIndexRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/$id': { + id: '/sec-c/$id' + path: '/$id' + fullPath: '/sec-c/$id' + preLoaderRoute: typeof SecCIdRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/about': { + id: '/sec-c/about' + path: '/about' + fullPath: '/sec-c/about' + preLoaderRoute: typeof SecCAboutRouteImport + parentRoute: typeof SecCRoute + } + '/sec-c/settings': { + id: '/sec-c/settings' + path: '/settings' + fullPath: '/sec-c/settings' + preLoaderRoute: typeof SecCSettingsRouteImport + parentRoute: typeof SecCRoute + } + '/sec-d/': { + id: '/sec-d/' + path: '/' + fullPath: '/sec-d/' + preLoaderRoute: typeof SecDIndexRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/$id': { + id: '/sec-d/$id' + path: '/$id' + fullPath: '/sec-d/$id' + preLoaderRoute: typeof SecDIdRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/about': { + id: '/sec-d/about' + path: '/about' + fullPath: '/sec-d/about' + preLoaderRoute: typeof SecDAboutRouteImport + parentRoute: typeof SecDRoute + } + '/sec-d/settings': { + id: '/sec-d/settings' + path: '/settings' + fullPath: '/sec-d/settings' + preLoaderRoute: typeof SecDSettingsRouteImport + parentRoute: typeof SecDRoute + } + '/sec-e/': { + id: '/sec-e/' + path: '/' + fullPath: '/sec-e/' + preLoaderRoute: typeof SecEIndexRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/$id': { + id: '/sec-e/$id' + path: '/$id' + fullPath: '/sec-e/$id' + preLoaderRoute: typeof SecEIdRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/about': { + id: '/sec-e/about' + path: '/about' + fullPath: '/sec-e/about' + preLoaderRoute: typeof SecEAboutRouteImport + parentRoute: typeof SecERoute + } + '/sec-e/settings': { + id: '/sec-e/settings' + path: '/settings' + fullPath: '/sec-e/settings' + preLoaderRoute: typeof SecESettingsRouteImport + parentRoute: typeof SecERoute + } + '/sec-f/': { + id: '/sec-f/' + path: '/' + fullPath: '/sec-f/' + preLoaderRoute: typeof SecFIndexRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/$id': { + id: '/sec-f/$id' + path: '/$id' + fullPath: '/sec-f/$id' + preLoaderRoute: typeof SecFIdRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/about': { + id: '/sec-f/about' + path: '/about' + fullPath: '/sec-f/about' + preLoaderRoute: typeof SecFAboutRouteImport + parentRoute: typeof SecFRoute + } + '/sec-f/settings': { + id: '/sec-f/settings' + path: '/settings' + fullPath: '/sec-f/settings' + preLoaderRoute: typeof SecFSettingsRouteImport + parentRoute: typeof SecFRoute } } } diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts index a547406198..189ba1de99 100644 --- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -37,6 +38,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav route-tree-scale (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts index c534611bd0..0b38f7bddb 100644 --- a/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-search-params', () => { - const test = setup() +test('client-search-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-search-params navigation loop (react)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/search-params/react/src/main.tsx b/benchmarks/client-nav/scenarios/search-params/react/src/main.tsx index a68ef7bbb2..b10d53554b 100644 --- a/benchmarks/client-nav/scenarios/search-params/react/src/main.tsx +++ b/benchmarks/client-nav/scenarios/search-params/react/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { RouterProvider, createRouter } from '@tanstack/react-router' import { createRoot } from 'react-dom/client' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -21,8 +23,8 @@ declare module '@tanstack/react-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const reactRoot = createRoot(container) reactRoot.render() diff --git a/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts index b220ae7d0d..0318a10815 100644 --- a/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts +++ b/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -32,6 +33,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav search-params (react)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts index df6a24dc15..caa626c596 100644 --- a/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-search-params', () => { - const test = setup() +test('client-search-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-search-params navigation loop (solid)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx b/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx index e95846e12d..25071f7979 100644 --- a/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx +++ b/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import { render } from 'solid-js/web' import { RouterProvider, createRouter } from '@tanstack/solid-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -21,8 +23,8 @@ declare module '@tanstack/solid-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const unmount = render(() => , container) diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts index 96d211d64c..b15beed09b 100644 --- a/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts @@ -9,13 +9,13 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as ProductsRouteImport } from './routes/products' -import { Route as CatalogRouteImport } from './routes/catalog' import { Route as IndexRouteImport } from './routes/index' +import { Route as CatalogRouteImport } from './routes/catalog' +import { Route as ProductsRouteImport } from './routes/products' -const ProductsRoute = ProductsRouteImport.update({ - id: '/products', - path: '/products', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const CatalogRoute = CatalogRouteImport.update({ @@ -23,9 +23,9 @@ const CatalogRoute = CatalogRouteImport.update({ path: '/catalog', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const ProductsRoute = ProductsRouteImport.update({ + id: '/products', + path: '/products', getParentRoute: () => rootRouteImport, } as any) @@ -61,11 +61,11 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/products': { - id: '/products' - path: '/products' - fullPath: '/products' - preLoaderRoute: typeof ProductsRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/catalog': { @@ -75,11 +75,11 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof CatalogRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/products': { + id: '/products' + path: '/products' + fullPath: '/products' + preLoaderRoute: typeof ProductsRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts index c2f4b32806..511fd49466 100644 --- a/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts +++ b/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -35,6 +36,7 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav search-params (solid)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts index 0b394bbe27..728d2779e8 100644 --- a/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts +++ b/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' +import { benchLifecycle } from '../../../../cpu-simulation' import { benchOptions, ticksPerIteration } from '../shared' import { setup } from './setup' -describe('client-search-params', () => { - const test = setup() +test('client-search-params', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-search-params navigation loop (vue)', + benchLifecycle(scenario), async () => { for (let i = 0; i < ticksPerIteration; i++) { - await test.tick() + await scenario.tick() } + await scenario.finishBatch() }, - { - ...benchOptions, - setup: test.before, - teardown: test.after, - }, - ) + ).run(benchOptions) }) diff --git a/benchmarks/client-nav/scenarios/search-params/vue/src/main.tsx b/benchmarks/client-nav/scenarios/search-params/vue/src/main.tsx index 1454b8d547..65bade775c 100644 --- a/benchmarks/client-nav/scenarios/search-params/vue/src/main.tsx +++ b/benchmarks/client-nav/scenarios/search-params/vue/src/main.tsx @@ -1,10 +1,12 @@ +import type { RouterHistory } from '@tanstack/history' import * as Vue from 'vue' import { RouterProvider, createRouter } from '@tanstack/vue-router' import { routeTree } from './routeTree.gen' -export function createTestRouter() { +export function createTestRouter(history: RouterHistory) { return createRouter({ routeTree, + history, scrollRestoration: true, // Key the scroll-restoration cache by pathname instead of the default // random per-entry location key: with push navigations the default mints @@ -21,8 +23,8 @@ declare module '@tanstack/vue-router' { } } -export function mountTestApp(container: HTMLElement) { - const router = createTestRouter() +export function mountTestApp(container: HTMLElement, history: RouterHistory) { + const router = createTestRouter(history) const component = const app = Vue.createApp({ diff --git a/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts index b95b667803..f73b84ebe7 100644 --- a/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts +++ b/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts @@ -9,13 +9,13 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as ProductsRouteImport } from './routes/products' -import { Route as CatalogRouteImport } from './routes/catalog' import { Route as IndexRouteImport } from './routes/index' +import { Route as CatalogRouteImport } from './routes/catalog' +import { Route as ProductsRouteImport } from './routes/products' -const ProductsRoute = ProductsRouteImport.update({ - id: '/products', - path: '/products', +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', getParentRoute: () => rootRouteImport, } as any) const CatalogRoute = CatalogRouteImport.update({ @@ -23,9 +23,9 @@ const CatalogRoute = CatalogRouteImport.update({ path: '/catalog', getParentRoute: () => rootRouteImport, } as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', +const ProductsRoute = ProductsRouteImport.update({ + id: '/products', + path: '/products', getParentRoute: () => rootRouteImport, } as any) @@ -61,11 +61,11 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/products': { - id: '/products' - path: '/products' - fullPath: '/products' - preLoaderRoute: typeof ProductsRouteImport + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } '/catalog': { @@ -75,11 +75,11 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof CatalogRouteImport parentRoute: typeof rootRouteImport } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport + '/products': { + id: '/products' + path: '/products' + fullPath: '/products' + preLoaderRoute: typeof ProductsRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts index 9a3b82d066..27490b276a 100644 --- a/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts +++ b/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts @@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -34,6 +35,7 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav search-params (vue)', watch: false, environment: 'jsdom', diff --git a/benchmarks/client-nav/solid/speed.bench.ts b/benchmarks/client-nav/solid/speed.bench.ts index 34791180ce..d629da17a8 100644 --- a/benchmarks/client-nav/solid/speed.bench.ts +++ b/benchmarks/client-nav/solid/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' import { setup } from './setup' -describe('client-nav', () => { - const test = setup() +test('client-nav', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-side navigation loop (solid)', + { beforeAll: scenario.before, afterAll: scenario.after }, async () => { for (let i = 0; i < 10; i++) { - await test.tick() + await scenario.tick() } }, - { - warmupIterations: 100, - time: 10_000, - setup: test.before, - teardown: test.after, - }, - ) + ).run({ + warmupIterations: 100, + time: 10_000, + }) }) diff --git a/benchmarks/client-nav/solid/vite.config.ts b/benchmarks/client-nav/solid/vite.config.ts index bd11fe8de9..0c26b32f5f 100644 --- a/benchmarks/client-nav/solid/vite.config.ts +++ b/benchmarks/client-nav/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import solid from 'vite-plugin-solid' import codspeedPlugin from '@codspeed/vitest-plugin' +import { cpuSimulationExecArgv } from '../../cpu-simulation' // Anchor the project root to the package directory so this config resolves // identically when run directly and as part of an aggregate `projects` config. @@ -31,10 +32,12 @@ export default defineConfig({ conditions: ['solid', 'browser'], }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav (solid)', watch: false, environment: 'jsdom', setupFiles: [`${rootDir}vitest.setup.ts`], + benchmark: { include: ['solid/speed.bench.ts'] }, server: { deps: { inline: [/@solidjs/, /@tanstack\/solid-store/], diff --git a/benchmarks/client-nav/vue/speed.bench.ts b/benchmarks/client-nav/vue/speed.bench.ts index f9e532f5ba..503e91e7b7 100644 --- a/benchmarks/client-nav/vue/speed.bench.ts +++ b/benchmarks/client-nav/vue/speed.bench.ts @@ -1,34 +1,19 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' +import { test } from 'vitest' import { setup } from './setup' -describe('client-nav', () => { - const test = setup() +test('client-nav', async ({ bench }) => { + const scenario = setup() - /** - * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`, - * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic. - * - * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`, - * but it does support `beforeAll` and `afterAll`. - * - * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended. - */ - - beforeAll(test.before) - afterAll(test.after) - - bench( + await bench( 'client-side navigation loop (vue)', + { beforeAll: scenario.before, afterAll: scenario.after }, async () => { for (let i = 0; i < 10; i++) { - await test.tick() + await scenario.tick() } }, - { - warmupIterations: 100, - time: 10_000, - setup: test.before, - teardown: test.after, - }, - ) + ).run({ + warmupIterations: 100, + time: 10_000, + }) }) diff --git a/benchmarks/client-nav/vue/vite.config.ts b/benchmarks/client-nav/vue/vite.config.ts index 4c44c09fdd..78d8ae5638 100644 --- a/benchmarks/client-nav/vue/vite.config.ts +++ b/benchmarks/client-nav/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import codspeedPlugin from '@codspeed/vitest-plugin' +import { cpuSimulationExecArgv } from '../../cpu-simulation' // Anchor the project root to the package directory so this config resolves // identically when run directly and as part of an aggregate `projects` config. @@ -30,9 +31,11 @@ export default defineConfig({ }, }, test: { + execArgv: cpuSimulationExecArgv(), name: '@benchmarks/client-nav (vue)', watch: false, environment: 'jsdom', setupFiles: [`${rootDir}vitest.setup.ts`], + benchmark: { include: ['vue/speed.bench.ts'] }, }, }) diff --git a/benchmarks/cpu-simulation.ts b/benchmarks/cpu-simulation.ts new file mode 100644 index 0000000000..9b8859f74d --- /dev/null +++ b/benchmarks/cpu-simulation.ts @@ -0,0 +1,53 @@ +function codspeedRunnerMode() { + return process.env.CODSPEED_ENV === undefined + ? undefined + : process.env.CODSPEED_RUNNER_MODE +} + +/** + * Whether CodSpeed's simulation or memory instrument drives the run. Both + * measure one invocation after a few warmup calls instead of sampling. + */ +export function isCodSpeedAnalysis() { + const mode = codspeedRunnerMode() + return ( + mode === 'simulation' || mode === 'instrumentation' || mode === 'memory' + ) +} + +/** Extra worker flags for CodSpeed CPU simulation, not walltime benchmarks. */ +export function cpuSimulationExecArgv() { + const mode = codspeedRunnerMode() + if (mode === 'simulation' || mode === 'instrumentation') { + // CodSpeed supplies --no-opt, which only disables TurboFan on Node 24. + // Maglev can still compile and inline hot functions between measured runs. + // Compile baseline code on first use, so warmup does not leave functions + // near Sparkplug's later tier-up/batch-compilation thresholds. + // V8 renamed --scavenge-task in Node 20; CodSpeed's old flag is omitted. + // Keep minor GC tied to allocations instead of scheduled foreground tasks. + // Fix the initial/minimum old-generation allocation budget. This can skip + // automatic full collections below the budget; minor GC remains enabled. + return [ + '--no-maglev', + '--always-sparkplug', + '--no-minor-gc-task', + '--initial-old-space-size=512', + ] + } + return [] +} + +/** + * Per-bench lifecycle for apps that a bench prepares and disposes outside + * timing. CodSpeed measures one invocation, so each invocation gets fresh + * state. Tinybench samples thousands of iterations and keeps one instance per + * warmup/run phase instead of preparing it for every iteration. + */ +export function benchLifecycle(hooks: { + before: () => Promise | void + after: () => Promise | void +}) { + return isCodSpeedAnalysis() + ? { beforeEach: hooks.before, afterEach: hooks.after } + : { beforeAll: hooks.before, afterAll: hooks.after } +} diff --git a/benchmarks/memory/README.md b/benchmarks/memory/README.md index cf871f3439..18b68768f9 100644 --- a/benchmarks/memory/README.md +++ b/benchmarks/memory/README.md @@ -2,7 +2,7 @@ Dedicated memory benchmarks for TanStack Router / Start, measured with the CodSpeed **memory instrument** (`mode: memory` in -`.github/workflows/client-nav-benchmarks.yml`). The workflow runs on every +`.github/workflows/benchmarks.yml`). The workflow runs on every push to `main` except docs/examples/e2e-only pushes: CodSpeed compares a PR against the run on its merge-base commit, and a main commit without a run makes CodSpeed silently fall back to an older base — a single outlier base run then @@ -34,8 +34,8 @@ benchmarks/memory// One app per scenario; apps and bench names are stable once landed (CodSpeed continuity). Never grow an existing scenario for a new case — add a scenario. `setup.ts` imports the built app and exports the concrete workload; -`memory.bench.ts` registers `bench(...)` directly, and `memory.flame.ts` runs the -same workload through the Flame profiler. +`memory.bench.ts` registers it with Vitest's `bench` test fixture, and +`memory.flame.ts` runs the same workload through the Flame profiler. ## How the memory instrument executes a bench @@ -43,40 +43,98 @@ same workload through the Flame profiler. after a forced GC. Under plain `vitest bench` the suites only smoke-test: timing output is meaningless; real numbers come from CodSpeed. - Under CodSpeed the bench fn runs several warmup invocations plus the - measured one **on the same mount**, so bench fns must be idempotent and - module-level counters/LCGs are used where ids must never repeat across - invocations. -- Plain `vitest bench` never runs suite hooks (`beforeAll`/`afterAll`) and - only honors tinybench's `setup`/`teardown` options; the CodSpeed runner - does the exact opposite. Client benches therefore register **both** — in - any given mode exactly one pair runs. -- The process runs with V8 determinism flags (predictable GC schedule, - `--no-opt`). Never call `global.gc()` manually in **churn** scenarios — - their signal is accumulation across iterations, which a forced collection - masks. **Peak** scenarios do the opposite: they set - `pinGcBetweenIterations` on the request loop so a collection runs between - iterations. Their signal is the footprint of a single request, and without - pinned GC points the measured peak flips by a whole payload depending on - whether iteration i's garbage is collected before iteration i+1 allocates. - Because of `--no-opt`, allocation counts overstate production; numbers are - for regression tracking, not absolute claims. + measured one. The bench's `beforeEach`/`afterEach` hooks + (`memoryBenchHooks`) run around every invocation, outside the measurement + window: client workloads mount a fresh app before each invocation and tear + it down afterward. This prevents warmup navigation history and caches from + changing the starting state. Plain `vitest bench` runs the same hooks around + its warmup and measured iteration. Module-level counters/LCGs keep generated + URLs unique across invocations. +- Workload `run` functions must be `async` functions. CodSpeed's Vitest 5 + provider awaits only `AsyncFunction`s; a plain function that returns a + promise would be measured only up to its first suspension. +- Worker flags live in `runtime.ts` and apply only to the CodSpeed memory + instrument. They supplement the integration's predictable execution flags; + the retained overrides are described below. +- Before each CodSpeed invocation, the `beforeEach` hook yields to the event + loop, outside the measurement marker and before CodSpeed forces GC. Promise-only + warmup chains can keep WeakRef targets alive through a collection in the same + job. Client app setup also runs before the forced GC. +- Do not force GC inside a measured request loop or poll `heapUsed` to choose + how much work to do. Both introduce allocator activity from the harness into + the measurement. Footprint scenarios run exactly one large request per + invocation; churn scenarios retain their fixed sequential request counts. +- Error-path cases use separate isolated workers so one case's module and + allocator history cannot contaminate the next case. - Keep each bench under **~1.5M allocations** (instrument overhead grows past 2M); this is the main constraint when tuning iteration counts. +## Worker settings + +All scenarios use [`memoryConfig`](./runtime.ts). It adds these flags only in +memory mode: + +- `--no-maglev` +- `--no-flush-bytecode` +- `--no-minor-gc-task` +- `--no-incremental-marking` +- `--initial-old-space-size=512` + +`--jitless` was removed after repeated CI comparisons. Ten unchanged-commit +repetitions with the last four flags kept all 48 peak-memory results within 1% +(worst spread: 0.834%). With JIT enabled, all 16 subsets of the four flags were +tested. Removing bytecode, minor-GC-task, incremental-marking, or heap-budget +overrides from this profile produced worst client peak spreads of 6.616%, 2.714%, +2.109%, and 10.669%, respectively. Smaller combinations also exceeded 1% in at +least one tracked metric. This supports retaining the four-flag profile; it does +not establish that every override is required in every individual scenario. + +A server-only heap-budget profile initially passed five repetitions, but further +confirmation produced a 24.46% server peak outlier. That configuration was +rejected. Allocated bytes and allocation counts remain imperfectly repeatable: +a client confirmation with the retained four flags showed a 6.77% allocated-byte +spread and a 5.91% allocation-count spread. Client peaks remained within 0.834% +across all 15 observations with the retained profile. Experiment details and CI runs are recorded in +[PR #8260](https://github.com/TanStack/router/pull/8260). + +These settings trade production GC behavior for repeatable regression signals. +They suppress bytecode reclamation and change collection scheduling. The 512 MiB +initial/minimum old-generation allocation budget can postpone automatic full +collections. This does not preallocate 512 MiB, and the smallest sufficient budget +was not determined. Results describe this controlled worker profile, not a +production application's absolute memory footprint. + +CodSpeed's `--no-opt` only disables TurboFan on Node 24 (V8 13); Maglev still +compiles. Under CodSpeed's `--predictable` there is no background compilation, +so Maglev compiles run synchronously inside whichever request triggers them, and +the forced GC before the measured call can discard optimized code so recompiles +land inside the measured window. Maglev's malloc'd Zone scratch (32 KiB +segments) then dominates allocation metrics, and its size depends on +per-process feedback state. `--no-maglev` was added for this: the bimodal ++32,792 B / +1 allocation in `mem server error-paths unmatched (react)` was one +Maglev Zone segment allocated while compiling React Fizz's per-request stream +`write` closure, and compiler scratch made up ~97% of that bench's allocated +bytes. Retained-object measurements are unaffected because Zone memory is freed +after each compile. The repeatability figures above predate this flag. + ## Bench shapes and signals -- **Churn (leak detector):** N sequential iterations at steady state. If one - iteration leaks L bytes, peak grows by ~N·L; healthy builds show a flat - timeline floor independent of N. Tuning check: doubling N must leave peak - roughly unchanged. -- **Peak (footprint):** one (or very few) large operations; peak memory - scaling with the workload is the signal. +- **Churn:** a fixed number of sequential operations, measuring native + allocation activity and peak outstanding native allocations. +- **Peak (footprint):** one large operation, measuring its native footprint. + +CodSpeed reports native allocator activity, not individual JavaScript object +allocations or retained JS heap size. V8 can reuse heap pages without a visible +native allocation. These benchmarks can detect native buffering and allocator +regressions, but a flat graph does not establish that route data or JS objects +are collectable. Absolute numbers include Node/framework/jsdom activity under +benchmark-specific V8 settings; compare identical harness versions. ## Scenarios ### Server -| Scenario | Shape | Guards against | +| Scenario | Shape | Exercises | | ----------------------- | ----- | --------------------------------------------------------- | | `request-churn` | churn | cross-request retention in document SSR (unique URLs) | | `server-fn-churn` | churn | retention in the server-function RPC path | @@ -88,7 +146,7 @@ same workload through the Flame profiler. ### Client -| Scenario | Shape | Guards against | +| Scenario | Shape | Exercises | | ------------------------- | ----- | -------------------------------------------------------- | | `navigation-churn` | churn | per-navigation retention at steady state | | `unique-location-churn` | churn | unbounded href/search-keyed caches (never-repeated URLs) | @@ -103,14 +161,10 @@ same workload through the Flame profiler. server response is fully consumed before the next request. Pairing a single navigation with its render signal via `Promise.all([navigate, rendered])` is fine — never overlap distinct work items. -- Randomness only via the seeded LCG in `bench-utils.ts`; no `Math.random`, - `Date.now`, or timers with a nonzero delay — anywhere async ordering must be - staged (`streaming-peak`'s deferred sections, `aborted-requests`' deferred - loader data and post-abort drain), chain **0ms `setTimeout` hops** and count - event-loop turns instead. A wall-clock delay races renderer work differently - depending on runner load and instrumentation overhead, which makes the - single measured run non-reproducible; 0ms hops fire in registration order in - the timers phase, so the interleaving is a pure function of the schedule. +- Randomness only via the seeded LCG in `bench-utils.ts`. Deferred streaming + uses counted zero-delay timer hops to stage work. Timers still depend on the + event loop, so validate repeatability on CI instead of assuming deterministic + ordering from a zero delay alone. - Sanity assertions run once at module load and throw on wrong status/markers, so a bench can never silently measure the wrong thing. - Server requests follow `benchmarks/ssr` conventions: document GETs send @@ -184,7 +238,7 @@ pnpm --filter @benchmarks/memory-client clean:profiles ``` Client memory benches are useful for regression tracking of router/React/jsdom -integration behavior, especially retained route/cache data. They are not pure +integration behavior and native allocation activity. They are not pure browser-memory measurements, and local Flame attribution can include jsdom, React DOM, and profiler shutdown frames. @@ -200,3 +254,20 @@ WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/mem WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/memory-client:test:perf:solid WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/memory-client:test:perf:vue ``` + +Run the benchmark workflow on an experiment branch: + +```bash +gh workflow run benchmarks.yml --ref +``` + +Repeat at the same commit, using distinct branch names if runs should overlap +(the workflow serializes runs on the same ref). Compare all 48 fresh memory +results: 18 client and 30 server. Exclude CPU simulation results, inherited +CodSpeed results, and failed or incomplete repetitions. For each workload, calculate +`100 * (max / min - 1)` across runs for peak bytes, allocated bytes, and +allocation counts; aggregate averages hide unstable cases. + +Observed spreads below 1% establish repeatability in the tested sample, not a +bound on future runs. Changes to worker flags or workload lifecycles establish +new measurement baselines. diff --git a/benchmarks/memory/client/bench-utils.ts b/benchmarks/memory/client/bench-utils.ts index 0cbaedbd71..785e8fac7f 100644 --- a/benchmarks/memory/client/bench-utils.ts +++ b/benchmarks/memory/client/bench-utils.ts @@ -1,3 +1,5 @@ +export { memoryBenchHooks } from '../turn' + export const memoryBenchOptions = { iterations: 1, warmupIterations: 1, diff --git a/benchmarks/memory/client/benchmark.ts b/benchmarks/memory/client/benchmark.ts index 8b877b0740..463047f4d9 100644 --- a/benchmarks/memory/client/benchmark.ts +++ b/benchmarks/memory/client/benchmark.ts @@ -1,6 +1,10 @@ export interface ClientMemoryWorkload { name: string before?: () => Promise | void + /** + * Must be an `async` function: CodSpeed's Vitest 5 provider awaits only + * `AsyncFunction`s and otherwise measures just the synchronous part. + */ run: () => Promise | void sanity: () => Promise | void after?: () => Promise | void diff --git a/benchmarks/memory/client/package.json b/benchmarks/memory/client/package.json index 2624b9e4e5..4dc6246183 100644 --- a/benchmarks/memory/client/package.json +++ b/benchmarks/memory/client/package.json @@ -22,7 +22,7 @@ "vue": "^3.5.16" }, "devDependencies": { - "@codspeed/vitest-plugin": "^5.5.0", + "@codspeed/vitest-plugin": "^6.0.1", "@datadog/pprof": "^5.13.2", "@platformatic/flame": "^1.6.0", "@testing-library/react": "^16.2.0", @@ -30,11 +30,14 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "@types/jsdom": "28.0.0", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", "jsdom": "29.1.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11", - "vitest": "^4.1.4" + "vitest": "catalog:" }, "nx": { "targets": { @@ -199,7 +202,7 @@ "build:react" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts", "cwd": "benchmarks/memory/client" } }, @@ -211,7 +214,7 @@ "build:solid" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts", "cwd": "benchmarks/memory/client" } }, @@ -223,12 +226,12 @@ "build:vue" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts", "cwd": "benchmarks/memory/client" } }, "test:types": { - "executor": "nx:noop", + "executor": "nx:run-commands", "dependsOn": [ { "projects": [ @@ -253,6 +256,17 @@ ], "target": "test:types:client" } + ], + "options": { + "command": "tsc -p ./tsconfig.json --noEmit", + "cwd": "benchmarks/memory/client" + }, + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "dependentTaskOutputs", + "{workspaceRoot}/benchmarks/memory/*.ts" ] } } diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts index 048a9cc833..0f05cedf40 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client interrupted-navigations (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts index f7f3a7cd8b..80f234f0c8 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts @@ -35,7 +35,6 @@ type RenderedEvent = { } type InterruptedNavigationRouter = { - latestLoadPromise: Promise | undefined load: () => Promise navigate: (options: { to: '/fast/$id' | '/slow/$id' @@ -104,18 +103,6 @@ function assertSlowNavigationSettlement(settlement: NavigationSettlement) { ) } -async function awaitExpectedLoadSettlement(loadPromise: Promise) { - try { - await loadPromise - } catch (reason) { - if (reasonHasAbortShape(reason) || reasonHasCancellationShape(reason)) { - return - } - - throw reason - } -} - function reasonHasAbortShape(reason: unknown) { return reason instanceof DOMException && reason.name === 'AbortError' } @@ -144,7 +131,6 @@ export function createWorkload( let navigateFast: (id: string) => Promise = uninitialized let startSlowNavigation: (id: string) => Promise = uninitializedSettlement - let getLatestLoadPromise: () => Promise | undefined = () => undefined function assertRenderedPage(page: 'shell' | 'fast', id?: string) { const element = container?.querySelector('[data-bench-page]') @@ -203,7 +189,6 @@ export function createWorkload( const mounted = mountTestApp(container) const router = mounted.router as InterruptedNavigationRouter unmount = mounted.unmount - getLatestLoadPromise = () => router.latestLoadPromise unsub = router.subscribe('onRendered', (event) => { if ( @@ -265,7 +250,6 @@ export function createWorkload( expectedRenderedPath = undefined navigateFast = uninitialized startSlowNavigation = uninitializedSettlement - getLatestLoadPromise = () => undefined } async function interrupt( @@ -276,12 +260,6 @@ export function createWorkload( const slowNavigation = startSlowNavigation(slowId) await waitForSlowLoader(slowId) - const slowLoadPromise = getLatestLoadPromise() - - if (!slowLoadPromise) { - throw new Error(`Slow navigation did not start a load for id: ${slowId}`) - } - await navigateFast(fastId) resolveSlowLoader(slowId) @@ -291,7 +269,6 @@ export function createWorkload( assertSlowNavigationSettlement(settlement) } - await awaitExpectedLoadSettlement(slowLoadPromise) await drainMicrotasks() } diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts index e710e0fd12..26ff0b5c8c 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client interrupted-navigations (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx index 3bd820bd07..f6dc9ac3bd 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx @@ -1,6 +1,19 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { fixedTimestamp } from '../../../slow-loaders' +const FastComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+ {`${data.value.kind}:${data.value.id}:${data.value.ts}`} +
+ ) + }, +}) + export const Route = createFileRoute('/fast/$id')({ loader: ({ params }: { params: { id: string } }) => ({ id: params.id, @@ -9,13 +22,3 @@ export const Route = createFileRoute('/fast/$id')({ }), component: FastComponent, }) - -function FastComponent() { - const data = Route.useLoaderData() - - return ( -
- {`${data.value.kind}:${data.value.id}:${data.value.ts}`} -
- ) -} diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx index 68885fb918..3b5bb75ede 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx @@ -1,6 +1,19 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { getSlowLoaderDeferred } from '../../../slow-loaders' +const SlowComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+ {`${data.value.kind}:${data.value.id}:${data.value.ts}`} +
+ ) + }, +}) + export const Route = createFileRoute('/slow/$id')({ loader: async ({ params }: { params: { id: string } }) => { const deferred = getSlowLoaderDeferred(params.id) @@ -9,13 +22,3 @@ export const Route = createFileRoute('/slow/$id')({ }, component: SlowComponent, }) - -function SlowComponent() { - const data = Route.useLoaderData() - - return ( -
- {`${data.value.kind}:${data.value.id}:${data.value.ts}`} -
- ) -} diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts index b2912ce9d1..02574908d2 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client interrupted-navigations (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts index 555e5f5612..8630417936 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client loader-data-retention (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts index 58d6b77acc..5dfd5b53fe 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client loader-data-retention (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx b/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx index 9f4b3c4470..38f1d2614c 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx +++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx @@ -1,22 +1,25 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { createLoaderData } from '../../../loader-data' +const PageComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+ {`${data.value.id}:${data.value.records.length}`} +
+ ) + }, +}) + export const Route = createFileRoute('/page/$id')({ loader: ({ params }: { params: { id: string } }) => createLoaderData(params.id), component: PageComponent, }) - -function PageComponent() { - const data = Route.useLoaderData() - - return ( -
- {`${data.value.id}:${data.value.records.length}`} -
- ) -} diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts index bbf2fd02d8..006636eaa0 100644 --- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client loader-data-retention (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts index bb0f3c2e0a..a08352a837 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client mount-unmount (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts index 5f0ab26252..33699639de 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client mount-unmount (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx b/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx index cbcd543ce5..0dd650e1dd 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx +++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx @@ -1,12 +1,15 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const AComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () =>
{data.value.id}
+ }, +}) + export const Route = createFileRoute('/a')({ loader: () => ({ id: 'a' }), component: AComponent, }) - -function AComponent() { - const data = Route.useLoaderData() - - return
{data.value.id}
-} diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts index 0f7573a408..a3f0eeaa8c 100644 --- a/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client mount-unmount (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts index b05b999297..eef60a658e 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client navigation-churn (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts index 6b6735891a..7dfb186b2e 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client navigation-churn (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx index 183228e748..c1a9cfb244 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx +++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx @@ -1,16 +1,19 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' const fixedTimestamp = 1_700_000_000_000 +const AComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
{`${data.value.name}:${data.value.ts}`}
+ ) + }, +}) + export const Route = createFileRoute('/a')({ loader: () => ({ name: 'a', ts: fixedTimestamp }), component: AComponent, }) - -function AComponent() { - const data = Route.useLoaderData() - - return ( -
{`${data.value.name}:${data.value.ts}`}
- ) -} diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx index 3a18ec97a9..3a20799f3b 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx +++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx @@ -1,16 +1,19 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' const fixedTimestamp = 1_700_000_000_000 +const BComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
{`${data.value.name}:${data.value.ts}`}
+ ) + }, +}) + export const Route = createFileRoute('/b')({ loader: () => ({ name: 'b', ts: fixedTimestamp }), component: BComponent, }) - -function BComponent() { - const data = Route.useLoaderData() - - return ( -
{`${data.value.name}:${data.value.ts}`}
- ) -} diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts index d26ce23d07..b3bdd39dd2 100644 --- a/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client navigation-churn (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts index f9c426656b..c12995f68e 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client preload-churn (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/shared.ts b/benchmarks/memory/client/scenarios/preload-churn/shared.ts index 8cea4aca81..68fdfedd3f 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/shared.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/shared.ts @@ -35,18 +35,14 @@ type PreloadRouter = { subscribe: (event: 'onRendered', listener: () => void) => () => void } -// Fixed id for the eviction navigations interleaved into the bench loop; its -// payload is a constant-size steady-state resident, never part of the signal. +// Reuse one navigation target while evicting the distinct preloaded routes. const evictionItemId = 'nav-evict' const preloadChurnIterations = 200 // A navigation commit is what triggers the router's clearExpiredCache -- // preloaded matches (defaultPreloadGcTime: 0) are only evicted then, never -// during a preload-only loop. Interleaving a navigation every few preloads is -// what makes the flat floor assert "eviction releases preloaded payloads". +// during a preload-only loop. Interleave navigation to exercise eviction. const preloadsPerEvictionNavigation = 10 -// Module-level so ids stay unique across runner invocations on one mount; a -// per-invocation LCG would replay identical ids, and every preload after the -// first invocation would dedupe against cachedMatches instead of doing work. +// Keep generated URLs unique across warmup and measured invocations. const benchmarkRandom = createDeterministicRandom(0x706c6f61) let preloadCounter = 0 diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts index c86a6fcbb3..efc75d2b93 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client preload-churn (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx index 2a29245926..08254e173e 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx +++ b/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx @@ -1,6 +1,19 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { createItemPayload, trackItemLoaderCall } from '../../../item-payload' +const ItemComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+ {`${data.value.id}:${data.value.byteLength}`} +
+ ) + }, +}) + export const Route = createFileRoute('/items/$id')({ loader: ({ params }: { params: { id: string } }) => { trackItemLoaderCall(params.id) @@ -8,13 +21,3 @@ export const Route = createFileRoute('/items/$id')({ }, component: ItemComponent, }) - -function ItemComponent() { - const data = Route.useLoaderData() - - return ( -
- {`${data.value.id}:${data.value.byteLength}`} -
- ) -} diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts index ea7ed7b695..3d56089ba7 100644 --- a/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client preload-churn (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts index f424c57cef..7ee67bfe30 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client unique-location-churn (react)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts index d4acf0019a..4db90da2d2 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -26,9 +27,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client unique-location-churn (solid)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts index e645ab38f1..43ab822de3 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts @@ -1,21 +1,14 @@ -import { afterAll, beforeAll, bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-client/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-client/bench-utils' import { workload } from './setup' await workload.sanity() -describe('memory', () => { - if (workload.before && workload.after) { - beforeAll(workload.before) - afterAll(workload.after) - - bench(workload.name, workload.run, { - ...memoryBenchOptions, - setup: workload.before, - teardown: workload.after, - }) - return - } - - bench(workload.name, workload.run, memoryBenchOptions) +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(workload), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx index 1854367142..e796ee14d1 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx +++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx @@ -1,9 +1,22 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' type ItemSearch = { q: string } +const ItemComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
{`${data.value.id}:${data.value.q}:${data.value.checksum}`}
+ ) + }, +}) + export const Route = createFileRoute('/items/$id')({ validateSearch: (search: Record): ItemSearch => ({ q: typeof search.q === 'string' ? search.q : '', @@ -22,13 +35,3 @@ export const Route = createFileRoute('/items/$id')({ }), component: ItemComponent, }) - -function ItemComponent() { - const data = Route.useLoaderData() - - return ( -
{`${data.value.id}:${data.value.q}:${data.value.checksum}`}
- ) -} diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts index 423126019b..d074d571b9 100644 --- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts +++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -28,9 +29,9 @@ export default defineConfig({ }, }, test: { + ...memoryConfig('client'), name: '@benchmarks/memory-client unique-location-churn (vue)', watch: false, environment: 'jsdom', - setupFiles: ['../../../vitest.setup.ts'], }, }) diff --git a/benchmarks/memory/client/tsconfig.json b/benchmarks/memory/client/tsconfig.json index 9280d5c42f..eefc5c581e 100644 --- a/benchmarks/memory/client/tsconfig.json +++ b/benchmarks/memory/client/tsconfig.json @@ -3,5 +3,10 @@ "compilerOptions": { "types": ["node", "vite/client", "vitest/globals"] }, - "include": ["bench-utils.ts", "lifecycle.ts", "vitest.setup.ts"] + "include": [ + "bench-utils.ts", + "lifecycle.ts", + "vitest.setup.ts", + "scenarios/*/shared.ts" + ] } diff --git a/benchmarks/memory/runtime.ts b/benchmarks/memory/runtime.ts new file mode 100644 index 0000000000..010149b4df --- /dev/null +++ b/benchmarks/memory/runtime.ts @@ -0,0 +1,36 @@ +import { fileURLToPath } from 'node:url' +import { isMemoryInstrumented } from './turn' + +/** Worker settings for the CodSpeed memory instrument. */ +export function memoryExecArgv() { + if (!isMemoryInstrumented()) { + return [] + } + + // CodSpeed supplies --no-opt, which only disables TurboFan on Node 24. + // Under --predictable, Maglev compilations run synchronously inside the + // request that triggers them, and the forced GC before the measured call can + // discard optimized code so recompiles land in the measured window. Their + // malloc'd Zone scratch (32 KiB segments) then dominates allocation metrics + // and depends on per-process feedback state. + // Limit variation from GC scheduling and bytecode reclamation; keep a + // fixed initial old-generation budget. + return [ + '--no-maglev', + '--no-flush-bytecode', + '--no-minor-gc-task', + '--no-incremental-marking', + '--initial-old-space-size=512', + ] +} + +export function memoryConfig(side: 'client' | 'server') { + const execArgv = memoryExecArgv() + return { + execArgv, + setupFiles: + side === 'client' + ? [fileURLToPath(new URL('./client/vitest.setup.ts', import.meta.url))] + : [], + } +} diff --git a/benchmarks/memory/server/bench-utils.ts b/benchmarks/memory/server/bench-utils.ts index b8a09fdd8e..9caaf63384 100644 --- a/benchmarks/memory/server/bench-utils.ts +++ b/benchmarks/memory/server/bench-utils.ts @@ -1,3 +1,5 @@ +export { memoryBenchHooks } from '../turn' + export interface StartRequestHandler { fetch: (request: Request) => Promise | Response } @@ -17,24 +19,6 @@ export type RunSequentialRequestLoopOptions = iterations?: number buildRequest: (random: () => number, index: number) => Request validateResponse?: (response: Response, request: Request) => void - // Whether V8 collects iteration i's garbage before iteration i+1 - // allocates its payload is not reproducible run to run — the measured - // peak flips by a whole payload depending on GC timing, which shifts - // with runner hardware. Forcing a collection between iterations pins - // the GC points so peak deterministically measures the largest - // single-iteration footprint plus any reachable accumulation. - // Accumulation signals stay visible: leaked or cached objects are - // still referenced, so a forced collection cannot reclaim them — it - // only removes floating garbage, whose collection timing is the - // dominant cross-run noise source. - pinGcBetweenIterations?: boolean - // For peak-shape scenarios ONLY (flat inter-iteration heap floor): - // verify each pinned collection actually returned the heap to the - // floor, extending the barrier when a runner's late teardown holds the - // payload past the fixed window. Churn/abort scenarios must not set - // this: their floor legitimately drifts, so the verification caps out - // chronically and the extra collections it fires destabilize the peak. - verifyGcFloor?: boolean } export const memoryBenchOptions = { @@ -66,7 +50,7 @@ export async function drainResponse(response: Response) { } try { - while (true) { + for (;;) { const result = await reader.read() if (result.done) { @@ -82,13 +66,7 @@ export async function runSequentialRequestLoop( handler: StartRequestHandler, options: RunSequentialRequestLoopOptions, ) { - const { - iterations = 10, - buildRequest, - validateResponse, - pinGcBetweenIterations = false, - verifyGcFloor = false, - } = options + const { iterations = 10, buildRequest, validateResponse } = options const random = options.seed !== undefined ? createDeterministicRandom(options.seed) @@ -103,8 +81,6 @@ export async function runSequentialRequestLoop( } }) - const gcPinState = verifyGcFloor ? createGcPinState() : undefined - for (let index = 0; index < iterations; index++) { const request = buildRequest(random, index) const response = await handler.fetch(request) @@ -112,89 +88,12 @@ export async function runSequentialRequestLoop( validate(response, request) await drainResponse(response) - - if (pinGcBetweenIterations) { - await settleAndPinGc(gcPinState) - } } } -// Renderer/stream teardown spans several event-loop turns (React and Vue -// need more than the two turns the original barrier allowed for), and a -// too-short settle window leaks a whole payload of garbage past the -// collection point, flipping the measured peak bimodally between runs. -// The settle length is a fixed count on purpose: an adaptive exit (collect -// until the post-GC heap size stops moving) makes the collection points -// land at data-dependent turns, which re-introduces exactly the run-to-run -// variance this barrier exists to remove — heap-size readings never fully -// stabilize under the instrumented CI environment, so the exit point (and -// with it every subsequent GC point) shifted between identical runs. -const settleTurnsBeforeGc = 16 -const maxSettleTurns = 64 -// Below every scenario's payload size, above normal inter-iteration jitter. -const settledHeapSlackBytes = 256 * 1024 - -// Tracks the smallest post-collection heap size seen in a workload run: -// the inter-iteration floor the heap must return to before the next -// iteration may start. -export interface GcPinState { - floorHeapUsed: number -} - -export function createGcPinState(): GcPinState { - return { floorHeapUsed: Infinity } -} - -// Settle trailing renderer/stream teardown with a fixed number of 0ms timer -// hops (one full event-loop turn each, microtasks flushing between hops), -// then pin a collection point. The second collection one turn later picks -// up whatever the first collection's finalizers released. gc() is present -// under CodSpeed (--expose-gc); in plain smoke runs there is nothing to -// pin, so only the settle hops run. -// -// The collection is then verified against the inter-iteration heap floor: -// on some runners the response teardown holds the payload past the fixed -// settle window (released only by a later internal timer), and that one -// still-reachable payload survives the collection and bleeds into the next -// iteration's measured peak. When the post-collection heap has not returned -// to the floor, keep hopping and collecting — bounded — until the payload -// is actually released, so the barrier self-heals in exactly the case where -// the fixed-count barrier fails. A workload that genuinely accumulates -// reachable memory raises the floor as it goes (the floor is the minimum -// seen), so accumulation still measures; it only pays the turn cap. -export async function settleAndPinGc(state?: GcPinState) { - for (let turn = 0; turn < settleTurnsBeforeGc; turn++) { +// Cancellation can leave deferred loaders and renderer teardown queued. +export async function settle() { + for (let turn = 0; turn < 16; turn++) { await new Promise((resolve) => setTimeout(resolve, 0)) } - - const gc = (globalThis as { gc?: () => void }).gc - - if (!gc) { - return - } - - gc() - await new Promise((resolve) => setTimeout(resolve, 0)) - gc() - - if (!state) { - return - } - - let heapUsed = process.memoryUsage().heapUsed - - for ( - let turn = settleTurnsBeforeGc; - turn < maxSettleTurns && - heapUsed > state.floorHeapUsed + settledHeapSlackBytes; - turn++ - ) { - await new Promise((resolve) => setTimeout(resolve, 0)) - gc() - heapUsed = process.memoryUsage().heapUsed - } - - if (heapUsed < state.floorHeapUsed) { - state.floorHeapUsed = heapUsed - } } diff --git a/benchmarks/memory/server/benchmark.ts b/benchmarks/memory/server/benchmark.ts index 301a9f956d..9b8dc2c76f 100644 --- a/benchmarks/memory/server/benchmark.ts +++ b/benchmarks/memory/server/benchmark.ts @@ -1,5 +1,9 @@ export interface ServerMemoryWorkload { name: string + /** + * Must be an `async` function: CodSpeed's Vitest 5 provider awaits only + * `AsyncFunction`s and otherwise measures just the synchronous part. + */ run: () => Promise | void } diff --git a/benchmarks/memory/server/package.json b/benchmarks/memory/server/package.json index 68ba6b3c32..d09343c7b6 100644 --- a/benchmarks/memory/server/package.json +++ b/benchmarks/memory/server/package.json @@ -23,15 +23,18 @@ "vue": "^3.5.16" }, "devDependencies": { - "@codspeed/vitest-plugin": "^5.5.0", + "@codspeed/vitest-plugin": "^6.0.1", "@datadog/pprof": "^5.13.2", "@platformatic/flame": "^1.6.0", "@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-vue-jsx": "^5.1.5", - "typescript": "^6.0.2", + "@types/react": "catalog:", + "@typescript/native": "npm:typescript@^7.0.2", + "jsdom": "29.1.1", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11", - "vitest": "^4.1.4" + "vitest": "catalog:" }, "nx": { "targets": { @@ -205,7 +208,7 @@ "build:react" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts", "cwd": "benchmarks/memory/server" } }, @@ -217,7 +220,7 @@ "build:solid" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts", "cwd": "benchmarks/memory/server" } }, @@ -229,12 +232,12 @@ "build:vue" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts", "cwd": "benchmarks/memory/server" } }, "test:types": { - "executor": "nx:noop", + "executor": "nx:run-commands", "dependsOn": [ { "projects": [ @@ -262,6 +265,17 @@ ], "target": "test:types:ssr" } + ], + "options": { + "command": "tsc -p ./tsconfig.json --noEmit", + "cwd": "benchmarks/memory/server" + }, + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "dependentTaskOutputs", + "{workspaceRoot}/benchmarks/memory/*.ts" ] } } diff --git a/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts b/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts index 4886e3ee80..7a1cd6d254 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts @@ -16,3 +16,42 @@ export function makeAbortedRequestRecords( label: `deferred-${group}-${id}-${index}`, })) } + +// Abort probes keep their deferred payload pending until the request is +// cancelled. Timer chains can outlive cancellation and spill into the next +// measured request; route-loader signals stop observing the request after load. +export function makeDeferredRecords( + id: string, + group: RecordGroup, + signal: AbortSignal, +): Promise> { + return new Promise((resolve) => { + if (signal.aborted) { + resolve([]) + return + } + + let timeoutId: ReturnType | undefined + const onAbort = () => { + clearTimeout(timeoutId) + resolve([]) + } + signal.addEventListener('abort', onAbort, { once: true }) + + if (id === 'sanity-mid-stream' || id.startsWith('abort-')) { + return + } + + let remaining = group === 'alpha' ? 4 : 6 + const step = () => { + remaining -= 1 + if (remaining === 0) { + signal.removeEventListener('abort', onAbort) + resolve(makeAbortedRequestRecords(id, group)) + return + } + timeoutId = setTimeout(step, 0) + } + timeoutId = setTimeout(step, 0) + }) +} diff --git a/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts index 2ce925e406..eff0d0e043 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server aborted-requests (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/aborted-requests/shared.ts b/benchmarks/memory/server/scenarios/aborted-requests/shared.ts index f7f63c17e6..29eca99e00 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/shared.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/shared.ts @@ -1,4 +1,4 @@ -import { settleAndPinGc } from '#memory-server/bench-utils' +import { settle } from '#memory-server/bench-utils' import type { StartRequestHandler } from '#memory-server/bench-utils' export type { StartRequestHandler } @@ -6,13 +6,6 @@ export type { StartRequestHandler } type Framework = 'react' | 'solid' | 'vue' type AbortedRequestReadMode = 'first-chunk' | 'shell-before-deferred' -type AbortedRequestCancelMode = 'plain' | 'swallow-abort-error' - -type AbortedRequestMode = { - readMode: AbortedRequestReadMode - cancelMode: AbortedRequestCancelMode -} - const abortedRequestIterations = 40 let abortedRequestCounter = 0 const eagerMarker = 'data-bench="aborted-requests-eager"' @@ -24,19 +17,10 @@ const betaFirstRecord = (id: string) => `deferred-beta-${id}-0` const betaLastRecord = (id: string) => `deferred-beta-${id}-19` const textDecoder = new TextDecoder() -const abortedRequestModes: Record = { - react: { - readMode: 'first-chunk', - cancelMode: 'plain', - }, - solid: { - readMode: 'first-chunk', - cancelMode: 'plain', - }, - vue: { - readMode: 'shell-before-deferred', - cancelMode: 'swallow-abort-error', - }, +const abortedRequestModes: Record = { + react: 'first-chunk', + solid: 'first-chunk', + vue: 'shell-before-deferred', } const documentRequestInit = { @@ -96,7 +80,7 @@ async function readShellBeforeDeferred( const reader = response.body.getReader() let text = '' - while (true) { + for (;;) { const result = await reader.read() const value = result.value @@ -137,10 +121,10 @@ async function readShellBeforeDeferred( async function readSanityStream( response: Response, request: Request, - mode: AbortedRequestMode, + mode: AbortedRequestReadMode, id: string, ) { - if (mode.readMode === 'shell-before-deferred') { + if (mode === 'shell-before-deferred') { return readShellBeforeDeferred(response, request, id) } @@ -165,36 +149,19 @@ function readLoopStream( return readFirstChunk(response, request) } -async function cancelReader( - reader: ReadableStreamDefaultReader, - mode: AbortedRequestCancelMode, -) { - if (mode === 'swallow-abort-error') { - try { - await reader.cancel() - } catch (error) { - if (!(error instanceof DOMException && error.name === 'AbortError')) { - throw error - } +async function cancelReader(reader: ReadableStreamDefaultReader) { + try { + await reader.cancel() + } catch (error) { + if (!(error instanceof DOMException && error.name === 'AbortError')) { + throw error } - - return } - - await reader.cancel() -} - -// Post-abort settlement barrier. Settles renderer teardown across a fixed -// number of event-loop turns, then (under CodSpeed) pins a collection point -// after every aborted request, so the measured peak cannot drift with how -// much floating garbage the previous iterations happened to leave behind. -async function drainCancellation() { - await settleAndPinGc() } async function assertAbortedRequestsSanity( handler: StartRequestHandler, - mode: AbortedRequestMode, + mode: AbortedRequestReadMode, ) { const fullId = 'sanity-full' const fullRequest = buildStreamRequest(fullId) @@ -227,13 +194,13 @@ async function assertAbortedRequestsSanity( // reader.cancel() is the response-stream cancellation path if the handler // does not observe Request.signal for this in-process request. controller.abort() - await cancelReader(reader, mode.cancelMode) - await drainCancellation() + await cancelReader(reader) + await settle() } async function runAbortedRequestLoop( handler: StartRequestHandler, - mode: AbortedRequestMode, + mode: AbortedRequestReadMode, ) { for (let index = 0; index < abortedRequestIterations; index++) { const controller = new AbortController() @@ -242,15 +209,10 @@ async function runAbortedRequestLoop( const response = await handler.fetch(request) validateDocumentResponse(response, request) - const { reader } = await readLoopStream( - mode.readMode, - response, - request, - id, - ) + const { reader } = await readLoopStream(mode, response, request, id) controller.abort() - await cancelReader(reader, mode.cancelMode) - await drainCancellation() + await cancelReader(reader) + await settle() } } @@ -259,7 +221,7 @@ export function createWorkloadGroup( handler: StartRequestHandler, ) { const mode = abortedRequestModes[framework] - const run = () => runAbortedRequestLoop(handler, mode) + const run = async () => runAbortedRequestLoop(handler, mode) return { sanity: () => assertAbortedRequestsSanity(handler, mode), diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx index b47f25a405..bf6af17f31 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx +++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx @@ -1,90 +1,17 @@ +import { createServerOnlyFn } from '@tanstack/solid-start' +import { getRequest } from '@tanstack/solid-start/server' import { createFileRoute } from '@tanstack/solid-router' import { Show, Suspense, createResource } from 'solid-js' -import { - makeAbortedRequestRecords, - type DeferredRecord, - type RecordGroup, -} from '../../../deferred-records' +import { makeDeferredRecords } from '../../../deferred-records' +import type { DeferredRecord } from '../../../deferred-records' -const alphaResolveTicks = 4 -const betaResolveTicks = 6 -const abortProbeAlphaResolveTicks = 40 -const abortProbeBetaResolveTicks = 60 - -function isAbortProbeId(id: string) { - return id === 'sanity-mid-stream' || id.startsWith('abort-') -} - -function getResolveTicks(id: string, group: RecordGroup) { - if (isAbortProbeId(id)) { - return group === 'alpha' - ? abortProbeAlphaResolveTicks - : abortProbeBetaResolveTicks - } - - return group === 'alpha' ? alphaResolveTicks : betaResolveTicks -} - -// One tick = one 0ms timers-phase hop. Counting event-loop turns instead of -// milliseconds keeps the resolve/abort interleaving a pure function of the -// event-loop schedule: a wall-clock delay races the abort differently -// depending on runner load and instrumentation overhead, which made this -// benchmark's single measured run swing between runs. -function resolveAfterTicks( - ticks: number, - signal: AbortSignal, - value: () => T, - abortedValue: () => T, -) { - return new Promise((resolve) => { - if (signal.aborted) { - resolve(abortedValue()) - return - } - - let remaining = ticks - let timeoutId: ReturnType - - const onAbort = () => { - clearTimeout(timeoutId) - resolve(abortedValue()) - } - - const step = () => { - remaining -= 1 - - if (remaining <= 0) { - signal.removeEventListener('abort', onAbort) - resolve(value()) - return - } - - timeoutId = setTimeout(step, 0) - } - - signal.addEventListener('abort', onAbort, { once: true }) - timeoutId = setTimeout(step, 0) - }) -} - -function makeDeferredRecords( - id: string, - group: RecordGroup, - signal: AbortSignal, -) { - return resolveAfterTicks( - getResolveTicks(id, group), - signal, - () => makeAbortedRequestRecords(id, group), - () => [], - ) -} +const getRequestSignal = createServerOnlyFn(() => getRequest().signal) export const Route = createFileRoute('/stream/$id')({ - loader: ({ params, abortController }) => ({ + loader: ({ params }) => ({ eager: `eager-${params.id}`, - alpha: makeDeferredRecords(params.id, 'alpha', abortController.signal), - beta: makeDeferredRecords(params.id, 'beta', abortController.signal), + alpha: makeDeferredRecords(params.id, 'alpha', getRequestSignal()), + beta: makeDeferredRecords(params.id, 'beta', getRequestSignal()), }), component: StreamComponent, }) diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts index 5ee4e152af..d7fd3459ee 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server aborted-requests (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx b/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx index b723c7f69e..e41af03c16 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx +++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx @@ -1,136 +1,65 @@ +import { createServerOnlyFn } from '@tanstack/vue-start' +import { getRequest } from '@tanstack/vue-start/server' import { Await, createFileRoute } from '@tanstack/vue-router' -import { Suspense } from 'vue' -import { - makeAbortedRequestRecords, - type DeferredRecord, - type RecordGroup, -} from '../../../deferred-records' +import { Suspense, defineComponent } from 'vue' +import { makeDeferredRecords } from '../../../deferred-records' +import type { DeferredRecord } from '../../../deferred-records' -const alphaResolveTicks = 4 -const betaResolveTicks = 6 -const abortProbeAlphaResolveTicks = 40 -const abortProbeBetaResolveTicks = 60 +const getRequestSignal = createServerOnlyFn(() => getRequest().signal) -function isAbortProbeId(id: string) { - return id === 'sanity-mid-stream' || id.startsWith('abort-') -} +const StreamComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() -function getResolveTicks(id: string, group: RecordGroup) { - if (isAbortProbeId(id)) { - return group === 'alpha' - ? abortProbeAlphaResolveTicks - : abortProbeBetaResolveTicks - } - - return group === 'alpha' ? alphaResolveTicks : betaResolveTicks -} - -// One tick = one 0ms timers-phase hop. Counting event-loop turns instead of -// milliseconds keeps the resolve/abort interleaving a pure function of the -// event-loop schedule: a wall-clock delay races the abort differently -// depending on runner load and instrumentation overhead, which made this -// benchmark's single measured run swing between runs. -function resolveAfterTicks( - ticks: number, - signal: AbortSignal, - value: () => T, - abortedValue: () => T, -) { - return new Promise((resolve) => { - if (signal.aborted) { - resolve(abortedValue()) - return - } - - let remaining = ticks - let timeoutId: ReturnType - - const onAbort = () => { - clearTimeout(timeoutId) - resolve(abortedValue()) - } - - const step = () => { - remaining -= 1 - - if (remaining <= 0) { - signal.removeEventListener('abort', onAbort) - resolve(value()) - return - } - - timeoutId = setTimeout(step, 0) - } - - signal.addEventListener('abort', onAbort, { once: true }) - timeoutId = setTimeout(step, 0) - }) -} - -function makeDeferredRecords( - id: string, - group: RecordGroup, - signal: AbortSignal, -) { - return resolveAfterTicks( - getResolveTicks(id, group), - signal, - () => makeAbortedRequestRecords(id, group), - () => [], - ) -} + return () => ( +
+

{data.value.eager}

+

loading-alpha

+

loading-beta

+ + {{ + default: () => ( + ) => ( +
    + {records.map((record) => ( +
  • {record.label}
  • + ))} +
+ )} + /> + ), + fallback: () => null, + }} +
+ + {{ + default: () => ( + ) => ( +
    + {records.map((record) => ( +
  • {record.label}
  • + ))} +
+ )} + /> + ), + fallback: () => null, + }} +
+
+ ) + }, +}) export const Route = createFileRoute('/stream/$id')({ - loader: ({ params, abortController }) => ({ + loader: ({ params }) => ({ eager: `eager-${params.id}`, - alpha: makeDeferredRecords(params.id, 'alpha', abortController.signal), - beta: makeDeferredRecords(params.id, 'beta', abortController.signal), + alpha: makeDeferredRecords(params.id, 'alpha', getRequestSignal()), + beta: makeDeferredRecords(params.id, 'beta', getRequestSignal()), }), component: StreamComponent, }) - -function StreamComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.eager}

-

loading-alpha

-

loading-beta

- - {{ - default: () => ( - ) => ( -
    - {records.map((record) => ( -
  • {record.label}
  • - ))} -
- )} - /> - ), - fallback: () => null, - }} -
- - {{ - default: () => ( - ) => ( -
    - {records.map((record) => ( -
  • {record.label}
  • - ))} -
- )} - /> - ), - fallback: () => null, - }} -
-
- ) -} diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts index 5ccc9f5d1d..e4e1eb66d4 100644 --- a/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server aborted-requests (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts index 9a5c211fee..a6f07b97be 100644 --- a/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { - for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) - } +const workload = workloadGroup.workloads[0]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts new file mode 100644 index 0000000000..89071137c3 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[2]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts new file mode 100644 index 0000000000..fa6a6693ed --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[1]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts new file mode 100644 index 0000000000..b2c3d24200 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[3]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json index 11ddcce4ea..2dba47fc99 100644 --- a/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json +++ b/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json @@ -7,7 +7,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "memory.bench.ts", + "memory*.bench.ts", "memory.flame.ts", "setup.ts", "vite.config.ts", diff --git a/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts index bc67b1cfc7..c00de7727a 100644 --- a/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,8 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + isolate: true, + ...memoryConfig('server'), name: '@benchmarks/memory-server error-paths (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/error-paths/shared.ts b/benchmarks/memory/server/scenarios/error-paths/shared.ts index 57e229b7e3..11ed293d22 100644 --- a/benchmarks/memory/server/scenarios/error-paths/shared.ts +++ b/benchmarks/memory/server/scenarios/error-paths/shared.ts @@ -9,8 +9,6 @@ export type { StartRequestHandler } type Framework = 'react' | 'solid' | 'vue' -// Sized to sit just above the 2s measured-run floor on CI (per-iteration -// cost with the pinned collection is ~0.13-0.19s across frameworks). const errorPathsIterations = 18 const redirectSeed = 0xdecafbad const notFoundSeed = 0xdecafb0d @@ -138,40 +136,36 @@ export function createWorkloadGroup( framework: Framework, handler: StartRequestHandler, ) { - const runRedirect = () => + const runRedirect = async () => runSequentialRequestLoop(handler, { random: redirectRandom, iterations: errorPathsIterations, buildRequest: buildRedirectRequest, validateResponse: validateRedirectResponse, - pinGcBetweenIterations: true, }) - const runNotFound = () => + const runNotFound = async () => runSequentialRequestLoop(handler, { random: notFoundRandom, iterations: errorPathsIterations, buildRequest: buildNotFoundRequest, validateResponse: validateNotFoundResponse, - pinGcBetweenIterations: true, }) - const runError = () => + const runError = async () => runSequentialRequestLoop(handler, { random: errorRandom, iterations: errorPathsIterations, buildRequest: buildErrorRequest, validateResponse: validateErrorResponse, - pinGcBetweenIterations: true, }) - const runUnmatched = () => + const runUnmatched = async () => runSequentialRequestLoop(handler, { random: unmatchedRandom, iterations: errorPathsIterations, buildRequest: buildUnmatchedRequest, validateResponse: validateNotFoundResponse, - pinGcBetweenIterations: true, }) return { diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts index 9a5c211fee..a6f07b97be 100644 --- a/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { - for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) - } +const workload = workloadGroup.workloads[0]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts new file mode 100644 index 0000000000..89071137c3 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[2]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts new file mode 100644 index 0000000000..fa6a6693ed --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[1]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts new file mode 100644 index 0000000000..b2c3d24200 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[3]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json index 4b61264e11..1e8103127a 100644 --- a/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json +++ b/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json @@ -7,7 +7,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "memory.bench.ts", + "memory*.bench.ts", "memory.flame.ts", "setup.ts", "vite.config.ts", diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts index 401d1e5f25..d7a0bb51b0 100644 --- a/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,8 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + isolate: true, + ...memoryConfig('server'), name: '@benchmarks/memory-server error-paths (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts index 9a5c211fee..a6f07b97be 100644 --- a/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { - for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) - } +const workload = workloadGroup.workloads[0]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) }) diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts new file mode 100644 index 0000000000..89071137c3 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[2]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts new file mode 100644 index 0000000000..fa6a6693ed --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[1]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts new file mode 100644 index 0000000000..b2c3d24200 --- /dev/null +++ b/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts @@ -0,0 +1,16 @@ +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' +import { workloadGroup } from './setup' + +await workloadGroup.sanity() + +const workload = workloadGroup.workloads[3]! + +test('memory', async ({ bench }) => { + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) +}) diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx b/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx index 17ade6bf5b..0bbf4a3dc6 100644 --- a/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx +++ b/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx @@ -1,11 +1,14 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const TargetComponent = defineComponent({ + setup() { + const params = Route.useParams() + + return () =>
{`target-${params.value.id}`}
+ }, +}) + export const Route = createFileRoute('/target/$id')({ component: TargetComponent, }) - -function TargetComponent() { - const params = Route.useParams() - - return
{`target-${params.value.id}`}
-} diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json index 9ad6481342..af8b83005c 100644 --- a/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json +++ b/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json @@ -7,7 +7,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "memory.bench.ts", + "memory*.bench.ts", "memory.flame.ts", "setup.ts", "vite.config.ts", diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts index 9a0ca28a25..3dc0762aa0 100644 --- a/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,8 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + isolate: true, + ...memoryConfig('server'), name: '@benchmarks/memory-server error-paths (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts index adaacda86e..dcfcf1f92b 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server peak-large-page (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/peak-large-page/shared.ts b/benchmarks/memory/server/scenarios/peak-large-page/shared.ts index 578fc9c5a2..085e576244 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/shared.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/shared.ts @@ -6,7 +6,7 @@ export type { StartRequestHandler } type Framework = 'react' | 'solid' | 'vue' const benchmarkSeed = 0x5eed_0005 -const peakLargePageIterations = 20 +const peakLargePageIterations = 1 const peakLargePageUrl = 'http://localhost/l1/l2/l3/l4/l5/l6/l7/l8' const levelEightMarker = 'data-bench="peak-large-page-level-8"' @@ -48,14 +48,12 @@ export function createWorkloadGroup( framework: Framework, handler: StartRequestHandler, ) { - const run = () => + const run = async () => runSequentialRequestLoop(handler, { seed: benchmarkSeed, iterations: peakLargePageIterations, buildRequest: buildPeakLargePageRequest, validateResponse: validatePeakLargePageResponse, - pinGcBetweenIterations: true, - verifyGcFloor: true, }) return { diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts index 27d4dd65f7..15b8c3a571 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server peak-large-page (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx index bd079aa1a0..7f7a42d645 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx @@ -1,28 +1,34 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelEightComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6/l7/l8')({ loader: () => makeLargePageLevelData(8, 0x5eed_1008), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelEightComponent, }) - -function LevelEightComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
-
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx index 7f69f6f438..a99c56e529 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelSevenComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6/l7')({ loader: () => makeLargePageLevelData(7, 0x5eed_1007), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelSevenComponent, }) - -function LevelSevenComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx index 75a7c717e3..3de3f03427 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelSixComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6')({ loader: () => makeLargePageLevelData(6, 0x5eed_1006), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelSixComponent, }) - -function LevelSixComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx index f390ae3db3..5d936f83b5 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelFiveComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3/l4/l5')({ loader: () => makeLargePageLevelData(5, 0x5eed_1005), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelFiveComponent, }) - -function LevelFiveComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx index 6b30bd50dc..8e10331f2d 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelFourComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3/l4')({ loader: () => makeLargePageLevelData(4, 0x5eed_1004), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelFourComponent, }) - -function LevelFourComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx index 6ec6f32fea..d69529c50c 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelThreeComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2/l3')({ loader: () => makeLargePageLevelData(3, 0x5eed_1003), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelThreeComponent, }) - -function LevelThreeComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx index e5b4cf0de1..d04bc7f827 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelTwoComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1/l2')({ loader: () => makeLargePageLevelData(2, 0x5eed_1002), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelTwoComponent, }) - -function LevelTwoComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx index a29e465cd4..a95ae7f9b0 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx @@ -1,29 +1,35 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLargePageHead, makeLargePageLevelData, } from '../../../large-page-data' +const LevelOneComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const first = data.value.records[0]! + + return ( +
+

{data.value.marker}

+

records: {data.value.records.length}

+
+

{first.name}

+

{first.id}

+

{first.description}

+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/l1')({ loader: () => makeLargePageLevelData(1, 0x5eed_1001), head: ({ loaderData }) => makeLargePageHead(loaderData), component: LevelOneComponent, }) - -function LevelOneComponent() { - const data = Route.useLoaderData() - const first = data.value.records[0]! - - return ( -
-

{data.value.marker}

-

records: {data.value.records.length}

-
-

{first.name}

-

{first.id}

-

{first.description}

-
- -
- ) -} diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts index 0f238bd7f7..3fab2aff9e 100644 --- a/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server peak-large-page (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts index 1e956958ec..35adf6a249 100644 --- a/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server request-churn (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/request-churn/shared.ts b/benchmarks/memory/server/scenarios/request-churn/shared.ts index a196eec8b5..b200c96ed6 100644 --- a/benchmarks/memory/server/scenarios/request-churn/shared.ts +++ b/benchmarks/memory/server/scenarios/request-churn/shared.ts @@ -62,13 +62,12 @@ export function createWorkloadGroup( return new Request(`http://localhost/items/${id}?q=${q}`, requestInit) } - const run = () => + const run = async () => runSequentialRequestLoop(handler, { random: benchmarkRandom, iterations: requestChurnIterations, buildRequest: buildItemRequest, validateResponse: validateItemResponse, - pinGcBetweenIterations: true, }) return { diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts index fbf8df9491..6601309a74 100644 --- a/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server request-churn (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx index a98d036565..570561f2a8 100644 --- a/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx +++ b/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' const itemIndexes = Array.from({ length: 5 }, (_, index) => index) @@ -6,6 +7,24 @@ type ItemSearch = { q: string } +const ItemComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.title}

+

{data.value.q}

+
    + {data.value.items.map((item) => ( +
  • {item.label}
  • + ))} +
+
+ ) + }, +}) + export const Route = createFileRoute('/items/$id')({ validateSearch: (search: Record): ItemSearch => ({ q: typeof search.q === 'string' ? search.q : '', @@ -22,19 +41,3 @@ export const Route = createFileRoute('/items/$id')({ }), component: ItemComponent, }) - -function ItemComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.title}

-

{data.value.q}

-
    - {data.value.items.map((item) => ( -
  • {item.label}
  • - ))} -
-
- ) -} diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts index a551a96e2f..7f15c5c7af 100644 --- a/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server request-churn (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts index de5549de3b..1ed3bcc335 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server serialization-payload (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/serialization-payload/shared.ts b/benchmarks/memory/server/scenarios/serialization-payload/shared.ts index ce095b5e10..14ec8f7e0a 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/shared.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/shared.ts @@ -9,7 +9,7 @@ export type { StartRequestHandler } type Framework = 'react' | 'solid' | 'vue' const benchmarkSeed = 0x51eaa11 -const serializationPayloadIterations = 12 +const serializationPayloadIterations = 1 const payloadPageMarker = 'data-bench="serialization-payload"' const requestInit = { @@ -55,14 +55,12 @@ export function createWorkloadGroup( framework: Framework, handler: StartRequestHandler, ) { - const run = () => + const run = async () => runSequentialRequestLoop(handler, { seed: benchmarkSeed, iterations: serializationPayloadIterations, buildRequest: buildPayloadRequest, validateResponse: validatePayloadResponse, - pinGcBetweenIterations: true, - verifyGcFloor: true, }) return { diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts index 926646ee12..a2d04b986c 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server serialization-payload (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx b/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx index e6b4cfadfb..37b1a590e4 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx +++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx @@ -1,17 +1,20 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeSerializationPayload } from '../../../serialization-payload' +const DataComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+ Map size: {data.value.lookup.size} +
+ ) + }, +}) + export const Route = createFileRoute('/data/$id')({ loader: ({ params }) => makeSerializationPayload(params.id), component: DataComponent, }) - -function DataComponent() { - const data = Route.useLoaderData() - - return ( -
- Map size: {data.value.lookup.size} -
- ) -} diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts index 41a5596adf..b63a561228 100644 --- a/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server serialization-payload (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts index 68d9ed839b..f72cc53d6f 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server server-fn-churn (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts b/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts index 6e2959e757..167b24d3b6 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts @@ -38,8 +38,6 @@ type SerovalNode = const benchmarkSeed = 0xdecafbad const payloadSeed = 0x51f0cafe const fixtureCount = 16 -// Sized to sit just above the 2s measured-run floor on CI (per-iteration -// cost with the pinned collection is ~0.08-0.11s across frameworks). const serverFnChurnIterations = 30 const origin = 'http://localhost' const tssContentTypeFramed = 'application/x-tss-framed' @@ -204,11 +202,10 @@ export async function createWorkloadGroup( handler: StartRequestHandler, ) { const urls = await discoverUrls(handler) - const run = () => + const run = async () => runSequentialRequestLoop(handler, { seed: benchmarkSeed, iterations: serverFnChurnIterations, - pinGcBetweenIterations: true, buildRequest: (_random, index) => { const fixtureIndex = Math.floor(index / 2) % fixtureCount diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts index 8d6d226e97..4fba196bd2 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server server-fn-churn (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts index 0e249b9f3b..5ab5ec37e3 100644 --- a/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server server-fn-churn (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts b/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts b/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts index 5af0f0d138..5d555441b6 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server streaming-peak (react)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/streaming-peak/shared.ts b/benchmarks/memory/server/scenarios/streaming-peak/shared.ts index 6b45470329..c027047408 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/shared.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/shared.ts @@ -9,7 +9,7 @@ export type { StartRequestHandler } type Framework = 'react' | 'solid' | 'vue' const benchmarkSeed = 0xdecafbad -const streamingPeakIterations = 20 +const streamingPeakIterations = 1 const fallbackMarker = 'streaming-peak-fallback-0' const requestInit = { @@ -50,7 +50,7 @@ async function readStreamingBody(response: Response) { let body = '' let chunkCount = 0 - while (true) { + for (;;) { const result = await reader.read() if (result.done) { @@ -92,18 +92,21 @@ export function createWorkloadGroup( framework: Framework, handler: StartRequestHandler, ) { - const run = () => + const run = async () => runSequentialRequestLoop(handler, { seed: benchmarkSeed, iterations: streamingPeakIterations, buildRequest: buildStreamingRequest, validateResponse: validateStreamingResponse, - pinGcBetweenIterations: true, - verifyGcFloor: true, }) return { - sanity: () => assertStreamingPeakSanity(handler), + sanity: async () => { + // Import the route chunks before checking streaming. Cold disk I/O can + // otherwise outlast the deferred payload and collapse the first response. + await run() + await assertStreamingPeakSanity(handler) + }, workloads: [ { name: `mem server streaming-peak chunked (${framework})`, diff --git a/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/streaming-peak/solid/vite.config.ts b/benchmarks/memory/server/scenarios/streaming-peak/solid/vite.config.ts index 18bf5b2d04..5fbdb48c23 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/solid/vite.config.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server streaming-peak (solid)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/scenarios/streaming-peak/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/streaming-peak/vue/memory.bench.ts index 9a5c211fee..8b5f16ad63 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/vue/memory.bench.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/vue/memory.bench.ts @@ -1,11 +1,16 @@ -import { bench, describe } from 'vitest' -import { memoryBenchOptions } from '#memory-server/bench-utils' +import { test } from 'vitest' +import { + memoryBenchHooks, + memoryBenchOptions, +} from '#memory-server/bench-utils' import { workloadGroup } from './setup' await workloadGroup.sanity() -describe('memory', () => { +test('memory', async ({ bench }) => { for (const workload of workloadGroup.workloads) { - bench(workload.name, workload.run, memoryBenchOptions) + await bench(workload.name, memoryBenchHooks(), workload.run).run( + memoryBenchOptions, + ) } }) diff --git a/benchmarks/memory/server/scenarios/streaming-peak/vue/src/routes/stream.$id.tsx b/benchmarks/memory/server/scenarios/streaming-peak/vue/src/routes/stream.$id.tsx index 0c71a8d3a0..750d1cb47d 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/vue/src/routes/stream.$id.tsx +++ b/benchmarks/memory/server/scenarios/streaming-peak/vue/src/routes/stream.$id.tsx @@ -1,5 +1,5 @@ import { Await, createFileRoute } from '@tanstack/vue-router' -import { Suspense } from 'vue' +import { Suspense, defineComponent } from 'vue' import { makeDeferredSectionPayload, type DeferredSectionPayload, @@ -7,6 +7,47 @@ import { const fallbackFlushTicks = 20 +const StreamComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => { + const deferredSections = [ + { index: 0, promise: data.value.deferred0 }, + { index: 1, promise: data.value.deferred1 }, + { index: 2, promise: data.value.deferred2 }, + { index: 3, promise: data.value.deferred3 }, + ] as const + + return ( +
+

{data.value.eager}

+ {deferredSections.map(({ index, promise }) => ( + <> +

+ streaming-peak-fallback-{index} +

+ + {{ + default: () => ( + ( + + )} + /> + ), + fallback: () => null, + }} + + + ))} +
+ ) + } + }, +}) + export const Route = createFileRoute('/stream/$id')({ loader: ({ params }) => ({ eager: `streaming-peak-eager-${params.id}`, @@ -48,42 +89,6 @@ function makeDeferredSection(id: string, sectionIndex: number) { ) } -function StreamComponent() { - const data = Route.useLoaderData() - const deferredSections = [ - { index: 0, promise: data.value.deferred0 }, - { index: 1, promise: data.value.deferred1 }, - { index: 2, promise: data.value.deferred2 }, - { index: 3, promise: data.value.deferred3 }, - ] as const - - return ( -
-

{data.value.eager}

- {deferredSections.map(({ index, promise }) => ( - <> -

- streaming-peak-fallback-{index} -

- - {{ - default: () => ( - ( - - )} - /> - ), - fallback: () => null, - }} - - - ))} -
- ) -} - function DeferredSection({ section }: { section: DeferredSectionPayload }) { const marker = `streaming-peak-deferred-${section.index}` diff --git a/benchmarks/memory/server/scenarios/streaming-peak/vue/vite.config.ts b/benchmarks/memory/server/scenarios/streaming-peak/vue/vite.config.ts index 7cd481da0b..cd848584a5 100644 --- a/benchmarks/memory/server/scenarios/streaming-peak/vue/vite.config.ts +++ b/benchmarks/memory/server/scenarios/streaming-peak/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { memoryConfig } from '../../../../runtime' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,19 +23,7 @@ export default defineConfig({ minify: false, }, test: { - // Keep lazily-compiled code alive for the whole run: the pinned - // collections age code fast enough for V8 to flush unused bytecode, - // and the mid-measurement recompile injects a multi-MB allocation - // burst at a run-dependent time. - execArgv: [ - '--no-flush-bytecode', - // Pre-size the V8 heap so no space has to grow mid-measurement: - // heap-growth events allocate several MB at a run-dependent moment, - // which flips the measured peak bimodally between identical runs. - '--initial-old-space-size=64', - '--min-semi-space-size=16', - '--max-semi-space-size=16', - ], + ...memoryConfig('server'), name: '@benchmarks/memory-server streaming-peak (vue)', watch: false, environment: 'node', diff --git a/benchmarks/memory/server/tsconfig.json b/benchmarks/memory/server/tsconfig.json index 5d5dcbf825..86d36f047a 100644 --- a/benchmarks/memory/server/tsconfig.json +++ b/benchmarks/memory/server/tsconfig.json @@ -3,5 +3,10 @@ "compilerOptions": { "types": ["node", "vite/client", "vitest/globals"] }, - "include": ["bench-utils.ts"] + "include": [ + "bench-utils.ts", + "scenarios/*/shared.ts", + "../runtime.ts", + "vitest.setup.ts" + ] } diff --git a/benchmarks/memory/tsconfig.json b/benchmarks/memory/tsconfig.json new file mode 100644 index 0000000000..5a325f3b6c --- /dev/null +++ b/benchmarks/memory/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["runtime.ts"] +} diff --git a/benchmarks/memory/turn.ts b/benchmarks/memory/turn.ts new file mode 100644 index 0000000000..08729685fe --- /dev/null +++ b/benchmarks/memory/turn.ts @@ -0,0 +1,34 @@ +export function isMemoryInstrumented() { + return ( + process.env.CODSPEED_ENV !== undefined && + process.env.CODSPEED_RUNNER_MODE === 'memory' + ) +} + +// CodSpeed calls beforeEach before its forced GC and measurement marker. End +// the previous warmup's job so WeakRef targets can be released by that GC. +export function endMemoryTurn() { + return new Promise((resolve) => setImmediate(resolve)) +} + +/** + * Per-invocation bench hooks. CodSpeed runs them around every warmup + * invocation and the measured one, outside the measurement marker: the turn + * ends first, then the workload prepares fresh state before the forced GC. + */ +export function memoryBenchHooks( + workload: { + before?: () => Promise | void + after?: () => Promise | void + } = {}, +) { + return { + async beforeEach() { + if (isMemoryInstrumented()) { + await endMemoryTurn() + } + await workload.before?.() + }, + afterEach: workload.after, + } +} diff --git a/benchmarks/ssr/README.md b/benchmarks/ssr/README.md index 625e1006c5..3d90af1598 100644 --- a/benchmarks/ssr/README.md +++ b/benchmarks/ssr/README.md @@ -98,3 +98,18 @@ Use `react`, `solid`, or `vue` for ``. The baseline projects use `@be - Server-function loops must include `sec-fetch-site: same-origin` so the default CSRF middleware accepts the request. - Loops that expect non-200 responses pass a custom `validateResponse` to `runRequestLoop`. - Bench loops must build deterministic requests from the seeded random helper and consume response bodies through `runRequestLoop` or `runSsrRequestLoop`. + +## Optional React Link workloads + +The [opt-in Link suite](../client-nav/README.md#opt-in-react-link-performance-suite) +adds focused standalone React Router SSR coverage for params/updaters, +inheritance, search middlewares, optional/splat segments, encoding, masks, +rewrites, and active props. Each timed batch creates four fresh routers and +renders their Links to HTML; it does not measure Start HTTP/streaming overhead. + +```bash +CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:ssr --outputStyle=stream --skipRemoteCache -- --run +``` + +These cases are excluded from this directory's aggregate projects and normal +CodSpeed dependency graph; they only run through the dedicated target above. diff --git a/benchmarks/ssr/bench-utils.test.ts b/benchmarks/ssr/bench-utils.test.ts new file mode 100644 index 0000000000..c6a520447b --- /dev/null +++ b/benchmarks/ssr/bench-utils.test.ts @@ -0,0 +1,145 @@ +import { describe, expect, it } from 'vitest' +import { buildRequestSequences, runRequestLoop } from './bench-utils' +import type { StartRequestHandler } from './bench-utils' + +function deferred() { + let resolve = () => {} + const promise = new Promise((resolvePromise) => { + resolve = resolvePromise + }) + return { promise, resolve } +} + +describe('runRequestLoop', () => { + it('caps fixed concurrency and waits for every streaming body', async () => { + const concurrency = 4 + const totalRequests = 20 + const firstWaveStarted = deferred() + let builtRequests = 0 + let executedRequests = 0 + let validatedResponses = 0 + let finishedBodies = 0 + let inFlightRequests = 0 + let maximumInFlightRequests = 0 + + const handler: StartRequestHandler = { + fetch() { + expect(builtRequests).toBe(totalRequests) + executedRequests += 1 + inFlightRequests += 1 + maximumInFlightRequests = Math.max( + maximumInFlightRequests, + inFlightRequests, + ) + + if (inFlightRequests === concurrency) { + firstWaveStarted.resolve() + } + + const body = new ReadableStream({ + async start(controller) { + await firstWaveStarted.promise + controller.enqueue(new Uint8Array([1])) + controller.close() + finishedBodies += 1 + inFlightRequests -= 1 + }, + }) + + return new Response(body) + }, + } + + await runRequestLoop(handler, { + seed: 123, + concurrency, + totalRequests, + buildRequest: (_random, index) => { + builtRequests += 1 + return new Request(`http://localhost/request/${index}`) + }, + validateResponse: () => { + validatedResponses += 1 + }, + }) + + expect(builtRequests).toBe(totalRequests) + expect(executedRequests).toBe(totalRequests) + expect(validatedResponses).toBe(totalRequests) + expect(maximumInFlightRequests).toBe(concurrency) + expect(inFlightRequests).toBe(0) + expect(finishedBodies).toBe(totalRequests) + }) + + it('builds identical predetermined worker sequences from identical seeds', () => { + const buildSequences = (seed: number) => + buildRequestSequences({ + seed, + concurrency: 4, + totalRequests: 12, + buildRequest: (random, index) => + new Request( + `http://localhost/request/${index}?value=${random().toString(36)}`, + ), + }).map((requests) => requests.map((request) => request.url)) + + const first = buildSequences(456) + const second = buildSequences(456) + + expect(second).toEqual(first) + expect(first.map((requests) => requests.map(requestIndex))).toEqual([ + [0, 4, 8], + [1, 5, 9], + [2, 6, 10], + [3, 7, 11], + ]) + }) + + it('drains every started body before reporting a worker failure', async () => { + const concurrency = 4 + const firstWaveStarted = deferred() + let executedRequests = 0 + let finishedBodies = 0 + let inFlightRequests = 0 + + const handler: StartRequestHandler = { + fetch(request) { + executedRequests += 1 + inFlightRequests += 1 + if (inFlightRequests === concurrency) { + firstWaveStarted.resolve() + } + + const body = new ReadableStream({ + async start(controller) { + await firstWaveStarted.promise + controller.close() + finishedBodies += 1 + inFlightRequests -= 1 + }, + }) + + return new Response(body, { + status: request.url.endsWith('/0') ? 500 : 200, + }) + }, + } + + await expect( + runRequestLoop(handler, { + seed: 789, + concurrency, + totalRequests: 12, + buildRequest: (_random, index) => + new Request(`http://localhost/request/${index}`), + }), + ).rejects.toThrow('non-200 status 500') + + expect(finishedBodies).toBe(executedRequests) + expect(inFlightRequests).toBe(0) + }) +}) + +function requestIndex(url: string) { + return Number(new URL(url).pathname.split('/').at(-1)) +} diff --git a/benchmarks/ssr/bench-utils.ts b/benchmarks/ssr/bench-utils.ts index 353c56cb4b..7a54fce897 100644 --- a/benchmarks/ssr/bench-utils.ts +++ b/benchmarks/ssr/bench-utils.ts @@ -9,7 +9,8 @@ export interface RunSsrRequestLoopOptions { export interface RunRequestLoopOptions { seed: number - iterations?: number + concurrency: number + totalRequests: number buildRequest: (random: () => number, index: number) => Request validateResponse?: (response: Response, request: Request) => void } @@ -99,13 +100,18 @@ export async function runRequestLoop( handler: StartRequestHandler, { seed, - iterations = 10, + concurrency, + totalRequests, buildRequest, validateResponse, }: RunRequestLoopOptions, ) { - const random = createDeterministicRandom(seed) - const pendingBodyReads: Array> = [] + const requestSequences = buildRequestSequences({ + seed, + concurrency, + totalRequests, + buildRequest, + }) const validate = validateResponse ?? ((response: Response, request: Request) => { @@ -116,20 +122,84 @@ export async function runRequestLoop( } }) - for (let index = 0; index < iterations; index++) { - const request = buildRequest(random, index) - const response = await handler.fetch(request) + let startWorkers = () => {} + const startBarrier = new Promise((resolve) => { + startWorkers = resolve + }) - try { - validate(response, request) - } catch (error) { - await Promise.allSettled(pendingBodyReads) + const workers = requestSequences.map(async (requests) => { + await startBarrier - throw error + for (const request of requests) { + const response = await handler.fetch(request) + let validationFailure: { error: unknown } | undefined + + try { + validate(response, request) + } catch (error) { + validationFailure = { error } + } + + await drainResponse(response) + + if (validationFailure) { + throw validationFailure.error + } } + }) - pendingBodyReads.push(drainResponse(response)) + startWorkers() + const results = await Promise.allSettled(workers) + const failedWorker = results.find( + (result): result is PromiseRejectedResult => result.status === 'rejected', + ) + + if (failedWorker) { + throw failedWorker.reason + } +} + +export type BuildRequestSequencesOptions = Pick< + RunRequestLoopOptions, + 'seed' | 'concurrency' | 'totalRequests' | 'buildRequest' +> + +/** + * Build the entire seeded workload before any request starts, then partition + * it round-robin so completion timing can never change a worker's next input. + */ +export function buildRequestSequences({ + seed, + concurrency, + totalRequests, + buildRequest, +}: BuildRequestSequencesOptions): Array> { + assertPositiveInteger('concurrency', concurrency) + assertPositiveInteger('totalRequests', totalRequests) + + if (concurrency > totalRequests) { + throw new RangeError( + `concurrency (${concurrency}) cannot exceed totalRequests (${totalRequests})`, + ) } - await Promise.all(pendingBodyReads) + const random = createDeterministicRandom(seed) + const requestSequences = Array.from( + { length: concurrency }, + () => new Array(), + ) + + for (let index = 0; index < totalRequests; index++) { + requestSequences[index % concurrency]!.push(buildRequest(random, index)) + } + + return requestSequences +} + +function assertPositiveInteger(name: string, value: number) { + if (!Number.isSafeInteger(value) || value < 1) { + throw new RangeError( + `${name} must be a positive integer; received ${value}`, + ) + } } diff --git a/benchmarks/ssr/package.json b/benchmarks/ssr/package.json index 40cd97df5e..20c1837468 100644 --- a/benchmarks/ssr/package.json +++ b/benchmarks/ssr/package.json @@ -15,14 +15,17 @@ "vue": "^3.5.16" }, "devDependencies": { - "@codspeed/vitest-plugin": "^5.5.0", + "@codspeed/vitest-plugin": "^6.0.1", "@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-vue-jsx": "^5.1.5", - "seroval": "^1.5.4", - "typescript": "^6.0.2", + "@types/react": "catalog:", + "seroval": "^1.6.7", + "@typescript/native": "npm:typescript@^7.0.2", + "jsdom": "29.1.1", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11", - "vitest": "^4.1.4" + "vitest": "catalog:" }, "nx": { "targets": { @@ -113,7 +116,14 @@ "build:vue" ], "options": { - "command": "NODE_ENV=production vitest bench", + "command": "NODE_ENV=production vitest bench --mode benchmark", + "cwd": "benchmarks/ssr" + } + }, + "test:unit": { + "executor": "nx:run-commands", + "options": { + "command": "vitest run --config ./vitest.unit.config.ts", "cwd": "benchmarks/ssr" } }, @@ -124,7 +134,7 @@ "build:react" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts", "cwd": "benchmarks/ssr" } }, @@ -135,7 +145,7 @@ "build:solid" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts", "cwd": "benchmarks/ssr" } }, @@ -146,12 +156,16 @@ "build:vue" ], "options": { - "command": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts", + "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts", "cwd": "benchmarks/ssr" } }, "test:types": { - "executor": "nx:noop", + "executor": "nx:run-commands", + "options": { + "command": "tsc -p ./tsconfig.json --noEmit", + "cwd": "benchmarks/ssr" + }, "dependsOn": [ { "projects": [ @@ -203,6 +217,13 @@ ], "target": "test:types:ssr" } + ], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "{workspaceRoot}/benchmarks/cpu-simulation.ts", + "dependentTaskOutputs" ] } } diff --git a/benchmarks/ssr/react/speed.bench.ts b/benchmarks/ssr/react/speed.bench.ts index 419b1ccb36..6825a7ddfb 100644 --- a/benchmarks/ssr/react/speed.bench.ts +++ b/benchmarks/ssr/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { runSsrRequestLoop } from '../bench-utils' import type { StartRequestHandler } from '../bench-utils' @@ -11,14 +11,12 @@ const { default: handler } = (await import( default: StartRequestHandler } -describe('ssr', () => { - bench( - 'ssr request loop (react)', - () => runSsrRequestLoop(handler, { seed: benchmarkSeed }), - { - warmupIterations: 100, - time: 10_000, - throws: true, - }, - ) +test('ssr', async ({ bench }) => { + await bench('ssr request loop (react)', async () => + runSsrRequestLoop(handler, { seed: benchmarkSeed }), + ).run({ + warmupIterations: 100, + time: 10_000, + throws: true, + }) }) diff --git a/benchmarks/ssr/react/vite.config.ts b/benchmarks/ssr/react/vite.config.ts index 04f15c3959..e607db366b 100644 --- a/benchmarks/ssr/react/vite.config.ts +++ b/benchmarks/ssr/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/assets/react/speed.assets-linked-css-control.bench.ts b/benchmarks/ssr/scenarios/assets/react/speed.assets-linked-css-control.bench.ts new file mode 100644 index 0000000000..0496613afb --- /dev/null +++ b/benchmarks/ssr/scenarios/assets/react/speed.assets-linked-css-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertAssetsScenario, + assetsBenchOptions, + runAssetsLinkedControlLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertAssetsScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr assets linked-css control (react)', async () => + runAssetsLinkedControlLoop(handler), + ).run(assetsBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/assets/react/speed.bench.ts b/benchmarks/ssr/scenarios/assets/react/speed.bench.ts index a54042cd86..7dc57d89f1 100644 --- a/benchmarks/ssr/scenarios/assets/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/assets/react/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertAssetsScenario, assetsBenchOptions, runAssetsInlineLoop, - runAssetsLinkedControlLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertAssetsScenario(handler) -describe('ssr', () => { - bench( - 'ssr assets inline-css cdn (react)', - () => runAssetsInlineLoop(handler), - assetsBenchOptions, - ) - bench( - 'ssr assets linked-css control (react)', - () => runAssetsLinkedControlLoop(handler), - assetsBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr assets inline-css cdn (react)', async () => + runAssetsInlineLoop(handler), + ).run(assetsBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/assets/react/tsconfig.json b/benchmarks/ssr/scenarios/assets/react/tsconfig.json index 91027bfc88..cf14e1d440 100644 --- a/benchmarks/ssr/scenarios/assets/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/assets/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/assets/react/vite.config.ts b/benchmarks/ssr/scenarios/assets/react/vite.config.ts index 91534d3de8..5990bba6d3 100644 --- a/benchmarks/ssr/scenarios/assets/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/assets/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -27,6 +28,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr assets (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/assets/shared.ts b/benchmarks/ssr/scenarios/assets/shared.ts index 3974988698..ec811794e3 100644 --- a/benchmarks/ssr/scenarios/assets/shared.ts +++ b/benchmarks/ssr/scenarios/assets/shared.ts @@ -7,8 +7,8 @@ export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad const origin = 'http://localhost' const cdnOrigin = 'https://cdn.example.com' -const inlineCssLoopIterations = 25 -const linkedCssLoopIterations = 30 +const inlineCssLoopTotalRequests = 32 +const linkedCssLoopTotalRequests = 32 const inlineRequestInit = { method: 'GET', @@ -41,7 +41,8 @@ function buildAssetsRequest(random: () => number, requestInit: RequestInit) { export function runAssetsInlineLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: inlineCssLoopIterations, + concurrency: 16, + totalRequests: inlineCssLoopTotalRequests, buildRequest: (random) => buildAssetsRequest(random, inlineRequestInit), }) } @@ -49,7 +50,8 @@ export function runAssetsInlineLoop(handler: StartRequestHandler) { export function runAssetsLinkedControlLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: linkedCssLoopIterations, + concurrency: 16, + totalRequests: linkedCssLoopTotalRequests, buildRequest: (random) => buildAssetsRequest(random, linkedRequestInit), }) } diff --git a/benchmarks/ssr/scenarios/assets/solid/speed.assets-linked-css-control.bench.ts b/benchmarks/ssr/scenarios/assets/solid/speed.assets-linked-css-control.bench.ts new file mode 100644 index 0000000000..d159124a04 --- /dev/null +++ b/benchmarks/ssr/scenarios/assets/solid/speed.assets-linked-css-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertAssetsScenario, + assetsBenchOptions, + runAssetsLinkedControlLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertAssetsScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr assets linked-css control (solid)', async () => + runAssetsLinkedControlLoop(handler), + ).run(assetsBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/assets/solid/speed.bench.ts b/benchmarks/ssr/scenarios/assets/solid/speed.bench.ts index 49d7722163..47f483df11 100644 --- a/benchmarks/ssr/scenarios/assets/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/assets/solid/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertAssetsScenario, assetsBenchOptions, runAssetsInlineLoop, - runAssetsLinkedControlLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertAssetsScenario(handler) -describe('ssr', () => { - bench( - 'ssr assets inline-css cdn (solid)', - () => runAssetsInlineLoop(handler), - assetsBenchOptions, - ) - bench( - 'ssr assets linked-css control (solid)', - () => runAssetsLinkedControlLoop(handler), - assetsBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr assets inline-css cdn (solid)', async () => + runAssetsInlineLoop(handler), + ).run(assetsBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/assets/solid/tsconfig.json b/benchmarks/ssr/scenarios/assets/solid/tsconfig.json index b1806caa67..42c3a2160f 100644 --- a/benchmarks/ssr/scenarios/assets/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/assets/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/assets/solid/vite.config.ts b/benchmarks/ssr/scenarios/assets/solid/vite.config.ts index 788ac1f5b8..3ee54e5ae2 100644 --- a/benchmarks/ssr/scenarios/assets/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/assets/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -27,6 +28,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr assets (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/assets/vue/speed.assets-linked-css-control.bench.ts b/benchmarks/ssr/scenarios/assets/vue/speed.assets-linked-css-control.bench.ts new file mode 100644 index 0000000000..e56d41df6b --- /dev/null +++ b/benchmarks/ssr/scenarios/assets/vue/speed.assets-linked-css-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertAssetsScenario, + assetsBenchOptions, + runAssetsLinkedControlLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertAssetsScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr assets linked-css control (vue)', async () => + runAssetsLinkedControlLoop(handler), + ).run(assetsBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/assets/vue/speed.bench.ts b/benchmarks/ssr/scenarios/assets/vue/speed.bench.ts index 01eb3b9d5a..3f77a0dcc1 100644 --- a/benchmarks/ssr/scenarios/assets/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/assets/vue/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertAssetsScenario, assetsBenchOptions, runAssetsInlineLoop, - runAssetsLinkedControlLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertAssetsScenario(handler) -describe('ssr', () => { - bench( - 'ssr assets inline-css cdn (vue)', - () => runAssetsInlineLoop(handler), - assetsBenchOptions, - ) - bench( - 'ssr assets linked-css control (vue)', - () => runAssetsLinkedControlLoop(handler), - assetsBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr assets inline-css cdn (vue)', async () => + runAssetsInlineLoop(handler), + ).run(assetsBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.$y.tsx b/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.$y.tsx index a20e292938..a29fe59f22 100644 --- a/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.$y.tsx +++ b/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.$y.tsx @@ -1,6 +1,21 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import '../styles/assets-leaf.css' +const LeafComponent = defineComponent({ + setup() { + const params = Route.useParams() + + return () => ( +
+

+ assets-leaf-{params.value.x}-{params.value.y} +

+
+ ) + }, +}) + export const Route = createFileRoute('/a/$x/$y')({ head: ({ params }) => ({ meta: [{ title: `SSR Assets ${params.x} ${params.y}` }], @@ -12,15 +27,3 @@ export const Route = createFileRoute('/a/$x/$y')({ }), component: LeafComponent, }) - -function LeafComponent() { - const params = Route.useParams() - - return ( -
-

- assets-leaf-{params.value.x}-{params.value.y} -

-
- ) -} diff --git a/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.tsx b/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.tsx index f8038f6f28..e1fe0418e4 100644 --- a/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.tsx +++ b/benchmarks/ssr/scenarios/assets/vue/src/routes/a.$x.tsx @@ -1,6 +1,20 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import '../styles/assets-a.css' +const LevelAComponent = defineComponent({ + setup() { + const params = Route.useParams() + + return () => ( +
+

assets-level-a-{params.value.x}

+ +
+ ) + }, +}) + export const Route = createFileRoute('/a/$x')({ head: ({ params }) => ({ meta: [{ title: `SSR Assets ${params.x}` }], @@ -12,14 +26,3 @@ export const Route = createFileRoute('/a/$x')({ }), component: LevelAComponent, }) - -function LevelAComponent() { - const params = Route.useParams() - - return ( -
-

assets-level-a-{params.value.x}

- -
- ) -} diff --git a/benchmarks/ssr/scenarios/assets/vue/tsconfig.json b/benchmarks/ssr/scenarios/assets/vue/tsconfig.json index 4fe3ccecb1..08c94853f4 100644 --- a/benchmarks/ssr/scenarios/assets/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/assets/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/assets/vue/vite.config.ts b/benchmarks/ssr/scenarios/assets/vue/vite.config.ts index 8beb38c972..e664b9b02b 100644 --- a/benchmarks/ssr/scenarios/assets/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/assets/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -27,6 +28,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr assets (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/before-load/react/speed.bench.ts b/benchmarks/ssr/scenarios/before-load/react/speed.bench.ts index 09073687c0..8a4355a168 100644 --- a/benchmarks/ssr/scenarios/before-load/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/before-load/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertBeforeLoadScenario, beforeLoadBenchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertBeforeLoadScenario(handler) -describe('ssr', () => { - bench( - 'ssr before-load chain (react)', - () => runBeforeLoadLoop(handler), - beforeLoadBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr before-load chain (react)', async () => + runBeforeLoadLoop(handler), + ).run(beforeLoadBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/before-load/react/vite.config.ts b/benchmarks/ssr/scenarios/before-load/react/vite.config.ts index 2767b85787..3fd72c5f1d 100644 --- a/benchmarks/ssr/scenarios/before-load/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/before-load/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr before-load (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/before-load/shared-bench.ts b/benchmarks/ssr/scenarios/before-load/shared-bench.ts index 39579fc818..cf3a02f114 100644 --- a/benchmarks/ssr/scenarios/before-load/shared-bench.ts +++ b/benchmarks/ssr/scenarios/before-load/shared-bench.ts @@ -5,7 +5,7 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const beforeLoadLoopIterations = 30 +const beforeLoadLoopTotalRequests = 32 const requestInit = { method: 'GET', @@ -57,7 +57,8 @@ export const beforeLoadBenchOptions = { export function runBeforeLoadLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: beforeLoadLoopIterations, + concurrency: 16, + totalRequests: beforeLoadLoopTotalRequests, buildRequest: buildBeforeLoadRequest, }) } diff --git a/benchmarks/ssr/scenarios/before-load/solid/speed.bench.ts b/benchmarks/ssr/scenarios/before-load/solid/speed.bench.ts index 5f6e8baf8a..27e0d3a64c 100644 --- a/benchmarks/ssr/scenarios/before-load/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/before-load/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertBeforeLoadScenario, beforeLoadBenchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertBeforeLoadScenario(handler) -describe('ssr', () => { - bench( - 'ssr before-load chain (solid)', - () => runBeforeLoadLoop(handler), - beforeLoadBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr before-load chain (solid)', async () => + runBeforeLoadLoop(handler), + ).run(beforeLoadBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/before-load/solid/vite.config.ts b/benchmarks/ssr/scenarios/before-load/solid/vite.config.ts index ea0177e059..a20e32742e 100644 --- a/benchmarks/ssr/scenarios/before-load/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/before-load/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr before-load (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/before-load/vue/speed.bench.ts b/benchmarks/ssr/scenarios/before-load/vue/speed.bench.ts index d2cfd6814b..8684c159eb 100644 --- a/benchmarks/ssr/scenarios/before-load/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/before-load/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertBeforeLoadScenario, beforeLoadBenchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertBeforeLoadScenario(handler) -describe('ssr', () => { - bench( - 'ssr before-load chain (vue)', - () => runBeforeLoadLoop(handler), - beforeLoadBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr before-load chain (vue)', async () => + runBeforeLoadLoop(handler), + ).run(beforeLoadBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/before-load/vue/src/routes/$a.$b.$c.tsx b/benchmarks/ssr/scenarios/before-load/vue/src/routes/$a.$b.$c.tsx index 118e16553b..178d4071eb 100644 --- a/benchmarks/ssr/scenarios/before-load/vue/src/routes/$a.$b.$c.tsx +++ b/benchmarks/ssr/scenarios/before-load/vue/src/routes/$a.$b.$c.tsx @@ -1,6 +1,15 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeBeforeLoadMarker, type BeforeLoadContext } from '../../../shared' +const LevelCComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () =>
{data.value.marker}
+ }, +}) + export const Route = createFileRoute('/$a/$b/$c')({ beforeLoad: ({ params, context }) => { const parent = context as BeforeLoadContext @@ -15,9 +24,3 @@ export const Route = createFileRoute('/$a/$b/$c')({ }), component: LevelCComponent, }) - -function LevelCComponent() { - const data = Route.useLoaderData() - - return
{data.value.marker}
-} diff --git a/benchmarks/ssr/scenarios/before-load/vue/vite.config.ts b/benchmarks/ssr/scenarios/before-load/vue/vite.config.ts index 181200a004..093776869f 100644 --- a/benchmarks/ssr/scenarios/before-load/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/before-load/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr before-load (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/control-flow/react/speed.bench.ts b/benchmarks/ssr/scenarios/control-flow/react/speed.bench.ts index 4fca8eb477..899f400799 100644 --- a/benchmarks/ssr/scenarios/control-flow/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/control-flow/react/speed.bench.ts @@ -1,12 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertControlFlowSanity, controlFlowBenchOptions, - runErrorLoop, - runNotFoundLoop, runRedirectLoop, - runRouteHeadersLoop, - runUnmatchedLoop, } from '../shared' import type { StartRequestHandler } from '../shared' @@ -20,34 +16,8 @@ const { default: handler } = (await import( await assertControlFlowSanity(handler) -describe('ssr', () => { - bench( - 'ssr redirect (react)', - () => runRedirectLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr not-found (react)', - () => runNotFoundLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow error 500 (react)', - () => runErrorLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow unmatched 404 (react)', - () => runUnmatchedLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow route headers (react)', - () => runRouteHeadersLoop(handler), +test('ssr', async ({ bench }) => { + await bench('ssr redirect (react)', async () => runRedirectLoop(handler)).run( controlFlowBenchOptions, ) }) diff --git a/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-error-500.bench.ts b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-error-500.bench.ts new file mode 100644 index 0000000000..0a93c5eac3 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-error-500.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runErrorLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow error 500 (react)', async () => + runErrorLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-route-headers.bench.ts b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-route-headers.bench.ts new file mode 100644 index 0000000000..53e09fd34e --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-route-headers.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runRouteHeadersLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow route headers (react)', async () => + runRouteHeadersLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-unmatched-404.bench.ts b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-unmatched-404.bench.ts new file mode 100644 index 0000000000..1cd7c1044c --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/react/speed.control-flow-unmatched-404.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runUnmatchedLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow unmatched 404 (react)', async () => + runUnmatchedLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/react/speed.not-found.bench.ts b/benchmarks/ssr/scenarios/control-flow/react/speed.not-found.bench.ts new file mode 100644 index 0000000000..1e8abfd318 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/react/speed.not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runNotFoundLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr not-found (react)', async () => + runNotFoundLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/react/tsconfig.json b/benchmarks/ssr/scenarios/control-flow/react/tsconfig.json index 91027bfc88..cf14e1d440 100644 --- a/benchmarks/ssr/scenarios/control-flow/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/control-flow/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/control-flow/react/vite.config.ts b/benchmarks/ssr/scenarios/control-flow/react/vite.config.ts index b15f7bc530..273d7d9d80 100644 --- a/benchmarks/ssr/scenarios/control-flow/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/control-flow/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr control-flow (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/control-flow/shared.ts b/benchmarks/ssr/scenarios/control-flow/shared.ts index 7b79683785..307665d59d 100644 --- a/benchmarks/ssr/scenarios/control-flow/shared.ts +++ b/benchmarks/ssr/scenarios/control-flow/shared.ts @@ -5,11 +5,11 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const redirectLoopIterations = 100 -const notFoundLoopIterations = 45 -const errorLoopIterations = 45 -const unmatchedLoopIterations = 60 -const routeHeadersLoopIterations = 50 +const redirectLoopTotalRequests = 112 +const notFoundLoopTotalRequests = 48 +const errorLoopTotalRequests = 48 +const unmatchedLoopTotalRequests = 64 +const routeHeadersLoopTotalRequests = 64 // Pinned to the current built handler responses for these control-flow routes. const OK_STATUS = 200 @@ -124,7 +124,8 @@ function validateRouteHeadersResponse(response: Response, request: Request) { export function runRedirectLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: redirectLoopIterations, + concurrency: 16, + totalRequests: redirectLoopTotalRequests, buildRequest: buildRedirectRequest, validateResponse: validateRedirectResponse, }) @@ -133,7 +134,8 @@ export function runRedirectLoop(handler: StartRequestHandler) { export function runNotFoundLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: notFoundLoopIterations, + concurrency: 16, + totalRequests: notFoundLoopTotalRequests, buildRequest: buildNotFoundRequest, validateResponse: validateNotFoundResponse, }) @@ -142,7 +144,8 @@ export function runNotFoundLoop(handler: StartRequestHandler) { export function runErrorLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: errorLoopIterations, + concurrency: 16, + totalRequests: errorLoopTotalRequests, buildRequest: buildErrorRequest, validateResponse: validateErrorResponse, }) @@ -151,7 +154,8 @@ export function runErrorLoop(handler: StartRequestHandler) { export function runUnmatchedLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: unmatchedLoopIterations, + concurrency: 16, + totalRequests: unmatchedLoopTotalRequests, buildRequest: buildUnmatchedRequest, validateResponse: validateUnmatchedResponse, }) @@ -160,7 +164,8 @@ export function runUnmatchedLoop(handler: StartRequestHandler) { export function runRouteHeadersLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: routeHeadersLoopIterations, + concurrency: 16, + totalRequests: routeHeadersLoopTotalRequests, buildRequest: buildRouteHeadersRequest, validateResponse: validateRouteHeadersResponse, }) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/speed.bench.ts b/benchmarks/ssr/scenarios/control-flow/solid/speed.bench.ts index ed23ed45d7..904b693e25 100644 --- a/benchmarks/ssr/scenarios/control-flow/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/control-flow/solid/speed.bench.ts @@ -1,12 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertControlFlowSanity, controlFlowBenchOptions, - runErrorLoop, - runNotFoundLoop, runRedirectLoop, - runRouteHeadersLoop, - runUnmatchedLoop, } from '../shared' import type { StartRequestHandler } from '../shared' @@ -20,34 +16,8 @@ const { default: handler } = (await import( await assertControlFlowSanity(handler) -describe('ssr', () => { - bench( - 'ssr redirect (solid)', - () => runRedirectLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr not-found (solid)', - () => runNotFoundLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow error 500 (solid)', - () => runErrorLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow unmatched 404 (solid)', - () => runUnmatchedLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow route headers (solid)', - () => runRouteHeadersLoop(handler), +test('ssr', async ({ bench }) => { + await bench('ssr redirect (solid)', async () => runRedirectLoop(handler)).run( controlFlowBenchOptions, ) }) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-error-500.bench.ts b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-error-500.bench.ts new file mode 100644 index 0000000000..57a2f0fbe9 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-error-500.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runErrorLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow error 500 (solid)', async () => + runErrorLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-route-headers.bench.ts b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-route-headers.bench.ts new file mode 100644 index 0000000000..6581e92b39 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-route-headers.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runRouteHeadersLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow route headers (solid)', async () => + runRouteHeadersLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-unmatched-404.bench.ts b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-unmatched-404.bench.ts new file mode 100644 index 0000000000..40f1679320 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/solid/speed.control-flow-unmatched-404.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runUnmatchedLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow unmatched 404 (solid)', async () => + runUnmatchedLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/speed.not-found.bench.ts b/benchmarks/ssr/scenarios/control-flow/solid/speed.not-found.bench.ts new file mode 100644 index 0000000000..efcb7cc229 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/solid/speed.not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runNotFoundLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr not-found (solid)', async () => + runNotFoundLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/solid/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/control-flow/solid/src/routeTree.gen.ts index 5e7342c172..3cec17d9c8 100644 --- a/benchmarks/ssr/scenarios/control-flow/solid/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/control-flow/solid/src/routeTree.gen.ts @@ -10,30 +10,20 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as TargetIdRouteImport } from './routes/target.$id' -import { Route as MissingIdRouteImport } from './routes/missing.$id' -import { Route as HeadersIdRouteImport } from './routes/headers.$id' -import { Route as FromIdRouteImport } from './routes/from.$id' import { Route as BoomIdRouteImport } from './routes/boom.$id' +import { Route as FromIdRouteImport } from './routes/from.$id' +import { Route as HeadersIdRouteImport } from './routes/headers.$id' +import { Route as MissingIdRouteImport } from './routes/missing.$id' +import { Route as TargetIdRouteImport } from './routes/target.$id' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const TargetIdRoute = TargetIdRouteImport.update({ - id: '/target/$id', - path: '/target/$id', - getParentRoute: () => rootRouteImport, -} as any) -const MissingIdRoute = MissingIdRouteImport.update({ - id: '/missing/$id', - path: '/missing/$id', - getParentRoute: () => rootRouteImport, -} as any) -const HeadersIdRoute = HeadersIdRouteImport.update({ - id: '/headers/$id', - path: '/headers/$id', +const BoomIdRoute = BoomIdRouteImport.update({ + id: '/boom/$id', + path: '/boom/$id', getParentRoute: () => rootRouteImport, } as any) const FromIdRoute = FromIdRouteImport.update({ @@ -41,9 +31,19 @@ const FromIdRoute = FromIdRouteImport.update({ path: '/from/$id', getParentRoute: () => rootRouteImport, } as any) -const BoomIdRoute = BoomIdRouteImport.update({ - id: '/boom/$id', - path: '/boom/$id', +const HeadersIdRoute = HeadersIdRouteImport.update({ + id: '/headers/$id', + path: '/headers/$id', + getParentRoute: () => rootRouteImport, +} as any) +const MissingIdRoute = MissingIdRouteImport.update({ + id: '/missing/$id', + path: '/missing/$id', + getParentRoute: () => rootRouteImport, +} as any) +const TargetIdRoute = TargetIdRouteImport.update({ + id: '/target/$id', + path: '/target/$id', getParentRoute: () => rootRouteImport, } as any) @@ -117,25 +117,11 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/target/$id': { - id: '/target/$id' - path: '/target/$id' - fullPath: '/target/$id' - preLoaderRoute: typeof TargetIdRouteImport - parentRoute: typeof rootRouteImport - } - '/missing/$id': { - id: '/missing/$id' - path: '/missing/$id' - fullPath: '/missing/$id' - preLoaderRoute: typeof MissingIdRouteImport - parentRoute: typeof rootRouteImport - } - '/headers/$id': { - id: '/headers/$id' - path: '/headers/$id' - fullPath: '/headers/$id' - preLoaderRoute: typeof HeadersIdRouteImport + '/boom/$id': { + id: '/boom/$id' + path: '/boom/$id' + fullPath: '/boom/$id' + preLoaderRoute: typeof BoomIdRouteImport parentRoute: typeof rootRouteImport } '/from/$id': { @@ -145,11 +131,25 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof FromIdRouteImport parentRoute: typeof rootRouteImport } - '/boom/$id': { - id: '/boom/$id' - path: '/boom/$id' - fullPath: '/boom/$id' - preLoaderRoute: typeof BoomIdRouteImport + '/headers/$id': { + id: '/headers/$id' + path: '/headers/$id' + fullPath: '/headers/$id' + preLoaderRoute: typeof HeadersIdRouteImport + parentRoute: typeof rootRouteImport + } + '/missing/$id': { + id: '/missing/$id' + path: '/missing/$id' + fullPath: '/missing/$id' + preLoaderRoute: typeof MissingIdRouteImport + parentRoute: typeof rootRouteImport + } + '/target/$id': { + id: '/target/$id' + path: '/target/$id' + fullPath: '/target/$id' + preLoaderRoute: typeof TargetIdRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/ssr/scenarios/control-flow/solid/tsconfig.json b/benchmarks/ssr/scenarios/control-flow/solid/tsconfig.json index b1806caa67..42c3a2160f 100644 --- a/benchmarks/ssr/scenarios/control-flow/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/control-flow/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/control-flow/solid/vite.config.ts b/benchmarks/ssr/scenarios/control-flow/solid/vite.config.ts index 0bcd175f60..c75c957466 100644 --- a/benchmarks/ssr/scenarios/control-flow/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/control-flow/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr control-flow (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/control-flow/vue/speed.bench.ts b/benchmarks/ssr/scenarios/control-flow/vue/speed.bench.ts index 99bb46dfb3..0b95f426f2 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/control-flow/vue/speed.bench.ts @@ -1,12 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertControlFlowSanity, controlFlowBenchOptions, - runErrorLoop, - runNotFoundLoop, runRedirectLoop, - runRouteHeadersLoop, - runUnmatchedLoop, } from '../shared' import type { StartRequestHandler } from '../shared' @@ -20,34 +16,8 @@ const { default: handler } = (await import( await assertControlFlowSanity(handler) -describe('ssr', () => { - bench( - 'ssr redirect (vue)', - () => runRedirectLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr not-found (vue)', - () => runNotFoundLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow error 500 (vue)', - () => runErrorLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow unmatched 404 (vue)', - () => runUnmatchedLoop(handler), - controlFlowBenchOptions, - ) - - bench( - 'ssr control-flow route headers (vue)', - () => runRouteHeadersLoop(handler), +test('ssr', async ({ bench }) => { + await bench('ssr redirect (vue)', async () => runRedirectLoop(handler)).run( controlFlowBenchOptions, ) }) diff --git a/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-error-500.bench.ts b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-error-500.bench.ts new file mode 100644 index 0000000000..262ca951af --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-error-500.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runErrorLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow error 500 (vue)', async () => + runErrorLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-route-headers.bench.ts b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-route-headers.bench.ts new file mode 100644 index 0000000000..bf8c90a8a1 --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-route-headers.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runRouteHeadersLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow route headers (vue)', async () => + runRouteHeadersLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-unmatched-404.bench.ts b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-unmatched-404.bench.ts new file mode 100644 index 0000000000..d7f8ebeb9e --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/vue/speed.control-flow-unmatched-404.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runUnmatchedLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr control-flow unmatched 404 (vue)', async () => + runUnmatchedLoop(handler), + ).run(controlFlowBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/vue/speed.not-found.bench.ts b/benchmarks/ssr/scenarios/control-flow/vue/speed.not-found.bench.ts new file mode 100644 index 0000000000..4b84fb594c --- /dev/null +++ b/benchmarks/ssr/scenarios/control-flow/vue/speed.not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertControlFlowSanity, + controlFlowBenchOptions, + runNotFoundLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertControlFlowSanity(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr not-found (vue)', async () => runNotFoundLoop(handler)).run( + controlFlowBenchOptions, + ) +}) diff --git a/benchmarks/ssr/scenarios/control-flow/vue/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/control-flow/vue/src/routeTree.gen.ts index f5063d1c09..6dcf0d095e 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/control-flow/vue/src/routeTree.gen.ts @@ -10,30 +10,20 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as TargetIdRouteImport } from './routes/target.$id' -import { Route as MissingIdRouteImport } from './routes/missing.$id' -import { Route as HeadersIdRouteImport } from './routes/headers.$id' -import { Route as FromIdRouteImport } from './routes/from.$id' import { Route as BoomIdRouteImport } from './routes/boom.$id' +import { Route as FromIdRouteImport } from './routes/from.$id' +import { Route as HeadersIdRouteImport } from './routes/headers.$id' +import { Route as MissingIdRouteImport } from './routes/missing.$id' +import { Route as TargetIdRouteImport } from './routes/target.$id' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const TargetIdRoute = TargetIdRouteImport.update({ - id: '/target/$id', - path: '/target/$id', - getParentRoute: () => rootRouteImport, -} as any) -const MissingIdRoute = MissingIdRouteImport.update({ - id: '/missing/$id', - path: '/missing/$id', - getParentRoute: () => rootRouteImport, -} as any) -const HeadersIdRoute = HeadersIdRouteImport.update({ - id: '/headers/$id', - path: '/headers/$id', +const BoomIdRoute = BoomIdRouteImport.update({ + id: '/boom/$id', + path: '/boom/$id', getParentRoute: () => rootRouteImport, } as any) const FromIdRoute = FromIdRouteImport.update({ @@ -41,9 +31,19 @@ const FromIdRoute = FromIdRouteImport.update({ path: '/from/$id', getParentRoute: () => rootRouteImport, } as any) -const BoomIdRoute = BoomIdRouteImport.update({ - id: '/boom/$id', - path: '/boom/$id', +const HeadersIdRoute = HeadersIdRouteImport.update({ + id: '/headers/$id', + path: '/headers/$id', + getParentRoute: () => rootRouteImport, +} as any) +const MissingIdRoute = MissingIdRouteImport.update({ + id: '/missing/$id', + path: '/missing/$id', + getParentRoute: () => rootRouteImport, +} as any) +const TargetIdRoute = TargetIdRouteImport.update({ + id: '/target/$id', + path: '/target/$id', getParentRoute: () => rootRouteImport, } as any) @@ -117,25 +117,11 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/target/$id': { - id: '/target/$id' - path: '/target/$id' - fullPath: '/target/$id' - preLoaderRoute: typeof TargetIdRouteImport - parentRoute: typeof rootRouteImport - } - '/missing/$id': { - id: '/missing/$id' - path: '/missing/$id' - fullPath: '/missing/$id' - preLoaderRoute: typeof MissingIdRouteImport - parentRoute: typeof rootRouteImport - } - '/headers/$id': { - id: '/headers/$id' - path: '/headers/$id' - fullPath: '/headers/$id' - preLoaderRoute: typeof HeadersIdRouteImport + '/boom/$id': { + id: '/boom/$id' + path: '/boom/$id' + fullPath: '/boom/$id' + preLoaderRoute: typeof BoomIdRouteImport parentRoute: typeof rootRouteImport } '/from/$id': { @@ -145,11 +131,25 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof FromIdRouteImport parentRoute: typeof rootRouteImport } - '/boom/$id': { - id: '/boom/$id' - path: '/boom/$id' - fullPath: '/boom/$id' - preLoaderRoute: typeof BoomIdRouteImport + '/headers/$id': { + id: '/headers/$id' + path: '/headers/$id' + fullPath: '/headers/$id' + preLoaderRoute: typeof HeadersIdRouteImport + parentRoute: typeof rootRouteImport + } + '/missing/$id': { + id: '/missing/$id' + path: '/missing/$id' + fullPath: '/missing/$id' + preLoaderRoute: typeof MissingIdRouteImport + parentRoute: typeof rootRouteImport + } + '/target/$id': { + id: '/target/$id' + path: '/target/$id' + fullPath: '/target/$id' + preLoaderRoute: typeof TargetIdRouteImport parentRoute: typeof rootRouteImport } } diff --git a/benchmarks/ssr/scenarios/control-flow/vue/src/routes/headers.$id.tsx b/benchmarks/ssr/scenarios/control-flow/vue/src/routes/headers.$id.tsx index ac2ec01b52..20c1bbe5ac 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/src/routes/headers.$id.tsx +++ b/benchmarks/ssr/scenarios/control-flow/vue/src/routes/headers.$id.tsx @@ -1,5 +1,14 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const HeadersComponent = defineComponent({ + setup() { + const params = Route.useParams() + + return () =>
{`headers-${params.value.id}`}
+ }, +}) + export const Route = createFileRoute('/headers/$id')({ headers: ({ params }) => ({ 'x-bench-route-header': `route-header-${params.id}`, @@ -7,9 +16,3 @@ export const Route = createFileRoute('/headers/$id')({ }), component: HeadersComponent, }) - -function HeadersComponent() { - const params = Route.useParams() - - return
{`headers-${params.value.id}`}
-} diff --git a/benchmarks/ssr/scenarios/control-flow/vue/src/routes/target.$id.tsx b/benchmarks/ssr/scenarios/control-flow/vue/src/routes/target.$id.tsx index 17ade6bf5b..0bbf4a3dc6 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/src/routes/target.$id.tsx +++ b/benchmarks/ssr/scenarios/control-flow/vue/src/routes/target.$id.tsx @@ -1,11 +1,14 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const TargetComponent = defineComponent({ + setup() { + const params = Route.useParams() + + return () =>
{`target-${params.value.id}`}
+ }, +}) + export const Route = createFileRoute('/target/$id')({ component: TargetComponent, }) - -function TargetComponent() { - const params = Route.useParams() - - return
{`target-${params.value.id}`}
-} diff --git a/benchmarks/ssr/scenarios/control-flow/vue/tsconfig.json b/benchmarks/ssr/scenarios/control-flow/vue/tsconfig.json index 4fe3ccecb1..08c94853f4 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/control-flow/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/control-flow/vue/vite.config.ts b/benchmarks/ssr/scenarios/control-flow/vue/vite.config.ts index 2c978a7a71..1b77968d96 100644 --- a/benchmarks/ssr/scenarios/control-flow/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/control-flow/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr control-flow (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/global-middleware/bench.ts b/benchmarks/ssr/scenarios/global-middleware/bench.ts index cd4dc662e3..d2784aed38 100644 --- a/benchmarks/ssr/scenarios/global-middleware/bench.ts +++ b/benchmarks/ssr/scenarios/global-middleware/bench.ts @@ -7,10 +7,13 @@ import { import { expectedFunctionTotal, expectedRequestTotal, + getExpectedRequestContext, makeDocumentMarker, makeServerFnMarker, makeServerRouteMarker, + setRequestMiddlewareCount, } from './shared' +import type { RequestMiddlewareCount } from './shared' import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } @@ -54,9 +57,9 @@ const postHeaders = { accept: acceptHeader, 'content-type': 'application/json', } satisfies HeadersInit -const documentLoopIterations = 50 -const serverFnLoopIterations = 125 -const serverRouteLoopIterations = 250 +const documentLoopTotalRequests = 64 +const serverFnLoopTotalRequests = 128 +const serverRouteLoopTotalRequests = 256 export const globalMiddlewareBenchOptions = { warmupIterations: 100, @@ -140,6 +143,7 @@ function buildPostRequest(urls: FnUrls, bodies: Array, index: number) { export async function setupGlobalMiddlewareBench( handler: StartRequestHandler, ): Promise { + setRequestMiddlewareCount(3) const urls = await discoverUrls(handler) const payloads = createPayloads() const bodies = await createBodies(payloads) @@ -154,6 +158,7 @@ export async function setupGlobalMiddlewareBench( } async function assertDocumentResponse(handler: StartRequestHandler) { + setRequestMiddlewareCount(3) const id = 'page-sanity' const response = await handler.fetch( new Request(`${origin}/page/${id}`, documentRequestInit), @@ -175,7 +180,11 @@ async function assertDocumentResponse(handler: StartRequestHandler) { } } -async function assertServerRouteResponse(handler: StartRequestHandler) { +async function assertServerRouteResponseForCount( + handler: StartRequestHandler, + count: RequestMiddlewareCount, +) { + setRequestMiddlewareCount(count) const id = 'route-sanity' const response = await handler.fetch( new Request(`${origin}/api/ping/${id}`, apiRequestInit), @@ -199,10 +208,8 @@ async function assertServerRouteResponse(handler: StartRequestHandler) { marker?: string requestTotal?: number } - const expectedMarker = makeServerRouteMarker(id, { - requestTrace: 'req.r1.r2.r3', - requestTotal: expectedRequestTotal, - }) + const expectedContext = getExpectedRequestContext(count) + const expectedMarker = makeServerRouteMarker(id, expectedContext) if (body.marker !== expectedMarker) { throw new Error( @@ -210,9 +217,9 @@ async function assertServerRouteResponse(handler: StartRequestHandler) { ) } - if (body.requestTotal !== expectedRequestTotal) { + if (body.requestTotal !== expectedContext.requestTotal) { throw new Error( - `Expected server route requestTotal ${expectedRequestTotal}, received ${body.requestTotal}`, + `Expected server route requestTotal ${expectedContext.requestTotal}, received ${body.requestTotal}`, ) } } @@ -221,6 +228,7 @@ async function assertServerFnResponse( handler: StartRequestHandler, context: GlobalMiddlewareBenchContext, ) { + setRequestMiddlewareCount(3) const response = await handler.fetch( buildPostRequest(context.urls, context.bodies, 0), ) @@ -257,13 +265,18 @@ export async function assertGlobalMiddlewareScenario( ) { await assertDocumentResponse(handler) await assertServerFnResponse(handler, context) - await assertServerRouteResponse(handler) + for (const count of [0, 1, 2, 3] as const) { + await assertServerRouteResponseForCount(handler, count) + } + setRequestMiddlewareCount(3) } export function runGlobalMiddlewareDocumentLoop(handler: StartRequestHandler) { + setRequestMiddlewareCount(3) return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: documentLoopIterations, + concurrency: 16, + totalRequests: documentLoopTotalRequests, buildRequest: buildDocumentRequest, }) } @@ -272,9 +285,11 @@ export function runGlobalMiddlewareServerFnLoop( handler: StartRequestHandler, context: GlobalMiddlewareBenchContext, ) { + setRequestMiddlewareCount(3) return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnLoopIterations, + concurrency: 16, + totalRequests: serverFnLoopTotalRequests, buildRequest: (_random, index) => buildPostRequest(context.urls, context.bodies, index), }) @@ -282,10 +297,13 @@ export function runGlobalMiddlewareServerFnLoop( export function runGlobalMiddlewareServerRouteLoop( handler: StartRequestHandler, + count: RequestMiddlewareCount = 3, ) { + setRequestMiddlewareCount(count) return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverRouteLoopIterations, + concurrency: 16, + totalRequests: serverRouteLoopTotalRequests, buildRequest: buildServerRouteRequest, }) } diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.bench.ts index 8288322e70..cb3f9f427c 100644 --- a/benchmarks/ssr/scenarios/global-middleware/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.bench.ts @@ -1,10 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertGlobalMiddlewareScenario, globalMiddlewareBenchOptions, runGlobalMiddlewareDocumentLoop, - runGlobalMiddlewareServerFnLoop, - runGlobalMiddlewareServerRouteLoop, setupGlobalMiddlewareBench, } from '../bench' import type { StartRequestHandler } from '../bench' @@ -16,27 +14,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupGlobalMiddlewareBench(handler) await assertGlobalMiddlewareScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr global-mw document (react)', - () => runGlobalMiddlewareDocumentLoop(handler), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-fn (react)', - () => runGlobalMiddlewareServerFnLoop(handler, context), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-route (react)', - () => runGlobalMiddlewareServerRouteLoop(handler), - globalMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr global-mw document (react)', async () => + runGlobalMiddlewareDocumentLoop(handler), + ).run(globalMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-fn.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-fn.bench.ts new file mode 100644 index 0000000000..48c444de77 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-fn.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerFnLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-fn (react)', async () => + runGlobalMiddlewareServerFnLoop(handler, context), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-0-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-0-middleware.bench.ts new file mode 100644 index 0000000000..22f53883ee --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-0-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 0 middleware (react)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 0), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-1-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-1-middleware.bench.ts new file mode 100644 index 0000000000..f01b48d66e --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-1-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 1 middleware (react)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 1), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-2-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-2-middleware.bench.ts new file mode 100644 index 0000000000..b01957f806 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route-2-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 2 middlewares (react)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 2), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route.bench.ts b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route.bench.ts new file mode 100644 index 0000000000..08d97fcaf6 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/react/speed.global-mw-server-route.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 3 middlewares (react)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 3), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/src/start.ts b/benchmarks/ssr/scenarios/global-middleware/react/src/start.ts index 6b59e8035b..8dfb2dd3c4 100644 --- a/benchmarks/ssr/scenarios/global-middleware/react/src/start.ts +++ b/benchmarks/ssr/scenarios/global-middleware/react/src/start.ts @@ -1,4 +1,5 @@ import { createMiddleware, createStart } from '@tanstack/react-start' +import { getRequestMiddlewareCount } from '../../shared' import type { GlobalMiddlewareContext } from '../../shared' function appendTrace( @@ -48,6 +49,13 @@ const requestMiddlewareC = createMiddleware({ type: 'request' }).server( }, ) +const requestMiddlewareSets: Array> = [ + [], + [requestMiddlewareA], + [requestMiddlewareA, requestMiddlewareB], + [requestMiddlewareA, requestMiddlewareB, requestMiddlewareC], +] + const functionMiddlewareA = createMiddleware({ type: 'function' }).server( ({ next, context }) => { const ctx = (context ?? {}) as GlobalMiddlewareContext @@ -75,10 +83,6 @@ const functionMiddlewareB = createMiddleware({ type: 'function' }).server( ) export const startInstance = createStart(() => ({ - requestMiddleware: [ - requestMiddlewareA, - requestMiddlewareB, - requestMiddlewareC, - ], + requestMiddleware: requestMiddlewareSets[getRequestMiddlewareCount()], functionMiddleware: [functionMiddlewareA, functionMiddlewareB], })) diff --git a/benchmarks/ssr/scenarios/global-middleware/react/tsconfig.json b/benchmarks/ssr/scenarios/global-middleware/react/tsconfig.json index 0c0192daaa..de4a3204b9 100644 --- a/benchmarks/ssr/scenarios/global-middleware/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/global-middleware/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared.ts", diff --git a/benchmarks/ssr/scenarios/global-middleware/react/vite.config.ts b/benchmarks/ssr/scenarios/global-middleware/react/vite.config.ts index 71c8ff3719..968a8a24e9 100644 --- a/benchmarks/ssr/scenarios/global-middleware/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/global-middleware/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr global-middleware (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/global-middleware/shared.ts b/benchmarks/ssr/scenarios/global-middleware/shared.ts index f90fa9b233..8fbe788911 100644 --- a/benchmarks/ssr/scenarios/global-middleware/shared.ts +++ b/benchmarks/ssr/scenarios/global-middleware/shared.ts @@ -10,11 +10,41 @@ export interface GlobalMiddlewareRouteContext extends GlobalMiddlewareContext { globalMiddlewareContext?: GlobalMiddlewareContext } +export type RequestMiddlewareCount = 0 | 1 | 2 | 3 + +const requestMiddlewareCountKey = '__TSR_SSR_BENCH_REQUEST_MIDDLEWARE_COUNT__' + +type BenchmarkGlobal = typeof globalThis & { + [requestMiddlewareCountKey]?: RequestMiddlewareCount +} + +const expectedRequestContexts: ReadonlyArray = [ + {}, + { requestTrace: 'req.r1', requestTotal: 1 }, + { requestTrace: 'req.r1.r2', requestTotal: 3 }, + { requestTrace: 'req.r1.r2.r3', requestTotal: 6 }, +] + export const expectedRequestTrace = 'req.r1.r2.r3' export const expectedRequestTotal = 6 export const expectedFunctionTrace = 'fn.f1.f2' export const expectedFunctionTotal = 30 +export function setRequestMiddlewareCount(count: RequestMiddlewareCount) { + const benchmarkGlobal = globalThis as BenchmarkGlobal + benchmarkGlobal[requestMiddlewareCountKey] = count +} + +export function getRequestMiddlewareCount(): RequestMiddlewareCount { + return (globalThis as BenchmarkGlobal)[requestMiddlewareCountKey] ?? 3 +} + +export function getExpectedRequestContext( + count: RequestMiddlewareCount, +): GlobalMiddlewareContext { + return expectedRequestContexts[count]! +} + export function makeDocumentMarker( id: string, context: GlobalMiddlewareContext, diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.bench.ts index 019735eb40..0e5f504090 100644 --- a/benchmarks/ssr/scenarios/global-middleware/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.bench.ts @@ -1,10 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertGlobalMiddlewareScenario, globalMiddlewareBenchOptions, runGlobalMiddlewareDocumentLoop, - runGlobalMiddlewareServerFnLoop, - runGlobalMiddlewareServerRouteLoop, setupGlobalMiddlewareBench, } from '../bench' import type { StartRequestHandler } from '../bench' @@ -16,27 +14,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupGlobalMiddlewareBench(handler) await assertGlobalMiddlewareScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr global-mw document (solid)', - () => runGlobalMiddlewareDocumentLoop(handler), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-fn (solid)', - () => runGlobalMiddlewareServerFnLoop(handler, context), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-route (solid)', - () => runGlobalMiddlewareServerRouteLoop(handler), - globalMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr global-mw document (solid)', async () => + runGlobalMiddlewareDocumentLoop(handler), + ).run(globalMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-fn.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-fn.bench.ts new file mode 100644 index 0000000000..915507ef9f --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-fn.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerFnLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-fn (solid)', async () => + runGlobalMiddlewareServerFnLoop(handler, context), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-0-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-0-middleware.bench.ts new file mode 100644 index 0000000000..a791145935 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-0-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 0 middleware (solid)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 0), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-1-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-1-middleware.bench.ts new file mode 100644 index 0000000000..1baab0f344 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-1-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 1 middleware (solid)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 1), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-2-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-2-middleware.bench.ts new file mode 100644 index 0000000000..d6fde20764 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route-2-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 2 middlewares (solid)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 2), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route.bench.ts b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route.bench.ts new file mode 100644 index 0000000000..558ebeb9a4 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/solid/speed.global-mw-server-route.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 3 middlewares (solid)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 3), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/global-middleware/solid/src/routeTree.gen.ts index 28d816525e..65f7fa5848 100644 --- a/benchmarks/ssr/scenarios/global-middleware/solid/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/global-middleware/solid/src/routeTree.gen.ts @@ -10,8 +10,8 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as PageIdRouteImport } from './routes/page.$id' import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls' +import { Route as PageIdRouteImport } from './routes/page.$id' import { Route as ApiPingIdRouteImport } from './routes/api.ping.$id' const IndexRoute = IndexRouteImport.update({ @@ -19,16 +19,16 @@ const IndexRoute = IndexRouteImport.update({ path: '/', getParentRoute: () => rootRouteImport, } as any) -const PageIdRoute = PageIdRouteImport.update({ - id: '/page/$id', - path: '/page/$id', - getParentRoute: () => rootRouteImport, -} as any) const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({ id: '/api/fn-urls', path: '/api/fn-urls', getParentRoute: () => rootRouteImport, } as any) +const PageIdRoute = PageIdRouteImport.update({ + id: '/page/$id', + path: '/page/$id', + getParentRoute: () => rootRouteImport, +} as any) const ApiPingIdRoute = ApiPingIdRouteImport.update({ id: '/api/ping/$id', path: '/api/ping/$id', @@ -78,13 +78,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/page/$id': { - id: '/page/$id' - path: '/page/$id' - fullPath: '/page/$id' - preLoaderRoute: typeof PageIdRouteImport - parentRoute: typeof rootRouteImport - } '/api/fn-urls': { id: '/api/fn-urls' path: '/api/fn-urls' @@ -92,6 +85,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ApiFnUrlsRouteImport parentRoute: typeof rootRouteImport } + '/page/$id': { + id: '/page/$id' + path: '/page/$id' + fullPath: '/page/$id' + preLoaderRoute: typeof PageIdRouteImport + parentRoute: typeof rootRouteImport + } '/api/ping/$id': { id: '/api/ping/$id' path: '/api/ping/$id' diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/src/start.ts b/benchmarks/ssr/scenarios/global-middleware/solid/src/start.ts index 8c4168d574..a6f6214b82 100644 --- a/benchmarks/ssr/scenarios/global-middleware/solid/src/start.ts +++ b/benchmarks/ssr/scenarios/global-middleware/solid/src/start.ts @@ -1,4 +1,5 @@ import { createMiddleware, createStart } from '@tanstack/solid-start' +import { getRequestMiddlewareCount } from '../../shared' import type { GlobalMiddlewareContext } from '../../shared' function appendTrace( @@ -48,6 +49,13 @@ const requestMiddlewareC = createMiddleware({ type: 'request' }).server( }, ) +const requestMiddlewareSets: Array> = [ + [], + [requestMiddlewareA], + [requestMiddlewareA, requestMiddlewareB], + [requestMiddlewareA, requestMiddlewareB, requestMiddlewareC], +] + const functionMiddlewareA = createMiddleware({ type: 'function' }).server( ({ next, context }) => { const ctx = (context ?? {}) as GlobalMiddlewareContext @@ -75,10 +83,6 @@ const functionMiddlewareB = createMiddleware({ type: 'function' }).server( ) export const startInstance = createStart(() => ({ - requestMiddleware: [ - requestMiddlewareA, - requestMiddlewareB, - requestMiddlewareC, - ], + requestMiddleware: requestMiddlewareSets[getRequestMiddlewareCount()], functionMiddleware: [functionMiddlewareA, functionMiddlewareB], })) diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/tsconfig.json b/benchmarks/ssr/scenarios/global-middleware/solid/tsconfig.json index 5ad8f505b6..dce3ceae30 100644 --- a/benchmarks/ssr/scenarios/global-middleware/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/global-middleware/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared.ts", diff --git a/benchmarks/ssr/scenarios/global-middleware/solid/vite.config.ts b/benchmarks/ssr/scenarios/global-middleware/solid/vite.config.ts index e8af6933ed..f3597b25d5 100644 --- a/benchmarks/ssr/scenarios/global-middleware/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/global-middleware/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr global-middleware (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.bench.ts index 0b3ed9dd7a..9660f29d07 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.bench.ts @@ -1,10 +1,8 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertGlobalMiddlewareScenario, globalMiddlewareBenchOptions, runGlobalMiddlewareDocumentLoop, - runGlobalMiddlewareServerFnLoop, - runGlobalMiddlewareServerRouteLoop, setupGlobalMiddlewareBench, } from '../bench' import type { StartRequestHandler } from '../bench' @@ -16,27 +14,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupGlobalMiddlewareBench(handler) await assertGlobalMiddlewareScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr global-mw document (vue)', - () => runGlobalMiddlewareDocumentLoop(handler), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-fn (vue)', - () => runGlobalMiddlewareServerFnLoop(handler, context), - globalMiddlewareBenchOptions, - ) - - bench( - 'ssr global-mw server-route (vue)', - () => runGlobalMiddlewareServerRouteLoop(handler), - globalMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr global-mw document (vue)', async () => + runGlobalMiddlewareDocumentLoop(handler), + ).run(globalMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-fn.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-fn.bench.ts new file mode 100644 index 0000000000..297e8cee7b --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-fn.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerFnLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-fn (vue)', async () => + runGlobalMiddlewareServerFnLoop(handler, context), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-0-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-0-middleware.bench.ts new file mode 100644 index 0000000000..d023dd458a --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-0-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 0 middleware (vue)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 0), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-1-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-1-middleware.bench.ts new file mode 100644 index 0000000000..5018163631 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-1-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 1 middleware (vue)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 1), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-2-middleware.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-2-middleware.bench.ts new file mode 100644 index 0000000000..f9abd8eb60 --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route-2-middleware.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 2 middlewares (vue)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 2), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route.bench.ts b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route.bench.ts new file mode 100644 index 0000000000..adcec3019f --- /dev/null +++ b/benchmarks/ssr/scenarios/global-middleware/vue/speed.global-mw-server-route.bench.ts @@ -0,0 +1,25 @@ +import { test } from 'vitest' +import { + assertGlobalMiddlewareScenario, + globalMiddlewareBenchOptions, + runGlobalMiddlewareServerRouteLoop, + setupGlobalMiddlewareBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} +const context = await setupGlobalMiddlewareBench(handler) + +await assertGlobalMiddlewareScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr global-mw server-route 3 middlewares (vue)', async () => + runGlobalMiddlewareServerRouteLoop(handler, 3), + ).run(globalMiddlewareBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/global-middleware/vue/src/routeTree.gen.ts index aae3329420..3118848e4d 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/global-middleware/vue/src/routeTree.gen.ts @@ -10,8 +10,8 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as PageIdRouteImport } from './routes/page.$id' import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls' +import { Route as PageIdRouteImport } from './routes/page.$id' import { Route as ApiPingIdRouteImport } from './routes/api.ping.$id' const IndexRoute = IndexRouteImport.update({ @@ -19,16 +19,16 @@ const IndexRoute = IndexRouteImport.update({ path: '/', getParentRoute: () => rootRouteImport, } as any) -const PageIdRoute = PageIdRouteImport.update({ - id: '/page/$id', - path: '/page/$id', - getParentRoute: () => rootRouteImport, -} as any) const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({ id: '/api/fn-urls', path: '/api/fn-urls', getParentRoute: () => rootRouteImport, } as any) +const PageIdRoute = PageIdRouteImport.update({ + id: '/page/$id', + path: '/page/$id', + getParentRoute: () => rootRouteImport, +} as any) const ApiPingIdRoute = ApiPingIdRouteImport.update({ id: '/api/ping/$id', path: '/api/ping/$id', @@ -78,13 +78,6 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/page/$id': { - id: '/page/$id' - path: '/page/$id' - fullPath: '/page/$id' - preLoaderRoute: typeof PageIdRouteImport - parentRoute: typeof rootRouteImport - } '/api/fn-urls': { id: '/api/fn-urls' path: '/api/fn-urls' @@ -92,6 +85,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof ApiFnUrlsRouteImport parentRoute: typeof rootRouteImport } + '/page/$id': { + id: '/page/$id' + path: '/page/$id' + fullPath: '/page/$id' + preLoaderRoute: typeof PageIdRouteImport + parentRoute: typeof rootRouteImport + } '/api/ping/$id': { id: '/api/ping/$id' path: '/api/ping/$id' diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/src/routes/page.$id.tsx b/benchmarks/ssr/scenarios/global-middleware/vue/src/routes/page.$id.tsx index 2010d0cd2a..6e837ef0a0 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/src/routes/page.$id.tsx +++ b/benchmarks/ssr/scenarios/global-middleware/vue/src/routes/page.$id.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { getGlobalMiddlewareContext, @@ -5,6 +6,14 @@ import { type GlobalMiddlewareContext, } from '../../../shared' +const PageComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () =>
{data.value.marker}
+ }, +}) + export const Route = createFileRoute('/page/$id')({ beforeLoad: ({ serverContext }) => ({ globalMiddlewareContext: (serverContext ?? {}) as GlobalMiddlewareContext, @@ -14,9 +23,3 @@ export const Route = createFileRoute('/page/$id')({ }), component: PageComponent, }) - -function PageComponent() { - const data = Route.useLoaderData() - - return
{data.value.marker}
-} diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/src/start.ts b/benchmarks/ssr/scenarios/global-middleware/vue/src/start.ts index dc3f142e27..6e4eb2c5ef 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/src/start.ts +++ b/benchmarks/ssr/scenarios/global-middleware/vue/src/start.ts @@ -1,4 +1,5 @@ import { createMiddleware, createStart } from '@tanstack/vue-start' +import { getRequestMiddlewareCount } from '../../shared' import type { GlobalMiddlewareContext } from '../../shared' function appendTrace( @@ -48,6 +49,13 @@ const requestMiddlewareC = createMiddleware({ type: 'request' }).server( }, ) +const requestMiddlewareSets: Array> = [ + [], + [requestMiddlewareA], + [requestMiddlewareA, requestMiddlewareB], + [requestMiddlewareA, requestMiddlewareB, requestMiddlewareC], +] + const functionMiddlewareA = createMiddleware({ type: 'function' }).server( ({ next, context }) => { const ctx = (context ?? {}) as GlobalMiddlewareContext @@ -75,10 +83,6 @@ const functionMiddlewareB = createMiddleware({ type: 'function' }).server( ) export const startInstance = createStart(() => ({ - requestMiddleware: [ - requestMiddlewareA, - requestMiddlewareB, - requestMiddlewareC, - ], + requestMiddleware: requestMiddlewareSets[getRequestMiddlewareCount()], functionMiddleware: [functionMiddlewareA, functionMiddlewareB], })) diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/tsconfig.json b/benchmarks/ssr/scenarios/global-middleware/vue/tsconfig.json index 70d62162e6..56800fd29e 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/global-middleware/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared.ts", diff --git a/benchmarks/ssr/scenarios/global-middleware/vue/vite.config.ts b/benchmarks/ssr/scenarios/global-middleware/vue/vite.config.ts index 6dd55adab3..8e29c5ee98 100644 --- a/benchmarks/ssr/scenarios/global-middleware/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/global-middleware/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr global-middleware (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/head/react/speed.bench.ts b/benchmarks/ssr/scenarios/head/react/speed.bench.ts index 19158b32a9..f75008506e 100644 --- a/benchmarks/ssr/scenarios/head/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/head/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertHeadSanity, headBenchOptions, runHeadLoop } from '../shared' import type { StartRequestHandler } from '../shared' @@ -12,6 +12,8 @@ const { default: handler } = (await import( await assertHeadSanity(handler) -describe('ssr', () => { - bench('ssr head (react)', () => runHeadLoop(handler), headBenchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr head (react)', async () => runHeadLoop(handler)).run( + headBenchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/head/react/vite.config.ts b/benchmarks/ssr/scenarios/head/react/vite.config.ts index 56d69443ac..d24fc850a1 100644 --- a/benchmarks/ssr/scenarios/head/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/head/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr head (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/head/shared.ts b/benchmarks/ssr/scenarios/head/shared.ts index 26e084b156..033ca47c22 100644 --- a/benchmarks/ssr/scenarios/head/shared.ts +++ b/benchmarks/ssr/scenarios/head/shared.ts @@ -7,7 +7,7 @@ export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad const origin = 'http://localhost' const dedupedMetaName = 'head-benchmark-shared' -const headLoopIterations = 25 +const headLoopTotalRequests = 32 const requestInit = { method: 'GET', @@ -32,7 +32,8 @@ function buildHeadRequest(random: () => number) { export function runHeadLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: headLoopIterations, + concurrency: 16, + totalRequests: headLoopTotalRequests, buildRequest: buildHeadRequest, }) } diff --git a/benchmarks/ssr/scenarios/head/solid/speed.bench.ts b/benchmarks/ssr/scenarios/head/solid/speed.bench.ts index ad5bf52809..333e2f091b 100644 --- a/benchmarks/ssr/scenarios/head/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/head/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertHeadSanity, headBenchOptions, runHeadLoop } from '../shared' import type { StartRequestHandler } from '../shared' @@ -12,6 +12,8 @@ const { default: handler } = (await import( await assertHeadSanity(handler) -describe('ssr', () => { - bench('ssr head (solid)', () => runHeadLoop(handler), headBenchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr head (solid)', async () => runHeadLoop(handler)).run( + headBenchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/head/solid/vite.config.ts b/benchmarks/ssr/scenarios/head/solid/vite.config.ts index f7b97a44d1..7a870bbd77 100644 --- a/benchmarks/ssr/scenarios/head/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/head/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr head (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/head/vue/speed.bench.ts b/benchmarks/ssr/scenarios/head/vue/speed.bench.ts index 5d8243b588..936735a909 100644 --- a/benchmarks/ssr/scenarios/head/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/head/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertHeadSanity, headBenchOptions, runHeadLoop } from '../shared' import type { StartRequestHandler } from '../shared' @@ -12,6 +12,8 @@ const { default: handler } = (await import( await assertHeadSanity(handler) -describe('ssr', () => { - bench('ssr head (vue)', () => runHeadLoop(handler), headBenchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr head (vue)', async () => runHeadLoop(handler)).run( + headBenchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/head/vue/vite.config.ts b/benchmarks/ssr/scenarios/head/vue/vite.config.ts index e020012560..1434d26069 100644 --- a/benchmarks/ssr/scenarios/head/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/head/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr head (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/loaders/react/speed.bench.ts b/benchmarks/ssr/scenarios/loaders/react/speed.bench.ts index a5eecfc648..7acd43c635 100644 --- a/benchmarks/ssr/scenarios/loaders/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/loaders/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertLoadersSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertLoadersSanity(handler) -describe('ssr', () => { - bench('ssr loaders (react)', () => runLoadersLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr loaders (react)', async () => runLoadersLoop(handler)).run( + benchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/loaders/react/vite.config.ts b/benchmarks/ssr/scenarios/loaders/react/vite.config.ts index 5c4dcaa40d..e761426c84 100644 --- a/benchmarks/ssr/scenarios/loaders/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/loaders/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr loaders (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/loaders/shared-bench.ts b/benchmarks/ssr/scenarios/loaders/shared-bench.ts index 2b1e9b4749..f52c51dccd 100644 --- a/benchmarks/ssr/scenarios/loaders/shared-bench.ts +++ b/benchmarks/ssr/scenarios/loaders/shared-bench.ts @@ -5,7 +5,7 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const loadersLoopIterations = 15 +const loadersLoopTotalRequests = 16 const requestInit = { method: 'GET', @@ -68,7 +68,8 @@ export const benchOptions = { export function runLoadersLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: loadersLoopIterations, + concurrency: 16, + totalRequests: loadersLoopTotalRequests, buildRequest: buildLoaderRequest, }) } diff --git a/benchmarks/ssr/scenarios/loaders/solid/speed.bench.ts b/benchmarks/ssr/scenarios/loaders/solid/speed.bench.ts index 7b3f6247ea..7fc8d88389 100644 --- a/benchmarks/ssr/scenarios/loaders/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/loaders/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertLoadersSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertLoadersSanity(handler) -describe('ssr', () => { - bench('ssr loaders (solid)', () => runLoadersLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr loaders (solid)', async () => runLoadersLoop(handler)).run( + benchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/loaders/solid/vite.config.ts b/benchmarks/ssr/scenarios/loaders/solid/vite.config.ts index 527ca977c5..64f52159c3 100644 --- a/benchmarks/ssr/scenarios/loaders/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/loaders/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr loaders (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/loaders/vue/speed.bench.ts b/benchmarks/ssr/scenarios/loaders/vue/speed.bench.ts index fb39e0652c..321350d98c 100644 --- a/benchmarks/ssr/scenarios/loaders/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/loaders/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertLoadersSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertLoadersSanity(handler) -describe('ssr', () => { - bench('ssr loaders (vue)', () => runLoadersLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr loaders (vue)', async () => runLoadersLoop(handler)).run( + benchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.$c.tsx b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.$c.tsx index de927a8092..0a52b9c542 100644 --- a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.$c.tsx +++ b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.$c.tsx @@ -1,6 +1,24 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../shared-data' +const LevelCComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.meta.label}

+
    + {data.value.items.slice(0, 10).map((item) => ( +
  • {item.name}
  • + ))} +
+
+ ) + }, +}) + export const Route = createFileRoute('/$a/$b/$c')({ beforeLoad: ({ params, context }) => { void context @@ -15,18 +33,3 @@ export const Route = createFileRoute('/$a/$b/$c')({ }, component: LevelCComponent, }) - -function LevelCComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.meta.label}

-
    - {data.value.items.slice(0, 10).map((item) => ( -
  • {item.name}
  • - ))} -
-
- ) -} diff --git a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.tsx b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.tsx index e1a5f52ae2..f3943d58e7 100644 --- a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.tsx +++ b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.$b.tsx @@ -1,6 +1,25 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../shared-data' +const LevelBComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.meta.label}

+
    + {data.value.items.slice(0, 10).map((item) => ( +
  • {item.name}
  • + ))} +
+ +
+ ) + }, +}) + export const Route = createFileRoute('/$a/$b')({ beforeLoad: ({ params, context }) => { void context @@ -15,19 +34,3 @@ export const Route = createFileRoute('/$a/$b')({ }, component: LevelBComponent, }) - -function LevelBComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.meta.label}

-
    - {data.value.items.slice(0, 10).map((item) => ( -
  • {item.name}
  • - ))} -
- -
- ) -} diff --git a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.tsx b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.tsx index b197a8edf1..63bb36949f 100644 --- a/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.tsx +++ b/benchmarks/ssr/scenarios/loaders/vue/src/routes/$a.tsx @@ -1,6 +1,25 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../shared-data' +const LevelAComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.meta.label}

+
    + {data.value.items.slice(0, 10).map((item) => ( +
  • {item.name}
  • + ))} +
+ +
+ ) + }, +}) + export const Route = createFileRoute('/$a')({ beforeLoad: ({ params, context }) => { void context @@ -15,19 +34,3 @@ export const Route = createFileRoute('/$a')({ }, component: LevelAComponent, }) - -function LevelAComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.meta.label}

-
    - {data.value.items.slice(0, 10).map((item) => ( -
  • {item.name}
  • - ))} -
- -
- ) -} diff --git a/benchmarks/ssr/scenarios/loaders/vue/vite.config.ts b/benchmarks/ssr/scenarios/loaders/vue/vite.config.ts index b7a4d1b48b..92bf3e60f0 100644 --- a/benchmarks/ssr/scenarios/loaders/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/loaders/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr loaders (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/rewrites/react/speed.bench.ts b/benchmarks/ssr/scenarios/rewrites/react/speed.bench.ts index d7025ce0f9..920186c5db 100644 --- a/benchmarks/ssr/scenarios/rewrites/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/rewrites/react/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertRewriteScenario, rewriteBenchOptions, runRewriteLocalizedLoop, - runRewritePassthroughLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertRewriteScenario(handler) -describe('ssr', () => { - bench( - 'ssr rewrite localized (react)', - () => runRewriteLocalizedLoop(handler), - rewriteBenchOptions, - ) - bench( - 'ssr rewrite passthrough (react)', - () => runRewritePassthroughLoop(handler), - rewriteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr rewrite localized (react)', async () => + runRewriteLocalizedLoop(handler), + ).run(rewriteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/rewrites/react/speed.rewrite-passthrough.bench.ts b/benchmarks/ssr/scenarios/rewrites/react/speed.rewrite-passthrough.bench.ts new file mode 100644 index 0000000000..f5d09089a6 --- /dev/null +++ b/benchmarks/ssr/scenarios/rewrites/react/speed.rewrite-passthrough.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertRewriteScenario, + rewriteBenchOptions, + runRewritePassthroughLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertRewriteScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr rewrite passthrough (react)', async () => + runRewritePassthroughLoop(handler), + ).run(rewriteBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/rewrites/react/tsconfig.json b/benchmarks/ssr/scenarios/rewrites/react/tsconfig.json index 91027bfc88..cf14e1d440 100644 --- a/benchmarks/ssr/scenarios/rewrites/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/rewrites/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/rewrites/react/vite.config.ts b/benchmarks/ssr/scenarios/rewrites/react/vite.config.ts index 5bf098275b..7b20340ec6 100644 --- a/benchmarks/ssr/scenarios/rewrites/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/rewrites/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -25,6 +26,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr rewrites (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/rewrites/shared.ts b/benchmarks/ssr/scenarios/rewrites/shared.ts index a8f2e3279b..9b29bc0249 100644 --- a/benchmarks/ssr/scenarios/rewrites/shared.ts +++ b/benchmarks/ssr/scenarios/rewrites/shared.ts @@ -6,8 +6,8 @@ export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad const origin = 'http://localhost' -const localizedLoopIterations = 25 -const passthroughLoopIterations = 25 +const localizedLoopTotalRequests = 32 +const passthroughLoopTotalRequests = 32 const requestInit = { method: 'GET', @@ -39,7 +39,8 @@ function buildPassthroughRequest(random: () => number) { export function runRewriteLocalizedLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: localizedLoopIterations, + concurrency: 16, + totalRequests: localizedLoopTotalRequests, buildRequest: buildLocalizedRequest, }) } @@ -47,7 +48,8 @@ export function runRewriteLocalizedLoop(handler: StartRequestHandler) { export function runRewritePassthroughLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: passthroughLoopIterations, + concurrency: 16, + totalRequests: passthroughLoopTotalRequests, buildRequest: buildPassthroughRequest, }) } diff --git a/benchmarks/ssr/scenarios/rewrites/solid/speed.bench.ts b/benchmarks/ssr/scenarios/rewrites/solid/speed.bench.ts index 7aa4bd0b18..488fb2ca52 100644 --- a/benchmarks/ssr/scenarios/rewrites/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/rewrites/solid/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertRewriteScenario, rewriteBenchOptions, runRewriteLocalizedLoop, - runRewritePassthroughLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertRewriteScenario(handler) -describe('ssr', () => { - bench( - 'ssr rewrite localized (solid)', - () => runRewriteLocalizedLoop(handler), - rewriteBenchOptions, - ) - bench( - 'ssr rewrite passthrough (solid)', - () => runRewritePassthroughLoop(handler), - rewriteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr rewrite localized (solid)', async () => + runRewriteLocalizedLoop(handler), + ).run(rewriteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/rewrites/solid/speed.rewrite-passthrough.bench.ts b/benchmarks/ssr/scenarios/rewrites/solid/speed.rewrite-passthrough.bench.ts new file mode 100644 index 0000000000..7b86e2ba11 --- /dev/null +++ b/benchmarks/ssr/scenarios/rewrites/solid/speed.rewrite-passthrough.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertRewriteScenario, + rewriteBenchOptions, + runRewritePassthroughLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertRewriteScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr rewrite passthrough (solid)', async () => + runRewritePassthroughLoop(handler), + ).run(rewriteBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/rewrites/solid/tsconfig.json b/benchmarks/ssr/scenarios/rewrites/solid/tsconfig.json index b1806caa67..42c3a2160f 100644 --- a/benchmarks/ssr/scenarios/rewrites/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/rewrites/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/rewrites/solid/vite.config.ts b/benchmarks/ssr/scenarios/rewrites/solid/vite.config.ts index ae9f925cb7..963fe7132b 100644 --- a/benchmarks/ssr/scenarios/rewrites/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/rewrites/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -25,6 +26,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr rewrites (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/rewrites/vue/speed.bench.ts b/benchmarks/ssr/scenarios/rewrites/vue/speed.bench.ts index 0bbd896d71..5fd4da9d3e 100644 --- a/benchmarks/ssr/scenarios/rewrites/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/rewrites/vue/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertRewriteScenario, rewriteBenchOptions, runRewriteLocalizedLoop, - runRewritePassthroughLoop, - type StartRequestHandler, } from '../shared' +import type { StartRequestHandler } from '../shared' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,15 +16,8 @@ const { default: handler } = (await import( await assertRewriteScenario(handler) -describe('ssr', () => { - bench( - 'ssr rewrite localized (vue)', - () => runRewriteLocalizedLoop(handler), - rewriteBenchOptions, - ) - bench( - 'ssr rewrite passthrough (vue)', - () => runRewritePassthroughLoop(handler), - rewriteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr rewrite localized (vue)', async () => + runRewriteLocalizedLoop(handler), + ).run(rewriteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/rewrites/vue/speed.rewrite-passthrough.bench.ts b/benchmarks/ssr/scenarios/rewrites/vue/speed.rewrite-passthrough.bench.ts new file mode 100644 index 0000000000..f3664b5f21 --- /dev/null +++ b/benchmarks/ssr/scenarios/rewrites/vue/speed.rewrite-passthrough.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertRewriteScenario, + rewriteBenchOptions, + runRewritePassthroughLoop, +} from '../shared' +import type { StartRequestHandler } from '../shared' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertRewriteScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr rewrite passthrough (vue)', async () => + runRewritePassthroughLoop(handler), + ).run(rewriteBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.$b.tsx b/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.$b.tsx index 3fdb7014f4..3c9de1806e 100644 --- a/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.$b.tsx +++ b/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.$b.tsx @@ -1,5 +1,41 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' +const LeafComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

+ rewrite-leaf {data.value.a} {data.value.b} +

+ + leaf-self-link + + + leaf-next-link + + + leaf-parent-link + +
+ ) + }, +}) + export const Route = createFileRoute('/p/$a/$b')({ loader: ({ params }) => ({ a: params.a, @@ -8,32 +44,3 @@ export const Route = createFileRoute('/p/$a/$b')({ }), component: LeafComponent, }) - -function LeafComponent() { - const data = Route.useLoaderData() - - return ( -
-

- rewrite-leaf {data.value.a} {data.value.b} -

- - leaf-self-link - - - leaf-next-link - - - leaf-parent-link - -
- ) -} diff --git a/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.tsx b/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.tsx index acb74aabbd..9702ebedd7 100644 --- a/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.tsx +++ b/benchmarks/ssr/scenarios/rewrites/vue/src/routes/p.$a.tsx @@ -1,5 +1,26 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' +const ParentComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

rewrite-parent {data.value.a}

+ + parent-branch-link + + +
+ ) + }, +}) + export const Route = createFileRoute('/p/$a')({ loader: ({ params }) => ({ a: params.a, @@ -7,21 +28,3 @@ export const Route = createFileRoute('/p/$a')({ }), component: ParentComponent, }) - -function ParentComponent() { - const data = Route.useLoaderData() - - return ( -
-

rewrite-parent {data.value.a}

- - parent-branch-link - - -
- ) -} diff --git a/benchmarks/ssr/scenarios/rewrites/vue/tsconfig.json b/benchmarks/ssr/scenarios/rewrites/vue/tsconfig.json index 4fe3ccecb1..08c94853f4 100644 --- a/benchmarks/ssr/scenarios/rewrites/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/rewrites/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/rewrites/vue/vite.config.ts b/benchmarks/ssr/scenarios/rewrites/vue/vite.config.ts index f3b69dfe20..22399ec6b2 100644 --- a/benchmarks/ssr/scenarios/rewrites/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/rewrites/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -25,6 +26,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr rewrites (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/selective-ssr/react/speed.bench.ts b/benchmarks/ssr/scenarios/selective-ssr/react/speed.bench.ts index e0e8a0e3c4..ba6bd4a61d 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSelectiveSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertSelectiveSanity(handler) -describe('ssr', () => { - bench('ssr selective (react)', () => runSelectiveLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr selective (react)', async () => + runSelectiveLoop(handler), + ).run(benchOptions) }) diff --git a/benchmarks/ssr/scenarios/selective-ssr/react/vite.config.ts b/benchmarks/ssr/scenarios/selective-ssr/react/vite.config.ts index 03ff77aa7b..70c67cff81 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr selective-ssr (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/selective-ssr/shared-bench.ts b/benchmarks/ssr/scenarios/selective-ssr/shared-bench.ts index bf97d5d63e..5b2530ccab 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/shared-bench.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/shared-bench.ts @@ -5,7 +5,7 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const selectiveLoopIterations = 20 +const selectiveLoopTotalRequests = 32 const requestInit = { method: 'GET', @@ -88,7 +88,8 @@ export const benchOptions = { export function runSelectiveLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: selectiveLoopIterations, + concurrency: 16, + totalRequests: selectiveLoopTotalRequests, buildRequest: buildSelectiveRequest, }) } diff --git a/benchmarks/ssr/scenarios/selective-ssr/solid/speed.bench.ts b/benchmarks/ssr/scenarios/selective-ssr/solid/speed.bench.ts index 6a2803d45f..76265397ab 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSelectiveSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertSelectiveSanity(handler) -describe('ssr', () => { - bench('ssr selective (solid)', () => runSelectiveLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr selective (solid)', async () => + runSelectiveLoop(handler), + ).run(benchOptions) }) diff --git a/benchmarks/ssr/scenarios/selective-ssr/solid/vite.config.ts b/benchmarks/ssr/scenarios/selective-ssr/solid/vite.config.ts index 09b42f00e6..2c0042c1ed 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr selective-ssr (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/selective-ssr/vue/speed.bench.ts b/benchmarks/ssr/scenarios/selective-ssr/vue/speed.bench.ts index f3082a102d..ff60341b27 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSelectiveSanity, benchOptions, @@ -16,6 +16,8 @@ const { default: handler } = (await import( await assertSelectiveSanity(handler) -describe('ssr', () => { - bench('ssr selective (vue)', () => runSelectiveLoop(handler), benchOptions) +test('ssr', async ({ bench }) => { + await bench('ssr selective (vue)', async () => runSelectiveLoop(handler)).run( + benchOptions, + ) }) diff --git a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.$c.tsx b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.$c.tsx index 46d7541c2b..8ae7d468f1 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.$c.tsx +++ b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.$c.tsx @@ -1,6 +1,21 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../../loaders/shared-data' +const LevelCComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + const params = Route.useParams() + + return () => ( +
+

{`csr-rendered-${params.value.c}`}

+

{data.value.marker}

+
+ ) + }, +}) + export const Route = createFileRoute('/mix/$a/$b/$c')({ ssr: false, loader: async ({ params }) => { @@ -11,15 +26,3 @@ export const Route = createFileRoute('/mix/$a/$b/$c')({ }, component: LevelCComponent, }) - -function LevelCComponent() { - const data = Route.useLoaderData() - const params = Route.useParams() - - return ( -
-

{`csr-rendered-${params.value.c}`}

-

{data.value.marker}

-
- ) -} diff --git a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.tsx b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.tsx index bc685478cc..c10751489e 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.tsx +++ b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.$b.tsx @@ -1,6 +1,22 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../../loaders/shared-data' +const LevelBComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + const params = Route.useParams() + + return () => ( +
+

{`data-only-rendered-${params.value.b}`}

+

{data.value.marker}

+ +
+ ) + }, +}) + export const Route = createFileRoute('/mix/$a/$b')({ ssr: 'data-only', loader: async ({ params }) => { @@ -11,16 +27,3 @@ export const Route = createFileRoute('/mix/$a/$b')({ }, component: LevelBComponent, }) - -function LevelBComponent() { - const data = Route.useLoaderData() - const params = Route.useParams() - - return ( -
-

{`data-only-rendered-${params.value.b}`}

-

{data.value.marker}

- -
- ) -} diff --git a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.tsx b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.tsx index 8ab4c7d54d..c96165c6d6 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.tsx +++ b/benchmarks/ssr/scenarios/selective-ssr/vue/src/routes/mix.$a.tsx @@ -1,6 +1,22 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { makeLevelData } from '../../../../loaders/shared-data' +const LevelAComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + const params = Route.useParams() + + return () => ( +
+

{`level-a-rendered-${params.value.a}`}

+

{data.value.items[0]?.name}

+ +
+ ) + }, +}) + export const Route = createFileRoute('/mix/$a')({ ssr: true, loader: async ({ params }) => { @@ -8,16 +24,3 @@ export const Route = createFileRoute('/mix/$a')({ }, component: LevelAComponent, }) - -function LevelAComponent() { - const data = Route.useLoaderData() - const params = Route.useParams() - - return ( -
-

{`level-a-rendered-${params.value.a}`}

-

{data.value.items[0]?.name}

- -
- ) -} diff --git a/benchmarks/ssr/scenarios/selective-ssr/vue/vite.config.ts b/benchmarks/ssr/scenarios/selective-ssr/vue/vite.config.ts index 76299a67fd..09bb36cb0b 100644 --- a/benchmarks/ssr/scenarios/selective-ssr/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/selective-ssr/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr selective-ssr (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/serialization/react/speed.bench.ts b/benchmarks/ssr/scenarios/serialization/react/speed.bench.ts index 95c91f4529..8be07d2643 100644 --- a/benchmarks/ssr/scenarios/serialization/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/serialization/react/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSerializationScenario, - runPlainSerializationLoop, runRichSerializationLoop, serializationBenchOptions, - type StartRequestHandler, } from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,16 +16,8 @@ const { default: handler } = (await import( await assertSerializationScenario(handler) -describe('ssr', () => { - bench( - 'ssr dehydrate rich types (react)', - () => runRichSerializationLoop(handler), - serializationBenchOptions, - ) - - bench( - 'ssr dehydrate plain control (react)', - () => runPlainSerializationLoop(handler), - serializationBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate rich types (react)', async () => + runRichSerializationLoop(handler), + ).run(serializationBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/serialization/react/speed.dehydrate-plain-control.bench.ts b/benchmarks/ssr/scenarios/serialization/react/speed.dehydrate-plain-control.bench.ts new file mode 100644 index 0000000000..c70fddc6c4 --- /dev/null +++ b/benchmarks/ssr/scenarios/serialization/react/speed.dehydrate-plain-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertSerializationScenario, + runPlainSerializationLoop, + serializationBenchOptions, +} from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertSerializationScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate plain control (react)', async () => + runPlainSerializationLoop(handler), + ).run(serializationBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/serialization/react/tsconfig.json b/benchmarks/ssr/scenarios/serialization/react/tsconfig.json index 9bfd9bcf62..59499356d6 100644 --- a/benchmarks/ssr/scenarios/serialization/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/serialization/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared-bench.ts", diff --git a/benchmarks/ssr/scenarios/serialization/react/vite.config.ts b/benchmarks/ssr/scenarios/serialization/react/vite.config.ts index 6280d87579..64568ccb7e 100644 --- a/benchmarks/ssr/scenarios/serialization/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/serialization/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr serialization (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/serialization/shared-bench.ts b/benchmarks/ssr/scenarios/serialization/shared-bench.ts index a39f35dc75..25ed478f03 100644 --- a/benchmarks/ssr/scenarios/serialization/shared-bench.ts +++ b/benchmarks/ssr/scenarios/serialization/shared-bench.ts @@ -5,8 +5,8 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const richSerializationLoopIterations = 30 -const plainSerializationLoopIterations = 30 +const richSerializationLoopTotalRequests = 32 +const plainSerializationLoopTotalRequests = 32 const requestInit = { method: 'GET', @@ -89,7 +89,8 @@ export const serializationBenchOptions = { export function runRichSerializationLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: richSerializationLoopIterations, + concurrency: 16, + totalRequests: richSerializationLoopTotalRequests, buildRequest: (random, index) => buildSerializationRequest('rich', random, index), }) @@ -98,7 +99,8 @@ export function runRichSerializationLoop(handler: StartRequestHandler) { export function runPlainSerializationLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: plainSerializationLoopIterations, + concurrency: 16, + totalRequests: plainSerializationLoopTotalRequests, buildRequest: (random, index) => buildSerializationRequest('plain', random, index), }) diff --git a/benchmarks/ssr/scenarios/serialization/solid/speed.bench.ts b/benchmarks/ssr/scenarios/serialization/solid/speed.bench.ts index a939cae51f..70bda8c7af 100644 --- a/benchmarks/ssr/scenarios/serialization/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/serialization/solid/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSerializationScenario, - runPlainSerializationLoop, runRichSerializationLoop, serializationBenchOptions, - type StartRequestHandler, } from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,16 +16,8 @@ const { default: handler } = (await import( await assertSerializationScenario(handler) -describe('ssr', () => { - bench( - 'ssr dehydrate rich types (solid)', - () => runRichSerializationLoop(handler), - serializationBenchOptions, - ) - - bench( - 'ssr dehydrate plain control (solid)', - () => runPlainSerializationLoop(handler), - serializationBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate rich types (solid)', async () => + runRichSerializationLoop(handler), + ).run(serializationBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/serialization/solid/speed.dehydrate-plain-control.bench.ts b/benchmarks/ssr/scenarios/serialization/solid/speed.dehydrate-plain-control.bench.ts new file mode 100644 index 0000000000..d7ccb16f6f --- /dev/null +++ b/benchmarks/ssr/scenarios/serialization/solid/speed.dehydrate-plain-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertSerializationScenario, + runPlainSerializationLoop, + serializationBenchOptions, +} from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertSerializationScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate plain control (solid)', async () => + runPlainSerializationLoop(handler), + ).run(serializationBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/serialization/solid/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/serialization/solid/src/routeTree.gen.ts index 69b63cffe9..b9e25f918e 100644 --- a/benchmarks/ssr/scenarios/serialization/solid/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/serialization/solid/src/routeTree.gen.ts @@ -9,19 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as RichIdRouteImport } from './routes/rich.$id' import { Route as PlainIdRouteImport } from './routes/plain.$id' +import { Route as RichIdRouteImport } from './routes/rich.$id' -const RichIdRoute = RichIdRouteImport.update({ - id: '/rich/$id', - path: '/rich/$id', - getParentRoute: () => rootRouteImport, -} as any) const PlainIdRoute = PlainIdRouteImport.update({ id: '/plain/$id', path: '/plain/$id', getParentRoute: () => rootRouteImport, } as any) +const RichIdRoute = RichIdRouteImport.update({ + id: '/rich/$id', + path: '/rich/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/plain/$id': typeof PlainIdRoute @@ -51,13 +51,6 @@ export interface RootRouteChildren { declare module '@tanstack/solid-router' { interface FileRoutesByPath { - '/rich/$id': { - id: '/rich/$id' - path: '/rich/$id' - fullPath: '/rich/$id' - preLoaderRoute: typeof RichIdRouteImport - parentRoute: typeof rootRouteImport - } '/plain/$id': { id: '/plain/$id' path: '/plain/$id' @@ -65,6 +58,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof PlainIdRouteImport parentRoute: typeof rootRouteImport } + '/rich/$id': { + id: '/rich/$id' + path: '/rich/$id' + fullPath: '/rich/$id' + preLoaderRoute: typeof RichIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/ssr/scenarios/serialization/solid/tsconfig.json b/benchmarks/ssr/scenarios/serialization/solid/tsconfig.json index d7feff5f61..3ea91b977f 100644 --- a/benchmarks/ssr/scenarios/serialization/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/serialization/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared-bench.ts", diff --git a/benchmarks/ssr/scenarios/serialization/solid/vite.config.ts b/benchmarks/ssr/scenarios/serialization/solid/vite.config.ts index 67df3299e1..db81e2ab74 100644 --- a/benchmarks/ssr/scenarios/serialization/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/serialization/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr serialization (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/serialization/vue/speed.bench.ts b/benchmarks/ssr/scenarios/serialization/vue/speed.bench.ts index ee1e072286..7f733dd601 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/serialization/vue/speed.bench.ts @@ -1,11 +1,10 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertSerializationScenario, - runPlainSerializationLoop, runRichSerializationLoop, serializationBenchOptions, - type StartRequestHandler, } from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href @@ -17,16 +16,8 @@ const { default: handler } = (await import( await assertSerializationScenario(handler) -describe('ssr', () => { - bench( - 'ssr dehydrate rich types (vue)', - () => runRichSerializationLoop(handler), - serializationBenchOptions, - ) - - bench( - 'ssr dehydrate plain control (vue)', - () => runPlainSerializationLoop(handler), - serializationBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate rich types (vue)', async () => + runRichSerializationLoop(handler), + ).run(serializationBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/serialization/vue/speed.dehydrate-plain-control.bench.ts b/benchmarks/ssr/scenarios/serialization/vue/speed.dehydrate-plain-control.bench.ts new file mode 100644 index 0000000000..8efdeb6c79 --- /dev/null +++ b/benchmarks/ssr/scenarios/serialization/vue/speed.dehydrate-plain-control.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertSerializationScenario, + runPlainSerializationLoop, + serializationBenchOptions, +} from '../shared-bench' +import type { StartRequestHandler } from '../shared-bench' + +const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href + +const { default: handler } = (await import( + /* @vite-ignore */ appModuleUrl +)) as { + default: StartRequestHandler +} + +await assertSerializationScenario(handler) + +test('ssr', async ({ bench }) => { + await bench('ssr dehydrate plain control (vue)', async () => + runPlainSerializationLoop(handler), + ).run(serializationBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/serialization/vue/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/serialization/vue/src/routeTree.gen.ts index 02268c2c3c..cd7b0b449b 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/serialization/vue/src/routeTree.gen.ts @@ -9,19 +9,19 @@ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { Route as rootRouteImport } from './routes/__root' -import { Route as RichIdRouteImport } from './routes/rich.$id' import { Route as PlainIdRouteImport } from './routes/plain.$id' +import { Route as RichIdRouteImport } from './routes/rich.$id' -const RichIdRoute = RichIdRouteImport.update({ - id: '/rich/$id', - path: '/rich/$id', - getParentRoute: () => rootRouteImport, -} as any) const PlainIdRoute = PlainIdRouteImport.update({ id: '/plain/$id', path: '/plain/$id', getParentRoute: () => rootRouteImport, } as any) +const RichIdRoute = RichIdRouteImport.update({ + id: '/rich/$id', + path: '/rich/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/plain/$id': typeof PlainIdRoute @@ -51,13 +51,6 @@ export interface RootRouteChildren { declare module '@tanstack/vue-router' { interface FileRoutesByPath { - '/rich/$id': { - id: '/rich/$id' - path: '/rich/$id' - fullPath: '/rich/$id' - preLoaderRoute: typeof RichIdRouteImport - parentRoute: typeof rootRouteImport - } '/plain/$id': { id: '/plain/$id' path: '/plain/$id' @@ -65,6 +58,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof PlainIdRouteImport parentRoute: typeof rootRouteImport } + '/rich/$id': { + id: '/rich/$id' + path: '/rich/$id' + fullPath: '/rich/$id' + preLoaderRoute: typeof RichIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/ssr/scenarios/serialization/vue/src/routes/plain.$id.tsx b/benchmarks/ssr/scenarios/serialization/vue/src/routes/plain.$id.tsx index d41d123f1f..47fdeb971f 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/src/routes/plain.$id.tsx +++ b/benchmarks/ssr/scenarios/serialization/vue/src/routes/plain.$id.tsx @@ -1,24 +1,27 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makePlainSerializationData } from '../../../shared-data' +const PlainComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.label}

+

{data.value.createdAt}

+

{data.value.lookup[0]?.[1].label}

+

{data.value.tags[0]}

+

{data.value.count}

+

{data.value.nested[0]?.id}

+

{data.value.points[0]?.label}

+

{data.value.problem.message}

+
+ ) + }, +}) + export const Route = createFileRoute('/plain/$id')({ loader: ({ params }) => makePlainSerializationData(params.id), component: PlainComponent, }) - -function PlainComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.label}

-

{data.value.createdAt}

-

{data.value.lookup[0]?.[1].label}

-

{data.value.tags[0]}

-

{data.value.count}

-

{data.value.nested[0]?.id}

-

{data.value.points[0]?.label}

-

{data.value.problem.message}

-
- ) -} diff --git a/benchmarks/ssr/scenarios/serialization/vue/src/routes/rich.$id.tsx b/benchmarks/ssr/scenarios/serialization/vue/src/routes/rich.$id.tsx index d50a3f292d..1ee86cefd3 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/src/routes/rich.$id.tsx +++ b/benchmarks/ssr/scenarios/serialization/vue/src/routes/rich.$id.tsx @@ -1,24 +1,27 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { makeRichSerializationData } from '../../../shared-data' +const RichComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
+

{data.value.label}

+

{data.value.createdAt.toISOString()}

+

{data.value.lookup.get('k0')?.label}

+

{Array.from(data.value.tags)[0]}

+

{data.value.count.toString()}

+

{data.value.nested[0]?.id}

+

{data.value.points[0]?.label}

+

{data.value.problem.message}

+
+ ) + }, +}) + export const Route = createFileRoute('/rich/$id')({ loader: ({ params }) => makeRichSerializationData(params.id), component: RichComponent, }) - -function RichComponent() { - const data = Route.useLoaderData() - - return ( -
-

{data.value.label}

-

{data.value.createdAt.toISOString()}

-

{data.value.lookup.get('k0')?.label}

-

{Array.from(data.value.tags)[0]}

-

{data.value.count.toString()}

-

{data.value.nested[0]?.id}

-

{data.value.points[0]?.label}

-

{data.value.problem.message}

-
- ) -} diff --git a/benchmarks/ssr/scenarios/serialization/vue/tsconfig.json b/benchmarks/ssr/scenarios/serialization/vue/tsconfig.json index 4a7f0ef092..5d8c7b5b62 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/serialization/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../shared-bench.ts", diff --git a/benchmarks/ssr/scenarios/serialization/vue/vite.config.ts b/benchmarks/ssr/scenarios/serialization/vue/vite.config.ts index 76f99750c3..b89537fa18 100644 --- a/benchmarks/ssr/scenarios/serialization/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/serialization/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr serialization (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fn-transport/bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/bench.ts index 73a79aa79a..4274c724ca 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/bench.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/bench.ts @@ -67,9 +67,9 @@ const commonHeaders = { 'sec-fetch-site': 'same-origin', accept: acceptHeader, } satisfies HeadersInit -const serverFnMultipartLoopIterations = 125 -const serverFnRawResponseLoopIterations = 175 -const serverFnRawStreamLoopIterations = 100 +const serverFnMultipartLoopTotalRequests = 128 +const serverFnRawResponseLoopTotalRequests = 176 +const serverFnRawStreamLoopTotalRequests = 112 export const serverFnTransportBenchOptions = { warmupIterations: 100, @@ -519,7 +519,8 @@ export function runServerFnMultipartRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnMultipartLoopIterations, + concurrency: 16, + totalRequests: serverFnMultipartLoopTotalRequests, buildRequest: (_random, index) => buildMultipartRequest(context.urls, context.multipartPayloads, index), validateResponse: validateSerializedResponse, @@ -532,7 +533,8 @@ export function runServerFnRawResponseRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnRawResponseLoopIterations, + concurrency: 16, + totalRequests: serverFnRawResponseLoopTotalRequests, buildRequest: (_random, index) => buildRawResponseRequest(context.urls, context.rawPayloads, index), validateResponse: validateRawResponse, @@ -545,7 +547,8 @@ export function runServerFnRawStreamRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnRawStreamLoopIterations, + concurrency: 16, + totalRequests: serverFnRawStreamLoopTotalRequests, buildRequest: (_random, index) => buildRawStreamRequest(context.urls, context.streamPayloads, index), validateResponse: validateRawStreamResponse, diff --git a/benchmarks/ssr/scenarios/server-fn-transport/react/speed.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.bench.ts index c168f6e61c..fa80cdb690 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.bench.ts @@ -1,9 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnTransportScenario, runServerFnMultipartRequestLoop, - runServerFnRawResponseRequestLoop, - runServerFnRawStreamRequestLoop, serverFnTransportBenchOptions, setupServerFnTransportBench, } from '../bench' @@ -14,27 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnTransportBench(handler) await assertServerFnTransportScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn multipart (react)', - () => runServerFnMultipartRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-response (react)', - () => runServerFnRawResponseRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-stream (react)', - () => runServerFnRawStreamRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn multipart (react)', async () => + runServerFnMultipartRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-response.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-response.bench.ts new file mode 100644 index 0000000000..fd535ee313 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-response.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawResponseRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-response (react)', async () => + runServerFnRawResponseRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-stream.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-stream.bench.ts new file mode 100644 index 0000000000..8fbce405dd --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/react/speed.server-fn-raw-stream.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawStreamRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-stream (react)', async () => + runServerFnRawStreamRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/react/tsconfig.json b/benchmarks/ssr/scenarios/server-fn-transport/react/tsconfig.json index 08c349fd49..4f3cc314af 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fn-transport/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../bench.ts", diff --git a/benchmarks/ssr/scenarios/server-fn-transport/react/vite.config.ts b/benchmarks/ssr/scenarios/server-fn-transport/react/vite.config.ts index 4c6293d5d7..c37fde0c4b 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fn-transport (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.bench.ts index b93d7d79a9..adac07cb22 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.bench.ts @@ -1,9 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnTransportScenario, runServerFnMultipartRequestLoop, - runServerFnRawResponseRequestLoop, - runServerFnRawStreamRequestLoop, serverFnTransportBenchOptions, setupServerFnTransportBench, } from '../bench' @@ -14,27 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnTransportBench(handler) await assertServerFnTransportScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn multipart (solid)', - () => runServerFnMultipartRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-response (solid)', - () => runServerFnRawResponseRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-stream (solid)', - () => runServerFnRawStreamRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn multipart (solid)', async () => + runServerFnMultipartRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-response.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-response.bench.ts new file mode 100644 index 0000000000..843a4c97ce --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-response.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawResponseRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-response (solid)', async () => + runServerFnRawResponseRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-stream.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-stream.bench.ts new file mode 100644 index 0000000000..aa24d55e79 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/solid/speed.server-fn-raw-stream.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawStreamRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-stream (solid)', async () => + runServerFnRawStreamRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/solid/tsconfig.json b/benchmarks/ssr/scenarios/server-fn-transport/solid/tsconfig.json index 54a0e49d93..0af78df33d 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fn-transport/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../bench.ts", diff --git a/benchmarks/ssr/scenarios/server-fn-transport/solid/vite.config.ts b/benchmarks/ssr/scenarios/server-fn-transport/solid/vite.config.ts index b71d03009b..a8af4a6b50 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fn-transport (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.bench.ts index 6f803d1665..24305cf1bc 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.bench.ts @@ -1,9 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnTransportScenario, runServerFnMultipartRequestLoop, - runServerFnRawResponseRequestLoop, - runServerFnRawStreamRequestLoop, serverFnTransportBenchOptions, setupServerFnTransportBench, } from '../bench' @@ -14,27 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnTransportBench(handler) await assertServerFnTransportScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn multipart (vue)', - () => runServerFnMultipartRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-response (vue)', - () => runServerFnRawResponseRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) - - bench( - 'ssr server-fn raw-stream (vue)', - () => runServerFnRawStreamRequestLoop(handler, context), - serverFnTransportBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn multipart (vue)', async () => + runServerFnMultipartRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-response.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-response.bench.ts new file mode 100644 index 0000000000..2eeb9a4f6b --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-response.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawResponseRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-response (vue)', async () => + runServerFnRawResponseRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-stream.bench.ts b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-stream.bench.ts new file mode 100644 index 0000000000..a73905004d --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fn-transport/vue/speed.server-fn-raw-stream.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnTransportScenario, + runServerFnRawStreamRequestLoop, + serverFnTransportBenchOptions, + setupServerFnTransportBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnTransportBench(handler) + +await assertServerFnTransportScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn raw-stream (vue)', async () => + runServerFnRawStreamRequestLoop(handler, context), + ).run(serverFnTransportBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fn-transport/vue/tsconfig.json b/benchmarks/ssr/scenarios/server-fn-transport/vue/tsconfig.json index 29efa76d67..5b7742b414 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fn-transport/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "../bench.ts", diff --git a/benchmarks/ssr/scenarios/server-fn-transport/vue/vite.config.ts b/benchmarks/ssr/scenarios/server-fn-transport/vue/vite.config.ts index 5d74904e14..0f3e2ce84d 100644 --- a/benchmarks/ssr/scenarios/server-fn-transport/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fn-transport/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fn-transport (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fns/bench.ts b/benchmarks/ssr/scenarios/server-fns/bench.ts index 65a8749cef..1461ce2bfd 100644 --- a/benchmarks/ssr/scenarios/server-fns/bench.ts +++ b/benchmarks/ssr/scenarios/server-fns/bench.ts @@ -53,12 +53,12 @@ const documentRequestInit = { accept: 'text/html', }, } satisfies RequestInit -const serverFnGetLoopIterations = 100 -const serverFnPostLoopIterations = 150 -const serverFnRedirectLoopIterations = 125 -const serverFnNotFoundLoopIterations = 200 -const serverFnSendContextLoopIterations = 175 -const serverFnDocumentSsrLoopIterations = 45 +const serverFnGetLoopTotalRequests = 112 +const serverFnPostLoopTotalRequests = 160 +const serverFnRedirectLoopTotalRequests = 128 +const serverFnNotFoundLoopTotalRequests = 208 +const serverFnSendContextLoopTotalRequests = 176 +const serverFnDocumentSsrLoopTotalRequests = 48 export const serverFnBenchOptions = { warmupIterations: 100, @@ -456,7 +456,8 @@ export function runServerFnGetRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnGetLoopIterations, + concurrency: 16, + totalRequests: serverFnGetLoopTotalRequests, buildRequest: (_random, index) => buildGetRequest(context.urls, context.getQueries, index), }) @@ -468,7 +469,8 @@ export function runServerFnPostRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnPostLoopIterations, + concurrency: 16, + totalRequests: serverFnPostLoopTotalRequests, buildRequest: (_random, index) => buildPostRequest(context.urls, context.bodies, index), }) @@ -480,7 +482,8 @@ export function runServerFnRedirectRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnRedirectLoopIterations, + concurrency: 16, + totalRequests: serverFnRedirectLoopTotalRequests, buildRequest: (_random, index) => buildRedirectRequest(context.urls, context.bodies, index), validateResponse: validateRedirectResponse, @@ -493,7 +496,8 @@ export function runServerFnNotFoundRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnNotFoundLoopIterations, + concurrency: 16, + totalRequests: serverFnNotFoundLoopTotalRequests, buildRequest: (_random, index) => buildNotFoundRequest(context.urls, context.bodies, index), validateResponse: (response) => @@ -507,7 +511,8 @@ export function runServerFnSendContextRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnSendContextLoopIterations, + concurrency: 16, + totalRequests: serverFnSendContextLoopTotalRequests, buildRequest: (_random, index) => buildContextRequest(context.urls, context.contextBodies, index), validateResponse: (response) => @@ -520,7 +525,8 @@ export function runServerFnDocumentSsrRequestLoop( ) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: serverFnDocumentSsrLoopIterations, + concurrency: 16, + totalRequests: serverFnDocumentSsrLoopTotalRequests, buildRequest: buildSsrCallRequest, validateResponse: validateDocumentResponse, }) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.bench.ts index 46dca5adc7..c876772ad1 100644 --- a/benchmarks/ssr/scenarios/server-fns/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.bench.ts @@ -1,12 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnScenario, - runServerFnDocumentSsrRequestLoop, runServerFnGetRequestLoop, - runServerFnNotFoundRequestLoop, - runServerFnPostRequestLoop, - runServerFnRedirectRequestLoop, - runServerFnSendContextRequestLoop, serverFnBenchOptions, setupServerFnBench, } from '../bench' @@ -17,45 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnBench(handler) await assertServerFnScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn GET (react)', - () => runServerFnGetRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn POST (react)', - () => runServerFnPostRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn redirect (react)', - () => runServerFnRedirectRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn not-found (react)', - () => runServerFnNotFoundRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn send-context (react)', - () => runServerFnSendContextRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn during document ssr (react)', - () => runServerFnDocumentSsrRequestLoop(handler), - serverFnBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn GET (react)', async () => + runServerFnGetRequestLoop(handler, context), + ).run(serverFnBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-during-document-ssr.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-during-document-ssr.bench.ts new file mode 100644 index 0000000000..6a0cb55f78 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-during-document-ssr.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnDocumentSsrRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn during document ssr (react)', async () => + runServerFnDocumentSsrRequestLoop(handler), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-not-found.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-not-found.bench.ts new file mode 100644 index 0000000000..96f1160078 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnNotFoundRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn not-found (react)', async () => + runServerFnNotFoundRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-post.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-post.bench.ts new file mode 100644 index 0000000000..e85d5debd3 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-post.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnPostRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn POST (react)', async () => + runServerFnPostRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-redirect.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-redirect.bench.ts new file mode 100644 index 0000000000..5dae598549 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-redirect.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnRedirectRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn redirect (react)', async () => + runServerFnRedirectRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-send-context.bench.ts b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-send-context.bench.ts new file mode 100644 index 0000000000..40d6961206 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/react/speed.server-fn-send-context.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnSendContextRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn send-context (react)', async () => + runServerFnSendContextRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/react/tsconfig.json b/benchmarks/ssr/scenarios/server-fns/react/tsconfig.json index 91027bfc88..cf14e1d440 100644 --- a/benchmarks/ssr/scenarios/server-fns/react/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fns/react/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/server-fns/react/vite.config.ts b/benchmarks/ssr/scenarios/server-fns/react/vite.config.ts index 4f608f0444..cd56edda95 100644 --- a/benchmarks/ssr/scenarios/server-fns/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fns/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fns (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.bench.ts index a116ea9102..f6bbdc9e73 100644 --- a/benchmarks/ssr/scenarios/server-fns/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.bench.ts @@ -1,12 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnScenario, - runServerFnDocumentSsrRequestLoop, runServerFnGetRequestLoop, - runServerFnNotFoundRequestLoop, - runServerFnPostRequestLoop, - runServerFnRedirectRequestLoop, - runServerFnSendContextRequestLoop, serverFnBenchOptions, setupServerFnBench, } from '../bench' @@ -17,45 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnBench(handler) await assertServerFnScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn GET (solid)', - () => runServerFnGetRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn POST (solid)', - () => runServerFnPostRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn redirect (solid)', - () => runServerFnRedirectRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn not-found (solid)', - () => runServerFnNotFoundRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn send-context (solid)', - () => runServerFnSendContextRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn during document ssr (solid)', - () => runServerFnDocumentSsrRequestLoop(handler), - serverFnBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn GET (solid)', async () => + runServerFnGetRequestLoop(handler, context), + ).run(serverFnBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-during-document-ssr.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-during-document-ssr.bench.ts new file mode 100644 index 0000000000..933f61b59c --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-during-document-ssr.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnDocumentSsrRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn during document ssr (solid)', async () => + runServerFnDocumentSsrRequestLoop(handler), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-not-found.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-not-found.bench.ts new file mode 100644 index 0000000000..513b69f4ba --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnNotFoundRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn not-found (solid)', async () => + runServerFnNotFoundRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-post.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-post.bench.ts new file mode 100644 index 0000000000..e2ce8ad9ee --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-post.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnPostRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn POST (solid)', async () => + runServerFnPostRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-redirect.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-redirect.bench.ts new file mode 100644 index 0000000000..14353f1290 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-redirect.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnRedirectRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn redirect (solid)', async () => + runServerFnRedirectRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-send-context.bench.ts b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-send-context.bench.ts new file mode 100644 index 0000000000..76d3a554bd --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/solid/speed.server-fn-send-context.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnSendContextRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn send-context (solid)', async () => + runServerFnSendContextRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/solid/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/server-fns/solid/src/routeTree.gen.ts index 3db5e487b3..3d0bd34eaa 100644 --- a/benchmarks/ssr/scenarios/server-fns/solid/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/server-fns/solid/src/routeTree.gen.ts @@ -10,24 +10,24 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id' import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls' +import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const SsrCallIdRoute = SsrCallIdRouteImport.update({ - id: '/ssr-call/$id', - path: '/ssr-call/$id', - getParentRoute: () => rootRouteImport, -} as any) const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({ id: '/api/fn-urls', path: '/api/fn-urls', getParentRoute: () => rootRouteImport, } as any) +const SsrCallIdRoute = SsrCallIdRouteImport.update({ + id: '/ssr-call/$id', + path: '/ssr-call/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -68,13 +68,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/ssr-call/$id': { - id: '/ssr-call/$id' - path: '/ssr-call/$id' - fullPath: '/ssr-call/$id' - preLoaderRoute: typeof SsrCallIdRouteImport - parentRoute: typeof rootRouteImport - } '/api/fn-urls': { id: '/api/fn-urls' path: '/api/fn-urls' @@ -82,6 +75,13 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ApiFnUrlsRouteImport parentRoute: typeof rootRouteImport } + '/ssr-call/$id': { + id: '/ssr-call/$id' + path: '/ssr-call/$id' + fullPath: '/ssr-call/$id' + preLoaderRoute: typeof SsrCallIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/ssr/scenarios/server-fns/solid/tsconfig.json b/benchmarks/ssr/scenarios/server-fns/solid/tsconfig.json index b1806caa67..42c3a2160f 100644 --- a/benchmarks/ssr/scenarios/server-fns/solid/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fns/solid/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/server-fns/solid/vite.config.ts b/benchmarks/ssr/scenarios/server-fns/solid/vite.config.ts index ef8292a042..2f2f78b75c 100644 --- a/benchmarks/ssr/scenarios/server-fns/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fns/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fns (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.bench.ts index 02cb03efd1..3f67c1a500 100644 --- a/benchmarks/ssr/scenarios/server-fns/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.bench.ts @@ -1,12 +1,7 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerFnScenario, - runServerFnDocumentSsrRequestLoop, runServerFnGetRequestLoop, - runServerFnNotFoundRequestLoop, - runServerFnPostRequestLoop, - runServerFnRedirectRequestLoop, - runServerFnSendContextRequestLoop, serverFnBenchOptions, setupServerFnBench, } from '../bench' @@ -17,45 +12,12 @@ const { default: handler } = (await import( )) as { default: StartRequestHandler } - const context = await setupServerFnBench(handler) await assertServerFnScenario(handler, context) -describe('ssr', () => { - bench( - 'ssr server-fn GET (vue)', - () => runServerFnGetRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn POST (vue)', - () => runServerFnPostRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn redirect (vue)', - () => runServerFnRedirectRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn not-found (vue)', - () => runServerFnNotFoundRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn send-context (vue)', - () => runServerFnSendContextRequestLoop(handler, context), - serverFnBenchOptions, - ) - - bench( - 'ssr server-fn during document ssr (vue)', - () => runServerFnDocumentSsrRequestLoop(handler), - serverFnBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-fn GET (vue)', async () => + runServerFnGetRequestLoop(handler, context), + ).run(serverFnBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-during-document-ssr.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-during-document-ssr.bench.ts new file mode 100644 index 0000000000..56c9addca5 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-during-document-ssr.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnDocumentSsrRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn during document ssr (vue)', async () => + runServerFnDocumentSsrRequestLoop(handler), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-not-found.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-not-found.bench.ts new file mode 100644 index 0000000000..e9a6e31617 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-not-found.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnNotFoundRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn not-found (vue)', async () => + runServerFnNotFoundRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-post.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-post.bench.ts new file mode 100644 index 0000000000..df9312ccd1 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-post.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnPostRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn POST (vue)', async () => + runServerFnPostRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-redirect.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-redirect.bench.ts new file mode 100644 index 0000000000..67c4611644 --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-redirect.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnRedirectRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn redirect (vue)', async () => + runServerFnRedirectRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-send-context.bench.ts b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-send-context.bench.ts new file mode 100644 index 0000000000..6f51ef4bab --- /dev/null +++ b/benchmarks/ssr/scenarios/server-fns/vue/speed.server-fn-send-context.bench.ts @@ -0,0 +1,23 @@ +import { test } from 'vitest' +import { + assertServerFnScenario, + runServerFnSendContextRequestLoop, + serverFnBenchOptions, + setupServerFnBench, +} from '../bench' +import type { StartRequestHandler } from '../bench' + +const { default: handler } = (await import( + /* @vite-ignore */ new URL('./dist/server/server.js', import.meta.url).href +)) as { + default: StartRequestHandler +} +const context = await setupServerFnBench(handler) + +await assertServerFnScenario(handler, context) + +test('ssr', async ({ bench }) => { + await bench('ssr server-fn send-context (vue)', async () => + runServerFnSendContextRequestLoop(handler, context), + ).run(serverFnBenchOptions) +}) diff --git a/benchmarks/ssr/scenarios/server-fns/vue/src/routeTree.gen.ts b/benchmarks/ssr/scenarios/server-fns/vue/src/routeTree.gen.ts index fa27fb1a5d..0e24cd9c15 100644 --- a/benchmarks/ssr/scenarios/server-fns/vue/src/routeTree.gen.ts +++ b/benchmarks/ssr/scenarios/server-fns/vue/src/routeTree.gen.ts @@ -10,24 +10,24 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id' import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls' +import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const SsrCallIdRoute = SsrCallIdRouteImport.update({ - id: '/ssr-call/$id', - path: '/ssr-call/$id', - getParentRoute: () => rootRouteImport, -} as any) const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({ id: '/api/fn-urls', path: '/api/fn-urls', getParentRoute: () => rootRouteImport, } as any) +const SsrCallIdRoute = SsrCallIdRouteImport.update({ + id: '/ssr-call/$id', + path: '/ssr-call/$id', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute @@ -68,13 +68,6 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/ssr-call/$id': { - id: '/ssr-call/$id' - path: '/ssr-call/$id' - fullPath: '/ssr-call/$id' - preLoaderRoute: typeof SsrCallIdRouteImport - parentRoute: typeof rootRouteImport - } '/api/fn-urls': { id: '/api/fn-urls' path: '/api/fn-urls' @@ -82,6 +75,13 @@ declare module '@tanstack/vue-router' { preLoaderRoute: typeof ApiFnUrlsRouteImport parentRoute: typeof rootRouteImport } + '/ssr-call/$id': { + id: '/ssr-call/$id' + path: '/ssr-call/$id' + fullPath: '/ssr-call/$id' + preLoaderRoute: typeof SsrCallIdRouteImport + parentRoute: typeof rootRouteImport + } } } diff --git a/benchmarks/ssr/scenarios/server-fns/vue/src/routes/ssr-call.$id.tsx b/benchmarks/ssr/scenarios/server-fns/vue/src/routes/ssr-call.$id.tsx index 8abe77c2af..45fad23dc0 100644 --- a/benchmarks/ssr/scenarios/server-fns/vue/src/routes/ssr-call.$id.tsx +++ b/benchmarks/ssr/scenarios/server-fns/vue/src/routes/ssr-call.$id.tsx @@ -1,6 +1,17 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { echoGet } from '../fns' +const SsrCallComponent = defineComponent({ + setup() { + const data = Route.useLoaderData() + + return () => ( +
{data.value.marker}
+ ) + }, +}) + export const Route = createFileRoute('/ssr-call/$id')({ loader: async ({ params }) => { const result = await echoGet({ @@ -15,9 +26,3 @@ export const Route = createFileRoute('/ssr-call/$id')({ }, component: SsrCallComponent, }) - -function SsrCallComponent() { - const data = Route.useLoaderData() - - return
{data.value.marker}
-} diff --git a/benchmarks/ssr/scenarios/server-fns/vue/tsconfig.json b/benchmarks/ssr/scenarios/server-fns/vue/tsconfig.json index 4fe3ccecb1..08c94853f4 100644 --- a/benchmarks/ssr/scenarios/server-fns/vue/tsconfig.json +++ b/benchmarks/ssr/scenarios/server-fns/vue/tsconfig.json @@ -6,7 +6,7 @@ "types": ["node", "vite/client", "vitest/globals"] }, "include": [ - "speed.bench.ts", + "speed*.bench.ts", "vite.config.ts", "../../../bench-utils.ts", "./src/**/*" diff --git a/benchmarks/ssr/scenarios/server-fns/vue/vite.config.ts b/benchmarks/ssr/scenarios/server-fns/vue/vite.config.ts index 2a7783ed7a..5f3e3ca4b5 100644 --- a/benchmarks/ssr/scenarios/server-fns/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-fns/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-fns (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/react/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes-middleware/react/speed.bench.ts index 8e96bc8e04..6331216522 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteMiddlewareResponse, runServerRouteMiddlewareLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteMiddlewareResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route middleware (react)', - () => runServerRouteMiddlewareLoop(handler), - serverRouteMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route middleware (react)', async () => + runServerRouteMiddlewareLoop(handler), + ).run(serverRouteMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/react/vite.config.ts b/benchmarks/ssr/scenarios/server-routes-middleware/react/vite.config.ts index 9c41f6d542..f6998c2ac8 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes-middleware (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/shared.ts b/benchmarks/ssr/scenarios/server-routes-middleware/shared.ts index 3177e0f763..663ca09294 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/shared.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/shared.ts @@ -4,7 +4,7 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const loopIterations = 150 +const loopTotalRequests = 160 const apiRequestInit = { method: 'GET', @@ -22,7 +22,8 @@ export const serverRouteMiddlewareBenchOptions = { export function runServerRouteMiddlewareLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: loopIterations, + concurrency: 16, + totalRequests: loopTotalRequests, buildRequest: (random) => new Request( `http://localhost/api/chain/${randomSegment(random)}`, diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/solid/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes-middleware/solid/speed.bench.ts index 7e6fac4bbe..77d58e7b19 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteMiddlewareResponse, runServerRouteMiddlewareLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteMiddlewareResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route middleware (solid)', - () => runServerRouteMiddlewareLoop(handler), - serverRouteMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route middleware (solid)', async () => + runServerRouteMiddlewareLoop(handler), + ).run(serverRouteMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/solid/vite.config.ts b/benchmarks/ssr/scenarios/server-routes-middleware/solid/vite.config.ts index 89116c111e..800cf9db9f 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes-middleware (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/vue/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes-middleware/vue/speed.bench.ts index e67ca0a420..3d03b9c1fa 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteMiddlewareResponse, runServerRouteMiddlewareLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteMiddlewareResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route middleware (vue)', - () => runServerRouteMiddlewareLoop(handler), - serverRouteMiddlewareBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route middleware (vue)', async () => + runServerRouteMiddlewareLoop(handler), + ).run(serverRouteMiddlewareBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes-middleware/vue/vite.config.ts b/benchmarks/ssr/scenarios/server-routes-middleware/vue/vite.config.ts index a1b26182f7..909b7cca50 100644 --- a/benchmarks/ssr/scenarios/server-routes-middleware/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes-middleware/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes-middleware (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes/react/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes/react/speed.bench.ts index 1bdb7946b2..631314148a 100644 --- a/benchmarks/ssr/scenarios/server-routes/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteResponse, runServerRouteLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route (react)', - () => runServerRouteLoop(handler), - serverRouteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route (react)', async () => + runServerRouteLoop(handler), + ).run(serverRouteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes/react/vite.config.ts b/benchmarks/ssr/scenarios/server-routes/react/vite.config.ts index fdc16bf50c..2c723c749c 100644 --- a/benchmarks/ssr/scenarios/server-routes/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes/shared.ts b/benchmarks/ssr/scenarios/server-routes/shared.ts index 20f67ea296..ce33faaefe 100644 --- a/benchmarks/ssr/scenarios/server-routes/shared.ts +++ b/benchmarks/ssr/scenarios/server-routes/shared.ts @@ -4,7 +4,7 @@ import type { StartRequestHandler } from '../../bench-utils' export type { StartRequestHandler } const benchmarkSeed = 0xdecafbad -const loopIterations = 200 +const loopTotalRequests = 208 const apiRequestInit = { method: 'GET', @@ -22,7 +22,8 @@ export const serverRouteBenchOptions = { export function runServerRouteLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, - iterations: loopIterations, + concurrency: 16, + totalRequests: loopTotalRequests, buildRequest: (random) => new Request( `http://localhost/api/users/${randomSegment(random)}`, diff --git a/benchmarks/ssr/scenarios/server-routes/solid/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes/solid/speed.bench.ts index ce3e1f8a21..4788d31854 100644 --- a/benchmarks/ssr/scenarios/server-routes/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteResponse, runServerRouteLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route (solid)', - () => runServerRouteLoop(handler), - serverRouteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route (solid)', async () => + runServerRouteLoop(handler), + ).run(serverRouteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes/solid/vite.config.ts b/benchmarks/ssr/scenarios/server-routes/solid/vite.config.ts index 24e502a63a..994e04f1d6 100644 --- a/benchmarks/ssr/scenarios/server-routes/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/server-routes/vue/speed.bench.ts b/benchmarks/ssr/scenarios/server-routes/vue/speed.bench.ts index f2b9e27acb..09c0bbe90b 100644 --- a/benchmarks/ssr/scenarios/server-routes/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/server-routes/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertServerRouteResponse, runServerRouteLoop, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertServerRouteResponse(handler) -describe('ssr', () => { - bench( - 'ssr server-route (vue)', - () => runServerRouteLoop(handler), - serverRouteBenchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr server-route (vue)', async () => + runServerRouteLoop(handler), + ).run(serverRouteBenchOptions) }) diff --git a/benchmarks/ssr/scenarios/server-routes/vue/vite.config.ts b/benchmarks/ssr/scenarios/server-routes/vue/vite.config.ts index c56f3c872a..0457453532 100644 --- a/benchmarks/ssr/scenarios/server-routes/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/server-routes/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr server-routes (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/streaming/react/speed.bench.ts b/benchmarks/ssr/scenarios/streaming/react/speed.bench.ts index c1dbf38ae5..eb4c9dc1d6 100644 --- a/benchmarks/ssr/scenarios/streaming/react/speed.bench.ts +++ b/benchmarks/ssr/scenarios/streaming/react/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertStreamingSanity, benchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertStreamingSanity(handler) -describe('ssr', () => { - bench( - 'ssr streaming deferred (react)', - () => runStreamingLoop(handler), - benchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr streaming deferred (react)', async () => + runStreamingLoop(handler), + ).run(benchOptions) }) diff --git a/benchmarks/ssr/scenarios/streaming/react/vite.config.ts b/benchmarks/ssr/scenarios/streaming/react/vite.config.ts index bdbfebdfce..e1cc5f534b 100644 --- a/benchmarks/ssr/scenarios/streaming/react/vite.config.ts +++ b/benchmarks/ssr/scenarios/streaming/react/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/react-start/plugin/vite' import react from '@vitejs/plugin-react' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr streaming (react)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/streaming/shared-bench.ts b/benchmarks/ssr/scenarios/streaming/shared-bench.ts index 25685b3c78..cc45062e1b 100644 --- a/benchmarks/ssr/scenarios/streaming/shared-bench.ts +++ b/benchmarks/ssr/scenarios/streaming/shared-bench.ts @@ -71,6 +71,8 @@ export const benchOptions = { export function runStreamingLoop(handler: StartRequestHandler) { return runRequestLoop(handler, { seed: benchmarkSeed, + concurrency: 16, + totalRequests: 16, buildRequest: buildStreamingRequest, }) } diff --git a/benchmarks/ssr/scenarios/streaming/shared-data.ts b/benchmarks/ssr/scenarios/streaming/shared-data.ts index 550a351794..695ed107c6 100644 --- a/benchmarks/ssr/scenarios/streaming/shared-data.ts +++ b/benchmarks/ssr/scenarios/streaming/shared-data.ts @@ -15,7 +15,11 @@ export const streamChunkCount = 96 export const streamChunkLength = 192 export function sleep0() { - return new Promise((resolve) => setTimeout(resolve, 1)) + // Give SSR a render turn before resolving deferred values. Counted turns + // avoid grouping concurrent requests by wall-clock timer expiration. + return new Promise((resolve) => { + setImmediate(() => setImmediate(resolve)) + }) } function hashId(id: string) { diff --git a/benchmarks/ssr/scenarios/streaming/solid/speed.bench.ts b/benchmarks/ssr/scenarios/streaming/solid/speed.bench.ts index 0828715220..19d5817d32 100644 --- a/benchmarks/ssr/scenarios/streaming/solid/speed.bench.ts +++ b/benchmarks/ssr/scenarios/streaming/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertStreamingSanity, benchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertStreamingSanity(handler) -describe('ssr', () => { - bench( - 'ssr streaming deferred (solid)', - () => runStreamingLoop(handler), - benchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr streaming deferred (solid)', async () => + runStreamingLoop(handler), + ).run(benchOptions) }) diff --git a/benchmarks/ssr/scenarios/streaming/solid/vite.config.ts b/benchmarks/ssr/scenarios/streaming/solid/vite.config.ts index 5b736899c0..353c21f552 100644 --- a/benchmarks/ssr/scenarios/streaming/solid/vite.config.ts +++ b/benchmarks/ssr/scenarios/streaming/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr streaming (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/scenarios/streaming/vue/speed.bench.ts b/benchmarks/ssr/scenarios/streaming/vue/speed.bench.ts index a484f95d6a..42473fc694 100644 --- a/benchmarks/ssr/scenarios/streaming/vue/speed.bench.ts +++ b/benchmarks/ssr/scenarios/streaming/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { assertStreamingSanity, benchOptions, @@ -16,10 +16,8 @@ const { default: handler } = (await import( await assertStreamingSanity(handler) -describe('ssr', () => { - bench( - 'ssr streaming deferred (vue)', - () => runStreamingLoop(handler), - benchOptions, - ) +test('ssr', async ({ bench }) => { + await bench('ssr streaming deferred (vue)', async () => + runStreamingLoop(handler), + ).run(benchOptions) }) diff --git a/benchmarks/ssr/scenarios/streaming/vue/vite.config.ts b/benchmarks/ssr/scenarios/streaming/vue/vite.config.ts index 8c65f71268..a09a30076f 100644 --- a/benchmarks/ssr/scenarios/streaming/vue/vite.config.ts +++ b/benchmarks/ssr/scenarios/streaming/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr streaming (vue)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/solid/speed.bench.ts b/benchmarks/ssr/solid/speed.bench.ts index 0c4317415d..2f72977612 100644 --- a/benchmarks/ssr/solid/speed.bench.ts +++ b/benchmarks/ssr/solid/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { runSsrRequestLoop } from '../bench-utils' import type { StartRequestHandler } from '../bench-utils' @@ -11,14 +11,12 @@ const { default: handler } = (await import( default: StartRequestHandler } -describe('ssr', () => { - bench( - 'ssr request loop (solid)', - () => runSsrRequestLoop(handler, { seed: benchmarkSeed }), - { - warmupIterations: 100, - time: 10_000, - throws: true, - }, - ) +test('ssr', async ({ bench }) => { + await bench('ssr request loop (solid)', async () => + runSsrRequestLoop(handler, { seed: benchmarkSeed }), + ).run({ + warmupIterations: 100, + time: 10_000, + throws: true, + }) }) diff --git a/benchmarks/ssr/solid/vite.config.ts b/benchmarks/ssr/solid/vite.config.ts index dc9cbf90e3..dfd82d9192 100644 --- a/benchmarks/ssr/solid/vite.config.ts +++ b/benchmarks/ssr/solid/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/solid-start/plugin/vite' import solid from 'vite-plugin-solid' +import { cpuSimulationExecArgv } from '../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr (solid)', watch: false, environment: 'node', diff --git a/benchmarks/ssr/tsconfig.json b/benchmarks/ssr/tsconfig.json index e3ed3ad08a..7279177023 100644 --- a/benchmarks/ssr/tsconfig.json +++ b/benchmarks/ssr/tsconfig.json @@ -3,5 +3,10 @@ "compilerOptions": { "types": ["node", "vite/client", "vitest/globals"] }, - "include": ["bench-utils.ts"] + "include": [ + "bench-utils.ts", + "bench-utils.test.ts", + "scenarios/streaming/shared-data.ts", + "vitest.unit.config.ts" + ] } diff --git a/benchmarks/ssr/vitest.unit.config.ts b/benchmarks/ssr/vitest.unit.config.ts new file mode 100644 index 0000000000..cbba6db9ef --- /dev/null +++ b/benchmarks/ssr/vitest.unit.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + name: '@benchmarks/ssr unit', + environment: 'node', + include: ['bench-utils.test.ts'], + }, +}) diff --git a/benchmarks/ssr/vue/speed.bench.ts b/benchmarks/ssr/vue/speed.bench.ts index 849f042e3c..57b59e0504 100644 --- a/benchmarks/ssr/vue/speed.bench.ts +++ b/benchmarks/ssr/vue/speed.bench.ts @@ -1,4 +1,4 @@ -import { bench, describe } from 'vitest' +import { test } from 'vitest' import { runSsrRequestLoop } from '../bench-utils' import type { StartRequestHandler } from '../bench-utils' @@ -11,14 +11,12 @@ const { default: handler } = (await import( default: StartRequestHandler } -describe('ssr', () => { - bench( - 'ssr request loop (vue)', - () => runSsrRequestLoop(handler, { seed: benchmarkSeed }), - { - warmupIterations: 100, - time: 10_000, - throws: true, - }, - ) +test('ssr', async ({ bench }) => { + await bench('ssr request loop (vue)', async () => + runSsrRequestLoop(handler, { seed: benchmarkSeed }), + ).run({ + warmupIterations: 100, + time: 10_000, + throws: true, + }) }) diff --git a/benchmarks/ssr/vue/vite.config.ts b/benchmarks/ssr/vue/vite.config.ts index 312f43a7ae..b2b9fc8a09 100644 --- a/benchmarks/ssr/vue/vite.config.ts +++ b/benchmarks/ssr/vue/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config' import codspeedPlugin from '@codspeed/vitest-plugin' import { tanstackStart } from '@tanstack/vue-start/plugin/vite' import vueJsx from '@vitejs/plugin-vue-jsx' +import { cpuSimulationExecArgv } from '../../cpu-simulation' const rootDir = fileURLToPath(new URL('.', import.meta.url)) @@ -22,6 +23,8 @@ export default defineConfig({ minify: false, }, test: { + execArgv: cpuSimulationExecArgv(), + isolate: true, name: '@benchmarks/ssr (vue)', watch: false, environment: 'node', diff --git a/benchmarks/tsconfig.json b/benchmarks/tsconfig.json new file mode 100644 index 0000000000..5e9ff9a8e1 --- /dev/null +++ b/benchmarks/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["cpu-simulation.ts"] +} diff --git a/docs/AGENTS.md b/docs/AGENTS.md new file mode 100644 index 0000000000..ab2d4117e2 --- /dev/null +++ b/docs/AGENTS.md @@ -0,0 +1,4 @@ +# Documentation + +- Register new published pages in `router/config.json` or `start/config.json`; drafts need not be registered. +- Run `pnpm test:docs` from the repository root for Markdown link validation. It checks `docs/**/*.md`, not Markdown elsewhere. Relative links resolve from the containing file. diff --git a/docs/router/api/file-based-routing.md b/docs/router/api/file-based-routing.md index ad3e07fad7..7c94d484d1 100644 --- a/docs/router/api/file-based-routing.md +++ b/docs/router/api/file-based-routing.md @@ -188,7 +188,7 @@ By default, this value is set to `false`. ### `autoCodeSplitting` -This feature is only available if you are using the TanStack Router Bundler Plugin. +This feature is only available if you are using the TanStack Router Bundler Plugin with Vite, Rspack/Rsbuild or Webpack. With Esbuild, setting it to `true` is an error. This option is used to enable automatic code-splitting for non-critical route configuration items. See the "Automatic Code-Splitting" guide for more information. diff --git a/docs/router/api/router/LinkOptionsType.md b/docs/router/api/router/LinkOptionsType.md index 481a5b4a3d..9d3d3fe8d8 100644 --- a/docs/router/api/router/LinkOptionsType.md +++ b/docs/router/api/router/LinkOptionsType.md @@ -9,7 +9,7 @@ The `LinkOptions` type extends the [`NavigateOptions`](./NavigateOptionsType.md) type LinkOptions = NavigateOptions & { target?: HTMLAnchorElement['target'] activeOptions?: ActiveOptions - preload?: false | 'intent' + preload?: false | 'intent' | 'viewport' | 'render' preloadDelay?: number disabled?: boolean } @@ -42,7 +42,7 @@ The `LinkOptions` object accepts/contains the following properties: - Type: `number` - Optional -- Delay intent preloading by this many milliseconds. If the intent exits before this delay, the preload will be cancelled. +- Delay focus, hover, and viewport preloading by this many milliseconds. Touch intent preloads immediately. If focus or hover ends, or the link leaves the viewport before the delay, the preload will be cancelled. ### `disabled` diff --git a/docs/router/api/router/RouteMatchType.md b/docs/router/api/router/RouteMatchType.md index 251c2c031e..b5009ebe68 100644 --- a/docs/router/api/router/RouteMatchType.md +++ b/docs/router/api/router/RouteMatchType.md @@ -11,9 +11,8 @@ interface RouteMatch { routeId: string pathname: string params: Route['allParams'] - status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound' + status: 'pending' | 'success' | 'error' | 'notFound' isFetching: false | 'beforeLoad' | 'loader' - showPending: boolean error: unknown paramsError: unknown searchError: unknown @@ -21,9 +20,17 @@ interface RouteMatch { loaderData?: Route['loaderData'] context: Route['allContext'] search: Route['fullSearchSchema'] - fetchedAt: number abortController: AbortController - cause: 'enter' | 'stay' + cause: 'preload' | 'enter' | 'stay' ssr?: boolean | 'data-only' } ``` + +`status` describes the match's render state. `isFetching` independently exposes +active `beforeLoad` or loader work. In particular, a successful match can report +`isFetching: 'loader'` while stale data remains visible during a background +reload. + +The router state can contain matches below the pending, error, or not-found +boundary. Those matches remain observable as part of the structurally matched +lane even though the route renderer stops at the boundary. diff --git a/docs/router/api/router/RouteOptionsType.md b/docs/router/api/router/RouteOptionsType.md index 1fb4c4eb30..2adfc6e5c6 100644 --- a/docs/router/api/router/RouteOptionsType.md +++ b/docs/router/api/router/RouteOptionsType.md @@ -56,6 +56,7 @@ The `RouteOptions` type accepts an object with the following properties: - Type: `(rawSearchParams: unknown) => TSearchSchema` - Optional - A function that will be called when this route is matched and passed the raw search params from the current location and return valid parsed search params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's search params and the return type will be inferred into the rest of the router. +- This is a planning callback. It must be deterministic and side-effect-free for the same input; do not navigate or mutate application/router state from it. - Optionally, the parameter type can be tagged with the `SearchSchemaInput` type like this: `(searchParams: TSearchSchemaInput & SearchSchemaInput) => TSearchSchema`. If this tag is present, `TSearchSchemaInput` will be used to type the `search` property of `` and `navigate()` **instead of** `TSearchSchema`. The difference between `TSearchSchemaInput` and `TSearchSchema` can be useful, for example, to express optional search parameters. ### `search.middlewares` property @@ -70,6 +71,7 @@ The `RouteOptions` type accepts an object with the following properties: - Type: `(rawParams: Record) => TParams` - Optional - A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's params and the return type will be inferred into the rest of the router. +- This is a planning callback. It must be deterministic and side-effect-free for the same input. ### `stringifyParams` method (⚠️ deprecated, use `params.stringify` instead) @@ -82,6 +84,7 @@ The `RouteOptions` type accepts an object with the following properties: - Type: `(rawParams: Record) => TParams | false` - Optional - A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function returns parsed params, its return value will be used as the route's params and the return type will be inferred into the rest of the router. +- This is a planning callback. It must be deterministic and side-effect-free for the same input. - Experimental: returning `false` during incoming route matching skips this route and allows matching to continue to another candidate route. ### `params.priority` property @@ -112,14 +115,14 @@ type beforeLoad = ( location: ParsedLocation navigate: NavigateFn // @deprecated buildLocation: BuildLocationFn - cause: 'enter' | 'stay' + cause: 'preload' | 'enter' | 'stay' }, ) => Promise | TRouteContext | void ``` - Optional - [`ParsedLocation`](./ParsedLocationType.md) -- This async function is called before a route is loaded. If an error is thrown here, the route's loader will not be called and the route will not render. If thrown during a navigation, the navigation will be canceled and the error will be passed to the `onError` function. If thrown during a preload event, the error will be logged to the console and the preload will fail. +- This async function is called before a route is loaded. If it fails, the route's loader and its descendants will not run. During navigation, ordinary errors become the match's error state and are passed to the `onError` function. During a preload, ordinary errors and not-found results are represented in the returned speculative match lane instead of rejecting the `preloadRoute` promise. - If this function returns a promise, the route will be put into a pending state and cause rendering to suspend until the promise resolves. If this route's pendingMs threshold is reached, the `pendingComponent` will be shown until it resolves. If the promise rejects, the route will be put into an error state and the error will be thrown during render. - If this function returns a `TRouteContext` object, that object will be merged into the route's context and be made available in the `loader` and other related route components/methods. - It's common to use this function to check if a user is authenticated and redirect them to a login page if they are not. To do this, you can either return or throw a `redirect` object from this function. @@ -156,9 +159,9 @@ type loader = - Optional - [`ParsedLocation`](./ParsedLocationType.md) -- This async function is called when a route is matched and passed the route's match object. If an error is thrown here, the route will be put into an error state and the error will be thrown during render. If thrown during a navigation, the navigation will be canceled and the error will be passed to the `onError` function. If thrown during a preload event, the error will be logged to the console and the preload will fail. +- This async function is called when a route is matched and passed the route's match object. During navigation, ordinary errors become the match's error state and are passed to the `onError` function. During a preload, ordinary errors and not-found results are represented in the returned speculative match lane instead of rejecting the `preloadRoute` promise. - If this function returns a promise, the route will be put into a pending state and cause rendering to suspend until the promise resolves. If this route's pendingMs threshold is reached, the `pendingComponent` will be shown until it resolves. If the promise rejects, the route will be put into an error state and the error will be thrown during render. -- If this function returns a `TLoaderData` object, that object will be stored on the route match until the route match is no longer active. It can be accessed using the `useLoaderData` hook in any component that is a child of the route match before another `` is rendered. +- If this function returns a `TLoaderData` object, that object will be stored on the route match and can remain available in the in-memory cache after the match becomes inactive. Navigation-owned data uses `gcTime` for retention, while preload-owned data uses `preloadGcTime`. It can be accessed using the `useLoaderData` hook in any component that is a child of the route match before another `` is rendered. - Deps must be returned by your `loaderDeps` function in order to appear. - Use the object form to configure loader-specific behavior like `staleReloadMode`. - `staleReloadMode: 'background'` preserves stale-while-revalidate behavior for stale successful matches. @@ -176,6 +179,7 @@ type loaderDeps = (opts: { search: TFullSearchSchema }) => Record - Optional - A function that will be called before this route is matched to provide additional unique identification to the route match and serve as a dependency tracker for when the match should be reloaded. It should return any serializable value that can uniquely identify the route match from navigation to navigation. +- This is a planning callback and cache-key function. It must be deterministic and side-effect-free for the same validated search input. The returned value and any serialization methods on it, such as `toJSON`, must also be side-effect-free. - By default, path params are already used to uniquely identify a route match, so it's unnecessary to return these here. - If your route match relies on search params for unique identification, it's required that you return them here so they can be made available in the `loader`'s `deps` argument. @@ -186,19 +190,26 @@ type loaderDeps = (opts: { search: TFullSearchSchema }) => Record - Defaults to `routerOptions.defaultStaleTime`, which defaults to `0` - The amount of time in milliseconds that a route match's loader data will be considered fresh. If a route match is matched again within this time frame, its loader data will not be reloaded. +### `preload` property + +- Type: `boolean` +- Optional +- Defaults to `true` +- If `false`, speculative preloads still run this route's `beforeLoad` function but skip its `loader`. A navigation runs both `beforeLoad` and the skipped `loader` normally. + ### `preloadStaleTime` property - Type: `number` - Optional - Defaults to `routerOptions.defaultPreloadStaleTime`, which defaults to `30_000` ms (30 seconds) -- The amount of time in milliseconds that a route match's loader data will be considered fresh when preloading. If a route match is preloaded again within this time frame, its loader data will not be reloaded. If a route match is loaded (for navigation) within this time frame, the normal `staleTime` is used instead. +- The amount of time in milliseconds that loader data produced by a preload is considered fresh. Another preload or the first navigation can reuse it within this interval. After navigation accepts the generation, subsequent freshness uses `staleTime`. ### `gcTime` property - Type: `number` - Optional -- Defaults to `routerOptions.defaultGcTime`, which defaults to 30 minutes. -- The amount of time in milliseconds that a route match's loader data will be kept in memory after a preload or it is no longer in use. +- Defaults to `routerOptions.defaultGcTime`, which defaults to 5 minutes. +- The retention window in milliseconds for unused loader data from an ordinary load. Once the data is older than this value, it is eligible for pruning during a later cache reconciliation. ### `shouldReload` property @@ -234,12 +245,12 @@ type loaderDeps = (opts: { search: TFullSearchSchema }) => Record - Defaults to `routerOptions.defaultPendingMinMs` which defaults to `500` - The minimum amount of time in milliseconds that the pending component will be shown for if it is shown. This is useful to prevent the pending component from flashing on the screen for a split second. -### `preloadMaxAge` property +### `preloadGcTime` property - Type: `number` - Optional -- Defaults to `30_000` ms (30 seconds) -- The maximum amount of time in milliseconds that a route's preloaded route data will be cached for. If a route is not matched within this time frame, its loader data will be discarded. +- Defaults to `routerOptions.defaultPreloadGcTime`, which defaults to 5 minutes. +- The retention window in milliseconds for unused loader data produced by a preload. Once the data is older than this value, it is eligible for pruning during a later cache reconciliation. Use `preloadStaleTime` to control whether retained data is fresh enough to reuse without reloading. ### `preSearchFilters` property (⚠️ deprecated, use `search.middlewares` instead) @@ -262,29 +273,33 @@ type loaderDeps = (opts: { search: TFullSearchSchema }) => Record - Type: `(error: any) => void` - Optional - A function that will be called when an error is thrown during a navigation or preload event. -- If this function throws a [`redirect`](./redirectFunction.md), then the router will process and apply the redirect immediately. +- If this function throws a [`redirect`](./redirectFunction.md), the redirect replaces the original error and becomes control flow for the current navigation or preload operation. If it throws a not-found result, that result replaces the original error in the current match lane. ### `onEnter` property - Type: `(match: RouteMatch) => void` - Optional - A function that will be called when a route is matched and loaded after not being matched in the previous location. +- Routes below an error or not-found boundary do not enter the active route lifecycle. The boundary itself remains active. A previously hidden route receives `onEnter` when a navigation makes it active again. ### `onStay` property - Type: `(match: RouteMatch) => void` - Optional - A function that will be called when a route is matched and loaded after being matched in the previous location. +- Both navigations must include the route in the active branch, through the first error or not-found boundary. ### `onLeave` property - Type: `(match: RouteMatch) => void` - Optional - A function that will be called when a route is no longer matched after being matched in the previous location. +- This also runs when a navigation hides a previously active route below an error or not-found boundary, even if the route remains structurally matched. +- Background reloads update route data without dispatching these lifecycle callbacks. ### `onCatch` property -- Type: `(error: Error, errorInfo: ErrorInfo) => void` +- Type: `(error: unknown) => void` in React and Vue; `(error: Error) => void` in Solid - Optional - Defaults to `routerOptions.defaultOnCatch` - A function that will be called when errors are caught when the route encounters an error. diff --git a/docs/router/api/router/RouterEventsType.md b/docs/router/api/router/RouterEventsType.md index c79bb47f81..c27887fba1 100644 --- a/docs/router/api/router/RouterEventsType.md +++ b/docs/router/api/router/RouterEventsType.md @@ -47,9 +47,6 @@ type RouterEvents = { hrefChanged: boolean hashChanged: boolean } - onInjectedHtml: { - type: 'onInjectedHtml' - } onRendered: { type: 'onRendered' fromLocation?: ParsedLocation @@ -67,7 +64,7 @@ Once an event is emitted, the following properties will be present on the event ### `type` property -- Type: `onBeforeNavigate | onBeforeLoad | onLoad | onBeforeRouteMount | onResolved | onRendered | onInjectedHtml` +- Type: `onBeforeNavigate | onBeforeLoad | onLoad | onBeforeRouteMount | onResolved | onRendered` - The type of the event - This is useful for discriminating between events in a listener function. diff --git a/docs/router/api/router/RouterOptionsType.md b/docs/router/api/router/RouterOptionsType.md index 7127e1191e..31f410b208 100644 --- a/docs/router/api/router/RouterOptionsType.md +++ b/docs/router/api/router/RouterOptionsType.md @@ -59,7 +59,7 @@ The `RouterOptions` type accepts an object with the following properties and met - Type: `number` - Optional - Defaults to `50` -- The delay in milliseconds that a route must be hovered over or touched before it is preloaded. +- The delay in milliseconds before intent focus/hover and viewport preloading. Touch intent preloads immediately. ### `defaultComponent` property @@ -129,19 +129,19 @@ The `RouterOptions` type accepts an object with the following properties and met - Type: `number` - Optional -- Defaults to `routerOptions.defaultGcTime`, which defaults to 30 minutes. +- Defaults to 5 minutes. - The default `preloadGcTime` a route should use if no preloadGcTime is provided. ### `defaultGcTime` property - Type: `number` - Optional -- Defaults to 30 minutes. +- Defaults to 5 minutes. - The default `gcTime` a route should use if no gcTime is provided. ### `defaultOnCatch` property -- Type: `(error: Error, errorInfo: ErrorInfo) => void` +- Type: `(error: unknown, errorInfo: ErrorInfo) => void` - Optional - The default `onCatch` handler for errors caught by the Router ErrorBoundary @@ -223,6 +223,13 @@ const router = createRouter({ - Defaults to `/` - The basepath for the entire router. This is useful for mounting a router instance at a subpath. +### `origin` property + +- Type: `string` +- Optional +- The origin used to resolve URLs. Defaults to the browser origin, or `http://localhost` on the server and in browsers with an opaque origin. +- Pass a normalized origin, such as `https://example.com` or `http://localhost:3000`, without a path or trailing slash. The router uses this value as provided; if you have a full URL, normalize it with `new URL(url).origin` before passing it to the router. + ### `rewrite` property - Type: `LocationRewrite` @@ -368,9 +375,10 @@ const router = createRouter({ ### `pathParamsAllowedCharacters` property -- Type: `Array<';' | ':' | '@' | '&' | '=' | '+' | '$' | ','>` +- Type: `ReadonlyArray<';' | ':' | '@' | '&' | '=' | '+' | '$' | ','>` - Optional - Configures which URI characters are allowed in path params that would ordinarily be escaped by encodeURIComponent. +- Read only when the router is created. To change these characters, create a new router instance. Router option updates and provider props do not change this setting. ### `defaultStructuralSharing` property diff --git a/docs/router/api/router/RouterStateType.md b/docs/router/api/router/RouterStateType.md index a77f4e775f..4da9cd9bb6 100644 --- a/docs/router/api/router/RouterStateType.md +++ b/docs/router/api/router/RouterStateType.md @@ -3,16 +3,17 @@ id: RouterStateType title: RouterState type --- -The `RouterState` type represents shape of the internal state of the router. The Router's internal state is useful, if you need to access certain internals of the router, such as any pending matches, is the router in its loading state, etc. +The `RouterState` type represents the observable state of the router, including +the requested and resolved locations, match presentation, and foreground loading +status. ```tsx type RouterState = { status: 'pending' | 'idle' isLoading: boolean - isTransitioning: boolean matches: Array location: ParsedLocation - resolvedLocation: ParsedLocation + resolvedLocation?: ParsedLocation } ``` @@ -23,22 +24,24 @@ The `RouterState` type contains all of the properties that are available on the ### `status` property - Type: `'pending' | 'idle'` -- The current status of the router. If the router is pending, it means that it is currently loading a route or the router is still transitioning to the new route. +- The current foreground status of the router. `pending` means the requested route is still loading or waiting for its framework transition to settle. ### `isLoading` property - Type: `boolean` -- `true` if the router is currently loading a route or waiting for a route to finish loading. - -### `isTransitioning` property - -- Type: `boolean` -- `true` if the router is currently transitioning to a new route. +- `true` when `status` is `pending`. +- Background loader refreshes do not change this value. Inspect each match's `isFetching` field to observe foreground `beforeLoad`/loader work and background loader work. ### `matches` property - Type: [`Array`](./RouteMatchType.md) -- An array of all of the route matches that have been resolved and are currently active. +- The match presentation currently exposed to the application. +- A navigation can keep the previous presentation visible until pending UI is + published. Once the destination is presented, this contains its complete + structurally matched lane, including descendants that are still loading. +- Error and not-found results also preserve the complete structurally matched + lane. Rendering stops at the selected pending or terminal boundary; it does + not truncate this array. ### `location` property @@ -47,5 +50,5 @@ The `RouterState` type contains all of the properties that are available on the ### `resolvedLocation` property -- Type: [`ParsedLocation`](./ParsedLocationType.md) -- The location that the router has resolved and loaded. +- Type: [`ParsedLocation`](./ParsedLocationType.md) | `undefined` +- The location whose load and framework transition have settled. It is `undefined` before the initial location resolves. diff --git a/docs/router/api/router/RouterType.md b/docs/router/api/router/RouterType.md index 757a6098ca..3fde90e32e 100644 --- a/docs/router/api/router/RouterType.md +++ b/docs/router/api/router/RouterType.md @@ -11,8 +11,9 @@ An instance of the `Router` has the following properties and methods: ### `.update` method -- Type: `(newOptions: RouterOptions) => void` +- Type: `(newOptions: Omit) => void` - Updates the router instance with new options. +- Initialization-only options such as `pathParamsAllowedCharacters` cannot be updated. Create a new router instance to change them. ### `state` property @@ -35,16 +36,6 @@ An instance of the `Router` has the following properties and methods: - Matches a pathname and search params against the router's route tree and returns an array of route matches. - If `opts.throwOnError` is `true`, any errors that occur during the matching process will be thrown (in addition to being returned in the route match's `error` property). -### `.cancelMatch` method - -- Type: `(matchId: string) => void` -- Cancels a route match that is currently pending by calling `match.abortController.abort()`. - -### `.cancelMatches` method - -- Type: `() => void` -- Cancels all route matches that are currently pending by calling `match.abortController.abort()` on each one. - ### `.buildLocation` method Builds a new parsed location object that can be used later to navigate to a new location. @@ -138,23 +129,27 @@ Navigates to a new location. ### `.invalidate` method -Invalidates route matches by forcing their `beforeLoad` and `load` functions to be called again. +Invalidates selected route-match generations, reruns their loading lifecycle, +reruns `beforeLoad`, and reloads their loaders through the normal loading +protocol. - Type: `(opts?: {filter?: (d: MakeRouteMatchUnion) => boolean, sync?: boolean, forcePending?: boolean }) => Promise` - This is useful any time your loader data might be out of date or stale. For example, if you have a route that displays a list of posts, and you have a loader function that fetches the list of posts from an API, you might want to invalidate the route matches for that route any time a new post is created so that the list of posts is always up-to-date. -- if `filter` is not supplied, all matches will be invalidated -- if `filter` is supplied, only matches for which `filter` returns `true` will be invalidated. -- if `sync` is true, the promise returned by this function will only resolve once all loaders have finished. -- if `forcePending` is true, the invalidated matches will be put into `'pending'` state regardless whether they are in `'error'` state or not. +- If `filter` is not supplied, all committed, cached, and in-flight match generations are invalidated. +- If `filter` is supplied, it is evaluated against committed, cached, and in-flight matches. Selecting one generation invalidates every committed, cached, or in-flight generation with the same match ID. +- Invalidation reruns `beforeLoad`; reusable loader data is marked stale and reloads through the normal loading protocol. Route-level `context` remains reusable while the match ID is unchanged. +- If `sync` is `true`, stale loader work is blocking and the returned promise resolves after it finishes instead of leaving a background refresh detached. +- If `forcePending` is `true`, selected routes that need loading enter the normal pending protocol even when successful data was already available. - You might also want to invalidate the Router if you imperatively `reset` the router's `CatchBoundary` to trigger loaders again. ### `.clearCache` method -Remove cached route matches. +Remove cached route matches and matching active preloads. - Type: `(opts?: {filter?: (d: MakeRouteMatchUnion) => boolean}) => void` -- if `filter` is not supplied, all cached matches will be removed -- if `filter` is supplied, only matches for which `filter` returns `true` will be removed. +- If `filter` is not supplied, all cached matches and active preload lanes are removed. +- If `filter` is supplied, matching cached matches are removed. An active preload lane is canceled when any match in that lane passes the filter. +- Current committed and presented matches are not removed. ### `.load` method @@ -170,16 +165,28 @@ Loads all of the currently matched route matches and resolves when they are all Preloads all of the matches that match the provided `NavigateOptions`. -> ⚠️⚠️⚠️ **Preloaded route matches are not stored long-term in the router state. They are only stored until the next attempted navigation action.** +An active preload is speculative and is not published as the current match +presentation. Successful loader data can enter the normal in-memory route +cache. Its freshness follows `preloadStaleTime`; once unused and older than +`preloadGcTime`, it is eligible for pruning during a later cache +reconciliation. -- Type: `(opts?: NavigateOptions) => Promise` +Every preload and navigation runs its own `beforeLoad` chain. A later lane can +reuse successful settled loader data or join loader work that is still in +flight, but it never reuses `beforeLoad` context or an already-settled +redirect, error, or not-found result. If joined loader work later produces a +terminal outcome, all current consumers of that flight observe it. + +- Type: `(opts: NavigateOptions) => Promise` - Properties - `opts` - Type: `NavigateOptions` - - Optional, defaults to the current location. + - Required. - The options that will be used to determine which route matches to preload. - Returns - - A promise that resolves with an array of all of the route matches that were preloaded. + - A promise that resolves with the speculative route-match lane. An ordinary error or not-found is represented by a terminal match array rather than a rejected promise. + - It resolves with `undefined` when cancellation or control flow does not produce a reusable lane. + - The method is also available on server router instances. It remains speculative and does not change the request's current location or presented matches. ### `.loadRouteChunk` method diff --git a/docs/router/api/router/catchBoundaryComponent.md b/docs/router/api/router/catchBoundaryComponent.md index deef0ffa22..aa2f6eb7ce 100644 --- a/docs/router/api/router/catchBoundaryComponent.md +++ b/docs/router/api/router/catchBoundaryComponent.md @@ -29,7 +29,7 @@ The `CatchBoundary` component accepts the following props: ### `props.onCatch` prop -- Type: `(error: any) => void` +- Type: `(error: unknown, errorInfo: ErrorInfo) => void` in React; `(error: unknown) => void` in Vue; `(error: Error) => void` in Solid - Optional - A callback that will be called with the error that was thrown by the component's children. diff --git a/docs/router/api/router/errorComponentComponent.md b/docs/router/api/router/errorComponentComponent.md index 04399f124d..07d7187580 100644 --- a/docs/router/api/router/errorComponentComponent.md +++ b/docs/router/api/router/errorComponentComponent.md @@ -3,7 +3,7 @@ id: errorComponentComponent title: ErrorComponent component --- -The `ErrorComponent` component is a component that renders an error message and optionally the error's message. +The `ErrorComponent` component renders an error notice and optional details about the thrown value. ## ErrorComponent props @@ -11,8 +11,8 @@ The `ErrorComponent` component accepts the following props: ### `props.error` prop -- Type: `TError` (defaults to `Error`) -- The error that was thrown by the component's children +- Type: `unknown` in React and Vue; `Error` in Solid +- The caught error. Solid normalizes non-`Error` values, including SSR loader errors, into an `Error` with the original value in `cause`. ### `props.info` prop @@ -27,6 +27,6 @@ The `ErrorComponent` component accepts the following props: ## ErrorComponent returns -- Returns a formatted error message with the error's message if it exists. +- Displays an error notice, with details when the thrown value has a nonempty `message`. Values without a message still display the error notice. - The error message can be toggled by clicking the "Show Error" button. - By default, the error message will be shown in development. diff --git a/docs/router/api/router/linkComponent.md b/docs/router/api/router/linkComponent.md index a8227913b5..478271a208 100644 --- a/docs/router/api/router/linkComponent.md +++ b/docs/router/api/router/linkComponent.md @@ -43,7 +43,7 @@ By default, param values with characters such as `@` will be encoded in the URL: ``` -To opt-out, update the [pathParamsAllowedCharacters](../router/RouterOptionsType#pathparamsallowedcharacters-property) config on the router +To opt out, set [pathParamsAllowedCharacters](../router/RouterOptionsType#pathparamsallowedcharacters-property) when creating the router. This setting cannot be changed on an existing router instance. ```tsx import { createRouter } from '@tanstack/react-router' diff --git a/docs/router/api/router/useChildMatchesHook.md b/docs/router/api/router/useChildMatchesHook.md index d6de892192..13212e61e0 100644 --- a/docs/router/api/router/useChildMatchesHook.md +++ b/docs/router/api/router/useChildMatchesHook.md @@ -5,8 +5,9 @@ title: useChildMatches hook The `useChildMatches` hook returns all of the child [`RouteMatch`](./RouteMatchType.md) objects from the closest match down to the leaf-most match. **It does not include the current match, which can be obtained using the `useMatch` hook.** -> [!IMPORTANT] -> If the router has pending matches and they are showing their pending component fallbacks, pending matches are used instead of active matches. +The result is derived from the router's current match presentation. It can +include still-loading descendants and descendants below the current render +boundary. ## useChildMatches options diff --git a/docs/router/api/router/useMatchRouteHook.md b/docs/router/api/router/useMatchRouteHook.md index 01c26d07c6..e67ccb6cbd 100644 --- a/docs/router/api/router/useMatchRouteHook.md +++ b/docs/router/api/router/useMatchRouteHook.md @@ -3,7 +3,9 @@ id: useMatchRouteHook title: useMatchRoute hook --- -The `useMatchRoute` hook is a hook that returns a `matchRoute` function that can be used to match a route against either the current or pending location. +The `useMatchRoute` hook returns a `matchRoute` function that can be used to match a route against either the current or pending location. The hook subscribes the component to changes in the router state used for matching, making it useful when the match result affects what the component renders. + +The `matchRoute` function's identity changes when that router state changes. For an imperative check, such as one performed in an event handler, use [`useRouter`](./useRouterHook.md) and call `router.matchRoute` instead. The router instance is stable, and this avoids subscribing the component to router state that it does not use while rendering. ## useMatchRoute returns @@ -25,6 +27,8 @@ The `matchRoute` function accepts a single argument, an `options` object. ## Examples +Use `useMatchRoute` when the result determines the rendered output: + ```tsx import { useMatchRoute } from '@tanstack/react-router' @@ -33,7 +37,36 @@ function Component() { const matchRoute = useMatchRoute() const params = matchRoute({ to: '/posts/$postId' }) // ^ { postId: '123' } + + return params ? : } +``` + +For a check made at the time of an event, call `router.matchRoute` directly: + +```tsx +import { useRouter } from '@tanstack/react-router' + +function Component() { + const router = useRouter() + + return ( + + ) +} +``` + +Additional matching examples: + +```tsx +import { useMatchRoute } from '@tanstack/react-router' // Current location: /posts/123 function Component() { diff --git a/docs/router/api/router/useMatchesHook.md b/docs/router/api/router/useMatchesHook.md index d7a1be8dc3..e57c6c2c7e 100644 --- a/docs/router/api/router/useMatchesHook.md +++ b/docs/router/api/router/useMatchesHook.md @@ -3,7 +3,7 @@ id: useMatchesHook title: useMatches hook --- -The `useMatches` hook returns all of the [`RouteMatch`](./RouteMatchType.md) objects from the router **regardless of its callers position in the React component tree**. +The `useMatches` hook returns the router's complete presented array of [`RouteMatch`](./RouteMatchType.md) objects **regardless of its caller's position in the component tree**. The array can include still-loading descendants or matches below a pending/error/not-found render boundary. > [!TIP] > If you only want the parent or child matches, then you can use the [`useParentMatches`](./useParentMatchesHook.md) or the [`useChildMatches`](./useChildMatchesHook.md) based on the selection you need. diff --git a/docs/router/api/router/useParentMatchesHook.md b/docs/router/api/router/useParentMatchesHook.md index 7afc5585a6..a0ce985411 100644 --- a/docs/router/api/router/useParentMatchesHook.md +++ b/docs/router/api/router/useParentMatchesHook.md @@ -5,8 +5,9 @@ title: useParentMatches hook The `useParentMatches` hook returns all of the parent [`RouteMatch`](./RouteMatchType.md) objects from the root down to the immediate parent of the current match in context. **It does not include the current match, which can be obtained using the `useMatch` hook.** -> [!IMPORTANT] -> If the router has pending matches and they are showing their pending component fallbacks, pending matches are used instead of active matches. +The result is derived from the router's current match presentation. During a +navigation that may still be the previous presentation; after pending UI is +published it is the destination's complete structurally matched lane. ## useParentMatches options diff --git a/docs/router/config.json b/docs/router/config.json index 179113e80c..1258ddd817 100644 --- a/docs/router/config.json +++ b/docs/router/config.json @@ -94,7 +94,7 @@ ] }, { - "label": "Routing", + "label": "Core Routing", "children": [ { "label": "Routing Concepts", @@ -123,6 +123,10 @@ { "label": "File Naming Conventions", "to": "routing/file-naming-conventions" + }, + { + "label": "URL Rewrites", + "to": "guide/url-rewrites" } ], "frameworks": [ @@ -137,31 +141,20 @@ ] }, { - "label": "Guides", + "label": "Navigation & URL State", + "collapsible": true, "children": [ - { - "label": "Code Splitting", - "to": "guide/code-splitting" - }, - { - "label": "Automatic Code Splitting", - "to": "guide/automatic-code-splitting" - }, - { - "label": "Creating a Router", - "to": "guide/creating-a-router" - }, - { - "label": "Outlets", - "to": "guide/outlets" - }, { "label": "Navigation", "to": "guide/navigation" }, { - "label": "Router Events", - "to": "guide/router-events" + "label": "Link Options", + "to": "guide/link-options" + }, + { + "label": "Custom Links", + "to": "guide/custom-link" }, { "label": "Path Params", @@ -172,12 +165,52 @@ "to": "guide/search-params" }, { - "label": "Link Options", - "to": "guide/link-options" + "label": "Custom Search Param Serialization", + "to": "guide/custom-search-param-serialization" }, { - "label": "Custom Links", - "to": "guide/custom-link" + "label": "Route Masking", + "to": "guide/route-masking" + }, + { + "label": "Navigation Blocking", + "to": "guide/navigation-blocking" + }, + { + "label": "History Types", + "to": "guide/history-types" + }, + { + "label": "Scroll Restoration", + "to": "guide/scroll-restoration" + }, + { + "label": "Internationalization", + "to": "guide/internationalization-i18n" + } + ], + "frameworks": [ + { + "label": "react", + "children": [] + }, + { + "label": "solid", + "children": [] + } + ] + }, + { + "label": "Data & Rendering", + "collapsible": true, + "children": [ + { + "label": "Code Splitting", + "to": "guide/code-splitting" + }, + { + "label": "Automatic Code Splitting", + "to": "guide/automatic-code-splitting" }, { "label": "Data Loading", @@ -195,14 +228,6 @@ "label": "Data Mutations", "to": "guide/data-mutations" }, - { - "label": "Type Safety", - "to": "guide/type-safety" - }, - { - "label": "Type Utilities", - "to": "guide/type-utilities" - }, { "label": "Preloading", "to": "guide/preloading" @@ -212,20 +237,48 @@ "to": "guide/document-head-management" }, { - "label": "Route Masking", - "to": "guide/route-masking" + "label": "SSR", + "to": "guide/ssr" }, { - "label": "Navigation Blocking", - "to": "guide/navigation-blocking" + "label": "Render Optimizations", + "to": "guide/render-optimizations" + } + ], + "frameworks": [ + { + "label": "react", + "children": [] }, { - "label": "Custom Search Param Serialization", - "to": "guide/custom-search-param-serialization" + "label": "solid", + "children": [] + } + ] + }, + { + "label": "Router Configuration", + "collapsible": true, + "children": [ + { + "label": "Creating a Router", + "to": "guide/creating-a-router" }, { - "label": "History Types", - "to": "guide/history-types" + "label": "Outlets", + "to": "guide/outlets" + }, + { + "label": "Router Events", + "to": "guide/router-events" + }, + { + "label": "Type Safety", + "to": "guide/type-safety" + }, + { + "label": "Type Utilities", + "to": "guide/type-utilities" }, { "label": "Router Context", @@ -239,21 +292,9 @@ "label": "Authenticated Routes", "to": "guide/authenticated-routes" }, - { - "label": "Scroll Restoration", - "to": "guide/scroll-restoration" - }, { "label": "Static Route Data", "to": "guide/static-route-data" - }, - { - "label": "SSR", - "to": "guide/ssr" - }, - { - "label": "Render Optimizations", - "to": "guide/render-optimizations" } ], "frameworks": [ @@ -301,12 +342,7 @@ "frameworks": [ { "label": "react", - "children": [ - { - "label": "NativeScript", - "to": "integrations/nativescript" - } - ] + "children": [] }, { "label": "solid", diff --git a/docs/router/eslint/create-route-property-order.md b/docs/router/eslint/create-route-property-order.md index c22aa7c52d..453fd64acc 100644 --- a/docs/router/eslint/create-route-property-order.md +++ b/docs/router/eslint/create-route-property-order.md @@ -37,7 +37,10 @@ import { createFileRoute } from '@tanstack/react-router' export const Route = createFileRoute('/path')({ loader: async ({ context }) => { - await context.queryClient.ensureQueryData(getQueryOptions(context.hello)) + await context.queryClient.query({ + ...getQueryOptions(context.hello), + staleTime: 'static', + }) }, beforeLoad: () => ({ hello: 'world' }), }) @@ -55,7 +58,10 @@ import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/path')({ loader: async ({ context }) => { - await context.queryClient.ensureQueryData(getQueryOptions(context.hello)) + await context.queryClient.query({ + ...getQueryOptions(context.hello), + staleTime: 'static', + }) }, beforeLoad: () => ({ hello: 'world' }), }) @@ -80,7 +86,10 @@ import { createFileRoute } from '@tanstack/react-router' export const Route = createFileRoute('/path')({ beforeLoad: () => ({ hello: 'world' }), loader: async ({ context }) => { - await context.queryClient.ensureQueryData(getQueryOptions(context.hello)) + await context.queryClient.query({ + ...getQueryOptions(context.hello), + staleTime: 'static', + }) }, }) ``` @@ -98,7 +107,10 @@ import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/path')({ beforeLoad: () => ({ hello: 'world' }), loader: async ({ context }) => { - await context.queryClient.ensureQueryData(getQueryOptions(context.hello)) + await context.queryClient.query({ + ...getQueryOptions(context.hello), + staleTime: 'static', + }) }, }) ``` diff --git a/docs/router/guide/automatic-code-splitting.md b/docs/router/guide/automatic-code-splitting.md index 4612c298c6..859a19ff09 100644 --- a/docs/router/guide/automatic-code-splitting.md +++ b/docs/router/guide/automatic-code-splitting.md @@ -4,7 +4,7 @@ title: Automatic Code Splitting The automatic code splitting feature in TanStack Router allows you to optimize your application's bundle size by lazily loading route components and their associated data. This is particularly useful for large applications where you want to minimize the initial load time by only loading the necessary code for the current route. -To turn this feature on, simply set the `autoCodeSplitting` option to `true` in your bundler plugin configuration. This enables the router to automatically handle code splitting for your routes without requiring any additional setup. +To turn this feature on, simply set the `autoCodeSplitting` option to `true` in your bundler plugin configuration. This enables the router to automatically handle code splitting for your routes without requiring any additional setup. It is available with Vite, Rspack/Rsbuild and Webpack, not with Esbuild. ```ts // vite.config.ts @@ -35,7 +35,7 @@ This happens seamlessly, without requiring you to manually split your code or ma ### The transformation process -When you enable automatic code splitting, the bundler plugin does this by using static code analysis look at your the code in your route files to transform them into optimized outputs. +When you enable automatic code splitting, the bundler plugin does this by using static code analysis to look at the code in your route files and to transform them into optimized outputs. This transformation process produces two key outputs when each of your route files are processed: @@ -48,7 +48,7 @@ This process ensures that your original code remains clean and readable, while t The decision of what to split into separate chunks is crucial for optimizing your application's performance. TanStack Router uses a concept called "**Split Groupings**" to determine how different parts of your route should be bundled together. -Split groupings are arrays of properties that tell TanStack Router how to bundle different parts of your route together. Each grouping is an list of property names that you want to bundle together into a single lazy-loaded chunk. +Split groupings are arrays of properties that tell TanStack Router how to bundle different parts of your route together. Each grouping is a list of property names that you want to bundle together into a single lazy-loaded chunk. The available properties to split are: @@ -76,7 +76,7 @@ This means that it creates three separate lazy-loaded chunks for each route. Res ### Rules of Splitting -For automatic code splitting to work, there are some rules in-place to make sure that this process can reliably and predictably happen. +For automatic code splitting to work, there are some rules in place to make sure that this process can happen reliably and predictably. #### Do not export route properties diff --git a/docs/router/guide/code-splitting.md b/docs/router/guide/code-splitting.md index 698bf262b5..b1423253be 100644 --- a/docs/router/guide/code-splitting.md +++ b/docs/router/guide/code-splitting.md @@ -115,7 +115,7 @@ These are the only options that `createLazyFileRoute` supports: ### Example code splitting with `.lazy.tsx` -When you are using `.lazy.tsx` you can split your route into two files to enable code splitting: +When you are using `.lazy.tsx`, you can split your route into two files to enable code splitting: **Before (Single File)** diff --git a/docs/router/guide/data-loading.md b/docs/router/guide/data-loading.md index 2ecdf443ad..6b9fd42777 100644 --- a/docs/router/guide/data-loading.md +++ b/docs/router/guide/data-loading.md @@ -81,7 +81,7 @@ Use the object form when you want to configure loader-specific behavior such as The `loader` function receives a single object with the following properties: -- `abortController` - The route's abortController. Its signal is cancelled when the route is unloaded or when the Route is no longer relevant and the current invocation of the `loader` function becomes outdated. +- `abortController` - The controller for this shareable loader invocation. A preload and navigation can share the same in-flight loader work. Its signal is cancelled after the invocation becomes outdated and no consumer still needs it. - `cause` - The cause of the current route match. Can be either one of the following: - `enter` - When the route is matched and loaded after not being matched in the previous location. - `preload` - When the route is being preloaded. @@ -150,7 +150,7 @@ Using these dependencies as keys, TanStack Router will cache the data returned f To control router dependencies and "freshness", TanStack Router provides a plethora of options to control the keying and caching behavior of your route loaders. Let's take a look at them in the order that you are most likely to use them: - `routeOptions.loaderDeps` - - A function that supplies you the search params for a router and returns an object of dependencies for use in your `loader` function. When these deps changed from navigation to navigation, it will cause the route to reload regardless of `staleTime`s. The deps are compared using a deep equality check. + - A deterministic, side-effect-free function that supplies you the validated search params for a router and returns a serializable object of dependencies for use in your `loader` function. When these deps change from navigation to navigation, it will cause the route to reload regardless of `staleTime`s. The deps are compared using a deep equality check. - `routeOptions.staleTime` - `routerOptions.defaultStaleTime` - The number of milliseconds that a route's data should be considered fresh when attempting to load. @@ -168,11 +168,11 @@ To control router dependencies and "freshness", TanStack Router provides a pleth ### ⚠️ Some Important Defaults -- By default, the `staleTime` is set to `0`, meaning that the route's data is immediately considered stale. Stale matches are reloaded in the background when the route is entered again, when its loader key changes (path params used by the route or `loaderDeps`), or when `router.load()` is called explicitly. -- By default, a previously preloaded route is considered fresh for **30 seconds**. This means if a route is preloaded, then preloaded again within 30 seconds, the second preload will be ignored. This prevents unnecessary preloads from happening too frequently. **When a route is loaded normally, the standard `staleTime` is used.** -- By default, the `gcTime` is set to **30 minutes**, meaning that any route data that has not been accessed in 30 minutes will be garbage collected and removed from the cache. +- By default, `staleTime` is set to `0`, so reusable successful data is immediately considered stale. When the same loader key is entered again or `router.load()` is called explicitly, stale data revalidates in the background by default. A different loader key identifies a separate cache entry and must load if it has no reusable data. +- By default, loader data produced by a preload is considered fresh for **30 seconds**. Every preload and navigation still runs its own `beforeLoad` chain, but a later preload and the first navigation can reuse the preload's loader data or in-flight loader work during that interval. After navigation accepts that loader generation, subsequent freshness checks use the standard `staleTime`. +- By default, `gcTime` and `preloadGcTime` define **5-minute** retention windows. Once unused data is older than its applicable window, it is eligible for pruning during a later cache reconciliation. The two windows can be configured independently. - By default, `staleReloadMode` is `'background'`, so stale successful matches keep rendering with their existing `loaderData` while the loader revalidates in the background. -- `router.invalidate()` will force all active routes to reload their loaders immediately and mark every cached route's data as stale. +- `router.invalidate()` selects matching committed, cached, and in-flight loader generations for invalidation and retires matching active preload lanes. Current active routes reload through the normal loading protocol; cached inactive data remains marked stale and reloads when it is reused. By default, stale successful loader data revalidates in the background unless `sync: true` is requested. ### Using `loaderDeps` to access search params @@ -180,6 +180,11 @@ Imagine a `/posts` route supports some pagination via search params `offset` and Once we have these deps in place, the route will always reload when the deps change. +`loaderDeps` defines a cache key during route planning. For the same validated +search input it must return the same value without navigating or mutating state. +The returned value and custom serialization methods such as `toJSON` must also +be side-effect-free. + ```tsx // /routes/posts.tsx export const Route = createFileRoute('/posts')({ @@ -216,7 +221,13 @@ export const Route = createFileRoute('/posts')({ ### Using `staleTime` to control how long data is considered fresh -By default, `staleTime` for navigations is set to `0`ms (and 30 seconds for preloads) which means that the route's data will always be considered stale. When a stale route is entered again, its loader key changes, or `router.load()` is called explicitly, the route will reload in the background. +By default, `staleTime` for accepted navigation data is `0`ms, while +`preloadStaleTime` is 30 seconds. A successful preload can therefore provide +loader data to the first navigation during that interval. Once navigation +accepts that loader generation, normal navigation freshness applies. With the +default `staleTime`, the data is immediately stale for a later use of the same +loader key and revalidates in the background while cached data remains visible. +A different loader key identifies a separate cache entry. **This is a good default for most use cases, but you may find that some route data is more static or potentially expensive to load.** In these cases, you can use the `staleTime` option to control how long the route's data is considered fresh for navigations. Let's take a look at an example: @@ -302,9 +313,16 @@ export const Route = createFileRoute('/posts')({ ### Opting out of caching while still preloading -Even though you may opt-out of short-term caching for your route data, you can still get the benefits of preloading! With the above configuration, preloading will still "just work" with the default `preloadGcTime`. This means that if a route is preloaded, then navigated to, the route's data will be considered fresh and will not be reloaded. +Even though you may opt out of retaining ordinary route data, you can still get +the benefits of preloading. Preloaded results use `preloadGcTime` for retention +and `preloadStaleTime` for freshness, so the default settings keep a recent +preload in memory and let the first navigation reuse it without another loader +call. -To opt out of preloading, don't turn it on via the `routerOptions.defaultPreload` or `routeOptions.preload` options. +Use `routerOptions.defaultPreload` to control automatic link preloading. Setting +`routeOptions.preload` to `false` has a narrower effect: a speculative lane +still runs that route's `beforeLoad`, but skips its `loader`. Navigation runs +both normally. ## Passing all loader events to an external cache @@ -317,7 +335,11 @@ const router = createRouter({ }) ``` -This will ensure that every preload, load, and reload event will trigger your `loader` functions, which can then be handled and deduped by your external cache. +This makes settled preload data immediately stale in the Router, allowing your +external cache to decide whether to fetch. Retention still follows +`preloadGcTime`, and overlapping preload or navigation consumers can still +share in-flight loader work. A route's `shouldReload` option can also suppress +a loader call. ## Using Router Context @@ -472,7 +494,7 @@ export const Route = createFileRoute('/posts')({ ## Using the Abort Signal -The `abortController` property of the `loader` function is an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). Its signal is cancelled when the route is unloaded or when the `loader` call becomes outdated. This is useful for cancelling network requests when the route is unloaded or when the route's params change. Here is an example using it with a fetch call: +The `abortController` property of the `loader` function is an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for that loader invocation. A preload and navigation can share an in-flight invocation, so its signal remains active while any consumer still needs the work. The signal is cancelled after the invocation becomes outdated and has no remaining consumers. Here is an example using it with a fetch call: ```tsx // src/routes/posts.tsx @@ -548,7 +570,7 @@ The `routeOptions.onCatch` option is a function that is called whenever an error ```tsx // src/routes/posts.tsx export const Route = createFileRoute('/posts')({ - onCatch: ({ error, errorInfo }) => { + onCatch: (error) => { // Log the error console.error(error) }, @@ -559,16 +581,20 @@ export const Route = createFileRoute('/posts')({ The `routeOptions.errorComponent` option is a component that is rendered when an error occurs during the route loading or rendering lifecycle. It is rendered with the following props: -- `error` - The error that occurred +- `error` - The caught value (`unknown` in React and Vue; `Error` in Solid) - `reset` - A function to reset the internal `CatchBoundary` +`ErrorComponentProps` defaults its `error` property to `unknown` in React and Vue, where you must narrow the value before accessing properties such as `message`. In Solid, it defaults to `Error`. `ErrorComponentProps` can describe an error after you have narrowed it; it does not restrict what a route can throw. This applies to boundary components and `onCatch` callbacks, including `defaultOnCatch`; it does not change the `onError` callback. + +React and Vue boundaries pass through the caught value, including falsy values. Solid wraps non-`Error` throws in an `Error` whose `cause` contains the original value. This also applies to Solid error components rendered during SSR: existing `Error` instances are preserved, strings become the error message, and other values use the message `Unknown error`. Router state and loader `onError` callbacks retain the original value. + ```tsx // src/routes/posts.tsx export const Route = createFileRoute('/posts')({ loader: () => fetchPosts(), errorComponent: ({ error }) => { // Render an error message - return
{error.message}
+ return
{error instanceof Error ? error.message : String(error)}
}, }) ``` @@ -582,7 +608,7 @@ export const Route = createFileRoute('/posts')({ errorComponent: ({ error, reset }) => { return (
- {error.message} + {error instanceof Error ? error.message : String(error)} + ) +} +``` + --- Phew! That's a lot of navigating! That said, hopefully you're feeling pretty good about getting around your application now. Let's move on! diff --git a/docs/router/guide/path-params.md b/docs/router/guide/path-params.md index b1ae4f5d2f..d326eabb4b 100644 --- a/docs/router/guide/path-params.md +++ b/docs/router/guide/path-params.md @@ -137,6 +137,9 @@ When multiple dynamic, optional, or wildcard routes can match the same URL, rout Higher `params.priority` values are tried first. The default priority is `0`, and if a higher-priority route's `params.parse` returns `false`, matching continues to the next candidate route. +`params.parse` runs during route planning and may be evaluated more than once. +It must be deterministic and side-effect-free for the same raw params. + ```tsx title="src/routes/posts.$postId.tsx" export const Route = createFileRoute('/posts/$postId')({ params: { @@ -226,7 +229,7 @@ function PostComponent() { -You can even combines prefixes with wildcard routes to create more complex patterns: +You can even combine prefixes with wildcard routes to create more complex patterns: @@ -582,10 +585,10 @@ Optional parameters can be combined with wildcards for complex routing patterns: # React -```tsx title="src/routes/docs/{-$version}/$.tsx" -// Route: /docs/{-$version}/$ +```tsx title="src/routes/docs/v{-$version}/$.tsx" +// Route: /docs/v{-$version}/$ // Matches: /docs/extra/path, /docs/v2/extra/path -export const Route = createFileRoute('/docs/{-$version}/$')({ +export const Route = createFileRoute('/docs/v{-$version}/$')({ component: DocsComponent, }) @@ -595,7 +598,7 @@ function DocsComponent() { return (
- Version: {version || 'latest'} + Version: {version ? `v${version}` : 'latest'} Path: {_splat}
) @@ -604,10 +607,10 @@ function DocsComponent() { # Solid -```tsx title="src/routes/docs/{-$version}/$.tsx" -// Route: /docs/{-$version}/$ +```tsx title="src/routes/docs/v{-$version}/$.tsx" +// Route: /docs/v{-$version}/$ // Matches: /docs/extra/path, /docs/v2/extra/path -export const Route = createFileRoute('/docs/{-$version}/$')({ +export const Route = createFileRoute('/docs/v{-$version}/$')({ component: DocsComponent, }) @@ -616,7 +619,7 @@ function DocsComponent() { return (
- Version: {params().version || 'latest'} + Version: {params().version ? `v${params().version}` : 'latest'} Path: {params()._splat}
) @@ -1392,6 +1395,8 @@ const router = createRouter({ }) ``` +This setting is fixed when the router is created. To use different allowed characters, create a new router instance. + The following is the list of accepted allowed characters: - `;` diff --git a/docs/router/guide/preloading.md b/docs/router/guide/preloading.md index 453294ab6e..7f48412ce6 100644 --- a/docs/router/guide/preloading.md +++ b/docs/router/guide/preloading.md @@ -18,10 +18,17 @@ Preloading in TanStack Router is a way to load a route before the user actually ## How long does preloaded data stay in memory? -Preloaded route matches are temporarily cached in memory with a few important caveats: +Successful preloaded loader results can enter the router's in-memory cache with +two independent policies: -- **Unused preloaded data is removed after 30 seconds by default.** This can be configured by setting the `defaultPreloadMaxAge` option on your router. -- **Obviously, when a route is loaded, its preloaded version is promoted to the router's normal pending matches state.** +- **Freshness defaults to 30 seconds.** Configure it with + `defaultPreloadStaleTime` or a route's `preloadStaleTime`. +- **The unused retention window defaults to 5 minutes.** Configure it with + `defaultPreloadGcTime` or a route's `preloadGcTime`. Older unused entries + are eligible for pruning during a later cache reconciliation. +- **The speculative lane is never promoted into router state.** Navigation + creates its own presentation and runs its own `beforeLoad` chain. It can reuse + cached loader data or join a loader that is still in flight. If you need more control over preloading, caching and/or garbage collection of preloaded data, you should use an external caching library like [TanStack Query](https://tanstack.com/query). @@ -57,7 +64,7 @@ This will turn on `intent` preloading by default for all `` components in ## Preload Delay -By default, preloading will start after **50ms** of the user hovering or touching a `` component. You can change this delay by setting the `defaultPreloadDelay` option on your router: +By default, intent focus/hover and viewport preloading start after **50ms**. Pending preloads are cancelled if focus or hover ends, or the link leaves the viewport. Touch intent preloads immediately. You can change this delay by setting the `defaultPreloadDelay` option on your router: @@ -87,9 +94,16 @@ const router = createRouter({ You can also set the `preloadDelay` prop on individual `` components to override the default behavior on a per-link basis. -## Built-in Preloading & `preloadStaleTime` +## Built-in Preloading, Freshness, and Retention -If you're using the built-in loaders, you can control how long preloaded data is considered fresh until another preload is triggered by setting either `routerOptions.defaultPreloadStaleTime` or `routeOptions.preloadStaleTime` to a number of milliseconds. **By default, preloaded data is considered fresh for 30 seconds.**. +If you're using the built-in loaders, you can control how long preloaded data is considered fresh by setting either `routerOptions.defaultPreloadStaleTime` or `routeOptions.preloadStaleTime` to a number of milliseconds. **By default, preloaded data is considered fresh for 30 seconds.** + +Freshness and retention are separate. `preloadStaleTime` controls whether the +retained loader result can be reused without another loader call. +`preloadGcTime` (or `defaultPreloadGcTime`) controls when an unused preload +result becomes eligible for pruning during a later cache reconciliation; it +does not schedule a timer to evict the result at that exact moment. Both preload +GC options default to 5 minutes. To change this, you can set the `defaultPreloadStaleTime` option on your router: @@ -125,16 +139,34 @@ Or, you can use the `routeOptions.preloadStaleTime` option on individual routes: // src/routes/posts.$postId.tsx export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params }) => fetchPost(params.postId), - // Preload the route again if the preload cache is older than 10 seconds + // Reload preloaded data when it is more than 10 seconds old preloadStaleTime: 10_000, }) ``` +Client-side preloading runs each route's `beforeLoad` with `preload: true`. +Every later preload or navigation runs its own `beforeLoad` chain, so a +navigation observes `preload: false` even when an identical preload is still +active. A later lane can reuse successful settled loader data or join loader +work that is still in flight, but it never reuses `beforeLoad` context or an +already-settled redirect, error, or not-found result. If joined loader work +later produces a terminal outcome, all current consumers of that flight observe +it. The `shouldReload` option remains loader-only. + +If a route has `preload: false`, its speculative lane still runs `beforeLoad`, +but skips that route's loader. Navigation runs `beforeLoad` again and performs +the skipped loader work. + ## Preloading with External Libraries When integrating external caching libraries like React Query, which have their own mechanisms for determining stale data, you may want to override the default preloading and stale-while-revalidate logic of TanStack Router. These libraries often use options like staleTime to control the freshness of data. -To customize the preloading behavior in TanStack Router and fully leverage your external library's caching strategy, you can bypass the built-in caching by setting routerOptions.defaultPreloadStaleTime or routeOptions.preloadStaleTime to 0. This ensures that all preloads are marked as stale internally, and loaders are always invoked, allowing your external library, such as React Query, to manage data loading and caching. +To let an external cache make the freshness decision, set +`routerOptions.defaultPreloadStaleTime` or `routeOptions.preloadStaleTime` to +`0`. Settled preload data then becomes immediately stale in the Router, while +retention still follows `preloadGcTime`. Overlapping preload or navigation +consumers can still share in-flight loader work, and `shouldReload` can still +suppress a loader call. For example: @@ -168,25 +200,38 @@ This would then allow you, for instance, to use an option like React Query's `st ## Preloading Manually -If you need to manually preload a route, you can use the router's `preloadRoute` method. It accepts a standard TanStack `NavigateOptions` object and returns a promise that resolves when the route is preloaded. +If you need to manually preload a route, use the router's `preloadRoute` method. +It accepts a standard TanStack `NavigateOptions` object and returns the +speculative match lane. An ordinary error or not-found thrown while loading is +represented in that returned lane; cancellation or control flow that produces +no reusable lane can return `undefined`. # React ```tsx +import { isNotFound } from '@tanstack/react-router' + function Component() { const router = useRouter() useEffect(() => { async function preload() { - try { - const matches = await router.preloadRoute({ - to: postRoute, - params: { id: 1 }, - }) - } catch (err) { - // Failed to preload route + const matches = await router.preloadRoute({ + to: postRoute, + params: { id: 1 }, + }) + + const routeFailure = matches?.find( + (match) => + match.status === 'error' || + match.status === 'notFound' || + isNotFound(match.error), + ) + + if (routeFailure) { + // Inspect routeFailure.error } } @@ -200,18 +245,27 @@ function Component() { # Solid ```tsx +import { isNotFound } from '@tanstack/solid-router' + function Component() { const router = useRouter() createEffect(() => { async function preload() { - try { - const matches = await router.preloadRoute({ - to: postRoute, - params: { id: 1 }, - }) - } catch (err) { - // Failed to preload route + const matches = await router.preloadRoute({ + to: postRoute, + params: { id: 1 }, + }) + + const routeFailure = matches?.find( + (match) => + match.status === 'error' || + match.status === 'notFound' || + isNotFound(match.error), + ) + + if (routeFailure) { + // Inspect routeFailure.error } } diff --git a/docs/router/guide/router-context.md b/docs/router/guide/router-context.md index 5fc4001010..347082106f 100644 --- a/docs/router/guide/router-context.md +++ b/docs/router/guide/router-context.md @@ -278,9 +278,10 @@ Then, in your route: export const Route = createFileRoute('/todos')({ component: Todos, loader: async ({ context }) => { - await context.queryClient.ensureQueryData({ + await context.queryClient.query({ queryKey: ['todos', { userId: user.id }], queryFn: fetchTodos, + staleTime: 'static', }) }, }) diff --git a/docs/router/guide/ssr.md b/docs/router/guide/ssr.md index f87849f8a1..46a0941e7c 100644 --- a/docs/router/guide/ssr.md +++ b/docs/router/guide/ssr.md @@ -60,7 +60,9 @@ To implement non-streaming SSR with TanStack Router, you will need the following ### Automatic Server History -On the client, Router defaults to using an instance of `createBrowserHistory`, which is the preferred type of history to use on the client. On the server, however, you will want to use an instance of `createMemoryHistory` instead. This is because `createBrowserHistory` uses the `window` object, which does not exist on the server. This is handled automatically for you in the RouterServer component. +On the client, Router defaults to using an instance of `createBrowserHistory`. On the server, the Router SSR request handler and TanStack Start automatically create a lightweight history containing only the request URL. This history does not keep a navigation stack or respond to `push`, `replace`, `go`, `back`, or `forward` calls. + +Server-side calls to `router.navigate()` and `router.commitLocation()` are also no-ops: their promises resolve without changing the request location or running another load. To redirect a request, use the dedicated [redirect API](../api/router/redirectFunction.md), such as `throw redirect({ to: '/login' })` in `beforeLoad` or a loader. ### Automatic Loader Dehydration/Hydration @@ -156,6 +158,8 @@ export async function render({ request }: { request: Request }) { using `renderRouterToString` +React and Solid use their native synchronous string renderers. Suspended components render their Suspense fallback without waiting for the component to resolve. The router still finishes serializing hydration data before returning the response. Use `renderRouterToStream` when you need the server to render suspended content after it resolves. + # React @@ -258,6 +262,9 @@ This pattern can be useful for pages that have slow or high-latency data fetchin > [!NOTE] > This streaming pattern is all automatic as long as you are using either `defaultStreamHandler` or `renderRouterToStream`. +> [!IMPORTANT] +> Render [``](./document-head-management.md#scripts) inside `` of your root route. It emits the route scripts and marks where the router inserts streamed hydration data. Without it the response still completes, but the page cannot hydrate. + using `defaultStreamHandler` diff --git a/docs/router/guide/type-safety.md b/docs/router/guide/type-safety.md index 2adffc58c5..3faaed79e7 100644 --- a/docs/router/guide/type-safety.md +++ b/docs/router/guide/type-safety.md @@ -137,12 +137,13 @@ As your application scales, TypeScript check times will naturally increase. Ther ### Only infer types you need -A great pattern with client side data caches (TanStack Query, etc.) is to prefetch data. For example with TanStack Query you might have a route which calls `queryClient.ensureQueryData` in a `loader`. +A great pattern with client side data caches (TanStack Query, etc.) is to prefetch data. For example with TanStack Query you might have a route which calls `queryClient.query` in a `loader`. ```tsx export const Route = createFileRoute('/posts/$postId/deep')({ + // (ctx: LoaderFnContext) => Promise loader: ({ context: { queryClient }, params: { postId } }) => - queryClient.ensureQueryData(postQueryOptions(postId)), + queryClient.query({ ...postQueryOptions(postId), staleTime: 'static' }), component: PostDeepComponent, }) @@ -154,12 +155,16 @@ function PostDeepComponent() { } ``` -This may look fine and for small route trees and you may not notice any TS performance issues. However in this case TS has to infer the loader's return type, despite it never being used in your route. If the loader data is a complex type with many routes that prefetch in this manner, it can slow down editor performance. In this case, the change is quite simple and let typescript infer Promise. +This may look fine and for small route trees and you may not notice any TS performance issues. However in this case TS has to infer the loader's return type, despite it never being used in your route. If the loader data is a complex type with many routes that prefetch in this manner, it can slow down editor performance. In this case, the change is quite simple and let typescript infer `Promise`. ```tsx export const Route = createFileRoute('/posts/$postId/deep')({ + // (ctx: LoaderFnContext) => Promise loader: async ({ context: { queryClient }, params: { postId } }) => { - await queryClient.ensureQueryData(postQueryOptions(postId)) + await queryClient.query({ + ...postQueryOptions(postId), + staleTime: 'static', + }) }, component: PostDeepComponent, }) diff --git a/docs/router/guide/url-rewrites.md b/docs/router/guide/url-rewrites.md index 7bc3df8545..e780e01781 100644 --- a/docs/router/guide/url-rewrites.md +++ b/docs/router/guide/url-rewrites.md @@ -343,6 +343,8 @@ const navigate = useNavigate() navigate({ to: '/about' }) ``` +When the final output URL has a different origin, programmatic navigation performs a full page load automatically. You do not need to set `reloadDocument: true` for cross-origin rewrites. If a route mask is applied, its output URL determines whether navigation stays on the current origin. + ### Hard Links for Cross-Origin Rewrites When an output rewrite changes the origin (hostname), the `` component automatically renders a standard anchor tag instead of using client-side navigation: diff --git a/docs/router/how-to/debug-router-issues.md b/docs/router/how-to/debug-router-issues.md index b4d20ec72f..27dadd361f 100644 --- a/docs/router/how-to/debug-router-issues.md +++ b/docs/router/how-to/debug-router-issues.md @@ -322,11 +322,16 @@ const route = createRoute({ ```tsx function DataLoadingDebug() { - const location = useLocation() + const state = useRouterState() console.log('Route status:', { - isLoading: location.isLoading, - isTransitioning: location.isTransitioning, + status: state.status, + isLoading: state.isLoading, + matches: state.matches.map((match) => ({ + routeId: match.routeId, + status: match.status, + isFetching: match.isFetching, + })), }) return null diff --git a/docs/router/how-to/setup-testing.md b/docs/router/how-to/setup-testing.md index 72f40032cf..104cbedc0d 100644 --- a/docs/router/how-to/setup-testing.md +++ b/docs/router/how-to/setup-testing.md @@ -224,8 +224,12 @@ export function LoadingComponent() { return
Loading...
} -export function ErrorComponent({ error }: { error: Error }) { - return
Error: {error.message}
+export function ErrorComponent({ error }: { error: unknown }) { + return ( +
+ Error: {error instanceof Error ? error.message : String(error)} +
+ ) } ``` @@ -586,8 +590,12 @@ describe('Code-Based Route Data Loading', () => { return
{user.name}
} - function ErrorComponent({ error }: { error: Error }) { - return
Error: {error.message}
+ function ErrorComponent({ error }: { error: unknown }) { + return ( +
+ Error: {error instanceof Error ? error.message : String(error)} +
+ ) } const userRoute = createRoute({ @@ -651,9 +659,10 @@ describe('React Query Integration', () => { path: '/posts', component: PostsList, loader: ({ context: { queryClient } }) => - queryClient.ensureQueryData({ + queryClient.query({ queryKey: ['posts'], queryFn: mockFetchPosts, + staleTime: 'static', }), }) diff --git a/docs/router/how-to/share-search-params-across-routes.md b/docs/router/how-to/share-search-params-across-routes.md index e1e24c1e0d..23a202b176 100644 --- a/docs/router/how-to/share-search-params-across-routes.md +++ b/docs/router/how-to/share-search-params-across-routes.md @@ -2,8 +2,6 @@ title: Share Search Parameters Across Routes --- -# How to Share Search Parameters Across Routes - Search parameters automatically inherit from parent routes in TanStack Router. When a parent route validates search parameters, child routes can access them via `Route.useSearch()` alongside their own parameters. ## How Parameter Inheritance Works diff --git a/docs/router/how-to/use-environment-variables.md b/docs/router/how-to/use-environment-variables.md index 2d35308158..4f6a764f28 100644 --- a/docs/router/how-to/use-environment-variables.md +++ b/docs/router/how-to/use-environment-variables.md @@ -164,7 +164,7 @@ const fetchPosts = async () => { export const Route = createFileRoute('/posts/')({ loader: fetchPosts, errorComponent: ({ error }) => ( -
Error loading posts: {error.message}
+
Error loading posts: {error instanceof Error ? error.message : String(error)}
), }) ``` diff --git a/docs/router/how-to/validate-search-params.md b/docs/router/how-to/validate-search-params.md index 5abd435cef..15d3f9d6c8 100644 --- a/docs/router/how-to/validate-search-params.md +++ b/docs/router/how-to/validate-search-params.md @@ -36,7 +36,7 @@ export const Route = createFileRoute('/products')({ return (

Invalid Search Parameters

-

{error.message}

+

{error instanceof Error ? error.message : String(error)}

diff --git a/docs/router/installation/with-esbuild.md b/docs/router/installation/with-esbuild.md index b5cad0622c..8ecd9b8d0a 100644 --- a/docs/router/installation/with-esbuild.md +++ b/docs/router/installation/with-esbuild.md @@ -25,7 +25,6 @@ export default { plugins: [ tanstackRouter({ target: 'react', - autoCodeSplitting: true, }), ], } @@ -50,10 +49,7 @@ const ctx = await esbuild.context({ format: 'esm', target: ['esnext'], sourcemap: true, - plugins: [ - solidPlugin(), - tanstackRouter({ target: 'solid', autoCodeSplitting: true }), - ], + plugins: [solidPlugin(), tanstackRouter({ target: 'solid' })], }) if (isDev) { @@ -72,6 +68,9 @@ Or, you can clone our [Quickstart Esbuild example](https://github.com/TanStack/r Now that you've added the plugin to your Esbuild configuration, you're all set to start using file-based routing with TanStack Router. +> [!NOTE] +> Automatic code splitting is not available with Esbuild: the plugin throws an error when `autoCodeSplitting` is `true`. Route generation works as usual. To split routes, use [manual code splitting](../guide/code-splitting.md) or another bundler. + ## Ignoring the generated route tree file If your project is configured to use a linter and/or formatter, you may want to ignore the generated route tree file. This file is managed by TanStack Router and therefore shouldn't be changed by your linter or formatter. diff --git a/docs/router/integrations/nativescript.md b/docs/router/integrations/nativescript.md deleted file mode 100644 index 4c33ef7e27..0000000000 --- a/docs/router/integrations/nativescript.md +++ /dev/null @@ -1,205 +0,0 @@ ---- -id: nativescript -title: NativeScript ---- - -`@tanstack/react-nativescript-router` runs a React Router route tree in a -NativeScript application using native iOS and Android views. It is not based on -a WebView. - -## Quick start - -Run the initializer from an existing React Router or TanStack Start app: - -```sh -npx @tanstack/router-cli@latest native init -``` - -The command detects the router module and whether the app uses Start, then adds -the NativeScript resources, entry point, Vite config, scripts, and dependencies. -It does not overwrite conflicting managed files unless you pass `--force`. -For pnpm projects it also merges the narrowly scoped build-script policy needed -by NativeScript and Vite into the nearest `pnpm-workspace.yaml`. Existing -workspace settings and explicit denials are preserved. - -```sh -npm run native:ios -npm run native:android -``` - -Requirements for the current stable NativeScript toolchain: - -- React 19 -- NativeScript 9 -- `@nativescript-community/react` 19 -- `react-nativescript` as an npm alias of `@nativescript-community/react` 19 -- `@nativescript/vite` 2.0.3 -- Vite 7.3 or newer within the Vite 7 major - -NativeScript's stable Vite plugin does not currently support Vite 8. The -initializer adds a compatible Vite version when one is absent and reports a -conflict for an existing incompatible range. `--force` deliberately replaces -that range. - -## Sharing an app - -The generated route tree and these behaviors can be shared: - -- route paths and type registration -- path params and search params -- loaders and router context -- redirects, not-found results, and blockers -- TanStack Start server functions - -NativeScript does not translate DOM elements or CSS into native controls. Keep -route modules thin and put host UI in sibling screen modules: - -```text -src/screens/SettingsScreen.tsx -src/screens/SettingsScreen-native.tsx -``` - -```tsx title="src/routes/settings.tsx" -import { createFileRoute } from '@tanstack/react-router' -import { SettingsScreen } from '../screens/SettingsScreen' - -export const Route = createFileRoute('/settings')({ - loader: loadSettings, - component: () => , - native: { - title: 'Settings', - headerLargeTitle: true, - }, -}) -``` - -The native Vite resolver selects `SettingsScreen-native.tsx`. It also replaces -the web root route with `src/native/root-route.tsx`, so a Start document root -containing `html`, `head`, and `body` is never evaluated by the native app. - -## Native stack behavior - -The adapter maps Router history to a NativeScript `Frame`. Every stack entry -owns a real `Page` and an independent snapshot of its complete matched route -tree. This has two important effects: - -- iOS interactive swipe-back reveals the already-rendered previous page. -- Hooks on retained pages continue to read that page's location, params, - search, matches, loader data, and route context. - -NativeScript's `Page.enableSwipeBackNavigation` supplies the iOS gesture. -Navigation blockers disable it while a blocker is registered. Android's system -back event is routed through `router.back()`. - -Absolute `http`, `https`, `mailto`, and `tel` links open through NativeScript's -platform URL handler. Override `native.openExternalUrl` on the router for a -custom host integration. Relative links, including `reloadDocument` links -shared with a web app, remain native stack navigations. - -### Route options - -Native route options inherit through matched parents. A child overrides fields -defined by an ancestor. - -```tsx -export const Route = createFileRoute('/messages/$threadId')({ - native: ({ params }) => ({ - title: `Thread ${params.threadId}`, - headerShown: true, - headerBackVisible: true, - gestureEnabled: true, - animation: 'slide_from_right', - getId: ({ params }) => `thread:${params.threadId}`, - stackMatch: 'nearest', - }), -}) -``` - -Supported options include: - -- `title`, `headerShown`, `headerBackVisible`, and `headerBackTitle` -- `headerLargeTitle`, `headerStyle`, and a custom native `header` -- `gestureEnabled`, `animated`, `animation`, and `transition` -- `getId` and `stackMatch` - -### Link and navigate options - -```tsx - -``` - -`stackBehavior` values: - -- `auto`: use normal Router push/replace behavior -- `push`: always add an entry -- `replace`: replace the current entry -- `reuse`: pop to a matching entry, replace the matching current entry when - its href changes, or push when no entry matches - -Reuse identity defaults to the complete href, including search and hash. Pass -`entryId`, or define route-level `native.getId`, for domain-specific identity. - -Targeted back navigation uses the same history model: - -```ts -await router.back({ steps: 2 }) -await router.back({ to: 'root' }) -await router.back({ to: '/messages/$threadId', params: { threadId: '42' } }) -``` - -A route target can use `ifMissing: 'push' | 'replace' | 'noop'`. - -## Manual provider setup - -The initializer is recommended. A manual native entry looks like this: - -```tsx title="src/native/index.tsx" -import { startNativeScriptApp } from '@tanstack/react-nativescript-router' -import { getRouter } from '../router' - -void startNativeScriptApp({ router: getRouter() }) -``` - -The Vite integration aliases app imports of `@tanstack/react-router` to the -native adapter, keeps one React runtime, provides the NativeScript renderer -bridge, resolves `-native` siblings, and runs file-route generation. - -For server functions, continue with the -[NativeScript Start guide](../../start/framework/react/guide/nativescript.md). - -## Deep links - -Deep-link sources differ between NativeScript app configurations, so the -adapter accepts injected initial-URL and subscription functions: - -```ts -const router = createRouter({ - routeTree, - native: { - linking: { - prefixes: ['myapp://', 'https://example.com'], - getInitialURL, - subscribe: subscribeToIncomingURLs, - initialMode: 'replace', - incomingMode: 'push', - }, - }, -}) -``` - -## Scope - -The first release covers native push/replace/pop navigation, interactive back, -native headers, deep-link plumbing, Router blockers, and Start server functions. -Modal route presentation is deferred until it has a separately tested native -state machine. Development route edits may cause a full NativeScript remount. - -The implementation incorporates lessons and primitives from the NativeScript -team's [`@nativescript/tanstack-router`](https://github.com/NativeScript/tanstack) -work and the stack API design in -[React Native pull request #7622](https://github.com/TanStack/router/pull/7622). diff --git a/docs/router/integrations/query.md b/docs/router/integrations/query.md index 243fcefdf4..707f90900c 100644 --- a/docs/router/integrations/query.md +++ b/docs/router/integrations/query.md @@ -17,7 +17,7 @@ title: TanStack Query Integration The TanStack query integration is a separate package that you need to install: - + react: @tanstack/react-router-ssr-query solid: @tanstack/solid-router-ssr-query @@ -152,7 +152,7 @@ Preload critical data in the route `loader` to avoid waterfalls and loading flas -# React +# Blocking `query` in loader ```tsx title="src/routes/posts.tsx" import { queryOptions, useSuspenseQuery, useQuery } from '@tanstack/react-query' @@ -165,7 +165,12 @@ const postsQuery = queryOptions({ export const Route = createFileRoute('/posts')({ // Ensure the data is in the cache before render - loader: ({ context }) => context.queryClient.ensureQueryData(postsQuery), + loader: ({ context }) => + context.queryClient.query({ + ...postsQuery, + // returns data from cache immediately, otherwise executes a fetch + staleTime: 'static', + }), component: PostsPage, }) @@ -180,15 +185,15 @@ function PostsPage() { ### Prefetching and streaming -You can also prefetch with `fetchQuery` or `ensureQueryData` in a loader without consuming the data in a component. If you return the promise directly from the loader, it will be awaited and thus block the SSR request until the query finishes. If you don't await the promise nor return it, the query will be started on the server and will be streamed to the client without blocking the SSR request. +You can also prefetch with `query` in a loader without consuming the data in a component. If you return the promise directly from the loader, it will be awaited and thus block the SSR request until the query finishes. If you don't await the promise nor return it, the query will be started on the server and will be streamed to the client without blocking the SSR request. -# React +# Non-blocking `query` in loader ```tsx title="src/routes/users.$id.tsx" import { createFileRoute } from '@tanstack/react-router' -import { queryOptions, useQuery } from '@tanstack/react-query' +import { noop, queryOptions, useQuery } from '@tanstack/react-query' const userQuery = (id: string) => queryOptions({ @@ -197,15 +202,18 @@ const userQuery = (id: string) => }) export const Route = createFileRoute('/user/$id')({ - loader: ({ params }) => { - // do not await this nor return the promise, just kick off the query to stream it to the client - context.queryClient.fetchQuery(userQuery(params.id)) + loader: ({ context, params }) => { + // Do not await this nor return the promise, just kick off the query to stream it to the client + void context.queryClient.query(userQuery(params.id)).catch(noop) }, }) ``` +> [!NOTE] +> Previous versions of this guide used `queryClient.ensureQueryData` and `queryClient.prefetchQuery`. These methods are now deprecated in TanStack Query in favor of `queryClient.query`. See the TanStack Query [v5 migration guide](https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#imperative-queryclient-methods) for more details. + ## Redirect handling If a query or mutation throws a `redirect(...)`, the integration intercepts it on the client and performs a router navigation. diff --git a/docs/router/routing/code-based-routing.md b/docs/router/routing/code-based-routing.md index d3102cafd6..b1457c6fbe 100644 --- a/docs/router/routing/code-based-routing.md +++ b/docs/router/routing/code-based-routing.md @@ -14,7 +14,7 @@ title: Code-Based Routing Code-based routing is no different from file-based routing in that it uses the same route tree concept to organize, match and compose matching routes into a component tree. The only difference is that instead of using the filesystem to organize your routes, you use code. -Let's consider the same route tree from the [Route Trees & Nesting](./route-trees.md#route-trees) guide, and convert it to code-based routing: +Let's consider the same route tree from the [Route Trees](./route-trees.md#route-trees) guide, and convert it to code-based routing: Here is the file-based version: diff --git a/docs/router/routing/file-based-routing.md b/docs/router/routing/file-based-routing.md index 6be11e55d6..2eea38bba2 100644 --- a/docs/router/routing/file-based-routing.md +++ b/docs/router/routing/file-based-routing.md @@ -12,7 +12,7 @@ File-based routing is a way to configure your routes using the filesystem. Inste - **Organization**: Routes are organized in a way that mirrors the URL structure of your application. - **Scalability**: As your application grows, file-based routing makes it easy to add new routes and maintain existing ones. - **Code-Splitting**: File-based routing allows TanStack Router to automatically code-split your routes for better performance. -- **Type-Safety**: File-based routing raises the ceiling on type-safety by generating managing type linkages for your routes, which can otherwise be a tedious process via code-based routing. +- **Type-Safety**: File-based routing raises the ceiling on type-safety by generating and managing type linkages for your routes, which can otherwise be a tedious process via code-based routing. - **Consistency**: File-based routing enforces a consistent structure for your routes, making it easier to maintain and update your application and move from one project to another. ## `/`s or `.`s? @@ -80,7 +80,7 @@ See the example below: ## Mixed Flat and Directory Routes -It's extremely likely that a 100% directory or flat route structure won't be the best fit for your project, which is why TanStack Router allows you to mix both flat and directory routes together to create a route tree that uses the best of both worlds where it makes sense: +It's extremely likely that a 100% directory or flat route structure won't be the best fit for your project, which is why TanStack Router allows you to mix both flat and directory routes together to create a route tree that uses the best of both worlds where it makes sense. See the example below: diff --git a/docs/router/routing/file-naming-conventions.md b/docs/router/routing/file-naming-conventions.md index 115310f5b3..896e7d3d9b 100644 --- a/docs/router/routing/file-naming-conventions.md +++ b/docs/router/routing/file-naming-conventions.md @@ -2,7 +2,7 @@ title: File Naming Conventions --- -File-based routing requires that you follow a few simple file naming conventions to ensure that your routes are generated correctly. The concepts these conventions enable are covered in detail in the [Route Trees & Nesting](./route-trees.md) guide. +File-based routing requires that you follow a few simple file naming conventions to ensure that your routes are generated correctly. The concepts these conventions enable are covered in detail in the [Route Trees](./route-trees.md) guide. | Feature | Description | | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -40,4 +40,4 @@ Pathless routes wrap child routes with either logic or a component without requi | ʦ `_app.a.tsx` | /a | `
` | | ʦ `_app.b.tsx` | /b | `` | -To learn more about pathless routes, see the [Routing Concepts - Pathless Routes](./routing-concepts.md#pathless-layout-routes) guide. +To learn more about pathless routes, see the [Routing Concepts - Pathless Layout Routes](./routing-concepts.md#pathless-layout-routes) guide. diff --git a/docs/router/routing/routing-concepts.md b/docs/router/routing/routing-concepts.md index 88eebbd5f0..11674e69c2 100644 --- a/docs/router/routing/routing-concepts.md +++ b/docs/router/routing/routing-concepts.md @@ -564,7 +564,7 @@ routes/ │ ├── ... ``` -We can import from the excluded files into our posts route +We can import from the excluded files into our posts route: diff --git a/docs/start/config.json b/docs/start/config.json index 6c34e752e1..36af0e6e0d 100644 --- a/docs/start/config.json +++ b/docs/start/config.json @@ -36,6 +36,10 @@ { "label": "Migrate from Next.js", "to": "framework/react/migrate-from-next-js" + }, + { + "label": "Migrate from the Release Candidate", + "to": "framework/react/migrate-from-release-candidate" } ] }, @@ -53,14 +57,19 @@ { "label": "Build from Scratch", "to": "framework/solid/build-from-scratch" + }, + { + "label": "Migrate from the Release Candidate", + "to": "framework/solid/migrate-from-release-candidate" } ] } ] }, { - "label": "Guides", + "label": "Server & Execution", "children": [], + "collapsible": true, "frameworks": [ { "label": "react", @@ -69,10 +78,6 @@ "label": "Routing", "to": "framework/react/guide/routing" }, - { - "label": "NativeScript", - "to": "framework/react/guide/nativescript" - }, { "label": "Execution Model", "to": "framework/react/guide/execution-model" @@ -85,6 +90,10 @@ "label": "Import Protection", "to": "framework/react/guide/import-protection" }, + { + "label": "Path Aliases", + "to": "framework/react/guide/path-aliases" + }, { "label": "Environment Variables", "to": "framework/react/guide/environment-variables" @@ -93,6 +102,10 @@ "label": "Server Functions", "to": "framework/react/guide/server-functions" }, + { + "label": "Streaming Data from Server Functions", + "to": "framework/react/guide/streaming-data-from-server-functions" + }, { "label": "Server Components", "to": "framework/react/guide/server-components" @@ -116,7 +129,72 @@ { "label": "Server Routes", "to": "framework/react/guide/server-routes" + } + ] + }, + { + "label": "solid", + "children": [ + { + "label": "Routing", + "to": "framework/solid/guide/routing" }, + { + "label": "Execution Model", + "to": "framework/solid/guide/execution-model" + }, + { + "label": "Code Execution Patterns", + "to": "framework/solid/guide/code-execution-patterns" + }, + { + "label": "Import Protection", + "to": "framework/solid/guide/import-protection" + }, + { + "label": "Path Aliases", + "to": "framework/solid/guide/path-aliases" + }, + { + "label": "Environment Variables", + "to": "framework/solid/guide/environment-variables" + }, + { + "label": "Server Functions", + "to": "framework/solid/guide/server-functions" + }, + { + "label": "Static Server Functions", + "to": "framework/solid/guide/static-server-functions" + }, + { + "label": "Environment Functions", + "to": "framework/solid/guide/environment-functions" + }, + { + "label": "Middleware", + "to": "framework/solid/guide/middleware" + }, + { + "label": "Error Boundaries", + "to": "framework/solid/guide/error-boundaries" + }, + { + "label": "Server Routes", + "to": "framework/solid/guide/server-routes" + } + ] + } + ] + }, + { + "label": "Rendering", + "children": [], + "collapsible": true, + "frameworks": [ + { + "label": "react", + "children": [ { "label": "Hydration Errors", "to": "framework/react/guide/hydration-errors" @@ -145,6 +223,10 @@ "label": "Server Entry Point", "to": "framework/react/guide/server-entry-point" }, + { + "label": "Client Entry Point", + "to": "framework/react/guide/client-entry-point" + }, { "label": "Early Hints", "to": "framework/react/guide/early-hints" @@ -152,108 +234,12 @@ { "label": "CDN Asset URLs", "to": "framework/react/guide/cdn-asset-urls" - }, - { - "label": "CSS Styling", - "to": "framework/react/guide/css-styling" - }, - { - "label": "Client Entry Point", - "to": "framework/react/guide/client-entry-point" - }, - { - "label": "Hosting", - "to": "framework/react/guide/hosting" - }, - { - "label": "Authentication Overview", - "to": "framework/react/guide/authentication-overview" - }, - { - "label": "Authentication Server Primitives", - "to": "framework/react/guide/authentication-server-primitives" - }, - { - "label": "Authentication", - "to": "framework/react/guide/authentication" - }, - { - "label": "Databases", - "to": "framework/react/guide/databases" - }, - { - "label": "Observability", - "to": "framework/react/guide/observability" - }, - { - "label": "Path Aliases", - "to": "framework/react/guide/path-aliases" - }, - { - "label": "Tailwind CSS Integration", - "to": "framework/react/guide/tailwind-integration" - }, - { - "label": "Rendering Markdown", - "to": "framework/react/guide/rendering-markdown" - }, - { - "label": "SEO", - "to": "framework/react/guide/seo" - }, - { - "label": "Generative Engine Optimization (GEO)", - "to": "framework/react/guide/geo" } ] }, { "label": "solid", "children": [ - { - "label": "Routing", - "to": "framework/solid/guide/routing" - }, - { - "label": "Execution Model", - "to": "framework/solid/guide/execution-model" - }, - { - "label": "Code Execution Patterns", - "to": "framework/solid/guide/code-execution-patterns" - }, - { - "label": "Import Protection", - "to": "framework/solid/guide/import-protection" - }, - { - "label": "Environment Variables", - "to": "framework/solid/guide/environment-variables" - }, - { - "label": "Server Functions", - "to": "framework/solid/guide/server-functions" - }, - { - "label": "Static Server Functions", - "to": "framework/solid/guide/static-server-functions" - }, - { - "label": "Environment Functions", - "to": "framework/solid/guide/environment-functions" - }, - { - "label": "Middleware", - "to": "framework/solid/guide/middleware" - }, - { - "label": "Error Boundaries", - "to": "framework/solid/guide/error-boundaries" - }, - { - "label": "Server Routes", - "to": "framework/solid/guide/server-routes" - }, { "label": "Hydration Errors", "to": "framework/solid/guide/hydration-errors" @@ -278,24 +264,90 @@ "label": "Server Entry Point", "to": "framework/solid/guide/server-entry-point" }, - { - "label": "Early Hints", - "to": "framework/solid/guide/early-hints" - }, - { - "label": "CSS Styling", - "to": "framework/solid/guide/css-styling" - }, { "label": "Client Entry Point", "to": "framework/solid/guide/client-entry-point" }, + { + "label": "Early Hints", + "to": "framework/solid/guide/early-hints" + } + ] + } + ] + }, + { + "label": "Deployment & Operations", + "children": [], + "collapsible": true, + "frameworks": [ + { + "label": "react", + "children": [ + { + "label": "Production Checklist", + "to": "framework/react/guide/production-checklist" + }, + { + "label": "Hosting", + "to": "framework/react/guide/hosting" + }, + { + "label": "Observability", + "to": "framework/react/guide/observability" + } + ] + }, + { + "label": "solid", + "children": [ { "label": "Hosting", "to": "framework/solid/guide/hosting" }, { - "label": "Authentication Overview", + "label": "Observability", + "to": "framework/solid/guide/observability" + } + ] + } + ] + }, + { + "label": "Authentication & Data", + "children": [], + "collapsible": true, + "frameworks": [ + { + "label": "react", + "children": [ + { + "label": "Choose Authentication", + "to": "framework/react/guide/authentication-overview" + }, + { + "label": "Authentication Server Primitives", + "to": "framework/react/guide/authentication-server-primitives" + }, + { + "label": "Implement Authentication", + "to": "framework/react/guide/authentication" + }, + { + "label": "Databases", + "to": "framework/react/guide/databases" + }, + { + "label": "TanStack Query", + "to": "framework/react/guide/tanstack-query" + } + ] + }, + { + "label": "solid", + "children": [ + { + "label": "Choose Authentication", "to": "framework/solid/guide/authentication-overview" }, { @@ -303,20 +355,53 @@ "to": "framework/solid/guide/authentication-server-primitives" }, { - "label": "Authentication", + "label": "Implement Authentication", "to": "framework/solid/guide/authentication" }, { "label": "Databases", "to": "framework/solid/guide/databases" + } + ] + } + ] + }, + { + "label": "Styling & Metadata", + "children": [], + "collapsible": true, + "frameworks": [ + { + "label": "react", + "children": [ + { + "label": "CSS Styling", + "to": "framework/react/guide/css-styling" }, { - "label": "Observability", - "to": "framework/solid/guide/observability" + "label": "Tailwind CSS Integration", + "to": "framework/react/guide/tailwind-integration" }, { - "label": "Path Aliases", - "to": "framework/solid/guide/path-aliases" + "label": "Rendering Markdown", + "to": "framework/react/guide/rendering-markdown" + }, + { + "label": "SEO", + "to": "framework/react/guide/seo" + }, + { + "label": "Generative Engine Optimization (GEO)", + "to": "framework/react/guide/geo" + } + ] + }, + { + "label": "solid", + "children": [ + { + "label": "CSS Styling", + "to": "framework/solid/guide/css-styling" }, { "label": "Tailwind CSS Integration", diff --git a/docs/start/framework/react/comparison.md b/docs/start/framework/react/comparison.md index 5c39e0f602..b72e286a76 100644 --- a/docs/start/framework/react/comparison.md +++ b/docs/start/framework/react/comparison.md @@ -1,338 +1,61 @@ --- title: Comparison | TanStack Start vs Next.js vs React Router +description: Compare rendering, server APIs, caching, forms, and deployment in TanStack Start, Next.js App Router, and React Router Framework Mode. toc: false --- -Choosing a full-stack React framework? This comparison focuses on the **full-stack framework features** that distinguish TanStack Start from Next.js and React Router (v7 Framework Mode). +This matrix compares full-stack framework capabilities. For the choice between Start and Next.js, read [TanStack Start vs Next.js](./start-vs-nextjs). For navigation and URL-state APIs, see the [TanStack Router comparison](/router/latest/docs/comparison). -> **🚨 IMPORTANT: Looking for routing features?** -> -> TanStack Start is built on **TanStack Router**, which provides industry-leading type-safe routing capabilities. For a comprehensive comparison of routing features (nested routes, search params, type safety, loaders, etc.), please see: -> -> ### [📖 TanStack Router Comparison vs React Router / Next.js →](/router/latest/docs/framework/react/comparison) -> -> That comparison covers all the routing features in detail. This page focuses specifically on **full-stack framework capabilities** like SSR, server functions, middleware, deployment, and more. +Checked September 11, 2026 against the linked documentation: TanStack Start's current guides, Next.js 16.3 App Router, and React Router 8.3 Framework Mode. -While we aim to provide an accurate and fair comparison, please note that this table may not capture every nuance or recent update of each framework. We recommend reviewing the official documentation and trying out each solution to make the most informed decision for your specific use case. +## Rendering and data -If you find any discrepancies or have suggestions for improvement, please don't hesitate to contribute via the "Edit this page on GitHub" link at the bottom of this page or open an issue in the [TanStack Router GitHub repository](https://github.com/TanStack/router). +| Capability | TanStack Start | Next.js App Router | React Router Framework Mode | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| Server rendering | [SSR with hydration by default](./overview) | [Server and Client Components contribute to initial HTML](https://nextjs.org/docs/app/getting-started/server-and-client-components) | [Server rendering is configurable](https://reactrouter.com/start/framework/rendering) | +| Rendering control | [Per-route full, data-only, or disabled SSR](./guide/selective-ssr) | [Server/Client Component boundaries](https://nextjs.org/docs/app/getting-started/server-and-client-components); `use client` does not disable initial SSR | [Global SSR setting and route-level client loaders](https://reactrouter.com/start/framework/rendering) | +| SPA applications | [Dedicated SPA mode](./guide/spa-mode) | [Documented SPA patterns](https://nextjs.org/docs/app/guides/single-page-applications) | [`ssr: false`](https://reactrouter.com/start/framework/rendering) | +| Static output | [Prerendering configuration](./guide/static-prerendering) | [Static export](https://nextjs.org/docs/app/guides/static-exports), with server-feature limitations | [Prerender selected URLs](https://reactrouter.com/start/framework/rendering) | +| React Server Components | [Experimental, opt-in](./guide/server-components) | [Core App Router component model](https://nextjs.org/docs/app/getting-started/server-and-client-components) | [Unstable RSC integration](https://reactrouter.com/how-to/react-server-components) | +| Client data reuse | [Router loader caching](/router/latest/docs/guide/data-loading), plus [Query integration](/router/latest/docs/integrations/query) | [Navigation caching and server cache APIs](https://nextjs.org/docs/app/getting-started/caching); a query library can manage additional client data | [Loader/action revalidation](https://reactrouter.com/start/framework/actions); separate client-data tools can be added | +| Revalidation after deployment | [HTTP caching and provider-specific ISR configuration](./guide/isr) | [ISR and cache coordination](https://nextjs.org/docs/app/guides/self-hosting) | [HTTP response headers](https://reactrouter.com/how-to/headers) and deployment infrastructure | -Feature/Capability Key: +A client loader cache, a cached server result, and a cached HTML response are different things. Compare invalidation behavior, persistence, and multi-instance coordination for the layer your application needs. A CDN honoring `stale-while-revalidate` is not proof of identical ISR behavior across providers. -- ✅ 1st-class, built-in, and ready to use with no added configuration or code -- 🟡 Partial Support (rated 1-5 where noted) -- 🟠 Supported via addon/community package -- 🔶 Possible, but requires custom code/implementation/casting -- 🛑 Not officially supported +## Server APIs and forms -| | TanStack Start | Next.js [_(Website)_][nextjs] | React Router [_(Website)_][react-router] | -| ----------------------------------------------------------------- | ------------------------------------------------ | --------------------------------------------- | ------------------------------------------ | -| Github Repo / Stars | [![][stars-tanstack-router]][gh-tanstack-router] | [![][stars-nextjs]][gh-nextjs] | [![][stars-react-router]][gh-react-router] | -| Bundle Size | [![][bp-tanstack-router]][bpl-tanstack-router] | ❓ | ❓ | -| -- | -- | -- | -- | -| **Routing Features** [_(See Full Comparison)_][router-comparison] | ✅ Built on TanStack Router | ✅ File-based App Router | ✅ File-based Nested Routes | -| -- | -- | -- | -- | -| **Full-Stack Features** | -- | -- | -- | -| SSR | ✅ | ✅ | ✅ | -| Streaming SSR | ✅ | ✅ | ✅ | -| Selective SSR (per-route) | ✅ | 🔶 | 🔶 | -| SPA Mode | ✅ | 🔶 (via "use client") | ✅ | -| Built-in Client-Side SWR Caching | ✅ (via TanStack Router) | 🔶 (fetch cache only) | 🛑 | -| Data Fetching Library Integration | ✅ (Official TanStack Query, Apollo, etc.) | 🔶 (manual integration) | 🔶 (manual integration) | -| Static Prerendering (SSG) | ✅ | ✅ | ✅ | -| Incremental Static Regeneration (ISR) | ✅ (via Cache-Control headers) | ✅ (Proprietary) | ✅ (via Cache-Control headers) | -| React Server Components | 🟡 (Experimental) | ✅ | 🟡 (Experimental) | -| Server Functions | ✅ (RPC-based) | ✅ (Server Actions) | ✅ (Actions) | -| Server Function Client Middleware | ✅ | 🛑 | 🛑 | -| Server Function Server Middleware | ✅ | 🛑 | ✅ | -| Request Middleware (All Routes) | ✅ | ✅ | ✅ | -| Server Function Input Validation | ✅ | 🔶 (manual) | 🔶 (manual) | -| API Routes / Server Routes / Resource Routes | ✅ | ✅ | ✅ | -| `
` API | 🛑 | 🟠 (via React 19 useActionState) | ✅ | -| -- | -- | -- | -- | -| **Developer Experience** | -- | -- | -- | -| Devtools | ✅ | 🛑 | 🟠 (3rd party) | -| CLI Tooling | ✅ | ✅ | ✅ | -| Dev Server Startup Speed | ✅ (Fast) | 🛑 (Slow) | ✅ (Fast) | -| HMR Speed | ✅ (Fast, Vite or Rsbuild) | 🛑 (Slow, Webpack/Turbopack) | ✅ (Fast, Vite) | -| Dev Navigation Speed | ✅ | 🟡 | ✅ | -| Dev Resource Usage (CPU/RAM) | ✅ (Lightweight) | 🛑 (Heavy) | ✅ (Lightweight) | -| TypeScript Support | ✅ | ✅ | ✅ | -| Type-First Architecture | ✅ | 🛑 | 🛑 | -| -- | -- | -- | -- | -| **Deployment & Hosting** | -- | -- | -- | -| Deployment Flexibility | ✅ (Vite and Rsbuild builds) | 🟡 (Optimized for Vercel, possible elsewhere) | ✅ (Multiple adapters) | -| Edge Runtime Support | ✅ | ✅ | ✅ | -| Serverless Support | ✅ | ✅ | ✅ | -| Node.js Support | ✅ | ✅ | ✅ | -| Docker Support | ✅ | ✅ | ✅ | -| Static Export | ✅ | ✅ | ✅ | -| Official Cloudflare Support | ✅ | 🟡 | ✅ | -| Official Netlify Support | ✅ | 🟡 | ✅ | -| Official Vercel Support | ✅ (via Nitro) | ✅ | ✅ | +| Capability | TanStack Start | Next.js App Router | React Router Framework Mode | +| -------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| Server calls and mutations | [Typed server functions with GET or POST](./guide/server-functions) | [Server Actions](https://nextjs.org/docs/app/guides/forms) | [Route actions and fetchers](https://reactrouter.com/start/framework/actions) | +| Input validation | [Validator API with inferred types](./guide/server-functions) | [Validate action input with application code or a schema](https://nextjs.org/docs/app/guides/forms) | [Validate action input with application code](https://reactrouter.com/how-to/form-validation) | +| Middleware | [Request middleware and client/server function middleware](./guide/middleware) | [Request interception with Proxy](https://nextjs.org/docs/app/getting-started/proxy); action authorization belongs in server code | [Server and client route middleware](https://reactrouter.com/how-to/middleware) | +| Form handling | [Server functions](./guide/server-functions) can be called from event handlers; use a form library when needed | [Built-in `next/form`](https://nextjs.org/docs/app/api-reference/components/form), plus [Server Action forms](https://nextjs.org/docs/app/guides/forms) | [`Form`, actions, and fetchers](https://reactrouter.com/start/framework/actions) | +| Server endpoints | [Server routes](./guide/server-routes) | [Route Handlers](https://nextjs.org/docs/app/getting-started/route-handlers) | [Resource routes](https://reactrouter.com/how-to/resource-routes) | ---- +Type inference helps callers write valid code. It does not validate an incoming HTTP request or authorize access to a record. All three frameworks need runtime validation and server-side authorization for private operations. For Start, see [Authentication Server Primitives](./guide/authentication-server-primitives). -> **⚠️ Remember:** For detailed comparisons of **routing features** (type safety, search params, loaders, navigation, etc.), see the [**TanStack Router Comparison**][router-comparison]. This page focuses on full-stack framework capabilities. +## Tooling and deployment ---- +| Capability | TanStack Start | Next.js App Router | React Router Framework Mode | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| Build integration | [Vite or Rsbuild](./build-from-scratch) | [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack) | [Framework tooling](https://reactrouter.com/start/framework/installation) | +| Type support | [Router inference](/router/latest/docs/guide/type-safety) and [server function inference](./guide/server-functions) | [Stable opt-in typed links](https://nextjs.org/docs/app/api-reference/config/next-config-js/typedRoutes) and TypeScript APIs | [Generated route-module types](https://reactrouter.com/how-to/route-module-type-safety) | +| Metadata | [Route head management and SEO guide](./guide/seo) | [Metadata API and file conventions](https://nextjs.org/docs/app/getting-started/metadata-and-og-images) | [Route-module metadata](https://reactrouter.com/start/framework/route-module) | +| Image and font handling | Choose CSS, an image service, or an integration for your deployment | Built-in [`next/image`](https://nextjs.org/docs/app/api-reference/components/image) and [`next/font`](https://nextjs.org/docs/app/api-reference/components/font) | Choose CSS, an image service, or an integration for your deployment | +| Hosting | [Provider and runtime guides](./guide/hosting) | [Self-hosting](https://nextjs.org/docs/app/guides/self-hosting) or a deployment provider | [Deployment templates and hosting options](https://reactrouter.com/start/framework/deploying) | -## Key Philosophical Differences - -### TanStack Start - -**Philosophy**: Maximum developer freedom with best-in-class type safety. - -- **Router-First**: Built on TanStack Router (see [full routing comparison][router-comparison]) -- **Deployment Agnostic**: Built on Vite and Rsbuild integrations, deploy without vendor lock-in -- **Composable Middleware**: Middleware system works at both the request level AND individual server function level (both client & server) -- **Selective SSR**: Fine-grained control over SSR behavior per route (full SSR, data-only, or client-only) -- **Developer Control**: Explicit, composable patterns over convention-based magic -- **Type Safety First**: End-to-end compile-time safety for server functions, loaders, and routing - -### Next.js - -**Philosophy**: Production-ready with optimal defaults, best with Vercel. - -- **RSC-First**: Deep integration with React Server Components as the primary paradigm -- **Vercel-Optimized**: Best performance and DX on Vercel's infrastructure -- **Convention over Configuration**: Opinionated structure with file-system routing conventions -- **Automatic Optimizations**: Many performance optimizations happen automatically -- **Production Grade**: Battle-tested at massive scale - -### React Router (v7 Framework Mode) - -**Philosophy**: Web fundamentals with progressive enhancement. - -- **Web Standards**: Embraces web platform primitives (fetch, FormData, Headers) -- **Progressive Enhancement**: Works without JavaScript by default -- **Nested Routes**: First-class support for nested routing and data loading -- **Action-Based**: Form submissions via actions follow web standards -- **Framework Evolution**: Successor to Remix, with Vite-based architecture - -## When to Choose Each Framework - -### Choose TanStack Start if you: - -- Want the absolute best type safety for routing (see [Router Comparison][router-comparison]) -- Need deployment flexibility without vendor lock-in (works with Vite and Rsbuild builds) -- Prefer composable, explicit patterns over convention -- Want fine-grained control over SSR behavior (selective SSR per route) -- Need composable middleware that works at both request and server function levels -- Are building a complex application that benefits from TanStack Router's advanced features -- Already use TanStack Query or other TanStack libraries - -### Choose Next.js if you: - -- Want to use React Server Components today with full ecosystem support -- Are deploying to Vercel or want a Vercel-optimized experience -- Prefer convention over configuration for faster initial development -- Want automatic image optimization and font loading - -### Choose React Router if you: - -- Prioritize progressive enhancement -- Want your app to work without JavaScript -- Prefer action-based mutations following web conventions - -## Feature Deep Dives - -### Built-in Client-Side Caching - -**TanStack Start** includes powerful built-in SWR (stale-while-revalidate) caching through TanStack Router: - -- **Out-of-the-box performance** - Loader data is automatically cached and revalidated -- **Fine-grained control** - Configure `staleTime`, `gcTime`, and revalidation per route -- **Structural sharing** - Efficient updates that only re-render what changed -- **Official integrations** - Turn-key support for TanStack Query, Apollo, and other data fetching libraries -- **More performant** - Optimized for the user experience with instant navigation and background updates - -```tsx -export const Route = createFileRoute('/posts/$postId')({ - loader: async ({ params }) => fetchPost(params.postId), - staleTime: 10_000, // Consider fresh for 10 seconds - gcTime: 5 * 60_000, // Keep in memory for 5 minutes -}) -``` - -For advanced scenarios, TanStack Start integrates seamlessly with TanStack Query: - -```tsx -import { queryOptions } from '@tanstack/react-query' - -const postQueryOptions = (postId: string) => - queryOptions({ - queryKey: ['post', postId], - queryFn: () => fetchPost(postId), - }) - -export const Route = createFileRoute('/posts/$postId')({ - loader: ({ context, params }) => - context.queryClient.ensureQueryData(postQueryOptions(params.postId)), -}) - -function Post() { - const { postId } = Route.useParams() - const { data } = useQuery(postQueryOptions(postId)) - // Automatically uses cached data from loader -} -``` - -**Next.js** has basic fetch caching but lacks fine-grained control and requires manual integration with libraries like React Query. - -**React Router** doesn't have built-in client-side caching - you need to manually integrate a caching solution. - -### Server Functions vs Server Actions - -**TanStack Start Server Functions**: - -```tsx -export const getTodos = createServerFn({ method: 'GET' }) - .validator(zodValidator(z.object({ userId: z.string() }))) - .middleware([authMiddleware]) - .handler(async ({ data, context }) => { - // Fully typed data and context - return db.todos.findMany({ where: { userId: data.userId } }) - }) - -// Call from anywhere with full type safety -const todos = await getTodos({ data: { userId: '123' } }) -``` - -**Next.js Server Actions**: - -```tsx -'use server' -export async function getTodos(userId: string) { - // Runs on server, called from client - return db.todos.findMany({ where: { userId } }) -} - -// Call from client component -const todos = await getTodos('123') -``` - -Key differences: - -- Start's server functions support both client and server middleware -- Start has built-in input validation -- Start's approach is more explicit about the client/server boundary -- Start's server functions support both GET and POST methods (configurable via the `method` option, defaults to GET), while Next.js Server Actions only support POST. -- Next.js Server Actions integrate more seamlessly with forms - -### Middleware Architecture - -**TanStack Start** has two types of middleware: - -1. **Request Middleware**: Runs for all requests (SSR, API routes, server functions) -2. **Server Function Middleware**: Runs specifically for server functions, supports both client-side and server-side execution - -This composability allows for: - -```tsx -const authMiddleware = createMiddleware({ type: 'function' }) - .client(async ({ next }) => { - // Run auth checks on client - return next({ - headers: { Authorization: `Bearer ${getToken()}` }, - }) - }) - .server(async ({ next }) => { - // Validate auth on server - return next({ context: { user: await getUser() } }) - }) -``` - -**Next.js** has a single proxy.ts file that runs on the Node.js runtime. Unlike the deprecated middleware.ts (which ran on Edge Runtime), proxy.ts has full access to server-side resources like databases. - -### Deployment Flexibility - -**TanStack Start** leverages modern build tool ecosystems: - -- Deploy to Cloudflare Workers, Netlify, Vercel, Railway, Fly.io, AWS, etc. -- Use Nitro for universal deployment support -- No vendor-specific features or lock-in -- Same codebase works everywhere - -**Next.js** is optimized for Vercel: - -- Many features work best or only on Vercel (ISR, Image Optimization, Middleware) -- Self-hosting requires more configuration -- Deployment to other platforms may have limitations - -## React Server Components (RSC) - -**Current Status**: - -- **Next.js**: Full production support with extensive ecosystem -- **TanStack Start**: Experimental support available -- **React Router**: Experimental support available - -TanStack Start's RSC implementation takes a client-led composition approach: server components are treated as data that the client can fetch, cache, and compose. See the [Server Components guide](/start/latest/docs/framework/react/guide/server-components) for details. +Deployment support depends on the adapter, runtime, and features you use. Check streaming, image processing, filesystem access, background work, and shared-cache behavior on your chosen target. Next.js self-hosting includes image optimization and ISR configuration; those features should not be labeled Vercel-only. ## Performance Considerations -### Production Performance +This page does not establish a performance winner. Startup time, HMR, memory use, JavaScript shipped, and response latency require separate measurements. Comparing a router package's bundle size with an entire framework is not a valid application benchmark. -All three frameworks are capable of achieving excellent production performance and top Lighthouse scores. The differences come down to optimization strategies: +For a useful comparison, build the same representative application with recommended patterns in each framework. Record package versions, hardware, dependencies, route count, rendering and caching settings, deployment target, warm and cold runs, and the raw results. -- **TanStack Start**: Optimized bundler builds, SWR caching reduces server load, lightweight runtime -- **Next.js**: Automatic code splitting, image optimization, and built-in performance features -- **React Router**: Web standards-based caching and optimization +## When to Choose Each Framework -### Development Performance +- **TanStack Start:** you want typed route context and URL state, explicit loaders and server functions, and control over per-route rendering. +- **Next.js:** you want its Server Component model and integrated image, font, metadata, and form facilities. Existing team experience and integrations can also make staying with Next.js the better choice. +- **React Router Framework Mode:** you want route loaders and actions, fetchers, and form-driven workflows. Read its [progressive enhancement guide](https://reactrouter.com/explanation/progressive-enhancement) if operation before JavaScript loads matters to your application. -This is where the frameworks differ significantly: - -**TanStack Start & React Router:** - -- ⚡ **Instant dev server startup** - Vite and Rsbuild start quickly -- ⚡ **Lightning-fast HMR** - Changes reflect instantly without page refresh -- ⚡ **Fast dev navigation** - Full-speed routing during development -- ⚡ **Lightweight resource usage** - Minimal CPU and RAM consumption -- ⚡ **High dev throughput** - Handle many concurrent requests efficiently - -**Next.js:** - -- 🐌 **Slow dev server startup** - Can take many seconds to start, especially on larger projects -- 🐌 **Slow HMR** - Hot reloading is noticeably sluggish even with Turbopack -- 🐌 **Throttled dev navigation** - Navigation is artificially slowed during development -- 🐌 **Heavy resource usage** - Significant CPU and RAM consumption during development - -**Why This Matters:** - -Development performance directly impacts developer productivity. Faster feedback loops mean: - -- More iterations per hour -- Better flow state and focus -- Lower machine requirements -- Reduced frustration during development -- Faster CI/CD pipelines for development builds - -While Next.js's production performance is excellent, the development experience can be notably slower, especially on larger codebases or less powerful machines. - -## Community and Ecosystem - -- **Next.js**: Largest community, most third-party integrations, extensive learning resources -- **React Router**: One of the oldest and most widely used React libraries, strong community, excellent documentation -- **TanStack Start**: Growing community, part of TanStack ecosystem, excellent Discord support - -## Maturity - -- **Next.js**: Production-ready, used by thousands of companies, proven at scale -- **React Router**: Production-ready, powers millions of apps, v7 Framework Mode is the evolution of Remix -- **TanStack Start**: Release Candidate stage, feature-complete, rapidly stabilizing toward v1 - -[bp-tanstack-router]: https://badgen.net/bundlephobia/minzip/@tanstack/react-router -[bpl-tanstack-router]: https://bundlephobia.com/result?p=@tanstack/react-router -[gh-tanstack-router]: https://github.com/tanstack/router -[stars-tanstack-router]: https://img.shields.io/github/stars/tanstack/router?label=%F0%9F%8C%9F -[router-comparison]: /router/latest/docs/framework/react/comparison -[_]: _ -[nextjs]: https://nextjs.org/ -[gh-nextjs]: https://github.com/vercel/next.js -[stars-nextjs]: https://img.shields.io/github/stars/vercel/next.js?label=%F0%9F%8C%9F -[_]: _ -[react-router]: https://reactrouter.com/ -[gh-react-router]: https://github.com/remix-run/react-router -[stars-react-router]: https://img.shields.io/github/stars/remix-run/react-router?label=%F0%9F%8C%9F +Check Start's [overview](./overview) and [Server Components guide](./guide/server-components) for current release and experimental-feature status before adopting those features. To try Start, use [Getting Started](./getting-started) or [Migrate from Next.js](./migrate-from-next-js). diff --git a/docs/start/framework/react/getting-started.md b/docs/start/framework/react/getting-started.md index 565dc4b4cf..6e5bcd8841 100644 --- a/docs/start/framework/react/getting-started.md +++ b/docs/start/framework/react/getting-started.md @@ -3,6 +3,7 @@ id: getting-started title: Getting Started redirect_from: - /framework/react/quick-start +description: Create a TanStack Start application with TanStack Builder, the CLI, or a working example, then run it locally and start adding routes. --- ## Start a new project @@ -39,6 +40,7 @@ To use a different example, replace `start-basic` with one of the slugs below. #### Examples - [Basic](https://github.com/TanStack/router/tree/main/examples/react/start-basic) (`start-basic`) +- [Basic + Rsbuild](https://github.com/TanStack/router/tree/main/examples/react/start-basic-rsbuild) (`start-basic-rsbuild`) - [Basic + Auth](https://github.com/TanStack/router/tree/main/examples/react/start-basic-auth) (`start-basic-auth`) - [Counter](https://github.com/TanStack/router/tree/main/examples/react/start-counter) (`start-counter`) - [Basic + React Query](https://github.com/TanStack/router/tree/main/examples/react/start-basic-react-query) (`start-basic-react-query`) diff --git a/docs/start/framework/react/guide/authentication-overview.md b/docs/start/framework/react/guide/authentication-overview.md index 8b5838a9f9..e80ba97f8c 100644 --- a/docs/start/framework/react/guide/authentication-overview.md +++ b/docs/start/framework/react/guide/authentication-overview.md @@ -1,8 +1,11 @@ --- id: authentication-overview -title: Authentication +title: Choose Authentication for React Apps +description: Compare hosted services, auth libraries, and custom authentication for React apps built with TanStack Start. Choose an approach before implementing sessions and authorization. --- +Choose how your React app will handle identity, sessions, and permissions. This page compares approaches and providers. Once you have chosen an approach, use [Implement Authentication in React](./authentication.md) for the application workflow. + ## Authentication vs Authorization - **Authentication**: Who is this user? (Login/logout, identity verification) @@ -113,7 +116,7 @@ Build your own authentication system using TanStack Start's server functions and - **Full Control**: Complete customization over authentication flow - **Server Primitives**: Sessions, OAuth, CSRF, rate limiting — see [Authentication Server Primitives](./authentication-server-primitives.md) -- **Session Management**: HTTP-only cookies via `setResponseHeader`, read with `getRequestHeader` +- **Session Management**: HTTP-only cookies written with `setCookie`, read with `getCookie` - **Type Safety**: End-to-end type safety for authentication state ### 🌐 Other Excellent Options diff --git a/docs/start/framework/react/guide/authentication-server-primitives.md b/docs/start/framework/react/guide/authentication-server-primitives.md index 20cc143d2f..103e9c4455 100644 --- a/docs/start/framework/react/guide/authentication-server-primitives.md +++ b/docs/start/framework/react/guide/authentication-server-primitives.md @@ -3,7 +3,7 @@ id: authentication-server-primitives title: Authentication Server Primitives --- -This guide covers the **server-side primitives** for building authentication in TanStack Start: session cookies, session lookup, OAuth, password-reset hardening, CSRF, and rate limiting. It pairs with the [routing-side guide](../../../../router/guide/authenticated-routes.md) (`_authenticated` layout, `beforeLoad`, redirects, RBAC). +This guide covers the **server-side primitives** for building authentication in TanStack Start: session cookies, session lookup, OAuth, password-reset hardening, CSRF, and rate limiting. It pairs with the [routing-side guide](/router/latest/docs/framework/react/guide/authenticated-routes) (`_authenticated` layout, `beforeLoad`, redirects, RBAC). If you can use a managed solution like [Clerk](https://go.clerk.com/wOwHtuJ) or [WorkOS](https://workos.com/), prefer that — they handle most of what this guide describes. Read on if you're rolling your own. @@ -28,47 +28,39 @@ Whichever you choose, the cookie flags matter: ```ts // src/server/session.ts import { - getRequestHeader, - setResponseHeader, + deleteCookie, + getCookie, + setCookie, } from '@tanstack/react-start/server' const SESSION_COOKIE = '__Host-session' const ONE_DAY = 60 * 60 * 24 +const sessionCookieOptions = { + httpOnly: true, + secure: true, + sameSite: 'lax', + path: '/', +} as const + export function setSessionCookie(token: string) { - setResponseHeader( - 'Set-Cookie', - [ - `${SESSION_COOKIE}=${token}`, - `HttpOnly`, - `Secure`, - `SameSite=Lax`, - `Path=/`, - `Max-Age=${ONE_DAY}`, - ].join('; '), - ) + setCookie(SESSION_COOKIE, token, { + ...sessionCookieOptions, + maxAge: ONE_DAY, + }) } export function clearSessionCookie() { - setResponseHeader( - 'Set-Cookie', - `${SESSION_COOKIE}=; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=0`, - ) + deleteCookie(SESSION_COOKIE, sessionCookieOptions) } export function readSessionToken(): string | null { - const header = getRequestHeader('cookie') - if (!header) return null - for (const part of header.split(/;\s*/)) { - // Split only on the FIRST '=' — signed/base64 values often contain '='. - const eq = part.indexOf('=') - if (eq === -1) continue - if (part.slice(0, eq) === SESSION_COOKIE) return part.slice(eq + 1) - } - return null + return getCookie(SESSION_COOKIE) ?? null } ``` +Write cookies with `setCookie` (or `appendResponseHeader('set-cookie', serialized)` for a cookie that a library already serialized). Do not use `setResponseHeader('Set-Cookie', ...)` for this: it replaces every cookie on the outgoing response, including cookies set by other middleware or returned by a handler. + | Flag | Why | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `HttpOnly` | JavaScript can't read the cookie. An XSS bug can't exfiltrate the session. | @@ -169,7 +161,7 @@ For OAuth authorization-code flow: // src/server/oauth.functions.ts import { createServerFn } from '@tanstack/react-start' import { redirect } from '@tanstack/react-router' -import { setResponseHeader } from '@tanstack/react-start/server' +import { setCookie } from '@tanstack/react-start/server' import crypto from 'node:crypto' const OAUTH_STATE_COOKIE = '__Host-oauth' @@ -190,10 +182,13 @@ export const startOAuth = createServerFn({ method: 'GET' }).handler( crypto.createHash('sha256').update(verifier).digest(), ) - setResponseHeader( - 'Set-Cookie', - `${OAUTH_STATE_COOKIE}=${signed({ state, verifier })}; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=600`, - ) + setCookie(OAUTH_STATE_COOKIE, signed({ state, verifier }), { + httpOnly: true, + secure: true, + sameSite: 'lax', + path: '/', + maxAge: 600, + }) throw redirect({ href: @@ -349,7 +344,7 @@ See [Execution Model: Module-Level `process.env` Reads](./execution-model.md#mod ## See Also - [Authentication Overview](./authentication-overview.md) — choosing between partner solutions, OSS libraries, and DIY. -- [Authenticated Routes (Router)](../../../../router/guide/authenticated-routes.md) — the routing-side guide. +- [Authenticated Routes (Router)](/router/latest/docs/framework/react/guide/authenticated-routes) — the routing-side guide. - [Server Functions](./server-functions.md) — the RPC primitive that auth lives inside. - [Middleware](./middleware.md) — composing `authMiddleware`. - [OWASP Cheat Sheets — Authentication](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html), [Session Management](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html), [CSRF](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html). diff --git a/docs/start/framework/react/guide/authentication.md b/docs/start/framework/react/guide/authentication.md index da839e1fbe..c77c681ee0 100644 --- a/docs/start/framework/react/guide/authentication.md +++ b/docs/start/framework/react/guide/authentication.md @@ -1,11 +1,12 @@ --- id: authentication -title: Authentication +title: Implement Authentication in React +description: Implement sessions, sign-in, sign-out, protected routes, and server-side authorization in a TanStack Start React app. --- -This guide covers authentication patterns and shows how to implement your own authentication system with TanStack Start. +Implement the authentication workflow in your React app, from sessions and sign-in to protected routes and authorization. -> **📋 Before You Start:** Check our [Authentication Overview](./authentication-overview.md) for all available options including partner solutions and hosted services. +To compare libraries and hosted services, read [Choose Authentication for React Apps](./authentication-overview.md). ## Authentication Approaches @@ -34,7 +35,7 @@ Authentication involves many considerations including password security, session - **Authentication**: Who is this user? (Login/logout) - **Authorization**: What can this user do? (Permissions/roles) -TanStack Start provides the tools for both through server functions, sessions, and route protection. +TanStack Start provides server functions, request and cookie utilities, and route protection. Session storage and authentication come from your application or a library you choose. > Protect the data/API boundary first. Any server function, server route, or other API endpoint that returns or mutates private data must authorize the request itself. `beforeLoad` is useful for route UX: it keeps users out of screens they cannot use and avoids triggering work that would fail anyway. It is not the security boundary for the data. See [Authentication Server Primitives](./authentication-server-primitives.md) for the server-side pattern. @@ -47,6 +48,7 @@ Server functions handle sensitive authentication logic securely on the server: ```tsx import { createServerFn } from '@tanstack/react-start' import { redirect } from '@tanstack/react-router' +import { getAppSession } from '~/utils/session' // Login server function export const loginFn = createServerFn({ method: 'POST' }) @@ -60,11 +62,9 @@ export const loginFn = createServerFn({ method: 'POST' }) } // Create session - const session = await useAppSession() - await session.update({ - userId: user.id, - email: user.email, - }) + const session = await getAppSession() + session.userId = user.id + await session.save() // Redirect to protected area throw redirect({ to: '/dashboard' }) @@ -72,98 +72,131 @@ export const loginFn = createServerFn({ method: 'POST' }) // Logout server function export const logoutFn = createServerFn({ method: 'POST' }).handler(async () => { - const session = await useAppSession() - await session.clear() + const session = await getAppSession() + session.destroy() throw redirect({ to: '/' }) }) // Get current user export const getCurrentUserFn = createServerFn({ method: 'GET' }).handler( async () => { - const session = await useAppSession() - const userId = session.data.userId + const session = await getAppSession() + const userId = session.userId if (!userId) { return null } - return await getUserById(userId) + const user = await getUserById(userId) + return user ? { id: user.id, email: user.email, role: user.role } : null }, ) ``` ### 2. Session Management -TanStack Start provides secure HTTP-only cookie sessions: +Start does not provide a session API. This guide uses iron-session for encrypted cookie sessions. Start's cookie helpers connect it to server functions, server routes, and request middleware. + +For encrypted cookie sessions, install [iron-session](https://github.com/vvo/iron-session): + +```sh +pnpm add iron-session +``` + +This example uses iron-session 9's cookie adapter. Its Node runtime requires Node 22.13 or newer; check the library's runtime requirements for other deployment targets. ```tsx -// utils/session.ts -import { useSession } from '@tanstack/react-start/server' +// utils/session.ts — import only from server code +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/react-start/server' type SessionData = { - userId?: string - email?: string - role?: string + userId: string + oauthState: string } -export function useAppSession() { - return useSession({ - // Session configuration - name: 'app-session', - password: process.env.SESSION_SECRET!, // At least 32 characters - // Optional: customize cookie settings - cookie: { - secure: process.env.NODE_ENV === 'production', - sameSite: 'lax', - httpOnly: true, +export function getAppSession(ttl = 7 * 24 * 60 * 60) { + const password = process.env.SESSION_SECRET + if (!password || password.length < 32) { + throw new Error('SESSION_SECRET must be at least 32 characters') + } + + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'app-session', + password, + ttl, + cookieOptions: { + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + httpOnly: true, + path: '/', + }, }, - }) + ) } ``` +Read fields directly from the returned session, change them, then `await session.save()` before returning or redirecting. Missing or expired sessions have no user ID. `session.destroy()` removes the browser cookie. Keep one session object for the operation; another call to `getAppSession()` reads the incoming request again. For middleware, pass that object through request context when downstream code needs the same mutations. + +The `getAppSession` helper belongs to your application. Start does not cache sessions, choose expiration rules, or synchronize concurrent writes. Keep secrets and session objects in server code, and read request-specific configuration inside the active request. + ### 3. Authentication Context -Share authentication state across your application: +Load the current user in your root route's `beforeLoad` so the initial server render and child routes receive the same authentication state. `useServerFn` returns a callable function, not an object with `data`, `isLoading`, or `refetch`. You can call a server function directly from `beforeLoad`. + +Merge this pattern into your existing root route, keeping its metadata and document shell: ```tsx -// contexts/auth.tsx -import { createContext, useContext, ReactNode } from 'react' -import { useServerFn } from '@tanstack/react-start' +// routes/__root.tsx +import { + createRootRoute, + HeadContent, + Outlet, + Scripts, +} from '@tanstack/react-router' +import type { ReactNode } from 'react' import { getCurrentUserFn } from '../server/auth' -type User = { - id: string - email: string - role: string -} - -type AuthContextType = { - user: User | null - isLoading: boolean - refetch: () => void -} - -const AuthContext = createContext(undefined) - -export function AuthProvider({ children }: { children: ReactNode }) { - const { data: user, isLoading, refetch } = useServerFn(getCurrentUserFn) +export const Route = createRootRoute({ + headers: () => ({ 'Cache-Control': 'private, no-store' }), + beforeLoad: async () => ({ user: await getCurrentUserFn() }), + component: Outlet, + shellComponent: RootDocument, +}) +function RootDocument({ children }: { children: ReactNode }) { return ( - - {children} - + + + + + + {children} + + + ) } +``` -export function useAuth() { - const context = useContext(AuthContext) - if (!context) { - throw new Error('useAuth must be used within AuthProvider') - } - return context +The root includes session-specific data, so its responses use `Cache-Control: private, no-store`. Keep that policy on child routes that render this data, and do not override it with public caching at your CDN. + +Read that state from a descendant component: + +```tsx +// components/AuthStatus.tsx +import { Route } from '../routes/__root' + +export function AuthStatus() { + const { user } = Route.useRouteContext() + return {user ? user.email : 'Signed out'} } ``` +After login or logout changes the session, call `await router.invalidate()` to reload the current user and rerun route guards. Keep private-data authorization in the server function itself, even when a route already checks the user. + ### 4. Route Protection Protect routes using `beforeLoad`: @@ -240,8 +273,9 @@ export const registerFn = createServerFn({ method: 'POST' }) }) // Create session - const session = await useAppSession() - await session.update({ userId: user.id }) + const session = await getAppSession() + session.userId = user.id + await session.save() return { success: true, user: { id: user.id, email: user.email } } }) @@ -309,8 +343,9 @@ export const initiateOAuthFn = createServerFn({ method: 'POST' }) const state = generateRandomState() // Store state in session for CSRF protection - const session = await useAppSession() - await session.update({ oauthState: state }) + const session = await getAppSession() + session.oauthState = state + await session.save() // Generate OAuth URL const authUrl = generateOAuthUrl(provider, state) @@ -373,21 +408,9 @@ const hashedPassword = await bcrypt.hash(password, saltRounds) ### 2. Session Security -```tsx -// Use secure session configuration -export function useAppSession() { - return useSession({ - name: 'app-session', - password: process.env.SESSION_SECRET!, // 32+ characters - cookie: { - secure: process.env.NODE_ENV === 'production', // HTTPS only in production - sameSite: 'lax', // CSRF protection - httpOnly: true, // XSS protection - maxAge: 7 * 24 * 60 * 60, // 7 days - }, - }) -} -``` +Set the library's server-validated expiration as well as appropriate cookie attributes. In the iron-session example, `ttl` limits a sealed credential's lifetime from its latest save; saving again renews it. A numeric `cookieOptions.maxAge` controls browser retention. In iron-session 9, explicitly setting `maxAge: undefined` also disables seal expiry; omit the property to use the configured `ttl`. Use an application-validated timestamp or a server-side record if you also need an absolute lifetime that writes cannot extend. + +Use `httpOnly`, `sameSite`, and `path` deliberately, and require `secure: true` on HTTPS deployments. These cookie attributes complement server-side authorization and CSRF protections. Keep only the minimum session data and load current account permissions from their authoritative store. Logout removes a stateless cookie from the current browser; it cannot revoke a copy without server-side state. ### 3. Rate Limiting @@ -489,28 +512,69 @@ describe('Authentication Flow', () => { ### Loading States +Call the function returned by `useServerFn` with `{ data }`. Track pending state in the component, handle invalid credentials, and refresh route context after a successful login. This form uses the `loginFn` from the server-functions example above. It requires JavaScript, so the fields stay disabled until hydration; `method="post"` also prevents credentials appearing in a native GET submission. + ```tsx -function LoginForm() { +// components/LoginForm.tsx +import { useState } from 'react' +import type { FormEvent } from 'react' +import { useHydrated, useRouter } from '@tanstack/react-router' +import { useServerFn } from '@tanstack/react-start' +import { loginFn } from '../server/auth' + +export function LoginForm() { + const hydrated = useHydrated() const [isLoading, setIsLoading] = useState(false) - const loginMutation = useServerFn(loginFn) + const [error, setError] = useState('') + const login = useServerFn(loginFn) + const router = useRouter() + + const handleSubmit = async (event: FormEvent) => { + event.preventDefault() + const formData = new FormData(event.currentTarget) + const email = formData.get('email') + const password = formData.get('password') + if (typeof email !== 'string' || typeof password !== 'string') { + return + } - const handleSubmit = async (data: LoginData) => { setIsLoading(true) + setError('') try { - await loginMutation.mutate(data) - } catch (error) { - // Handle error + const result = await login({ data: { email, password } }) + if (result?.error) { + setError(result.error) + return + } + await router.invalidate() + } catch { + setError('Login failed. Please try again.') } finally { setIsLoading(false) } } return ( - - {/* Form fields */} - + +
+ + + +
+

{error}

) } @@ -525,16 +589,14 @@ export const loginFn = createServerFn({ method: 'POST' }) ) .handler(async ({ data }) => { const user = await authenticateUser(data.email, data.password) - if (!user) return { error: 'Invalid credentials' } + if (!user) { + return { error: 'Invalid credentials' } + } - const session = await useAppSession() - await session.update( - { userId: user.id }, - { - // Extend session if remember me is checked - maxAge: data.rememberMe ? 30 * 24 * 60 * 60 : undefined, // 30 days vs session - }, - ) + const ttl = data.rememberMe ? 30 * 24 * 60 * 60 : 8 * 60 * 60 + const session = await getAppSession(ttl) + session.userId = user.id + await session.save() return { success: true } }) @@ -562,7 +624,6 @@ If you're migrating from client-side authentication (localStorage, context only) ### From Other Frameworks - **Next.js**: Replace API routes with server functions, migrate NextAuth sessions -- **Remix**: Convert loaders/actions to server functions, adapt session patterns - **SvelteKit**: Move form actions to server functions, update route protection ## Production Considerations diff --git a/docs/start/framework/react/guide/cdn-asset-urls.md b/docs/start/framework/react/guide/cdn-asset-urls.md index 28c9c8c030..ac5f3e7b57 100644 --- a/docs/start/framework/react/guide/cdn-asset-urls.md +++ b/docs/start/framework/react/guide/cdn-asset-urls.md @@ -3,8 +3,6 @@ id: cdn-asset-urls title: CDN Asset URLs --- -# CDN Asset URLs - > **Experimental:** `transformAssets` is experimental and subject to change. Use this guide when you need TanStack Start to rewrite manifest-managed asset URLs at runtime. The most common use case is serving JavaScript and CSS from a CDN whose origin is known only when the server starts, or varies per request. diff --git a/docs/start/framework/react/guide/client-entry-point.md b/docs/start/framework/react/guide/client-entry-point.md index 02d0ecd426..3d81a13ac2 100644 --- a/docs/start/framework/react/guide/client-entry-point.md +++ b/docs/start/framework/react/guide/client-entry-point.md @@ -3,8 +3,6 @@ id: client-entry-point title: Client Entry Point --- -# Client Entry Point - > [!NOTE] > The client entry point is **optional** out of the box. If not provided, TanStack Start will automatically handle the client entry point for you using the below as a default. diff --git a/docs/start/framework/react/guide/databases.md b/docs/start/framework/react/guide/databases.md index cbafa13f51..774a9df61b 100644 --- a/docs/start/framework/react/guide/databases.md +++ b/docs/start/framework/react/guide/databases.md @@ -1,6 +1,7 @@ --- id: databases title: Databases +description: Connect a database to TanStack Start through server functions and server routes, and compare supported database providers. --- Databases are at the core of any dynamic application, providing the necessary infrastructure to store, retrieve, and manage data. TanStack Start makes it easy to integrate with a variety of databases, offering a flexible approach to managing your application's data layer. diff --git a/docs/start/framework/react/guide/deferred-hydration.md b/docs/start/framework/react/guide/deferred-hydration.md index 1dc4760fa7..ba07d65b24 100644 --- a/docs/start/framework/react/guide/deferred-hydration.md +++ b/docs/start/framework/react/guide/deferred-hydration.md @@ -244,7 +244,7 @@ chunks only exist when `split` is enabled, so TypeScript rejects strategy-form Use procedural prefetch when you need custom work: ```tsx -import { useQueryClient } from '@tanstack/react-query' +import { noop, useQueryClient } from '@tanstack/react-query' import { Hydrate } from '@tanstack/react-start' import { visible } from '@tanstack/react-start/hydration' @@ -255,8 +255,10 @@ function DeferredReviews() { { - await preload() - await queryClient.prefetchQuery(reviewsQueryOptions) + await Promise.all([ + preload(), + queryClient.query(reviewsQueryOptions).catch(noop), + ]) }} > diff --git a/docs/start/framework/react/guide/early-hints.md b/docs/start/framework/react/guide/early-hints.md index da633a84d7..2341215022 100644 --- a/docs/start/framework/react/guide/early-hints.md +++ b/docs/start/framework/react/guide/early-hints.md @@ -3,8 +3,6 @@ id: early-hints title: Early Hints --- -# Early Hints - > **Experimental:** Early Hints are experimental and subject to change. HTTP `103 Early Hints` lets your server tell the browser about important resources before the final HTML response is ready. TanStack Start can collect route assets and route `head().links`, then call your server entry so your runtime can send `103` responses. @@ -166,6 +164,7 @@ Static Early Hints are collected from the final Start manifest resolved for the - CDN URL rewrites are reflected in Early Hints. - `crossOrigin` returned from `transformAssets` is reflected in Early Hints. - JavaScript hints follow the client output format: `modulepreload` for module output, or `preload; as=script` for IIFE output. +- JavaScript hints carry `fetchpriority=low`, matching the generated HTML preload links, so they don't compete with render-blocking stylesheets. - Per-request transforms with `cache: false` are reflected in Early Hints for that request. - Inlined CSS assets are skipped when Start's [CSS inlining](./css-styling#inline-route-css-in-production) build option inlines them into the HTML. diff --git a/docs/start/framework/react/guide/environment-functions.md b/docs/start/framework/react/guide/environment-functions.md index f472a3a26a..94fbb52501 100644 --- a/docs/start/framework/react/guide/environment-functions.md +++ b/docs/start/framework/react/guide/environment-functions.md @@ -121,3 +121,37 @@ Environment functions are tree-shaken based on the environment for each bundle p Functions created using `createIsomorphicFn()` are tree-shaken. All codes inside `.client()` are not included in server bundle, and vice-versa. On the server, functions created using `createClientOnlyFn()` are replaced with a function that throws an `Error` on the server. The reverse is true for `createServerOnlyFn` functions on the client. + +## Troubleshooting + +### A loader works on refresh but throws during navigation + +If a loader throws `createServerOnlyFn() functions can only be called on the server!` after clicking a link, check whether it calls a server-only helper directly. Route loaders also run in the browser during client navigation. `createServerOnlyFn` guards a local function, it does not send a request to the server. + +Wrap the server work in `createServerFn` and call that function from the loader: + +```tsx +import { createFileRoute } from '@tanstack/react-router' +import { createServerFn, createServerOnlyFn } from '@tanstack/react-start' + +const readOnlyOnServer = createServerOnlyFn(() => 'Read on the server') +const readThroughRpc = createServerFn().handler(() => readOnlyOnServer()) + +export const Route = createFileRoute('/example')({ + loader: () => readThroughRpc(), +}) +``` + +The server function runs directly during SSR and makes a request to the server when called in the browser. Test both a direct page request and navigation from another route. A successful refresh alone does not exercise the browser loader. + +The [execution-boundary tests](https://github.com/TanStack/router/blob/main/e2e/react-start/basic/tests/environment-functions.spec.ts) include the failing direct call and the working server-function version. See [Server Functions](./server-functions.md) for validation and middleware when the function accepts user input. + +### Browser code throws `window is not defined` on the server + +This means browser-only code ran during server execution. Use the stack trace to find the first application or dependency module that reads `window`, `document`, or another browser API. + +For a browser-only component, render it inside `ClientOnly` from `@tanstack/react-router` with a useful fallback. The Start compiler removes its children from the server bundle, which lets the bundler remove imports used only by those children. The [ClientOnly example](https://github.com/TanStack/router/blob/main/e2e/react-start/basic/src/routes/client-only.tsx) covers a component that reads `window` at module scope, and its [tests](https://github.com/TanStack/router/blob/main/e2e/react-start/basic/tests/client-only.spec.ts) check the server fallback and hydrated content. + +A browser API used elsewhere, such as a route loader or server function, still needs the correct execution boundary. Move component side effects into an effect or event handler. For logic that needs different server and browser implementations, use `createIsomorphicFn` with both implementations. Wrapping a function in `createClientOnlyFn` does not defer its call until the browser, calling that wrapper on the server throws the client-only guard error instead. + +If the stack points into build tooling or the error persists in a minimal app with the correct boundary, include that app and the installed Start and bundler versions in a [bug report](https://github.com/TanStack/router/issues/new/choose). A compiler or dependency bug needs a reproducible fix, not a blanket change to rendering mode. diff --git a/docs/start/framework/react/guide/hosting.md b/docs/start/framework/react/guide/hosting.md index aa1806c6bf..2d02f881b3 100644 --- a/docs/start/framework/react/guide/hosting.md +++ b/docs/start/framework/react/guide/hosting.md @@ -1,6 +1,7 @@ --- id: hosting title: Hosting +description: Deploy TanStack Start with Vite or Rsbuild using hosting guides for Cloudflare, Netlify, Railway, Vercel, Node.js, and other runtimes. --- Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the world. TanStack Start supports Vite and Rsbuild, giving you flexible build outputs for different hosting providers and runtimes. @@ -115,6 +116,32 @@ Deploy your application to Cloudflare Workers using their one-click deployment p A full TanStack Start example for Cloudflare Workers is available [here](https://github.com/TanStack/router/tree/main/examples/react/start-basic-cloudflare). +#### Deployment fails even though the Vite build succeeds + +If Wrangler reports a missing server entry or unresolved Start virtual modules, check whether your deployment command passes `--config wrangler.jsonc`. With the Cloudflare Vite plugin, that file is the build input. The plugin generates a deployment config with the built server entry and client assets, then writes `.wrangler/deploy/config.json` so Wrangler can find it. Forcing Wrangler to read the source config bypasses that redirect. + +Run these commands from the application directory to validate the generated deployment without publishing: + +```sh +pnpm run build +pnpm exec wrangler deploy --dry-run +``` + +Check that Wrangler reports the generated config under `dist`, rather than just the source `wrangler.jsonc`. Keep the source `main` set to `@tanstack/react-start/server-entry` or your custom server entry, and let the Vite plugin generate the deployment entry. Marking unresolved Start modules as external does not fix the missing build transformation. + +If your build and deployment run in separate jobs, preserve the build output and `.wrangler/deploy/config.json` with their relative paths, or explicitly pass the generated deployment config. Do not edit generated files to repair the source configuration. See Cloudflare's [generated configuration documentation](https://developers.cloudflare.com/workers/wrangler/configuration/#generated-configuration) for how Wrangler finds that output. + +For a named Cloudflare environment, select it when building. For example, if `env.staging` is defined in your source config: + +```sh +CLOUDFLARE_ENV=staging pnpm run build +pnpm exec wrangler deploy --dry-run +``` + +The plugin resolves the environment into the generated config. A later `wrangler deploy --env staging` does not select a different built environment. See [Cloudflare environments](https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/). + +The [Cloudflare fixture tests](https://github.com/TanStack/router/blob/main/e2e/react-start/basic-cloudflare/tests/app.spec.ts) exercise a generated-config dry run and preview the built app locally. A dry run validates packaging, it does not verify account permissions, a live domain, or deployed bindings. + ### Netlify ⭐ _Official Partner_
@@ -474,7 +501,7 @@ In your Appwrite project, navigate to the **Sites** page from the sidebar. Click 3. Confirm the build settings: - **Install command:** `npm install` - **Build command:** `npm run build` - - **Output directory:** `./dist` (if you're using Nitro v2 or v3, this should be `./.output`) + - **Output directory:** `./dist` (if you're using Nitro, this should be `./.output`) 4. Add any required **environment variables** 5. Click **Deploy** diff --git a/docs/start/framework/react/guide/import-protection.md b/docs/start/framework/react/guide/import-protection.md index 8bf47c729a..451d405f81 100644 --- a/docs/start/framework/react/guide/import-protection.md +++ b/docs/start/framework/react/guide/import-protection.md @@ -3,8 +3,6 @@ id: import-protection title: Import Protection --- -> **Experimental:** Import protection is experimental and subject to change. - Import protection prevents server-only code from leaking into client bundles and client-only code from leaking into server bundles. It runs inside TanStack Start and is enabled by default. ## How It Works diff --git a/docs/start/framework/react/guide/isr.md b/docs/start/framework/react/guide/isr.md index 5704af1a11..98007d3f15 100644 --- a/docs/start/framework/react/guide/isr.md +++ b/docs/start/framework/react/guide/isr.md @@ -492,5 +492,5 @@ Track key metrics: - [Static Prerendering](./static-prerendering.md) - Build-time page generation - [Hosting](./hosting.md) - CDN deployment configurations - [Server Functions](./server-functions.md) - Creating dynamic data endpoints -- [Data Loading](../../../../router/guide/data-loading.md) - Client-side cache control +- [Data Loading](/router/latest/docs/guide/data-loading) - Client-side cache control - [Middleware](./middleware.md) - Request/response customization diff --git a/docs/start/framework/react/guide/nativescript.md b/docs/start/framework/react/guide/nativescript.md deleted file mode 100644 index aff3c5a850..0000000000 --- a/docs/start/framework/react/guide/nativescript.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -id: nativescript -title: NativeScript ---- - -TanStack Start can compile the React client side of a Start app for NativeScript -while the normal Start server remains deployed as the server-function host. -Route definitions, loaders, params, search state, and server functions are -shared with the web client. Screen rendering uses native iOS and Android views. - -Read the [Router NativeScript integration](../../../../router/integrations/nativescript.md) -for native stack behavior and route options. - -## Initialize - -From a React Start app: - -```sh -npx @tanstack/router-cli@latest native init -``` - -The generated development scripts start the Start server and NativeScript app -together: - -```sh -npm run native:ios -npm run native:android -``` - -NativeScript Vite 2.0.3 does not register an HMR server for React, so these -scripts use `ns debug --no-hmr`. Source changes rebuild and restart the native -app instead of hot-patching it. - -The Android emulator reaches the host server through `10.0.2.2`. The iOS -simulator uses `127.0.0.1`. A physical device needs a reachable LAN or deployed -URL. - -## Compiler setup - -The generated `vite.native.config.ts` composes NativeScript React with Start's -standalone native client compiler: - -```ts -import { reactConfig } from '@nativescript/vite/react' -import { tanstackStartNativeScript } from '@tanstack/react-start/plugin/nativescript' -import { defineConfig, mergeConfig } from 'vite' - -export default defineConfig(({ mode }) => - mergeConfig(reactConfig({ mode }), { - plugins: [ - tanstackStartNativeScript({ - serverFnBase: - mode === 'production' - ? process.env.TSS_SERVER_FN_BASE! - : 'http://127.0.0.1:3000/_serverFn/', - serverFnMode: mode === 'production' ? 'build' : 'dev', - nativeRootRoute: 'src/native/root-route.tsx', - }), - ], - }), -) -``` - -`serverFnBase` must be an absolute HTTP or HTTPS URL ending at the Start -server-function endpoint. A production app must use the deployed server URL; -the compiler rejects a relative URL. - -The plugin performs three jobs: - -- generates the shared React route tree -- applies the NativeScript renderer and `-native` module resolver -- runs Start's client transform with the same deterministic server-function IDs - used by the deployed Start server - -Server handler bodies are removed from the native client bundle and replaced -with RPC calls. - -## Native entry - -Initialize Start's native fetch behavior before mounting the router: - -```tsx title="src/native/index.tsx" -import { startNativeScriptApp } from '@tanstack/react-nativescript-router' -import { configureNativeScriptStart } from '@tanstack/react-start/nativescript' -import { getRouter } from '../router' - -void startNativeScriptApp({ - router: getRouter(), - initialize: () => configureNativeScriptStart(), -}) -``` - -`configureNativeScriptStart` installs a native-safe server-function fetch -wrapper, including the `Origin` header expected by Start's CSRF validation. - -## Server functions - -No native-specific server-function definition is required: - -```ts -import { createServerFn } from '@tanstack/react-start' - -export const getAccount = createServerFn({ method: 'GET' }).handler(async () => - loadAccount(), -) -``` - -The web build keeps normal Start behavior. In the NativeScript build, app -imports of `@tanstack/react-start` resolve to the native client entry and calls -are sent to `serverFnBase`. - -## Production builds - -Set the deployed endpoint before invoking a generated build script: - -```sh -TSS_SERVER_FN_BASE=https://app.example.com/_serverFn/ npm run native:build:ios -TSS_SERVER_FN_BASE=https://app.example.com/_serverFn/ npm run native:build:android -``` - -The generated scripts pass NativeScript's `--release` flag. Android release -builds require all four `--key-store-*` options, which can be appended after -`npm run native:build:android --`. Add `--for-device` and the appropriate iOS -signing options when producing an iOS device build. - -NativeScript platform signing, App Store configuration, Android manifests, and -device permissions remain standard NativeScript responsibilities. The -initializer copies the official NativeScript iOS and Android resource template -as a starting point. diff --git a/docs/start/framework/react/guide/path-aliases.md b/docs/start/framework/react/guide/path-aliases.md index ff9735df83..bd75dc01ed 100644 --- a/docs/start/framework/react/guide/path-aliases.md +++ b/docs/start/framework/react/guide/path-aliases.md @@ -26,9 +26,7 @@ After updating your `tsconfig.json` file, configure your build tool so it resolv # Vite -## Vite 8 - -Vite 8+ has [built-in support for path aliases](https://vite.dev/config/shared-options#resolve-tsconfigpaths), which is disabled by default. To enable it, simply add the following configuration to your `vite.config.ts` file: +Vite has [built-in support for path aliases](https://vite.dev/config/shared-options#resolve-tsconfigpaths), which is disabled by default. To enable it, add the following configuration to your `vite.config.ts` file: ```ts // vite.config.ts @@ -42,31 +40,6 @@ export default defineConfig({ }) ``` -## Vite 7 and earlier - -For Vite 7 and earlier, install the `vite-tsconfig-paths` plugin to enable path aliases in your TanStack Start project. You can do this by running the following command: - -```sh -npm install -D vite-tsconfig-paths -``` - -Now, you'll need to update your `vite.config.ts` file to include the following: - -```ts -// vite.config.ts -import { defineConfig } from 'vite' -import viteTsConfigPaths from 'vite-tsconfig-paths' - -export default defineConfig({ - plugins: [ - // this is the plugin that enables path aliases - viteTsConfigPaths({ - projects: ['./tsconfig.json'], - }), - ], -}) -``` - # Rsbuild Rsbuild reads the `paths` field from `tsconfig.json` by default. No extra config is needed when your aliases live in the root `tsconfig.json`. diff --git a/docs/start/framework/react/guide/production-checklist.md b/docs/start/framework/react/guide/production-checklist.md new file mode 100644 index 0000000000..b46cd70f2e --- /dev/null +++ b/docs/start/framework/react/guide/production-checklist.md @@ -0,0 +1,42 @@ +--- +id: production-checklist +title: Production Checklist +description: Check a TanStack Start production build for secret exposure, authorization, cache isolation, HTTP status codes, SEO, assets, logging, and deployment failures. +--- + +Run these checks against the production build and again through your public hostname. A passing development server does not verify your deployment adapter, runtime environment, or CDN. + +## Secrets and server boundaries + +- [ ] **Check required environment variables at runtime.** Start the production server with the same variable names and runtime bindings as your host. Missing configuration should fail clearly before it serves dependent requests. Look for undefined credentials, connections to a development database, or values that only existed during the build. See [Environment Variables](./environment-variables). +- [ ] **Keep secrets out of browser output.** Build with a harmless, unique test secret and search the emitted client files, source maps you publish, and response bodies for that value. Do not use a real secret for this check. A match means a value crossed the server boundary, even if its variable name lacks `VITE_`. Check server-function return values as well as imports. See [Environment Variables](./environment-variables#security-best-practices) and [Import Protection](./import-protection). + +## Authorization and mutations + +- [ ] **Test endpoints directly.** Record a private read and write, then repeat them while signed out and as a different account. Both must reject unauthorized access without changing data. A redirect in `beforeLoad` does not protect a separately callable endpoint. See [Authentication Server Primitives](./authentication-server-primitives#protect-data-first). +- [ ] **Exercise session expiry and sign-out.** Reload a private page, expire its session, sign out, and revisit it. Confirm the cookie's HTTPS flags and that old account data disappears from browser caches. Look for sessions that survive beyond your intended policy or another account's data appearing after switching accounts. See [Session Cookies](./authentication-server-primitives#session-cookies). +- [ ] **Reject invalid and cross-site writes.** Send malformed input and browser-like requests from an untrusted origin to each mutation entry point, including ordinary server-route forms. Use an authenticated test session for protected writes so an authentication failure cannot be mistaken for CSRF protection. Verify validation and your intended CSRF policy before any write occurs. Also test rapid or repeated submissions. A disabled button helps the interface, but the endpoint still needs its own checks. See [Authentication Server Primitives](./authentication-server-primitives) and [Server Functions](./server-functions). + +## Cache isolation and rendering + +- [ ] **Request the same private URL as two accounts concurrently.** Inspect each HTML response and any serialized loader or query data. Each response must contain only its own account's values. Repeat through the CDN and after a browser account switch. Shared personalized HTML or process-wide user caches are failures. See [Middleware](./middleware) and [Authentication Server Primitives](./authentication-server-primitives). +- [ ] **Check final cache headers and update behavior.** Use `Cache-Control: no-store` for personalized responses unless you have an explicit identity-partitioned cache key and lifecycle that prevents reuse across accounts. `private` alone does not prevent a browser cache from retaining one account's response after sign-out. For public cached content, perform a write and confirm it becomes visible within the freshness policy you chose. Inspect the final headers from your host, not just the values assigned in route code. Query invalidation, Router invalidation, and CDN invalidation affect different caches. See [Server Routes](./server-routes) and [Static Prerendering](./static-prerendering). +- [ ] **Compare a direct visit with client navigation.** Test initial HTML, hydration, back/forward navigation, and a reload for a parameterized route and a route with search values. Missing content, mismatched metadata, hydration warnings, or repeated immediate reads need investigation. See [Hydration Errors](./hydration-errors) and [Routing](./routing). + +## HTTP responses and search visibility + +- [ ] **Probe success, missing, redirect, and error responses.** A real missing public resource should return HTTP 404, a moved URL should use its intended redirect, and a failed request should not masquerade as a successful page. Check status codes before following redirects. Test a controlled failure in staging and confirm the error interface offers recovery without leaking sensitive details. See [Server Routes](./server-routes), [Error Boundaries](./error-boundaries), and [Router Not Found Errors](/router/latest/docs/guide/not-found-errors). +- [ ] **Inspect public HTML before JavaScript runs.** Verify useful content, a specific title and description, the public canonical URL, and relevant social metadata. Repeat after client navigation. Look for preview hostnames in canonicals, duplicate titles, or metadata that depends on a browser effect. See [SEO](./seo). +- [ ] **Check indexing rules and discovery files.** Fetch `robots.txt` and the sitemap from the deployed hostname. Sitemap URLs should resolve to intended public canonical pages. Remove accidental production `noindex` rules, but keep private and preview content out of search. Robots rules are not access control. See [SEO](./seo#sitemaps). + +## Assets, logging, and deployment + +- [ ] **Inspect the production network waterfall.** Test a representative page on a narrow viewport with slower network and CPU settings. Check large images, missing dimensions, font loading, third-party scripts, and failed asset requests. Record a baseline so later releases have something to compare against. Local lab results do not establish real-user performance. See [SEO performance guidance](./seo#performance-matters), [CDN Asset URLs](./cdn-asset-urls), and [Observability](./observability). +- [ ] **Trigger and find a controlled error.** Confirm your chosen logs or error service receive it with enough route and release context to investigate. Check that credentials, cookies, and sensitive payloads are absent. An error boundary that only changes the screen is not evidence of a working alert. See [Observability](./observability). +- [ ] **Run the deployed entry point and rehearse rollback.** Use your adapter's production output and start command, then test a direct deep link, a static asset, a server function, and a server route. Check that requests still work after a restart. Rehearse restoring a previous release and account for any database migration separately. Local success cannot prove host bindings, asset retention, or database rollback safety. See [Hosting](./hosting). + +## Keep a release record + +Record the tested commit, runtime, hostname, commands, and results. Turn repeatable HTTP and browser checks into CI tests; repeat host-specific checks after deployment changes. + +The [Next.js migration reference](../examples/start-next-migration) provides production browser checks for public HTML and metadata, search, redirects, missing pages, session reloads, and protected mutations. Its demo credentials and cookie session are for local comparison, not a production authentication system. Use its tests as a starting point, then add your own authorization rules, external services, CDN behavior, and operational checks. diff --git a/docs/start/framework/react/guide/rendering-markdown.md b/docs/start/framework/react/guide/rendering-markdown.md index 4258d6f4f1..bf644124d9 100644 --- a/docs/start/framework/react/guide/rendering-markdown.md +++ b/docs/start/framework/react/guide/rendering-markdown.md @@ -3,191 +3,85 @@ id: rendering-markdown title: Rendering Markdown --- -This guide covers two methods for importing and rendering markdown content in your TanStack Start application: +Use [TanStack Markdown](https://tanstack.com/markdown/latest/docs/overview) to render Markdown in your TanStack Start application. Its React renderer works synchronously during server rendering and client navigation, so content does not need to wait for a client effect. -1. **Static markdown** with `content-collections` for build-time loading (e.g., blog posts) -2. **Dynamic markdown** fetched at runtime from GitHub or any remote source +This guide covers static posts loaded with Content Collections and remote content fetched through a server function. Both use the same Markdown component. -Both methods share a common rendering pipeline using the `unified` ecosystem. +## Rendering Markdown -## Setting Up the Markdown Processor - -Both approaches use the same markdown-to-HTML processing pipeline. First, install the required dependencies: +Install TanStack Markdown: ```bash -npm install unified remark-parse remark-gfm remark-rehype rehype-raw rehype-slug rehype-autolink-headings rehype-stringify shiki html-react-parser gray-matter +npm install @tanstack/markdown ``` -Create a markdown processor utility: - -```tsx -// src/utils/markdown.ts -import { unified } from 'unified' -import remarkParse from 'remark-parse' -import remarkGfm from 'remark-gfm' -import remarkRehype from 'remark-rehype' -import rehypeRaw from 'rehype-raw' -import rehypeSlug from 'rehype-slug' -import rehypeAutolinkHeadings from 'rehype-autolink-headings' -import rehypeStringify from 'rehype-stringify' - -export type MarkdownHeading = { - id: string - text: string - level: number -} - -export type MarkdownResult = { - markup: string - headings: Array -} - -export async function renderMarkdown(content: string): Promise { - const headings: Array = [] - - const result = await unified() - .use(remarkParse) // Parse markdown - .use(remarkGfm) // Support GitHub Flavored Markdown - .use(remarkRehype, { allowDangerousHtml: true }) // Convert to HTML AST - .use(rehypeRaw) // Process raw HTML in markdown - .use(rehypeSlug) // Add IDs to headings - .use(rehypeAutolinkHeadings, { - behavior: 'wrap', - properties: { className: ['anchor'] }, - }) - .use(() => (tree) => { - // Extract headings for table of contents - const { visit } = require('unist-util-visit') - const { toString } = require('hast-util-to-string') - - visit(tree, 'element', (node: any) => { - if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(node.tagName)) { - headings.push({ - id: node.properties?.id || '', - text: toString(node), - level: parseInt(node.tagName.charAt(1), 10), - }) - } - }) - }) - .use(rehypeStringify) // Serialize to HTML string - .process(content) - - return { - markup: String(result), - headings, - } -} -``` - -## Creating a Markdown Component - -Create a React component that renders the processed HTML with custom element handling: +Create a shared component that accepts either Markdown source or a parsed document: ```tsx // src/components/Markdown.tsx -import parse, { type HTMLReactParserOptions, Element } from 'html-react-parser' -import { renderMarkdown, type MarkdownResult } from '~/utils/markdown' +import { Markdown as ReactMarkdown } from '@tanstack/markdown/react' +import type { MarkdownDocument } from '@tanstack/markdown' type MarkdownProps = { - content: string + content: string | MarkdownDocument className?: string } export function Markdown({ content, className }: MarkdownProps) { - const [result, setResult] = useState(null) - - useEffect(() => { - renderMarkdown(content).then(setResult) - }, [content]) - - if (!result) { - return
Loading...
- } - - const options: HTMLReactParserOptions = { - replace: (domNode) => { - if (domNode instanceof Element) { - // Customize rendering of specific elements - if (domNode.name === 'a') { - // Handle links - const href = domNode.attribs.href - if (href?.startsWith('/')) { - // Internal link - use your router's Link component - return ( - {domToReact(domNode.children, options)} - ) - } - } - - if (domNode.name === 'img') { - // Add lazy loading to images - return ( - - ) - } - } - }, - } - - return
{parse(result.markup, options)}
+ return ( +
+ {content} +
+ ) } ``` -## Method 1: Static Markdown with content-collections +Headings receive stable IDs, and `headingAnchors` adds links to them. Raw HTML is escaped and unsafe URL protocols are removed by default. Keep these defaults for remote or user-written content. TanStack Markdown does not execute MDX or implement every CommonMark or GFM feature, so check the [supported syntax](https://tanstack.com/markdown/latest/docs/core-concepts/syntax-profile) when migrating existing content. -The `content-collections` package is ideal for static content like blog posts that are included in your repository. It processes markdown files at build time and provides type-safe access to the content. - -### Installation - -```bash -npm install @content-collections/core @content-collections/vite -``` - -### Configuration - -Create a `content-collections.ts` file in your project root: +Use the `components` prop to customize elements, for example to lazy-load images: ```tsx + , + }} +> + {content} + +``` + +The examples below use `~/*` for the `src/*` import alias. The `prose` class is optional and requires your own typography styles, such as Tailwind Typography. + +## Static Markdown with Content Collections + +[Content Collections](https://www.content-collections.dev/docs/quickstart/tanstack-start) loads local Markdown files and validates their frontmatter. Pass the Markdown body from the generated collection to the shared renderer. + +### Installation and Configuration + +```bash +npm install -D @content-collections/core @content-collections/vite zod +``` + +```ts // content-collections.ts import { defineCollection, defineConfig } from '@content-collections/core' -import matter from 'gray-matter' - -function extractFrontMatter(content: string) { - const { data, content: body, excerpt } = matter(content, { excerpt: true }) - return { data, body, excerpt: excerpt || '' } -} +import { z } from 'zod' const posts = defineCollection({ name: 'posts', - directory: './src/blog', // Directory containing your .md files + directory: './src/blog', include: '*.md', - schema: (z) => ({ + schema: z.object({ title: z.string(), - published: z.string().date(), - description: z.string().optional(), - authors: z.string().array(), + published: z.string().regex(/^\d{4}-\d{2}-\d{2}$/), + description: z.string(), + authors: z.array(z.string()), + content: z.string(), + }), + transform: (post) => ({ + ...post, + slug: post._meta.path, }), - transform: ({ content, ...post }) => { - const frontMatter = extractFrontMatter(content) - - // Extract header image (first image in the document) - const headerImageMatch = content.match(/!\[([^\]]*)\]\(([^)]+)\)/) - const headerImage = headerImageMatch ? headerImageMatch[2] : undefined - - return { - ...post, - slug: post._meta.path, - excerpt: frontMatter.excerpt, - description: frontMatter.data.description, - headerImage, - content: frontMatter.body, - } - }, }) export default defineConfig({ @@ -195,39 +89,55 @@ export default defineConfig({ }) ``` -### Vite Integration +Content Collections already separates frontmatter from `content`, so this transform does not need a second frontmatter parser. -Add the content-collections plugin to your Vite config: +Add the plugin to your existing Vite configuration, keeping any deployment plugins your app needs: -```tsx -// app.config.ts -import { defineConfig } from '@tanstack/react-start/config' +```ts +// vite.config.ts import contentCollections from '@content-collections/vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' +import { defineConfig } from 'vite' +import tsConfigPaths from 'vite-tsconfig-paths' export default defineConfig({ - vite: { - plugins: [contentCollections()], - }, + plugins: [ + contentCollections(), + tsConfigPaths({ projects: ['./tsconfig.json'] }), + tanstackStart(), + viteReact(), + ], }) ``` -### Creating Blog Posts +Add the generated collection alias to your existing `tsconfig.json`: -Create markdown files in your designated directory: +```json +{ + "compilerOptions": { + "paths": { + "~/*": ["./src/*"], + "content-collections": ["./.content-collections/generated"] + } + } +} +``` + +Add `.content-collections` to `.gitignore`. Starting the Vite dev server or running a build generates the collection. + +### Creating a Post + +Create `src/blog/hello-world.md`: ````markdown -## - -title: Hello World -published: 2024-01-15 -authors: - -- Jane Doe - description: My first blog post - --- - -![Hero Image](/images/hero.jpg) +title: Hello World +published: '2026-01-15' +description: My first blog post +authors: + - Jane Doe +--- Welcome to my blog! This is my first post. @@ -240,13 +150,11 @@ console.log('Hello, world!') ``` ```` -### Using the Collection - -Access your posts through the generated collection: +### Listing Posts ```tsx // src/routes/blog.index.tsx -import { createFileRoute } from '@tanstack/react-router' +import { createFileRoute, Link } from '@tanstack/react-router' import { allPosts } from 'content-collections' export const Route = createFileRoute('/blog/')({ @@ -254,31 +162,30 @@ export const Route = createFileRoute('/blog/')({ }) function BlogIndex() { - // Posts are sorted by published date - const sortedPosts = allPosts.sort( - (a, b) => new Date(b.published).getTime() - new Date(a.published).getTime(), + const sortedPosts = [...allPosts].sort((a, b) => + b.published.localeCompare(a.published), ) return ( -
+

Blog

    {sortedPosts.map((post) => (
  • -

    {post.title}

    -

    {post.excerpt}

    - {post.published} + {post.title} +

    {post.description}

    +
  • ))}
-
+ ) } ``` -### Rendering a Single Post +### Rendering a Post ```tsx // src/routes/blog.$slug.tsx @@ -288,7 +195,7 @@ import { Markdown } from '~/components/Markdown' export const Route = createFileRoute('/blog/$slug')({ loader: ({ params }) => { - const post = allPosts.find((p) => p.slug === params.slug) + const post = allPosts.find((post) => post.slug === params.slug) if (!post) { throw notFound() } @@ -302,202 +209,169 @@ function BlogPost() { return (
-
-

{post.title}

-

- By {post.authors.join(', ')} on {post.published} -

-
+

{post.title}

+

+ By {post.authors.join(', ')} on {post.published} +

) } ``` -## Method 2: Dynamic Markdown from Remote Sources +The renderer parses the Markdown synchronously and renders React elements on both the server and client. -For content stored externally (like GitHub repositories), you can fetch and render markdown dynamically using server functions. +## Remote Markdown with a Server Function -### Creating a Fetch Utility +Fetch remote content in a server function and parse it before returning it to the route. Install `gray-matter` if the remote files contain frontmatter: -```tsx -// src/utils/docs.server.ts +```bash +npm install gray-matter +``` + +Keep the repository, branch, and content directory in server code. Validate the requested filename before building the URL: + +```ts +// src/utils/docs.ts import { createServerFn } from '@tanstack/react-start' +import { notFound } from '@tanstack/react-router' +import { parseMarkdown } from '@tanstack/markdown/parser' import matter from 'gray-matter' -type FetchDocsParams = { - repo: string // e.g., 'tanstack/router' - branch: string // e.g., 'main' - filePath: string // e.g., 'docs/guide/getting-started.md' -} - export const fetchDocs = createServerFn({ method: 'GET' }) - .validator((params: FetchDocsParams) => params) - .handler(async ({ data: { repo, branch, filePath } }) => { - const url = `https://raw.githubusercontent.com/${repo}/${branch}/${filePath}` - - const response = await fetch(url, { - headers: { - // Add GitHub token for private repos or higher rate limits - // Authorization: `token ${process.env.GITHUB_TOKEN}`, - }, - }) + .validator((slug: unknown) => { + if (typeof slug !== 'string' || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) { + throw new Error('Invalid document slug') + } + return slug + }) + .handler(async ({ data: slug }) => { + // Replace this with your public repository's content directory. + const baseUrl = + 'https://raw.githubusercontent.com/your-org/your-repo/main/docs' + const response = await fetch(`${baseUrl}/${slug}.md`) + if (response.status === 404) { + throw notFound() + } if (!response.ok) { - throw new Error(`Failed to fetch: ${response.status}`) + throw new Error(`Failed to fetch document: ${response.status}`) } - const rawContent = await response.text() - const { data: frontmatter, content } = matter(rawContent) + const { data, content } = matter(await response.text()) return { - frontmatter, - content, - filePath, + title: typeof data.title === 'string' ? data.title : slug, + document: parseMarkdown(content), } }) ``` -### Adding Cache Headers - -For production, add appropriate cache headers: - ```tsx -export const fetchDocs = createServerFn({ method: 'GET' }) - .validator((params: FetchDocsParams) => params) - .handler(async ({ data: { repo, branch, filePath }, context }) => { - // Set cache headers for CDN caching - context.response.headers.set( - 'Cache-Control', - 'public, max-age=0, must-revalidate', - ) - context.response.headers.set( - 'CDN-Cache-Control', - 'max-age=300, stale-while-revalidate=300', - ) - - // ... fetch logic - }) -``` - -### Using Dynamic Markdown in Routes - -```tsx -// src/routes/docs.$path.tsx +// src/routes/docs.$slug.tsx import { createFileRoute } from '@tanstack/react-router' -import { fetchDocs } from '~/utils/docs.server' import { Markdown } from '~/components/Markdown' +import { fetchDocs } from '~/utils/docs' -export const Route = createFileRoute('/docs/$path')({ - loader: async ({ params }) => { - return fetchDocs({ - data: { - repo: 'your-org/your-repo', - branch: 'main', - filePath: `docs/${params.path}.md`, - }, - }) - }, +export const Route = createFileRoute('/docs/$slug')({ + loader: ({ params }) => fetchDocs({ data: params.slug }), component: DocsPage, }) function DocsPage() { - const { frontmatter, content } = Route.useLoaderData() + const { title, document } = Route.useLoaderData() return (
-

{frontmatter.title}

- +

{title}

+
) } ``` -### Fetching Directory Contents +Relative Markdown links and image URLs resolve against your app's URL, not the source repository. Use app-relative or absolute URLs in the content, or transform them for your site's route and asset layout. -To build navigation from a GitHub directory: +## Syntax Highlighting with TanStack Highlight -```tsx -// src/utils/docs.server.ts -type GitHubContent = { - name: string - path: string - type: 'file' | 'dir' -} +Install [TanStack Highlight](https://tanstack.com/highlight/latest/docs/overview). The Markdown adapter requires version `0.0.6` or newer: -export const fetchRepoContents = createServerFn({ method: 'GET' }) - .validator((params: { repo: string; branch: string; path: string }) => params) - .handler(async ({ data: { repo, branch, path } }) => { - const url = `https://api.github.com/repos/${repo}/contents/${path}?ref=${branch}` - - const response = await fetch(url, { - headers: { - Accept: 'application/vnd.github.v3+json', - // Authorization: `token ${process.env.GITHUB_TOKEN}`, - }, - }) - - if (!response.ok) { - throw new Error(`Failed to fetch contents: ${response.status}`) - } - - const contents: Array = await response.json() - - return contents - .filter((item) => item.type === 'file' && item.name.endsWith('.md')) - .map((item) => ({ - name: item.name.replace('.md', ''), - path: item.path, - })) - }) +```bash +npm install @tanstack/highlight ``` -## Adding Syntax Highlighting with Shiki +Register the languages your content uses and create the Markdown adapter: -For code blocks with syntax highlighting, integrate Shiki into your markdown processor: +```ts +// src/utils/markdown-highlighter.ts +import { createHighlighter } from '@tanstack/highlight/core' +import { js } from '@tanstack/highlight/languages/js' +import { plaintext } from '@tanstack/highlight/languages/plaintext' +import { ts } from '@tanstack/highlight/languages/ts' +import { tsx } from '@tanstack/highlight/languages/tsx' +import { createTanStackMarkdownHighlighter } from '@tanstack/highlight/markdown' -```tsx -// src/utils/markdown.ts -import { codeToHtml } from 'shiki' +const highlighter = createHighlighter({ + languages: [plaintext, js, ts, tsx], +}) -// Process code blocks after parsing -export async function highlightCode( - code: string, - language: string, -): Promise { - return codeToHtml(code, { - lang: language, - themes: { - light: 'github-light', - dark: 'tokyo-night', - }, - }) -} +export const highlightMarkdownCode = + createTanStackMarkdownHighlighter(highlighter) ``` -Then handle code blocks in your Markdown component: +Update the shared component to pass the highlighter and include its theme styles: ```tsx -// In your Markdown component's replace function -if (domNode.name === 'pre') { - const codeElement = domNode.children.find( - (child) => child instanceof Element && child.name === 'code', +// src/components/Markdown.tsx +import { createThemeCss } from '@tanstack/highlight/theme' +import { githubDarkTheme } from '@tanstack/highlight/themes/github-dark' +import { githubLightTheme } from '@tanstack/highlight/themes/github-light' +import { Markdown as ReactMarkdown } from '@tanstack/markdown/react' +import type { MarkdownDocument } from '@tanstack/markdown' +import { highlightMarkdownCode } from '~/utils/markdown-highlighter' + +const themeCss = createThemeCss({ + light: githubLightTheme, + dark: githubDarkTheme, + lightSelector: '.markdown-renderer', + darkSelector: '.dark .markdown-renderer', + codeBlockSelector: '.markdown-renderer pre.tm-code', + lineNumbersSelector: '.markdown-renderer .tm-code--line-numbers', +}) + +type MarkdownProps = { + content: string | MarkdownDocument + className?: string +} + +export function Markdown({ content, className }: MarkdownProps) { + return ( +
+ + + {content} + +
) - if (codeElement) { - const className = codeElement.attribs.class || '' - const language = className.replace('language-', '') || 'text' - const code = getText(codeElement) - - return - } } ``` -## Summary +The adapter returns escaped token markup inside the renderer's own `
` elements. Unknown languages fall back to plain text. Add a `dark` class to an ancestor to select the dark theme. See the [syntax highlighting guide](https://tanstack.com/markdown/latest/docs/guides/syntax-highlighting) for line numbers and highlighted lines.
 
-| Approach            | Best For                                  | Pros                                           | Cons                                      |
-| ------------------- | ----------------------------------------- | ---------------------------------------------- | ----------------------------------------- |
-| content-collections | Blog posts, static docs bundled with app  | Type-safe, build-time processing, fast runtime | Requires rebuild for content updates      |
-| Dynamic fetching    | External docs, frequently updated content | Always fresh, no rebuild needed                | Runtime overhead, requires error handling |
+## Table of Contents
 
-Choose the approach that best fits your content update frequency and deployment workflow. For hybrid scenarios, you can use both methods in the same application.
+To collect headings, add the docs preset when parsing the document:
+
+```ts
+import { docsMarkdownExtensions } from '@tanstack/markdown/extensions/docs'
+import { parseMarkdown } from '@tanstack/markdown/parser'
+
+const document = parseMarkdown(content, {
+  extensions: docsMarkdownExtensions(),
+})
+
+const headings = document.headings ?? []
+// Each heading has an id, text, and level.
+```
+
+Use this in the server function, then render links to each heading's `id`. The [docs preset guide](https://tanstack.com/markdown/latest/docs/guides/docs-preset) also covers callouts and custom comment components. Those features need the same extensions passed to the renderer.
diff --git a/docs/start/framework/react/guide/seo.md b/docs/start/framework/react/guide/seo.md
index 2d3e98757d..1a202503a8 100644
--- a/docs/start/framework/react/guide/seo.md
+++ b/docs/start/framework/react/guide/seo.md
@@ -1,6 +1,7 @@
 ---
 id: seo
 title: SEO
+description: Configure SEO in TanStack Start with page metadata, canonical URLs, structured data, server rendering, sitemaps, and robots.txt.
 ---
 
 > [!NOTE]
diff --git a/docs/start/framework/react/guide/server-components.md b/docs/start/framework/react/guide/server-components.md
index 893a633339..581ae145bd 100644
--- a/docs/start/framework/react/guide/server-components.md
+++ b/docs/start/framework/react/guide/server-components.md
@@ -74,7 +74,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild'
 
 export default defineConfig({
   plugins: [
-    pluginReact({ splitChunks: false }),
+    pluginReact(),
     tanstackStart({
       rsc: {
         enabled: true,
@@ -86,7 +86,7 @@ export default defineConfig({
 
 
 
-**Requirements:** React 19+, Vite 7+ or Rsbuild 2+
+**Requirements:** React 19+, Vite 8+ or Rsbuild 2+
 
 ## Quick Start
 
@@ -401,7 +401,10 @@ const postQueryOptions = (postId: string) => ({
 export const Route = createFileRoute('/posts/$postId')({
   loader: async ({ context, params }) => {
     // Prefetch during SSR - data reused on client without refetch
-    await context.queryClient.ensureQueryData(postQueryOptions(params.postId))
+    await context.queryClient.query({
+      ...postQueryOptions(params.postId),
+      staleTime: 'static',
+    })
   },
   component: PostPage,
 })
diff --git a/docs/start/framework/react/guide/server-entry-point.md b/docs/start/framework/react/guide/server-entry-point.md
index 5acc8ee550..5f74eb7846 100644
--- a/docs/start/framework/react/guide/server-entry-point.md
+++ b/docs/start/framework/react/guide/server-entry-point.md
@@ -3,38 +3,72 @@ id: server-entry-point
 title: Server Entry Point
 ---
 
-# Server Entry Point
-
 > [!NOTE]
-> The server entry point is **optional** out of the box. If not provided, TanStack Start will automatically handle the server entry point for you using the below as a default.
+> A custom server entry point is **optional**. Without one, TanStack Start uses its built-in entry, which renders requests and converts uncaught errors into HTTP responses automatically.
 
 The Server Entry Point supports the universal fetch handler format, commonly used by [Cloudflare Workers](https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/) and other WinterCG-compatible runtimes.
 
-To ensure interoperability, the default export must conform to our `ServerEntry` interface:
-
-```ts
-export default {
-  fetch(req: Request, opts?: RequestOptions): Response | Promise {
-    // ...
-  },
-}
-```
-
-TanStack Start exposes a wrapper to make creation type-safe. This is done in the `src/server.ts` file.
+The default export must provide a `fetch` method that accepts a `Request` and Start's request options, then returns a `Response` or `Promise`. Use `createServerEntry` to infer these types and keep the complete callback inside the request's context, including custom error handling. For example, this custom `src/server.ts` delegates to the built-in entry:
 
 ```tsx
 // src/server.ts
 import handler, { createServerEntry } from '@tanstack/react-start/server-entry'
 
 export default createServerEntry({
-  fetch(request) {
-    return handler.fetch(request)
+  fetch(request, opts) {
+    return handler.fetch(request, opts)
   },
 })
 ```
 
 Whether we are statically generating our app or serving it dynamically, the `server.ts` file is the entry point for doing all SSR-related work as well as for handling server routes and server function requests.
 
+## Configuring a Custom Server Entry
+
+Start automatically detects `src/server.ts`. If that file is absent, it uses the built-in entry. For a custom entry at another path, configure `server.entry` in your bundler plugin. This path is resolved relative to `srcDirectory`, which defaults to `src`.
+
+
+
+# Vite
+
+```ts title="vite.config.ts"
+import { defineConfig } from 'vite'
+import { tanstackStart } from '@tanstack/react-start/plugin/vite'
+import viteReact from '@vitejs/plugin-react'
+
+export default defineConfig({
+  plugins: [
+    tanstackStart({
+      server: {
+        entry: './server-entry.ts',
+      },
+    }),
+    viteReact(),
+  ],
+})
+```
+
+# Rsbuild
+
+```ts title="rsbuild.config.ts"
+import { defineConfig } from '@rsbuild/core'
+import { pluginReact } from '@rsbuild/plugin-react'
+import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild'
+
+export default defineConfig({
+  plugins: [
+    pluginReact(),
+    tanstackStart({
+      server: {
+        entry: './server-entry.ts',
+      },
+    }),
+  ],
+})
+```
+
+
+
 ## Custom Server Handlers
 
 You can create custom server handlers to modify how your application is rendered:
@@ -53,16 +87,155 @@ const customHandler = defineHandlerCallback((ctx) => {
   return defaultStreamHandler(ctx)
 })
 
-const fetch = createStartHandler(customHandler)
+const startHandler = createStartHandler(customHandler)
 
 export default createServerEntry({
-  fetch,
+  fetch(request, opts) {
+    return startHandler(request, opts)
+  },
 })
 ```
 
+## Error Handling
+
+The built-in entry uses `createServerEntry` to catch errors that escape the Start handler and call `handleStartError(error)` inside the active request context. This works without a custom `src/server.ts`. Response helpers such as `setResponseStatus`, `setResponseHeader`, and `setCookie` are applied to the error response.
+
+For an uncaught error, Start returns a generic JSON error body with status `500` unless a response helper or HTTP-style error property supplies an error status. A thrown `Response` keeps its body and response metadata, with response helpers applied, and loses its body for `HEAD` requests and for statuses `204`, `205`, and `304`, including one selected by a helper. The generic error body Start generates always uses an error status, so only `HEAD` removes it.
+
+For example, a request to this server route returns `401` with a `WWW-Authenticate` header:
+
+```tsx
+// src/routes/api/protected.ts
+import { createFileRoute } from '@tanstack/react-router'
+import { createMiddleware } from '@tanstack/react-start'
+import {
+  setResponseHeader,
+  setResponseStatus,
+} from '@tanstack/react-start/server'
+
+const authMiddleware = createMiddleware().server(() => {
+  setResponseStatus(401, 'Unauthorized')
+  setResponseHeader('www-authenticate', 'Bearer')
+  throw new Error('Unauthorized')
+})
+
+export const Route = createFileRoute('/api/protected')({
+  server: {
+    middleware: [authMiddleware],
+    handlers: {
+      GET: () => new Response('Protected content'),
+    },
+  },
+})
+```
+
+Error conversion preserves:
+
+- Error statuses (`400`-`599`) and their status text from `setResponseStatus`
+- Header operations from the response helpers
+- Cookies from `setCookie` and `appendResponseHeader('set-cookie', ...)`, including multiple `Set-Cookie` headers
+- HTTP-style error metadata such as `error.status`, `error.statusText`, `error.headers`, and `error.cause.headers`
+
+Start builds a new JSON body for an error, so it never copies the framing and connection headers `Content-Length`, `Content-Encoding`, `Transfer-Encoding`, `Trailer`, `Connection`, `Keep-Alive`, `Proxy-Connection`, and `TE` from error metadata. When `error.cause` is a `Response`, such as a failed upstream `fetch` from any fetch implementation, Start uses its status and status text but none of its headers, because they were written for that upstream reply.
+
+Explicit helper error statuses, their status text, and header operations take precedence over error metadata. An error response only uses an error status (`400`-`599`). A status set with `setResponseStatus` before the error applies only when it is an error status. A success, redirect, or bodyless status such as `200`, `201`, `302`, or `204` describes the response that the failure replaced, so Start discards it together with its status text and uses the error's own status or `500`. Error metadata such as `error.status` or `error.statusCode` likewise applies only when it is `400` or higher.
+
+Start logs the error to the server console unless the error's own metadata marks it as an HTTP error with a status of `400` or higher, even when a helper selected the status. The generic JSON body does not expose the error's message or stack.
+
+Errors that Router handles through route error components do not reach this top-level catch. Server function calls and their request middleware use a separate error response path that preserves the RPC serialization protocol. Failures during initialization, before that path is established, fall back to the top-level error response. Errors in a streamed body after the entry has returned its `Response` cannot replace that response's status or headers.
+
+You can use `createServerEntry` with your own `try`/`catch`, including for error reporting with Sentry. Your catch runs first; the wrapper converts only errors that escape your callback. Call the handler returned by `createStartHandler(...)` inside that catch, because it rethrows the original uncaught value:
+
+```tsx
+// src/server.ts
+import {
+  createStartHandler,
+  defaultStreamHandler,
+  handleStartError,
+} from '@tanstack/react-start/server'
+import { createServerEntry } from '@tanstack/react-start/server-entry'
+
+const startHandler = createStartHandler(defaultStreamHandler)
+
+export default createServerEntry({
+  async fetch(request, opts) {
+    try {
+      return await startHandler(request, opts)
+    } catch (error) {
+      // Report the original error here, for example to Sentry.
+      return handleStartError(error)
+    }
+  },
+})
+```
+
+After reporting, choose how to finish the catch:
+
+- Return `handleStartError(error)` to obtain Start's error response explicitly.
+- Rethrow `error` to let `createServerEntry` produce that same error response.
+- Return your own `Response` to choose its body, status, and headers.
+
+All three options keep `createServerEntry` and its request context. The first two preserve Start's response-helper state.
+
+The wrapper creates the request context before calling your `fetch` callback. The entire callback, including its own catch and code after `await`, runs inside that context. Calling the Start handler with the same `Request` reuses it. `handleStartError` therefore uses the correct request's state even when the thrown value is a primitive, or several requests throw the same `Error` object. Start does not attach request state to errors or remember them for a later catch. A catch outside this wrapper cannot recover a completed request's helper state from the error.
+
+The default export from `@tanstack/react-start/server-entry` is already wrapped. Calling its `fetch` method converts uncaught errors before an outer catch can see them. Use the handler returned by `createStartHandler(...)` inside your callback when you need to catch the original error, as above.
+
+Delegating to the default entry or another wrapped entry with the same `Request` object shares the current request context. A cloned or rewritten `Request` starts a separate context. When passing a new request to a raw `createStartHandler` handler, wrap that invocation with `createServerEntry` too, so errors are converted before leaving the new context:
+
+```tsx
+import {
+  createStartHandler,
+  defaultStreamHandler,
+} from '@tanstack/react-start/server'
+import { createServerEntry } from '@tanstack/react-start/server-entry'
+
+const rewrittenEntry = createServerEntry({
+  fetch: createStartHandler(defaultStreamHandler),
+})
+
+export default createServerEntry({
+  fetch(request, opts) {
+    const url = new URL(request.url)
+    if (url.pathname === '/legacy-home') {
+      url.pathname = '/'
+    }
+    return rewrittenEntry.fetch(new Request(url, request), opts)
+  },
+})
+```
+
+The rewritten request owns its response helper state. Catching a raw rewritten handler's error only in the original request's scope would not recover the rewritten request's headers or cookies.
+
+To replace an uncaught error response completely, return your own response from the custom catch:
+
+```tsx
+// src/server.ts
+import {
+  createStartHandler,
+  defaultStreamHandler,
+} from '@tanstack/react-start/server'
+import { createServerEntry } from '@tanstack/react-start/server-entry'
+
+const startHandler = createStartHandler(defaultStreamHandler)
+
+export default createServerEntry({
+  async fetch(request, opts) {
+    try {
+      return await startHandler(request, opts)
+    } catch (error) {
+      console.error(error)
+      return new Response('Internal Server Error', { status: 500 })
+    }
+  },
+})
+```
+
+`createServerEntry` returns custom responses as-is, whether they come from a catch or a successful callback. Such responses do not automatically inherit helper state. Likewise, helper writes after `await handler.fetch(...)` are not automatically applied to its returned response; modify that response directly or put the helper writes in Start middleware. Call `handleStartError` in a catch when the error response should inherit helper state.
+
 ## Request context
 
-When your server needs to pass additional, typed data into request handlers (for example, authenticated user info, a database connection, or per-request flags), register a request context type via TypeScript module augmentation. The registered context is delivered as the second argument to the server `fetch` handler and is available throughout the server-side middleware chain — including global middleware, request/function middleware, server routes, server functions, and the router itself.
+When your server needs to pass additional, typed data into request handlers (for example, authenticated user info, a database connection, or per-request flags), register a request context type via TypeScript module augmentation. Pass the runtime values through the `context` property of the second argument to `handler.fetch`. Type registration does not create these values. The context is available throughout the server-side middleware chain — including global middleware, request/function middleware, server routes, server functions, and the router itself.
 
 To add types for your request context, augment the `Register` interface from `@tanstack/react-router` with a `server.requestContext` property. The runtime `context` you pass to `handler.fetch` will then match that type. Example:
 
@@ -83,8 +256,11 @@ declare module '@tanstack/react-router' {
 }
 
 export default createServerEntry({
-  async fetch(request) {
-    return handler.fetch(request, { context: { hello: 'world', foo: 123 } })
+  fetch(request, opts) {
+    return handler.fetch(request, {
+      ...opts,
+      context: { hello: 'world', foo: 123 },
+    })
   },
 })
 ```
diff --git a/docs/start/framework/react/guide/server-functions.md b/docs/start/framework/react/guide/server-functions.md
index 903e5d7b86..879aa9e867 100644
--- a/docs/start/framework/react/guide/server-functions.md
+++ b/docs/start/framework/react/guide/server-functions.md
@@ -390,7 +390,7 @@ Stream typed data from server functions to the client. See the [Streaming Data f
 
 ### Raw Responses
 
-Return `Response` objects binary data, or custom content types.
+Return a `Response` for binary data or custom content types, and the call resolves with it. Throw a `Response` instead to reject the call with it. Either way, the caller receives its body and headers, and its status unless a response helper set one. The browser follows a `Response` with a redirect status and a `Location` header before the caller sees it, so use `redirect()` to send the user elsewhere.
 
 ### Progressive Enhancement
 
@@ -425,7 +425,9 @@ Customization:
 
 You can customize function ID generation for the production build by providing a `generateFunctionId` function when configuring the TanStack Start build tool plugin.
 
-Prefer deterministic inputs (filename + functionName) so IDs remain stable between builds.
+Return `undefined` (or an empty string) to use the default ID. Prefer deterministic inputs (filename + functionName) so IDs remain stable between builds.
+
+The ID becomes one segment of the server function's URL (`/_serverFn/`), unencoded, so use only ASCII letters, digits, `-`, `.`, `_`, `~` and `$`, and not `.` or `..`. An ID with whitespace, a control or non-ASCII character, or any of `"`, `#`, `/`, `<`, `>`, `?`, `\`, `^`, `` ` ``, `{` and `}`, an ID that is `.` or `..`, or one with a percent-encoding the server reads as another ID (`%41` for `A`, lowercase hex, `%2E`) or rejects, fails the build with an error naming the file, the function and the ID: the request would reach another function or none. Other characters (`%`, `+`, `:`, `;`, `@`, `'`, `|`, `[`, `]`, …) still work, with a deprecation warning: the next major version rejects them, since proxies and servers may encode or normalise them in the URL. `filename` contains `/`, so hash it (as in the example below) rather than embedding it as is.
 
 Please note that this customization is **experimental** and subject to change.
 
diff --git a/docs/start/framework/react/guide/tanstack-query.md b/docs/start/framework/react/guide/tanstack-query.md
new file mode 100644
index 0000000000..dec42ca26c
--- /dev/null
+++ b/docs/start/framework/react/guide/tanstack-query.md
@@ -0,0 +1,158 @@
+---
+id: tanstack-query
+title: TanStack Query
+updated: '2026-09-11'
+testedWith:
+  '@tanstack/react-start': '1.168.52'
+  '@tanstack/react-query': '5.102.0'
+  react: '19.2.3'
+  vite: '8.0.14'
+description: Use TanStack Query with TanStack Start for request-isolated SSR, hydration, route preloading, streaming, and mutation invalidation.
+---
+
+TanStack Start uses Router loaders to coordinate navigation. TanStack Query can own the fetched data, freshness, and mutation state. Use them together when your application needs a query cache across routes, background updates, or mutation-driven invalidation.
+
+The [React Query example](../examples/start-basic-react-query) includes a `/preferences` page that reads and updates a display name stored in a cookie. Its [tests](https://github.com/TanStack/router/blob/main/examples/react/start-basic-react-query/tests/preferences.spec.ts) check server-rendered data, isolation between requests, hydration without a duplicate read, and invalidation after a server function. The preference cookie is not an authentication mechanism.
+
+## Install and create a QueryClient per router
+
+Install `@tanstack/react-query` and `@tanstack/react-router-ssr-query`. The example uses Query 5.102 or newer, including `queryClient.query`. See the [integration reference](/router/latest/docs/integrations/query) for its options.
+
+```tsx title="src/router.tsx"
+import { QueryClient } from '@tanstack/react-query'
+import { createRouter } from '@tanstack/react-router'
+import { setupRouterSsrQueryIntegration } from '@tanstack/react-router-ssr-query'
+import { routeTree } from './routeTree.gen'
+
+export function getRouter() {
+  const queryClient = new QueryClient({
+    defaultOptions: { queries: { staleTime: 30_000 } },
+  })
+  const router = createRouter({
+    routeTree,
+    context: { queryClient },
+    defaultPreload: 'intent',
+    defaultPreloadStaleTime: 0,
+  })
+
+  setupRouterSsrQueryIntegration({ router, queryClient })
+  return router
+}
+```
+
+Create the client inside `getRouter`, not at module scope. Start creates a router for each SSR request. A process-wide QueryClient could reuse one reader's cached data in another reader's HTML. The browser then keeps the client attached to its router during navigation.
+
+Declare `queryClient: QueryClient` in the root route's `createRootRouteWithContext` type so child loaders can access it. The integration supplies the Query provider and handles SSR dehydration, hydration, and streaming. Do not add a second QueryClient or independently dehydrate the same cache. If you already own the provider wrapper, use the integration's `wrapQueryClient: false` option.
+
+`defaultPreloadStaleTime: 0` lets Query decide whether a preload needs data. The example's 30-second Query `staleTime` prevents an immediate repeat read when the browser receives fresh SSR data. Choose the freshness window for your application, rather than treating 30 seconds as a universal setting.
+
+## Share query options between the loader and component
+
+Keep a query's key and function together. Privileged reads belong in a server function, because a normal route loader can also run in the browser during navigation.
+
+```tsx title="src/utils/preferences.ts"
+import { queryOptions } from '@tanstack/react-query'
+import { createServerFn } from '@tanstack/react-start'
+import { getCookie, setResponseHeader } from '@tanstack/react-start/server'
+
+export const getReaderName = createServerFn({ method: 'GET' }).handler(() => {
+  setResponseHeader('Cache-Control', 'private, no-store')
+  return getCookie('reader-name') || 'Guest'
+})
+
+export const readerNameOptions = queryOptions({
+  queryKey: ['reader-name'],
+  queryFn: () => getReaderName(),
+})
+```
+
+The route awaits the query for content that must appear in the initial HTML:
+
+```tsx title="src/routes/preferences.tsx"
+import { useSuspenseQuery } from '@tanstack/react-query'
+import { createFileRoute } from '@tanstack/react-router'
+import { readerNameOptions } from '../utils/preferences'
+
+export const Route = createFileRoute('/preferences')({
+  loader: async ({ context }) => {
+    await context.queryClient.query(readerNameOptions)
+  },
+  headers: () => ({ 'Cache-Control': 'private, no-store' }),
+  component: Preferences,
+})
+
+function Preferences() {
+  const { data: name } = useSuspenseQuery(readerNameOptions)
+  return 

Hello, {name}

+} +``` + +Both calls use the same query key and options. The loader populates the request's cache; the component reads it; the integration transfers it to the browser. The component does not need to call the server function again in an effect. + +For a parameterized resource, include its identity in the key, such as `['post', postId]`. If search values affect the result, validate them and include them in both `loaderDeps` and the query key. Keep secrets out of keys and serialized query data. + +## Await critical data and stream secondary data + +Await queries that determine the page's main content, title, authorization, redirects, or whether it exists. Return title and description data from the loader when a route's `head` needs them, as the example's post route does. + +Secondary content can begin loading without blocking the loader, then render inside a Suspense boundary. Keep that query under the SSR integration so its result can stream to the browser. Handle the imperative query promise's rejection as well as the component's error boundary; a fire-and-forget promise should not become an unhandled server rejection. + +The example's existing `/deferred` route shows a separate Suspense boundary. See [streaming and prefetching](/router/latest/docs/integrations/query#prefetching-and-streaming) for the integration's behavior. A plain `useQuery` that has no loader prefetch is not a guarantee that its data will be in the server-rendered HTML. + +## Invalidate Query after a server mutation + +The preference example validates the display name and writes its cookie inside a POST server function. Its `src/start.ts` enables Start's CSRF middleware for server-function requests. The component calls that function through `useServerFn`, then invalidates the query that reads the cookie: + +```tsx +const queryClient = useQueryClient() +const save = useServerFn(saveReaderName) +const mutation = useMutation({ + mutationFn: (name: string) => save({ data: name }), + onSuccess: () => + queryClient.invalidateQueries({ queryKey: readerNameOptions.queryKey }), +}) +``` + +Returning the invalidation promise keeps the mutation pending until its active query's refetch finishes. The form can use `mutation.isPending` and `mutation.isError` for feedback. The example also disables its JavaScript-dependent form until hydration and uses a POST method so a native submission cannot put form values in the URL. + +Invalidate the data's actual owner. `queryClient.invalidateQueries` refreshes Query data; `router.invalidate()` reloads Router-owned loader data and route context. Use both only when the mutation changes both, such as a login that changes root authentication context and private queries. Neither call purges your CDN or invalidates a database cache. + +If a mutation returns the complete updated resource, `setQueryData` can update that cache entry directly instead. Optimistic updates need cancellation, rollback on failure, and reconciliation with the server result. This example uses a confirmed write followed by invalidation, not an optimistic update. + +## Keep account data isolated beyond SSR + +Request-scoped QueryClients prevent cross-request cache sharing on the server. They do not authorize reads or automatically clear a browser cache when its account changes. + +For authenticated applications, authorize every private read and mutation on the server, including resource-level permissions. On sign-out or account switching, cancel and remove the previous account's private queries, then reload the relevant route context. Include account or tenant identity in keys when that is part of the resource's identity, but do not treat a key as an access-control check. + +The `/preferences` route and its server functions return `Cache-Control: private, no-store` because their output varies by cookie. Verify the final response through your hosting provider and CDN. Do not publicly cache personalized HTML merely because the QueryClient itself is isolated. + +## Diagnose extra requests + +Check when and where each request occurs. A background refresh after the freshness window, a reconnect, or a deliberate invalidation can be expected. + +| Symptom | Check | +| --------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| A read repeats immediately after hydration | Query `staleTime`, hydration configuration, matching keys, and accidental extra QueryClients | +| Navigation loads different data than a direct visit | Search validation, `loaderDeps`, query keys, and server-only boundaries | +| A mutation succeeds but old data stays visible | Which cache owns the displayed value and which keys were invalidated | +| A second account sees the first account's data | Module-scoped server clients, browser cache cleanup, account keys, and shared HTTP caches | +| SSR contains only a loading state | Whether the loader awaited critical data and whether the component reads the prefetched query | + +Start with the same options object in the loader and component. Avoid adding manual hydration code or disabling all refetching to hide a duplicate request. + +## Run the example's checks + +From the repository root, install dependencies and build the framework packages as described in [Contributing](https://github.com/TanStack/router/blob/main/CONTRIBUTING.md). Then: + +```sh +cd examples/react/start-basic-react-query +pnpm exec playwright install chromium +pnpm test:e2e +pnpm build +QUERY_EXAMPLE_PRODUCTION=1 pnpm test:e2e +``` + +The tests send concurrent SSR requests with different preference cookies while using the same query key. Each HTML response must contain only its own reader's value. The browser test then requires zero additional reads during hydration, exactly one read after mutation invalidation, and no extra read after a reload hydrates fresh data. + +The post and user demos use JSONPlaceholder. The preference tests run without that external API. diff --git a/docs/start/framework/react/migrate-from-next-js.md b/docs/start/framework/react/migrate-from-next-js.md index 2f4d988449..dc5377df08 100644 --- a/docs/start/framework/react/migrate-from-next-js.md +++ b/docs/start/framework/react/migrate-from-next-js.md @@ -1,510 +1,187 @@ --- id: migrate-from-next-js title: Migrate from Next.js +description: Move a Next.js App Router application to TanStack Start while preserving routes, metadata, authentication, mutations, and deployment behavior. --- -This guide provides a step-by-step process to migrate a project from the Next.js App Router to **TanStack Start**. We respect the powerful features of Next.js and aim to make this transition as smooth as possible. +This guide migrates a Next.js App Router application to TanStack Start. The [runnable before-and-after example](https://github.com/TanStack/router/tree/main/examples/react/start-next-migration) implements the same article site in both frameworks, including public articles, URL search, sign-in, a private saved-article page, and a mutation. -## Step-by-Step (Basics) +Start does not interpret Next.js route conventions or configuration. Keep your application behavior, then translate each framework boundary. If your application relies heavily on React Server Components, read the [comparison](./start-vs-nextjs) and [RSC guide](./guide/server-components) first. Start's RSC support is experimental and opt-in; the example uses ordinary route components and server functions. -This step-by-step guide provides an overview of how to migrate your Next.js App Router project to TanStack Start. The goal is to help you understand the basic steps involved in the migration process so you can adapt them to your specific project needs. +## Run the reference application -### Prerequisites - -Before we begin, this guide assumes your project structure looks like this: - -```txt -├── next.config.ts -├── package.json -├── postcss.config.mjs -├── public -│ ├── file.svg -│ ├── globe.svg -│ ├── next.svg -│ ├── vercel.svg -│ └── window.svg -├── README.md -├── src -│ └── app -│ ├── favicon.ico -│ ├── globals.css -│ ├── layout.tsx -│ └── page.tsx -└── tsconfig.json -``` - -Alternatively, you can follow along by cloning the following [starter template](https://github.com/nrjdalal/awesome-templates/tree/main/next.js-apps/next.js-start): +Use Node 24 or newer and pnpm 12: ```sh -npx gitpick nrjdalal/awesome-templates/tree/main/next.js-apps/next.js-start next.js-start-er +git clone --depth 1 https://github.com/TanStack/router.git +cd router +pnpm install +pnpm nx run @tanstack/react-start:build +cd examples/react/start-next-migration ``` -This structure is a basic Next.js application using the App Router, which we will migrate to TanStack Start. +Follow the example's [README](https://github.com/TanStack/router/blob/main/examples/react/start-next-migration/README.md) to set `SESSION_PASSWORD` and `DEMO_PASSWORD`. Run `pnpm dev:next` at `http://localhost:3100` and `pnpm dev` in another terminal at `http://localhost:3101`. -### 1. Remove Next.js +The example's single account is `reader@example.com`. It stores one saved-article flag in a session cookie so you can exercise a protected mutation without connecting a database. It is not a production authentication implementation. Both apps use iron-session with different cookie names, so sign in separately to each. -First, uninstall Next.js and remove related configuration files: +With those ports free, run: ```sh -npm uninstall @tailwindcss/postcss next -rm postcss.config.* next.config.* +pnpm exec playwright install chromium +pnpm test:e2e +pnpm build:next +pnpm build +MIGRATION_PRODUCTION=1 pnpm test:e2e ``` -### 2. Install Required Dependencies +The same browser tests run against both apps. They check public URLs, server-rendered metadata, query filtering, redirects, missing pages, sitemap entries, sign-in errors, session persistence, private response caching, mutations, and server rejection after sign-out. -TanStack Start leverages TanStack Router and supports [Vite](https://vite.dev) or [Rsbuild](https://rsbuild.dev/) as the build tool. The Vite setup below includes [Nitro](https://nitro.build/) as a deployment plugin. +## Inventory the application before changing it - +Record your current paths and observable behavior. Include dynamic paths, query parameters, redirects, trailing slashes, locale prefixes, response status, title, description, canonical, robots directives, and sitemap membership. Keep representative HTML responses and run your existing application tests against the replacement. -# Vite +Inventory Next.js-specific code separately: `next/*` imports, `'use server'`, server-only modules, metadata exports, `generateStaticParams`, `revalidatePath`, `revalidateTag`, cache directives, route configuration, Proxy or middleware, and image/font configuration. A route that renders successfully can still have lost authentication, cache invalidation, or an important search URL. -```sh -npm i @tanstack/react-router @tanstack/react-start nitro vite @vitejs/plugin-react +| Request | Required behavior | +| -------------------------- | -------------------------------------------------------------------- | +| `/` | Article list, title, description, self-referencing canonical | +| `/?q=metadata` | Filtered article list; canonical remains `/` | +| `/posts/keeping-your-urls` | Same article, title, description, canonical, and Open Graph title | +| `/posts/missing` | HTTP 404 | +| `/old-notes` | HTTP 308 to `/posts/keeping-your-urls` | +| `/saved` | Signed-out users reach sign-in; private HTML is not shared-cacheable | +| `/sitemap.xml` | Public pages only | + +For your application, decide which query variants deserve indexing. Do not copy the example's canonical policy onto meaningful product filters or paginated results without checking their content. + +## Set up Start alongside the existing app + +Create a Start application using [Getting Started](./getting-started) and [Build from Scratch](./build-from-scratch). Keep the Next.js app runnable until the migrated routes pass their checks. You do not need to remove Next.js, its configuration, or its CSS tooling before you can test Start. + +```text +next-app/ # Before: Next.js App Router + app/ + layout.tsx + page.tsx + posts/[slug]/page.tsx + actions.ts +src/ # After: TanStack Start + router.tsx + routes/ + __root.tsx + index.tsx + posts.$slug.tsx + server/account.ts +vite.config.ts ``` -# Rsbuild +The Start Vite plugin generates `src/routeTree.gen.ts`. `src/router.tsx` returns a new router using that tree. The root route renders `HeadContent` in the document head and `Scripts` in the body. Merge your existing CSS, document attributes, and providers into that root. -```sh -npm i @tanstack/react-router @tanstack/react-start @rsbuild/core @rsbuild/plugin-react -``` +The reference uses Vite and Nitro's Node output. If you use another host or build tool, follow its [hosting instructions](./guide/hosting) and test its actual build output. A Next.js deployment adapter does not become a Start adapter by changing dependencies. - +## Preserve paths while changing route files -For Tailwind CSS, install the build tool integration you want to use: +| Next.js App Router | Default Start route directory | +| ------------------------------ | ---------------------------------------------- | +| `app/layout.tsx` | `src/routes/__root.tsx` | +| `app/page.tsx` | `src/routes/index.tsx` | +| `app/posts/page.tsx` | `src/routes/posts.index.tsx` | +| `app/posts/[slug]/page.tsx` | `src/routes/posts.$slug.tsx` | +| `app/docs/[...parts]/page.tsx` | `src/routes/docs.$.tsx` | +| `app/api/hello/route.ts` | `src/routes/api.hello.ts` with server handlers | - +`src/routes` is a source directory, not a URL prefix. A route for `/posts/example` uses `createFileRoute('/posts/$slug')`, not `/app/posts/$slug`. -# Vite +Nested layouts, pathless layouts, route groups, optional parameters, catch-alls, parallel routes, and intercepting routes need individual mapping. Read [routing concepts](/router/latest/docs/routing/routing-concepts) instead of mechanically renaming every file. The reference does not reproduce Next.js parallel or intercepting route behavior. -```sh -npm i -D @tailwindcss/vite tailwindcss -``` - -# Rsbuild - -```sh -npm i -D @tailwindcss/postcss tailwindcss -``` - - - -### 3. Update Project Configuration - -Now that you've installed the necessary dependencies, update your project configuration files to work with TanStack Start. - - - -# Vite - -```json -{ - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "start": "node .output/server/index.mjs" - } -} -``` - -# Rsbuild - -```json -{ - "type": "module", - "scripts": { - "dev": "rsbuild dev", - "build": "rsbuild build" - } -} -``` - - - - - -# Vite - -```ts title="vite.config.ts" -import { defineConfig } from 'vite' -import { tanstackStart } from '@tanstack/react-start/plugin/vite' -import viteReact from '@vitejs/plugin-react' -import tailwindcss from '@tailwindcss/vite' -import { nitro } from 'nitro/vite' - -export default defineConfig({ - server: { - port: 3000, - }, - resolve: { - // Enables Vite to resolve imports using path aliases. - tsconfigPaths: true, - }, - plugins: [ - tailwindcss(), - tanstackStart({ - srcDirectory: 'src', // This is the default - router: { - // Specifies the directory TanStack Router uses for your routes. - routesDirectory: 'app', // Defaults to "routes", relative to srcDirectory - }, - }), - viteReact(), - nitro(), - ], -}) -``` - -# Rsbuild - -```ts title="rsbuild.config.ts" -import { defineConfig } from '@rsbuild/core' -import { pluginReact } from '@rsbuild/plugin-react' -import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' - -export default defineConfig({ - server: { - port: 3000, - }, - plugins: [ - pluginReact(), - tanstackStart({ - srcDirectory: 'src', // This is the default - router: { - // Specifies the directory TanStack Router uses for your routes. - routesDirectory: 'app', // Defaults to "routes", relative to srcDirectory - }, - }), - ], -}) -``` - -```js title="postcss.config.mjs" -export default { - plugins: { - '@tailwindcss/postcss': {}, - }, -} -``` - - - -By default, `routesDirectory` is set to `routes`. To maintain consistency with Next.js App Router conventions, you can set it to `app` instead. - -### 4. Adapt the Root Layout - -> TanStack Start uses a routing approach similar to Remix, with some changes to support nested structures and special features using tokens. Learn more about it at [Routing Concepts](/router/latest/docs/framework/react/routing/routing-concepts) guide. - -Instead of `layout.tsx`, create a file named `__root.tsx` in the `src/app` directory. This file will serve as the root layout for your application. - -- `src/app/layout.tsx` to `src/app/__root.tsx` +Replace `next/link` with Router's `Link`. Dynamic paths use typed `params`: ```tsx -- import type { Metadata } from "next" // [!code --] -import { - Outlet, - createRootRoute, - HeadContent, - Scripts, -} from "@tanstack/react-router" -import appCss from "./globals.css?url" + + {article.title} + +``` -- export const metadata: Metadata = { // [!code --] -- title: "Create Next App", // [!code --] -- description: "Generated by create next app", // [!code --] -- } // [!code --] -export const Route = createRootRoute({ - head: () => ({ - meta: [ - { charSet: "utf-8" }, - { - name: "viewport", - content: "width=device-width, initial-scale=1", - }, - { title: "TanStack Start Starter" } - ], - links: [ - { - rel: 'stylesheet', - href: appCss, - }, - ], +Check direct requests, client navigation, back/forward, and reload for each representative path. Update your redirects and sitemap from the same route inventory. + +## Validate URL search state + +Next.js passes `searchParams` to an App Router page. Start validates URL state in the route: + +```tsx +export const Route = createFileRoute('/')({ + validateSearch: (search) => ({ + q: typeof search.q === 'string' ? search.q : '', }), - component: RootLayout, + component: Articles, }) -- export default function RootLayout({ // [!code --] -- children, // [!code --] -- }: Readonly<{ // [!code --] -- children: React.ReactNode // [!code --] -- }>) { // [!code --] -- return ( // [!code --] -- // [!code --] -- {children} // [!code --] -- // [!code --] -- ) // [!code --] -- } // [!code --] -function RootLayout() { - return ( - - - - - - - - - - ) +function Articles() { + const { q } = Route.useSearch() + return

Searching for: {q}

} ``` -### 5. Adapt the Home Page +If a loader depends on search state, declare the relevant values in `loaderDeps`. That makes those values part of the loader's dependency and cache behavior. Validate page numbers, sorting, and filters at runtime; TypeScript types alone do not validate an incoming URL. See [search parameters](/router/latest/docs/guide/search-params) and [data loading](/router/latest/docs/guide/data-loading). -Instead of `page.tsx`, create an `index.tsx` file for the `/` route. +## Move server reads into server functions -- `src/app/page.tsx` to `src/app/index.tsx` +An ordinary Start route loader can execute on the server for the initial request and in the browser during navigation. Do not move a database query, credential, or privileged SDK directly from an async Next.js Server Component into an ordinary loader. -```tsx -+ import { createFileRoute } from '@tanstack/react-router' // [!code ++] +Put the privileged read inside a [server function](./guide/server-functions), then call it from the loader. The reference's `/saved` route calls `getAccount`, checks the result, and redirects signed-out readers. Its public article loader only reads bundled public content. -- export default function Home() { // [!code --] -+ export const Route = createFileRoute('/')({ // [!code ++] -+ component: Home, // [!code ++] -+ }) // [!code ++] +Return the data the browser is allowed to see, not an entire database record. Keep connection setup and secrets on the server. For a database-backed application, preserve your schema and access layer where possible, and change the framework-facing handler around them. -+ function Home() { // [!code ++] - return ( -
- ) -} -``` +## Translate mutations and their invalidation -### 6. Are we migrated yet? +The reference's Next.js form calls a Server Action. That Action authorizes the session, changes the saved flag, and calls `revalidatePath('/saved')`. The Start version calls a POST server function through `useServerFn`, then awaits `router.invalidate()` to reload the active route data. -Before you can run the development server, you need to create a file that will define the behavior of TanStack Router within TanStack Start. +These invalidation APIs operate on different caches. `router.invalidate()` does not purge a CDN, clear a database cache, or revalidate all statically generated pages. If the app uses TanStack Query, invalidate the relevant query keys as well. Map each existing `revalidatePath`, tag, and cache directive to the layer that owns the replacement data. -- `src/router.tsx` +The Start function checks authorization even though the route already checks it. A caller can invoke the mutation without visiting the page. Validate every untrusted input inside the server boundary and preserve resource-level permissions. -```tsx -import { createRouter } from '@tanstack/react-router' -import { routeTree } from './routeTree.gen' +`useServerFn` returns a callable function. The reference keeps pending and error state in the component and reloads route data after a successful mutation. It also tests replaying the mutation after sign-out. -export function getRouter() { - const router = createRouter({ - routeTree, - scrollRestoration: true, - }) +Next.js Action forms and these Start event-handler forms have different no-JavaScript behavior. The latter require JavaScript and keep their fields disabled until hydration. If progressive enhancement is a requirement, use a FormData-compatible [server function URL](./guide/server-functions#progressive-enhancement) or an ordinary form POST to a [server route](./guide/server-routes). Include validation, CSRF protection, and an appropriate response or redirect. Do not treat `createServerFn` as a drop-in replacement for the React form Action protocol. - return router -} -``` +## Preserve authentication and session boundaries -> 🧠 Here you can configure everything from the default [preloading functionality](/router/latest/docs/framework/react/guide/preloading) to [caching staleness](/router/latest/docs/framework/react/guide/data-loading). +Follow the [authentication guide](./guide/authentication) for the route-context pattern. Check sessions on the server for private reads and mutations. A hidden button or a client route guard is not authorization. -Don't worry if you see some TypeScript errors at this point; the next step will resolve them. +The example keeps `iron-session` and replaces Next.js `cookies()` with a small adapter using Start's `getCookie` and `setCookie`. Start does not provide a session API. The example uses different cookie names to keep its two local apps independent; sharing a library alone does not make every session configuration compatible. A real migration can keep its existing auth provider or session service and adapt the request boundary instead. If sessions must survive cutover or rollback, verify cookie names, domains, paths, signing/encryption formats, expiration, key rotation, and logout in both deployments. -### 7. Verify the Migration +Private pages need a cache policy that prevents another user receiving personalized HTML. The Start reference returns `Cache-Control: private, no-store` for `/saved`. Check the final response through your deployment and CDN, including after sign-in and sign-out. Do not prerender or publicly cache pages that include private account data. -Run the development server: +## Preserve metadata and search responses -```sh -npm run dev -``` +Next.js `metadata` and `generateMetadata` become a Start route's `head` configuration. The article route derives title, description, Open Graph title, and canonical from its loader result. Keep `HeadContent` in the root document so those values appear in the response. -Then, visit `http://localhost:3000`. You should see the TanStack Start welcome page with its logo and a documentation link. +Compare HTML responses before JavaScript runs, then check the head after client navigation. Keep the public canonical origin independent of a local or preview host. Preserve locale alternates and social images where your app has them. See [SEO](./guide/seo) and [head management](/router/latest/docs/guide/document-head-management). -> If you encounter issues, review the steps above and ensure that file names and paths match exactly. For a reference implementation, see the [post-migration repository](https://github.com/nrjdalal/next-to-start). +Next.js metadata file conventions also need replacements. The reference turns `app/sitemap.ts` into a Start server route at `/sitemap.xml`. Migrate `robots.txt`, icons, manifests, and generated social images explicitly. Return real 404s for missing content and maintain intentional permanent redirects. Avoid redirecting every missing URL to the homepage. -## Next Steps (Advanced) +## Replace image and font services deliberately -Now that you have migrated the basic structure of your Next.js application to TanStack Start, you can explore more advanced features and concepts. +Start does not automatically provide the Next.js image optimizer. Preserve image dimensions, responsive sources, loading behavior, alt text, and cache policy. Plain `` works for preprocessed assets; an image component such as Unpic needs a compatible image service or prepared sources to provide transformations. It does not create Next.js's image processing backend by itself. Next.js also supports its optimizer when [self-hosted](https://nextjs.org/docs/app/guides/self-hosting). -### Routing Concepts +Replace `next/font` with self-hosted font files, a package such as Fontsource, or another chosen font delivery method. CSS `@font-face` does not require Tailwind. Preserve font weights and subsets, set an appropriate `font-display`, and check layout shift and network requests. Copy public assets and update imports only after confirming their resulting URLs. -| Route Example | Next.js | TanStack Start | -| ------------------------------ | ---------------------------------- | ------------------------- | -| Root Layout | `src/app/layout.tsx` | `src/app/__root.tsx` | -| `/` (Home Page) | `src/app/page.tsx` | `src/app/index.tsx` | -| `/posts` (Static Route) | `src/app/posts/page.tsx` | `src/app/posts.tsx` | -| `/posts/[slug]` (Dynamic) | `src/app/posts/[slug]/page.tsx` | `src/app/posts/$slug.tsx` | -| `/posts/[...slug]` (Catch-All) | `src/app/posts/[...slug]/page.tsx` | `src/app/posts/$.tsx` | -| `/api/endpoint` (API Route) | `src/app/api/endpoint/route.ts` | `src/app/api/endpoint.ts` | +The reference uses text and the browser's default font. It does not claim to verify your image transformations or font loading. -Learn more about the [Routing Concepts](/router/latest/docs/framework/react/routing/routing-concepts). +## Rebuild caching and deployment behavior -### Dynamic and Catch-All Routes +List each cache separately: browser data, Router loaders, Query, server data, generated pages, and CDN responses. Define what populates it, its key, expiration, and the operation that invalidates it. Test after changing data, signing out, and deploying a new version. -Retrieving dynamic route parameters in TanStack Start is straightforward. +Next.js cache directives, revalidation, and `generateStaticParams` do not carry across automatically. Use [static prerendering](./guide/static-prerendering) only for suitable public routes, and review [ISR](./guide/isr) with your hosting provider's actual behavior. A cache header alone is not proof of equivalent regeneration or invalidation. -```tsx -- export default async function Page({ // [!code --] -- params, // [!code --] -- }: { // [!code --] -- params: Promise<{ slug: string }> // [!code --] -- }) { // [!code --] -+ export const Route = createFileRoute('/app/posts/$slug')({ // [!code ++] -+ component: Page, // [!code ++] -+ }) // [!code ++] +Move server-only environment variables into the server runtime. Audit any public variable prefix changes rather than exposing the old environment wholesale. Verify API/webhook URLs, forwarded host/protocol, cookies behind a proxy, asset paths, streaming, and runtime limits in the deployment you will use. -+ function Page() { // [!code ++] -- const { slug } = await params // [!code --] -+ const { slug } = Route.useParams() // [!code ++] - return
My Post: {slug}
-} -``` +## Cut over with a rollback path -> Note: If you've made a catch-all route (like `src/app/posts/$.tsx`), you can access the parameters via `const { _splat } = Route.useParams()`. +1. Build both applications and run the contract checks against a staging deployment of Start. Include real representative data, authenticated sessions, and the CDN in that check. +2. Keep the current database schema compatible with both versions during the transition. Separate destructive schema changes from the framework cutover. +3. Preserve the public origin and paths where possible. If paths must change, deploy tested redirects and update internal links, canonicals, and sitemaps together. +4. Record the previous deployment and routing configuration. Know how to route traffic back, and what happens to sessions and writes if you do. +5. Monitor error rates, login and mutation failures, response status, indexing signals, and application conversion events after cutover. Compare against the baseline rather than assuming a framework change will improve search traffic. -Similarly, you can access `searchParams` using `const { page, filter, sort } = Route.useSearch()`. - -Learn more about the [Dynamic and Catch-All Routes](/router/latest/docs/framework/react/routing/routing-concepts#dynamic-route-segments). - -### Links - -```tsx -- import Link from "next/link" // [!code --] -+ import { Link } from "@tanstack/react-router" // [!code ++] - -function Component() { -- return Dashboard // [!code --] -+ return Dashboard // [!code ++] -} -``` - -Learn more about the [Links](/router/latest/docs/framework/react/guide/navigation#link-component). - -### Images - -Next.js uses the `next/image` component for optimized images. In TanStack Start, you can use the package called [Unpic](https://unpic.pics/) for similar functionality -and almost a drop-in replacement. - -```tsx -import Image from 'next/image' // [!code --] -import { Image } from '@unpic/react' // [!code ++] -function Component() { - return ( - Description - ) -} -``` - -### Server ~Actions~ Functions - -```tsx -- 'use server' // [!code --] -+ import { createServerFn } from "@tanstack/react-start" // [!code ++] - -- export const create = async () => { // [!code --] -+ export const create = createServerFn().handler(async () => { // [!code ++] - return true -- } // [!code --] -+ }) // [!code ++] -``` - -Learn more about the [Server Functions](./guide/server-functions). - -### Server Routes ~Handlers~ - -```ts -- export async function GET() { // [!code --] -+ export const Route = createFileRoute('/api/hello')({ // [!code ++] -+ server: { // [!code ++] -+ handlers: { // [!code ++] -+ GET: async () => { // [!code ++] -+ return Response.json("Hello, World!") -+ } // [!code ++] -+ } // [!code ++] -+ } // [!code ++] -+ }) // [!code ++] -``` - -Learn more about the [Server Routes](./guide/server-routes). - -### Fonts - -```tsx -- import { Inter } from "next/font/google" // [!code --] - -- const inter = Inter({ // [!code --] -- subsets: ["latin"], // [!code --] -- display: "swap", // [!code --] -- }) // [!code --] - -- export default function Page() { // [!code --] -- return

Font Sans

// [!code --] -- } // [!code --] -``` - -Instead of `next/font`, use Tailwind CSS’s CSS-first approach. Install fonts (for example, from [Fontsource](https://github.com/fontsource/fontsource)): - -```sh -npm i -D @fontsource-variable/dm-sans @fontsource-variable/jetbrains-mono -``` - -Add the following to `src/app/globals.css`: - -```css -@import 'tailwindcss' source('../'); - -@import '@fontsource-variable/dm-sans'; /* [!code ++] */ -@import '@fontsource-variable/jetbrains-mono'; /* [!code ++] */ - -@theme inline { - --font-sans: 'DM Sans Variable', sans-serif; /* [!code ++] */ - --font-mono: 'JetBrains Mono Variable', monospace; /* [!code ++] */ - /* ... */ -} - -/* ... */ -``` - -### Fetching Data - -```tsx -- export default async function Page() { // [!code --] -+ export const Route = createFileRoute('/')({ // [!code ++] -+ component: Page, // [!code ++] -+ loader: async () => { // [!code ++] -+ const res = await fetch('https://api.vercel.app/blog') // [!code ++] -+ return res.json() // [!code ++] -+ }, // [!code ++] -+ }) // [!code ++] - -+ function Page() { // [!code ++] -- const data = await fetch('https://api.vercel.app/blog') // [!code --] -- const posts = await data.json() // [!code --] -+ const posts = Route.useLoaderData() // [!code ++] - - return ( -
    - {posts.map((post) => ( -
  • {post.title}
  • - ))} -
- ) -} -``` +Remove Next.js and its unused configuration after the migrated behavior and rollback plan are verified. Retain historical redirects and any assets still referenced by public content. diff --git a/docs/start/framework/react/migrate-from-release-candidate.md b/docs/start/framework/react/migrate-from-release-candidate.md new file mode 100644 index 0000000000..5cfa614cda --- /dev/null +++ b/docs/start/framework/react/migrate-from-release-candidate.md @@ -0,0 +1,39 @@ +--- +id: migrate-from-release-candidate +title: Migrate from the Release Candidate +description: Upgrade a TanStack Start release-candidate app to the first stable release, 1.169. +--- + +`@tanstack/react-start` 1.169 is the first stable release of TanStack Start. Upgrading from a release candidate means replacing the removed APIs below and checking the behavior changes that apply to your app. + +## Vite 8 + +Start requires Vite 8 when you build with Vite. Upgrade with Vite's [migration guide](https://vite.dev/guide/migration). + +## Removed APIs + +| Removed | Use instead | +| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `@tanstack/nitro-v2-vite-plugin` | `nitro()` from `nitro/vite`. See [Nitro hosting](./guide/hosting#nitro). | +| `useSession` | A session library such as iron-session. See [Session Management](./guide/authentication#2-session-management). The new library cannot read existing Start session cookies: use a new cookie name and sign users in again, or test a migration that reads the old cookies first. | +| `.inputValidator()` on server functions and middleware | `.validator()`, which takes the same validator. | + +## Errors + +- A handler returned by `createStartHandler(...)` now rethrows the original error. `createServerEntry` converts errors to responses, and the built-in entry already uses it. In a custom entry, catch inside the `createServerEntry` callback and `return handleStartError(error)` or rethrow. See [Error Handling](./guide/server-entry-point#error-handling). +- Uncaught errors produce a generic JSON body with a status from `400` to `599` (`500` by default), even if a success status was set before the error. Return a `Response` when an endpoint needs a specific error payload. +- A server-function call rejects with whatever was thrown, including a `Response` and falsy values such as `undefined`. Return a `Response` to resolve the call with it. See [Raw Responses](./guide/server-functions#raw-responses). +- Errors thrown by request middleware during a server-function call are sent to the client with their message, and their status is no longer always `500`. + +## Responses + +- Response helpers override the response you return or throw. `setResponseStatus(401)` followed by returning a `200` response sends `401`. +- `setResponseHeader('set-cookie', cookie)` replaces all outgoing cookies. Use `setCookie` or `appendResponseHeader('set-cookie', cookie)` to add one. +- `setResponseStatus` ignores codes outside `200`-`599` and warns outside production. +- Serialized server-function replies never carry `Location`, `Content-Encoding`, or `Content-Length` from helpers, and ignore a helper `204`, `205`, or `304`. Use `redirect()` to redirect. + +## Requests and middleware + +- `getRequestHeader(name)` returns `''` for a header that is present but empty, and `undefined` only when it is missing. +- A path with invalid percent-encoding, such as `/%E0%A4%A`, gets `400 Bad Request` before your server entry or middleware runs. +- When no function middleware sends context, `sendContext` is `undefined` instead of `{}`. diff --git a/docs/start/framework/react/overview.md b/docs/start/framework/react/overview.md index 3494b7a187..ced7b65458 100644 --- a/docs/start/framework/react/overview.md +++ b/docs/start/framework/react/overview.md @@ -1,12 +1,11 @@ --- id: overview title: TanStack Start Overview +description: Build full-stack React applications with TanStack Start, including server rendering, streaming, server functions, and type-safe routing. --- > [!NOTE] -> TanStack Start is currently in the **Release Candidate** stage! This means it is considered feature-complete and its API is considered stable. -> **This does not mean it is bug-free or without issues, which is why we invite you to try it out and provide feedback!** -> The road to v1 will likely be a quick one, so don't wait too long to try it out! +> TanStack Start is stable. If you're upgrading from a release candidate, follow [Migrate from the Release Candidate](./migrate-from-release-candidate). TanStack Start is a full-stack React framework powered by TanStack Router. It provides a full-document SSR, streaming, server functions, client/server builds, and more. With [Vite](https://vite.dev/) and [Rsbuild](https://rsbuild.dev/) support, it's ready to develop and deploy to the hosting provider or runtime you want. diff --git a/docs/start/framework/react/start-vs-nextjs.md b/docs/start/framework/react/start-vs-nextjs.md index 27b814725f..f1dd175a41 100644 --- a/docs/start/framework/react/start-vs-nextjs.md +++ b/docs/start/framework/react/start-vs-nextjs.md @@ -1,286 +1,67 @@ --- id: start-vs-nextjs title: TanStack Start vs Next.js +description: Compare TanStack Start and Next.js for routing, rendering, server functions, caching, deployment, and the work each framework handles for you. --- -Choosing between TanStack Start and Next.js isn't just about features - it's about understanding what each framework optimizes for and how those decisions cascade through your entire development experience. +TanStack Start is a good fit when you want TanStack Router's typed navigation, search parameters, and loaders in a full-stack application. Next.js is a good fit when you want the App Router's Server Component model and integrated image, font, and metadata tools. Both can build interactive applications and server-rendered websites. -This page explains the fundamental differences, addresses common misconceptions, and helps you make an informed decision. For a feature-by-feature matrix, see the [full comparison table](./comparison). Ready to switch? See the [migration guide](./migrate-from-next-js). +This comparison was checked on September 11, 2026 against the linked documentation, including Next.js 16.3. For a broader feature matrix, see [Start, Next.js, and React Router](./comparison). For a practical migration, see [Migrate from Next.js](./migrate-from-next-js). -**A note on benchmarks:** If someone quotes performance numbers comparing Start and Next without methodology, app complexity, hosting details, and configuration specifics - those numbers are meaningless. Comparisons must assume best practices on both sides. You can't give Next the benefit of optimized usage while assuming Start users misconfigure things. +## Rendering and interactivity -## Two Different Visions of React +Start's React components are server-rendered and hydrated by default. You can change rendering behavior per route with [selective SSR](./guide/selective-ssr), including data-only and client-only rendering. You do not need React Server Components to use Start's server functions or SSR. -Both frameworks want to help you build great React applications. But they start from different assumptions about what "great" means. +Next.js App Router layouts and pages are Server Components by default. A `use client` boundary enables client-side state, effects, and event handlers. It applies to the imported module tree, so you do not add the directive to every interactive component. Client Components can still contribute server-rendered HTML on the initial request. [Next.js component model](https://nextjs.org/docs/app/getting-started/server-and-client-components). -### Next.js: The Platform Play - -Next.js optimizes for **Vercel's vision of the web**: server-first rendering, tight platform integration, and automatic optimizations that work best on their infrastructure. - -The core bet: most web content is static or near-static. Server Components should be the default. Interactivity is the exception you opt into. The framework should make decisions for you, and those decisions should be optimized for their infrastructure. - -This works well if: - -- You're deploying to Vercel and want tight platform integration -- Your app is content-heavy with islands of interactivity -- You want the framework to make architectural decisions for you - -### TanStack Start: The Developer-First Play - -TanStack Start optimizes for **developer control and correctness**: type safety everywhere, explicit over implicit, composable primitives, and deployment freedom. - -The core bet: developers know their apps better than frameworks do. Server rendering is an optimization you opt into where it makes sense. The framework should give you powerful primitives and get out of your way. - -This works well if: - -- You want your deployment target to be a decision you make, not one the framework makes for you -- Your app is highly interactive -- You value type safety and explicit control -- You want to understand exactly what your code is doing - -## The Mental Model Gap - -This is the most important difference to understand. Everything else flows from it. - -### Both SSR - Different Defaults for Interactivity - -Let's be clear: both frameworks SSR by default, and both support static generation and React Server Components. The difference isn't capability - it's how you access those capabilities and how much control you have. - -**Next.js** defaults to Server Components. Every component is a Server Component unless you add `"use client"`. Server Components can't use state, effects, or event handlers - so the path to interactivity requires understanding the framework's implicit boundaries, caching layers, and serialization rules. - -**TanStack Start** defaults to interactive components (traditional React). Your components SSR and hydrate, ready for state and event handlers out of the box. You opt into Server Components where they provide value - for heavy static content, keeping secrets server-side, or reducing bundle size. - -Both approaches get you to the same destination. The question is: which direction feels like swimming upstream for _your_ app? - -Consider: - -- If most of your components need state, effects, or event handlers, Next's defaults mean constant `"use client"` annotations and thinking about serialization boundaries -- If most of your content is static, Start lets you explicitly opt those components into server-only rendering - with clearer control over caching and hydration -- Either way, Start gives you more granular control over _how_ things render, not just _where_ - -### Implicit vs Explicit - -Both frameworks handle the fundamentals - code splitting, caching, SSR, static optimization. The difference is visibility and predictability. **Next.js** layers implicit behaviors: multi-layer server-side caching with a history of breaking changes and community frustration, data fetching conventions tied to file structure, optimizations that require understanding the framework's internals to override. - -**TanStack Start** is explicit without being verbose. Loader functions, cache configuration, middleware chains - they're visible in your code, not hidden behind conventions. This doesn't mean more code; it means the code you write maps directly to what happens at runtime. - -## Architecture Deep Dive - -### The Build Pipeline - -**Next.js** uses a custom build system (historically Webpack, now Turbopack). It's tightly integrated with their architecture, which enables optimizations but limits flexibility. Turbopack has improved dev speed, but it's still no match for Vite or Rsbuild. - -**TanStack Start** supports Vite and Rsbuild. This means: - -- Faster dev server startup -- Faster HMR -- Access to modern plugin ecosystems -- Standard tooling that transfers to other projects - -### The Runtime - -**Next.js** ships a substantial runtime to support Server Components, server-side caching, automatic optimizations, and the App Router's conventions. This runtime has real weight. - -**TanStack Start** ships a minimal runtime. The router is powerful but lean. Server functions are thin RPC wrappers. There's no framework magic layer between you and React. - -Bundle size isn't everything, but it's the baseline everything else builds on. Start's architecture is designed to minimize runtime overhead - even with RSC support, the runtime stays lean. Much of Next's bundle weight is architectural tax, not feature weight. - -### The Type System - -**Next.js** has TypeScript support. **TanStack Start** is built around TypeScript. - -The difference matters: - -- In Next.js, the boundary between client and server creates type gaps. Server Actions can receive data that doesn't match what TypeScript expects. You need runtime validation to be safe. -- In Start, server functions have end-to-end type safety. Input validation, return types, middleware context, route parameters - all checked at compile time. - -In the age of AI-assisted development, end-to-end type safety should be non-negotiable. Types aren't just "nice for DX" - they're correctness guarantees that prevent production errors. +Start's [Server Components support](./guide/server-components) is **experimental and opt-in**. It uses client-led composition of server-produced UI. That is a different integration model from Next.js, and experimental support should not be presented as production feature parity. ## Routing -This is where TanStack shines brightest. TanStack Router (which powers Start) is the most powerful, type-safe router in any framework. +Start inherits [TanStack Router's routing model](/router/latest/docs/guide/type-safety). Route definitions connect the types for links, path parameters, validated search parameters, loaders, and route context. This is useful when application state lives in the URL or when many screens share typed data dependencies. -**Features Next.js doesn't have:** +Next.js also provides compile-time checking for links through its stable, opt-in [`typedRoutes`](https://nextjs.org/docs/app/api-reference/config/next-config-js/typedRoutes) option. Describing it as only IDE hints is inaccurate. The distinction is the scope of inference and validation across your application, not whether Next.js supports TypeScript. -- **Typesafe search params** - Define, validate, and parse search params with full type inference. Next gives you `?foo=bar` as strings; Start gives you validated, typed objects -- **Search param validation & middleware** - Transform and validate search params at the route level -- **Typesafe path params** - Path params are inferred and validated, not just `string | string[]` -- **Typesafe route context** - Pass typed context down through nested routes -- **Path param validation & custom parsing** - Parse `/users/123` as a number, validate it exists -- **Route mount/transition/unmount events** - Hook into the route lifecycle -- **Code-based routes** - Define routes in code when file-based doesn't fit -- **Built-in devtools** - Inspect router state, cache, and pending navigations -- **Element scroll restoration** - Restore scroll position for specific elements, not just the page -- **Navigation blocking** - `useBlocker` for unsaved changes warnings +In either framework, a valid route type does not prove that a database record exists or that a user may access it. Handle missing data and authorization at runtime. -**Type safety that actually works:** - -- Route paths are fully typed - typos are compile errors -- Links validate their destinations - no broken links in production -- Loaders know their route context - no guessing what data is available -- Search params are typed end-to-end - from URL to component - -Next.js has file-based routing that works, but the type safety is superficial (an IDE plugin for link hints) compared to TanStack Router's compile-time guarantees. - -**First-class integrations:** - -TanStack Router was designed from the ground up for isomorphism and hydration. This makes it the foundation for first-class integrations with TanStack Query and other data-fetching libraries. In Next, you wire up Query manually; in Start, it's a supported pattern with official integrations. - -See the [full router comparison](/router/latest/docs/framework/react/comparison) for the complete feature matrix. - -## The Caching Question - -Caching is where the philosophical differences become most visible. - -### Next.js: Implicit and Server-Side - -Next.js caches aggressively by default (or did - they've changed this multiple times). The caching happens in layers: - -- Request memoization -- Data cache -- Full route cache -- Router cache - -Each layer has its own invalidation semantics. The system has been rewritten multiple times with community criticism for being unpredictable. Next 15 simplified the defaults, but the fundamental complexity of server-side RSC stream caching remains. - -When people talk about "component caching," they're referring to caching serialized RSC streams on the server. This is more complicated than most realize: - -- You're caching text streams with complex invalidation semantics -- This happens in lambda-style environments with their own constraints -- Granular invalidation requires explicit tagging setup -- Cache misses cascade through the component tree in ways that aren't always predictable - -**Ask anyone claiming server-side component caching is special:** "How do you invalidate a cached RSC stream when a data dependency changes?" Most can't answer clearly. - -### TanStack Start: RSCs Are Just Data - -Start treats Server Component output the same as any other data flowing through your app. There's no special "component cache" with its own semantics - RSC payloads are data, and you cache data however you want: - -- **TanStack Router** - Built-in SWR-style caching with `staleTime` and `gcTime` -- **TanStack Query** - Full-featured async state management -- **CDN caching** - Standard HTTP cache headers at the edge -- **Redis, database, whatever** - It's just data; use your existing infrastructure - -```tsx -export const Route = createFileRoute('/posts/$postId')({ - loader: async ({ params }) => fetchPost(params.postId), - staleTime: 10_000, // Fresh for 10 seconds - gcTime: 5 * 60_000, // Keep in memory for 5 minutes -}) -``` - -This is the same SWR pattern TanStack Query has battle-tested across millions of applications. No new mental model. No framework-specific caching semantics to learn. No chasing ghosts. - -The caching layers are well-understood and compose naturally: - -- Client-side SWR caching (built into the router) -- CDN caching at the edge (standard HTTP semantics) -- Server-side caching where you want it (explicit, opt-in) - -You already know how to cache data. Start doesn't make you learn a new way. - -### The Bottom Line on RSCs - -Start has full RSC support with feature parity to Next.js. The difference is mental model and cognitive overhead. - -In Next, RSCs are the paradigm - you build around them, think about them constantly, manage their boundaries everywhere. In Start, RSCs are just another data primitive. Fetch them, cache them, compose them - using patterns you already know from TanStack Query and Router. - -We call our approach **Composite Components** - server-produced React components that the client can fetch, cache, stream, and assemble. The client owns composition; the server ships UI pieces. No new mental model. No framework-specific caching semantics. Just data flowing through tools you already understand. - -For the full deep-dive, see [Composite Components: Server Components with Client-Led Composition](https://tanstack.com/blog/composite-components). +For detailed navigation features, see the [Router comparison](/router/latest/docs/comparison). ## Server Functions vs Server Actions -Both frameworks let you call server code from the client. The approaches differ significantly. +Start's [server functions](./guide/server-functions) provide callable server endpoints with inferred inputs and outputs. You can choose GET or POST, supply an input validator, and compose [function middleware](./guide/middleware). Use runtime validation for untrusted inputs and server-side authorization for private data. -### Next.js Server Actions +Next.js Server Actions integrate with forms and React's pending and error-state APIs. They can validate input with a schema too. Receiving `FormData` does not prevent validation, and a TypeScript annotation does not perform validation in either framework. [Next.js forms and validation](https://nextjs.org/docs/app/guides/forms). -```tsx -'use server' +Choose the API that fits your application's data flow. A typed RPC call and a form action solve overlapping problems, but they are not interchangeable in every workflow. -export async function createPost(formData: FormData) { - const title = formData.get('title') - // No compile-time type safety on inputs - return db.posts.create({ title }) -} -``` +## Caching -Server Actions integrate with forms and transitions. They're convenient for simple cases but provide limited type safety at the boundary. +Start uses [TanStack Router's loader cache](/router/latest/docs/guide/data-loading) for navigation data, with options such as `staleTime` and `gcTime`. You can also use the [official Query integration](/router/latest/docs/integrations/query) when you need a separate query cache. Browser data caching, server data caching, and CDN response caching serve different purposes. -### TanStack Server Functions +Next.js documents explicit caching through Cache Components, enabled with `cacheComponents: true`. Its `use cache`, `cacheLife`, and tag-based revalidation APIs control reuse and invalidation. Applications without that option use a different documented caching model. Compare the configuration you intend to run, rather than treating every Next.js version and configuration as having the same defaults. [Next.js caching](https://nextjs.org/docs/app/getting-started/caching). -```tsx -export const createPost = createServerFn({ method: 'POST' }) - .validator(z.object({ title: z.string().min(1) })) - .middleware([authMiddleware]) - .handler(async ({ data, context }) => { - // data is typed and validated - // context comes from middleware, also typed - return db.posts.create({ title: data.title }) - }) -``` +Start's [ISR guide](./guide/isr) describes HTTP caching and provider-specific options. A `Cache-Control` header alone does not guarantee the same regeneration, invalidation, or shared-cache behavior on every host. Verify those behaviors on your deployment target. -Server functions give you: +## Build tools -- **Input validation** - Define schemas, get runtime validation and compile-time types -- **Middleware** - Composable, works on both client and server -- **Full type inference** - From input to output to error handling -- **Explicit RPC** - Clear mental model of what's happening +Start supports [Vite and Rsbuild](./build-from-scratch). Next.js integrates [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack), with its own supported configuration and plugin surface. Your existing build tooling can make one choice easier to adopt. -**Security note:** Start's architecture doesn't parse Flight data on the server - payloads flow one direction (server to client). Recent React security advisories around RSC serialization vulnerabilities don't apply to Start's model. +There is no benchmark in this comparison establishing a startup, HMR, build-time, memory, or runtime-size winner. A router package's bundle size is not the bundle size of a complete Start application. Measure the same application, dependencies, rendering behavior, hardware, and production deployment before drawing performance conclusions. + +## Deployment + +Start has [deployment guides](./guide/hosting) for several providers and runtimes. Check the guide for your chosen bundler and target, especially when you need streaming, image processing, background work, or cache invalidation. + +Next.js supports self-hosting. Its image optimizer works with `next start`, and its documentation covers ISR, shared caches, streaming, and multi-instance deployments. These features are not inherently Vercel-only. Operating them yourself still requires infrastructure configuration. [Next.js self-hosting](https://nextjs.org/docs/app/guides/self-hosting). ## Where Next.js Has the Advantage -Next.js has been around longer. That's not a technical advantage, but it creates real ecosystem effects: +Next.js is worth choosing when your application depends on its established Server Component integration, or when you want the built-in [`next/image`](https://nextjs.org/docs/app/api-reference/components/image), [`next/font`](https://nextjs.org/docs/app/api-reference/components/font), and [metadata conventions](https://nextjs.org/docs/app/getting-started/metadata-and-og-images). Replacing those facilities is migration work, even when alternatives exist. -**More content** - More tutorials, more Stack Overflow answers, more blog posts, more example repos. When you Google a problem, you're more likely to find a Next-specific answer. +If your team already maintains a working Next.js application, keep that experience and migration cost in the decision. A different routing model is not, by itself, a reason to rewrite a healthy application. -**Mindshare** - Next is the default recommendation in many circles. That means more developers have used it, which means more content, which reinforces the cycle. +## When to Choose TanStack Start -**Vercel integration** - Next.js is built by Vercel, so new Vercel platform features often ship with Next.js support first. That said, Start works great on Vercel too - you're not giving up preview deployments or edge functions by choosing Start. You're just not locked into Vercel as the only first-class option. +Start is worth choosing when typed URL state, route context, explicit loaders, and callable server functions fit how you build applications. Its [Router integration](./guide/routing), [selective SSR](./guide/selective-ssr), and [middleware](./guide/middleware) are concrete reasons to try it. -**Built-in image/font optimization** - Start supports image optimization via pluggable solutions (like [Unpic](https://unpic.pics/)), but it's not built-in. Whether "built-in" is better than "pluggable" depends on whether you want the framework making that choice for you. - -None of these are technical superiority - they're ecosystem and business model advantages. On the technical merits, we're confident in Start's approach. - -## What Start Does Better - -With RSC support, the question isn't "what does Start lack?" - it's: **"Why give up Start's router, type safety, caching design, and simpler mental model for Next's API design?"** - -**Type safety** - End-to-end, not bolted on. This prevents bugs and enables confident refactoring. - -**Routing** - The most powerful, type-safe router in any framework. Search params, path params, loaders, middleware - all fully typed. - -**Caching model** - Explicit SWR primitives you already understand if you've used TanStack Query. No implicit layers to debug. - -**Dev experience** - Vite and Rsbuild are fast. Instant startup, fast HMR, lower resource usage. This compounds over a workday - and even more so when AI agents are iterating on your code in tight loops. - -**Deployment as a feature** - Start treats deployment flexibility as a first-class feature. Cloudflare, Netlify, AWS, Fly, Railway, your own servers - they're all equally supported. Your app works the same everywhere because it's built on standards, not platform-specific optimizations. This means you can: - -- Choose hosting based on price, performance, or proximity to your users -- Switch providers without rewriting deployment logic -- Run the same code in development, staging, and production across different platforms -- Avoid accumulating platform-specific patterns that create friction later - -**Middleware** - Composable middleware that works at both the request level AND the server function level, on both client and server. - -**Debugging** - Predictable execution. When something breaks, you can trace it. No abstraction layers hiding behavior. - -## Summary - -| Aspect | TanStack Start | Next.js | -| -------------------- | ------------------------------------ | ------------------------------------- | -| **Philosophy** | Developer control, explicit patterns | Platform integration, conventions | -| **Components** | Interactive by default, opt into RSC | Server Components by default | -| **Type safety** | End-to-end, compile-time | TypeScript support with boundary gaps | -| **Server functions** | Typed, validated, middleware support | Untyped boundary, no middleware | -| **Caching** | Explicit SWR primitives | Multi-layer implicit caching | -| **Build tool** | Vite or Rsbuild | Turbopack/Webpack | -| **Deployment** | Equal support everywhere | Optimized for Vercel | -| **Routing** | Best-in-class type safety | File-based, basic types | -| **RSC** | Supported | Supported | -| **Maturity** | 2+ years, approaching 1.0 | 8+ years, historically unstable APIs | - ---- - -> **Ready to try Start?** See the [Getting Started guide](./getting-started) or [migrate from Next.js](./migrate-from-next-js). +Build one representative route before committing to a migration: load real data, validate search parameters, submit a mutation, handle unauthorized access, and deploy it. If those tasks become easier to maintain, you have evidence that Start fits your application. Continue with [Getting Started](./getting-started) or the [Next.js migration guide](./migrate-from-next-js). diff --git a/docs/start/framework/react/tutorial/reading-writing-file.md b/docs/start/framework/react/tutorial/reading-writing-file.md index 11b1be0794..f4af4480f1 100644 --- a/docs/start/framework/react/tutorial/reading-writing-file.md +++ b/docs/start/framework/react/tutorial/reading-writing-file.md @@ -152,7 +152,7 @@ export type JokesData = Joke[] ### Step 1.3: Create Server Functions to Read the File -Let's create a new file `src/serverActions/jokesActions.ts` to create a server function to perform a read-write operation. We will be creating a server function using [`createServerFn`](https://tanstack.com/start/latest/docs/framework/react/server-functions). +Let's create a new file `src/serverActions/jokesActions.ts` to create a server function to perform a read-write operation. We will be creating a server function using [`createServerFn`](https://tanstack.com/start/latest/docs/framework/react/guide/server-functions). ```tsx // src/serverActions/jokesActions.ts diff --git a/docs/start/framework/solid/guide/authentication.md b/docs/start/framework/solid/guide/authentication.md index 8ae205ef21..460a58747c 100644 --- a/docs/start/framework/solid/guide/authentication.md +++ b/docs/start/framework/solid/guide/authentication.md @@ -1,11 +1,12 @@ --- id: authentication -title: Authentication +title: Implement Authentication in SolidJS +description: Implement sessions, sign-in, sign-out, protected routes, and server-side authorization in a TanStack Start SolidJS app. --- -This guide covers authentication patterns and shows how to implement your own authentication system with TanStack Start. +Implement the authentication workflow in your SolidJS app, from sessions and sign-in to protected routes and authorization. -> **📋 Before You Start:** Check our [Authentication Overview](./authentication-overview.md) for all available options including partner solutions and hosted services. +To compare libraries and hosted services, read [Choose Authentication for SolidJS Apps](./authentication-overview.md). ## Authentication Approaches @@ -34,7 +35,7 @@ Authentication involves many considerations including password security, session - **Authentication**: Who is this user? (Login/logout) - **Authorization**: What can this user do? (Permissions/roles) -TanStack Start provides the tools for both through server functions, sessions, and route protection. +TanStack Start provides server functions, request and cookie utilities, and route protection. Session storage and authentication come from your application or a library you choose. > Protect the data/API boundary first. Any server function, server route, or other API endpoint that returns or mutates private data must authorize the request itself. `beforeLoad` is useful for route UX: it keeps users out of screens they cannot use and avoids triggering work that would fail anyway. It is not the security boundary for the data. See [Authentication Server Primitives](./authentication-server-primitives.md) for the server-side pattern. @@ -47,6 +48,7 @@ Server functions handle sensitive authentication logic securely on the server: ```tsx import { createServerFn } from '@tanstack/solid-start' import { redirect } from '@tanstack/solid-router' +import { getAppSession } from '~/utils/session' // Login server function export const loginFn = createServerFn({ method: 'POST' }) @@ -60,11 +62,9 @@ export const loginFn = createServerFn({ method: 'POST' }) } // Create session - const session = await useAppSession() - await session.update({ - userId: user.id, - email: user.email, - }) + const session = await getAppSession() + session.userId = user.id + await session.save() // Redirect to protected area throw redirect({ to: '/dashboard' }) @@ -72,98 +72,131 @@ export const loginFn = createServerFn({ method: 'POST' }) // Logout server function export const logoutFn = createServerFn({ method: 'POST' }).handler(async () => { - const session = await useAppSession() - await session.clear() + const session = await getAppSession() + session.destroy() throw redirect({ to: '/' }) }) // Get current user export const getCurrentUserFn = createServerFn({ method: 'GET' }).handler( async () => { - const session = await useAppSession() - const userId = session.get('userId') + const session = await getAppSession() + const userId = session.userId if (!userId) { return null } - return await getUserById(userId) + const user = await getUserById(userId) + return user ? { id: user.id, email: user.email, role: user.role } : null }, ) ``` ### 2. Session Management -TanStack Start provides secure HTTP-only cookie sessions: +Start does not provide a session API. This guide uses iron-session for encrypted cookie sessions. Start's cookie helpers connect it to server functions, server routes, and request middleware. + +For encrypted cookie sessions, install [iron-session](https://github.com/vvo/iron-session): + +```sh +pnpm add iron-session +``` + +This example uses iron-session 9's cookie adapter. Its Node runtime requires Node 22.13 or newer; check the library's runtime requirements for other deployment targets. ```tsx -// utils/session.ts -import { useSession } from '@tanstack/solid-start/server' +// utils/session.ts — import only from server code +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/solid-start/server' type SessionData = { - userId?: string - email?: string - role?: string + userId: string + oauthState: string } -export function useAppSession() { - return useSession({ - // Session configuration - name: 'app-session', - password: process.env.SESSION_SECRET!, // At least 32 characters - // Optional: customize cookie settings - cookie: { - secure: process.env.NODE_ENV === 'production', - sameSite: 'lax', - httpOnly: true, +export function getAppSession(ttl = 7 * 24 * 60 * 60) { + const password = process.env.SESSION_SECRET + if (!password || password.length < 32) { + throw new Error('SESSION_SECRET must be at least 32 characters') + } + + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'app-session', + password, + ttl, + cookieOptions: { + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + httpOnly: true, + path: '/', + }, }, - }) + ) } ``` +Read fields directly from the returned session, change them, then `await session.save()` before returning or redirecting. Missing or expired sessions have no user ID. `session.destroy()` removes the browser cookie. Keep one session object for the operation; another call to `getAppSession()` reads the incoming request again. For middleware, pass that object through request context when downstream code needs the same mutations. + +The `getAppSession` helper belongs to your application. Start does not cache sessions, choose expiration rules, or synchronize concurrent writes. Keep secrets and session objects in server code, and read request-specific configuration inside the active request. + ### 3. Authentication Context -Share authentication state across your application: +Load the current user in your root route's `beforeLoad` so the initial server render and child routes receive the same authentication state. `useServerFn` returns a callable function, not an object with `data`, `isLoading`, or `refetch`. You can call a server function directly from `beforeLoad`. + +Merge this pattern into your existing root route, keeping its metadata and document shell: ```tsx -// contexts/auth.tsx -import { createContext, useContext } from 'solid-js' -import { useServerFn } from '@tanstack/solid-start' +// routes/__root.tsx +import { + createRootRoute, + HeadContent, + Outlet, + Scripts, +} from '@tanstack/solid-router' +import type { JSX } from 'solid-js' import { getCurrentUserFn } from '../server/auth' -type User = { - id: string - email: string - role: string -} - -type AuthContextType = { - user: User | null - isLoading: boolean - refetch: () => void -} - -const AuthContext = createContext(undefined) - -export function AuthProvider(props) { - const { data: user, isLoading, refetch } = useServerFn(getCurrentUserFn) +export const Route = createRootRoute({ + headers: () => ({ 'Cache-Control': 'private, no-store' }), + beforeLoad: async () => ({ user: await getCurrentUserFn() }), + component: Outlet, + shellComponent: RootDocument, +}) +function RootDocument({ children }: { children: JSX.Element }) { return ( - - {props.children} - + + + + + + {children} + + + ) } +``` -export function useAuth() { - const context = useContext(AuthContext) - if (!context) { - throw new Error('useAuth must be used within AuthProvider') - } - return context +The root includes session-specific data, so its responses use `Cache-Control: private, no-store`. Keep that policy on child routes that render this data, and do not override it with public caching at your CDN. + +Read that state from a descendant component: + +```tsx +// components/AuthStatus.tsx +import { Route } from '../routes/__root' + +export function AuthStatus() { + const context = Route.useRouteContext() + return {context().user?.email ?? 'Signed out'} } ``` +After login or logout changes the session, call `await router.invalidate()` to reload the current user and rerun route guards. Keep private-data authorization in the server function itself, even when a route already checks the user. + ### 4. Route Protection Protect routes using `beforeLoad`: @@ -240,8 +273,9 @@ export const registerFn = createServerFn({ method: 'POST' }) }) // Create session - const session = await useAppSession() - await session.update({ userId: user.id }) + const session = await getAppSession() + session.userId = user.id + await session.save() return { success: true, user: { id: user.id, email: user.email } } }) @@ -309,8 +343,9 @@ export const initiateOAuthFn = createServerFn({ method: 'POST' }) const state = generateRandomState() // Store state in session for CSRF protection - const session = await useAppSession() - await session.update({ oauthState: state }) + const session = await getAppSession() + session.oauthState = state + await session.save() // Generate OAuth URL const authUrl = generateOAuthUrl(provider, state) @@ -373,21 +408,9 @@ const hashedPassword = await bcrypt.hash(password, saltRounds) ### 2. Session Security -```tsx -// Use secure session configuration -export function useAppSession() { - return useSession({ - name: 'app-session', - password: process.env.SESSION_SECRET!, // 32+ characters - cookie: { - secure: process.env.NODE_ENV === 'production', // HTTPS only in production - sameSite: 'lax', // CSRF protection - httpOnly: true, // XSS protection - maxAge: 7 * 24 * 60 * 60, // 7 days - }, - }) -} -``` +Set the library's server-validated expiration as well as appropriate cookie attributes. In the iron-session example, `ttl` limits a sealed credential's lifetime from its latest save; saving again renews it. A numeric `cookieOptions.maxAge` controls browser retention. In iron-session 9, explicitly setting `maxAge: undefined` also disables seal expiry; omit the property to use the configured `ttl`. Use an application-validated timestamp or a server-side record if you also need an absolute lifetime that writes cannot extend. + +Use `httpOnly`, `sameSite`, and `path` deliberately, and require `secure: true` on HTTPS deployments. These cookie attributes complement server-side authorization and CSRF protections. Keep only the minimum session data and load current account permissions from their authoritative store. Logout removes a stateless cookie from the current browser; it cannot revoke a copy without server-side state. ### 3. Rate Limiting @@ -489,28 +512,70 @@ describe('Authentication Flow', () => { ### Loading States +Call the function returned by `useServerFn` with `{ data }`. Track pending state in the component, handle invalid credentials, and refresh route context after a successful login. This form uses the `loginFn` from the server-functions example above. It requires JavaScript, so the fields stay disabled until hydration; `method="post"` also prevents credentials appearing in a native GET submission. + ```tsx -function LoginForm() { +// components/LoginForm.tsx +import { createSignal } from 'solid-js' +import { useHydrated, useRouter } from '@tanstack/solid-router' +import { useServerFn } from '@tanstack/solid-start' +import { loginFn } from '../server/auth' + +export function LoginForm() { + const hydrated = useHydrated() const [isLoading, setIsLoading] = createSignal(false) - const loginMutation = useServerFn(loginFn) + const [error, setError] = createSignal('') + const login = useServerFn(loginFn) + const router = useRouter() + + const handleSubmit = async ( + event: SubmitEvent & { currentTarget: HTMLFormElement }, + ) => { + event.preventDefault() + const formData = new FormData(event.currentTarget) + const email = formData.get('email') + const password = formData.get('password') + if (typeof email !== 'string' || typeof password !== 'string') { + return + } - const handleSubmit = async (data: LoginData) => { setIsLoading(true) + setError('') try { - await loginMutation.mutate(data) - } catch (error) { - // Handle error + const result = await login({ data: { email, password } }) + if (result?.error) { + setError(result.error) + return + } + await router.invalidate() + } catch { + setError('Login failed. Please try again.') } finally { setIsLoading(false) } } return ( -
- {/* Form fields */} - + +
+ + + +
+

{error()}

) } @@ -525,16 +590,14 @@ export const loginFn = createServerFn({ method: 'POST' }) ) .handler(async ({ data }) => { const user = await authenticateUser(data.email, data.password) - if (!user) return { error: 'Invalid credentials' } + if (!user) { + return { error: 'Invalid credentials' } + } - const session = await useAppSession() - await session.update( - { userId: user.id }, - { - // Extend session if remember me is checked - maxAge: data.rememberMe ? 30 * 24 * 60 * 60 : undefined, // 30 days vs session - }, - ) + const ttl = data.rememberMe ? 30 * 24 * 60 * 60 : 8 * 60 * 60 + const session = await getAppSession(ttl) + session.userId = user.id + await session.save() return { success: true } }) @@ -554,7 +617,6 @@ If you're migrating from client-side authentication (localStorage, context only) ### From Other Frameworks - **Next.js**: Replace API routes with server functions, migrate NextAuth sessions -- **Remix**: Convert loaders/actions to server functions, adapt session patterns - **SvelteKit**: Move form actions to server functions, update route protection ## Production Considerations diff --git a/docs/start/framework/solid/guide/client-entry-point.md b/docs/start/framework/solid/guide/client-entry-point.md index b73408e8e4..929efc7a2d 100644 --- a/docs/start/framework/solid/guide/client-entry-point.md +++ b/docs/start/framework/solid/guide/client-entry-point.md @@ -3,8 +3,6 @@ id: client-entry-point title: Client Entry Point --- -# Client Entry Point - > [!NOTE] > The client entry point is **optional** out of the box. If not provided, TanStack Start will automatically handle the client entry point for you using the below as a default. diff --git a/docs/start/framework/solid/guide/reading-writing-file.md b/docs/start/framework/solid/guide/reading-writing-file.md deleted file mode 100644 index 5aa48d8188..0000000000 --- a/docs/start/framework/solid/guide/reading-writing-file.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -ref: docs/start/framework/react/guide/reading-writing-file.md -replace: - { '@tanstack/react-start': '@tanstack/solid-start', 'React': 'SolidJS' } ---- diff --git a/docs/start/framework/solid/migrate-from-release-candidate.md b/docs/start/framework/solid/migrate-from-release-candidate.md new file mode 100644 index 0000000000..9f988a14fc --- /dev/null +++ b/docs/start/framework/solid/migrate-from-release-candidate.md @@ -0,0 +1,8 @@ +--- +ref: docs/start/framework/react/migrate-from-release-candidate.md +replace: + { + '@tanstack/react-start': '@tanstack/solid-start', + '@tanstack/react-router': '@tanstack/solid-router', + } +--- diff --git a/docs/start/framework/solid/tutorial/reading-writing-file.md b/docs/start/framework/solid/tutorial/reading-writing-file.md index de3d4d472e..09b58c38f5 100644 --- a/docs/start/framework/solid/tutorial/reading-writing-file.md +++ b/docs/start/framework/solid/tutorial/reading-writing-file.md @@ -1,6 +1,8 @@ --- id: reading-and-writing-file title: Building a Full Stack DevJokes App with TanStack Start +redirect_from: + - /framework/solid/guide/reading-writing-file --- This tutorial will guide you through building a complete full-stack application using TanStack Start. You'll create a DevJokes app where users can view and add developer-themed jokes, demonstrating key concepts of TanStack Start including server functions, file-based data storage, and Solid components. @@ -152,7 +154,7 @@ export type JokesData = Joke[] ### Step 1.3: Create Server Functions to Read the File -Let's create a new file `src/serverActions/jokesActions.ts` to create a server function to perform a read-write operation. We will be creating a server function using [`createServerFn`](https://tanstack.com/start/latest/docs/framework/solid/server-functions). +Let's create a new file `src/serverActions/jokesActions.ts` to create a server function to perform a read-write operation. We will be creating a server function using [`createServerFn`](https://tanstack.com/start/latest/docs/framework/solid/guide/server-functions). ```tsx // src/serverActions/jokesActions.ts diff --git a/e2e/AGENTS.md b/e2e/AGENTS.md new file mode 100644 index 0000000000..f373ecba4f --- /dev/null +++ b/e2e/AGENTS.md @@ -0,0 +1,9 @@ +# E2E tests + +- Read the project's `package.json` and test config. Inspect resolved targets with `CI=1 NX_DAEMON=false pnpm nx show project --json`: `nx.metadata.playwrightModes` generates modes, variants, and shards. The aggregate `test:e2e` can also run extra package-script suites. For focused Playwright runs, select an executable test target (a mode/shard target when inferred) and append filters after `--` (e.g. `-- tests/navigation.spec.ts --grep "redirect"`). +- Check Playwright's `webServer.command` to select dev or production coverage. A mode named `ssr` can still start a dev server. `e2e/eslint-plugin-start` uses Vitest instead of Playwright. +- For inferred Playwright modes, Nx builds first and supplies `MODE`, `E2E_TOOLCHAIN`, `E2E_DIST_DIR`, and `E2E_PORT_KEY`. Preserve these in server/config changes; let Nx own the build while `webServer.command` only starts the selected server. Target generation lives in [`scripts/nx/playwright-plugin.ts`](../scripts/nx/playwright-plugin.ts). +- Use the same `E2E_PORT_KEY`-aware key throughout config, app, and dummy-server setup/teardown. Clean only that key's port files, before allocation, when `TEST_WORKER_INDEX === undefined`; worker config reloads must not remap a running server's port. +- For new browser tests, reuse the local error-checking fixture. The shared `test` from `@tanstack/router-e2e-utils` fails on unexpected `console.error`, including hydration errors; allow only expected errors with `whitelistErrors`. +- HMR/watch tests edit real app sources. Reuse existing edit/restore helpers such as `createHmrFileEditor`, restore edits in teardown even after failures, and preserve the suites' single-worker and Nx `parallelism: false` settings. +- `@tanstack/router-e2e-utils:test:unit` is a placeholder. Validate helper changes through consuming e2e projects. diff --git a/e2e/e2e-utils/mock-api.mjs b/e2e/e2e-utils/mock-api.mjs new file mode 100644 index 0000000000..f92ec840e5 --- /dev/null +++ b/e2e/e2e-utils/mock-api.mjs @@ -0,0 +1,4 @@ +import { setupServer } from 'msw/node' +import { apiHandlers } from './src/api-handlers.ts' + +setupServer(...apiHandlers).listen({ onUnhandledRequest: 'bypass' }) diff --git a/e2e/e2e-utils/package.json b/e2e/e2e-utils/package.json index a0708e0475..fcfa5f8dc0 100644 --- a/e2e/e2e-utils/package.json +++ b/e2e/e2e-utils/package.json @@ -5,7 +5,7 @@ "clean": "rimraf ./dist && rimraf ./coverage", "build": "vite build", "test:eslint": "eslint ./src", - "test:unit": "exit 0; vitest --typecheck" + "test:unit": "vitest run" }, "type": "module", "types": "dist/types/index.d.ts", @@ -22,7 +22,8 @@ "default": "./dist/cjs/index.cjs" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./mock-api": "./mock-api.mjs" }, "sideEffects": false, "files": [ @@ -30,12 +31,14 @@ "src" ], "engines": { - "node": ">=20.19" + "node": "^22.18.0 || >=24.0.0" }, - "dependencies": {}, "devDependencies": { - "get-port-please": "^3.2.0", + "@msw/playwright": "0.6.7", + "msw": "2.15.0", + "rimraf": "catalog:", "vite": "^8.0.14", - "vite-plugin-dts": "^4.5.4" + "vite-plugin-dts": "^4.5.4", + "vitest": "catalog:" } } diff --git a/e2e/e2e-utils/src/api-fixture.ts b/e2e/e2e-utils/src/api-fixture.ts new file mode 100644 index 0000000000..90ca1912a3 --- /dev/null +++ b/e2e/e2e-utils/src/api-fixture.ts @@ -0,0 +1,17 @@ +import { test as base } from '@playwright/test' +import { defineNetworkFixture } from '@msw/playwright' +import { apiHandlers } from './api-handlers' + +// Opt in only for suites that consume the canned API. Playwright routing +// disables HTTP caching; other suites keep their normal browser behavior. +export const apiTest = base.extend<{ mockApi: void }>({ + mockApi: [ + async ({ context }, use) => { + const network = defineNetworkFixture({ context, handlers: apiHandlers }) + await network.enable() + await use() + await network.disable() + }, + { auto: true }, + ], +}) diff --git a/e2e/e2e-utils/src/api-handlers.ts b/e2e/e2e-utils/src/api-handlers.ts new file mode 100644 index 0000000000..4e2c0498f4 --- /dev/null +++ b/e2e/e2e-utils/src/api-handlers.ts @@ -0,0 +1,32 @@ +import { HttpResponse, http } from 'msw' +import { posts } from './posts.ts' +import { users } from './users.ts' + +export const apiHandlers = [ + ...Object.entries({ posts, users }).flatMap(([resource, data]) => [ + http.get(`https://jsonplaceholder.typicode.com/${resource}`, () => + HttpResponse.json(data), + ), + http.get( + `https://jsonplaceholder.typicode.com/${resource}/:id`, + ({ params }) => { + const id = parseInt(String(params.id)) + if (Number.isNaN(id)) { + return HttpResponse.json( + { error: `invalid ${resource.slice(0, -1)} id` }, + { status: 404 }, + ) + } + const item = data.find((entry) => entry.id === id) + return item + ? HttpResponse.json(item) + : new HttpResponse(null, { + headers: { 'content-type': 'application/json' }, + }) + }, + ), + ]), + http.all('https://jsonplaceholder.typicode.com/*', () => + HttpResponse.error(), + ), +] diff --git a/e2e/e2e-utils/src/derivePort.ts b/e2e/e2e-utils/src/derivePort.ts deleted file mode 100644 index 3ecb86cb53..0000000000 --- a/e2e/e2e-utils/src/derivePort.ts +++ /dev/null @@ -1,27 +0,0 @@ -import fs from 'node:fs' -import { getRandomPort } from 'get-port-please' - -/** - * Check if a port has been allocated, if it hasn't generate a random port and save it. - * @param {string} input - port test allocation - * @returns {number} A random port. - */ -export async function derivePort(input: string): Promise { - const portFile = `port-${input}.txt` - - if (!fs.existsSync(portFile)) { - fs.writeFileSync(portFile, (await getRandomPort()).toString()) - } - - const portNumber = parseInt(await fs.promises.readFile(portFile, 'utf-8')) - console.info(`Mapped "${input}" to port ${portNumber}`) - return portNumber -} - -export async function getDummyServerPort(input: string): Promise { - return await derivePort(`${input}-external`) -} - -export async function getTestServerPort(input: string): Promise { - return await derivePort(input) -} diff --git a/e2e/e2e-utils/src/e2eSetupTeardown.ts b/e2e/e2e-utils/src/e2eSetupTeardown.ts deleted file mode 100644 index d1acf4740e..0000000000 --- a/e2e/e2e-utils/src/e2eSetupTeardown.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { localDummyServer } from './localDummyServer' -import { getDummyServerPort } from './derivePort' - -export async function e2eStartDummyServer(input: string) { - const port = await getDummyServerPort(input) - - return await localDummyServer(port) -} - -export async function e2eStopDummyServer(input: string) { - const port = await getDummyServerPort(input) - - await fetch(`http://localhost:${port}/stop`, { - method: 'POST', - }) -} diff --git a/e2e/e2e-utils/src/index.ts b/e2e/e2e-utils/src/index.ts index 17e58f82e5..960a01a9be 100644 --- a/e2e/e2e-utils/src/index.ts +++ b/e2e/e2e-utils/src/index.ts @@ -1,10 +1,9 @@ -export { derivePort, getDummyServerPort, getTestServerPort } from './derivePort' -export { localDummyServer } from './localDummyServer' -export { toRuntimePath } from './to-runtime-path' -export { resolveRuntimeSuffix } from './resolve-runtime-suffix' -export { e2eStartDummyServer, e2eStopDummyServer } from './e2eSetupTeardown' +export { apiTest } from './api-fixture' export { preOptimizeDevServer, waitForServer } from './devServerWarmup' +export { collectBrowserErrors, test } from './fixture' export { createHmrFileEditor, replaceAll } from './hmrFileEditor' export type { HmrFileEditorOptions } from './hmrFileEditor' export type { Post } from './posts' -export { collectBrowserErrors, test } from './fixture' +export { resolveRuntimeSuffix } from './resolve-runtime-suffix' +export { toRuntimePath } from './to-runtime-path' +export { appServerReady, appServerReadyPattern } from './webServer' diff --git a/e2e/e2e-utils/src/localDummyServer.ts b/e2e/e2e-utils/src/localDummyServer.ts deleted file mode 100644 index d452f54c59..0000000000 --- a/e2e/e2e-utils/src/localDummyServer.ts +++ /dev/null @@ -1,128 +0,0 @@ -import http from 'node:http' -import { posts } from './posts' -import { users } from './users' - -// some tests redirect to an external host -// however, in CI this is unstable due to network conditions -// so here we spawn a local server to simulate the external host - -export async function localDummyServer(port: number) { - const server = http.createServer((req, res) => { - // Set CORS headers - res.setHeader('Access-Control-Allow-Origin', '*') - res.setHeader('Access-Control-Request-Method', '*') - res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET, POST') - res.setHeader('Access-Control-Allow-Headers', '*') - - if (req.method === 'OPTIONS') { - res.writeHead(200) - res.end() - return - } - }) - - server.on('request', (req, res) => { - const url = new URL(req.url!, 'http://localhost') - - if (res.req.method === 'GET' && url.pathname === '/') { - res.writeHead(200, { 'Content-Type': 'text/html' }) - res.end('Hello World') - } - }) - - server.on('request', (req, res) => { - const url = new URL(req.url!, `http://localhost`) - - if (res.req.method === 'POST' && url.pathname === '/stop') { - server.close() - console.info( - `stopped local dummy server running at http://localhost:${port}`, - ) - - res.writeHead(200) - res.end() - } - }) - - server.on('request', (req, res) => { - const url = new URL(req.url ?? '/', `http://localhost`) - - if (req.method === 'GET' && url.pathname.startsWith('/posts')) { - const parts = url.pathname.split('/') - - if (parts.length === 2) { - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify(posts)) - return - } - - if (parts[2]) { - const postId = parseInt(parts[2]) - - if (isNaN(postId)) { - res.writeHead(404) - res.end(JSON.stringify({ error: 'invalid post id' })) - return - } - - const post = posts.find((post) => post.id === postId) - - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify(post)) - return - } - - res.writeHead(404) - res.end(JSON.stringify({ error: 'invalid posts path' })) - return - } - }) - - server.on('request', (req, res) => { - const url = new URL(req.url ?? '/', `http://localhost`) - - if (req.method === 'GET' && url.pathname.startsWith('/users')) { - const parts = url.pathname.split('/') - - if (parts.length === 2) { - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify(users)) - return - } - - if (parts[2]) { - const userId = parseInt(parts[2]) - - if (isNaN(userId)) { - res.writeHead(404) - res.end(JSON.stringify({ error: 'invalid user id' })) - return - } - - const user = users.find((user) => user.id === userId) - - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify(user)) - return - } - - res.writeHead(404) - res.end(JSON.stringify({ error: 'invalid users path' })) - return - } - }) - - const startServer = new Promise((resolve) => { - server.listen(port, 'localhost', () => { - console.info( - `started local dummy server running at http://localhost:${port}`, - ) - resolve() - }) - }) - - await startServer - - await new Promise((r) => setTimeout(r, 500)) - return server -} diff --git a/e2e/e2e-utils/src/webServer.ts b/e2e/e2e-utils/src/webServer.ts new file mode 100644 index 0000000000..77536e4c69 --- /dev/null +++ b/e2e/e2e-utils/src/webServer.ts @@ -0,0 +1,9 @@ +// Vite, Rsbuild, srvx, serve, and the custom E2E servers print their bound +// address only after listening. Playwright exports named captures to workers. +export const appServerReadyPattern = + /(?:Local:|Listening on|Accepting connections at|E2E app:)[^\n]*?https?:\/\/(?:localhost|127\.0\.0\.1|\[::\]):(?\d+)/ + +export const appServerReady = { + stdout: appServerReadyPattern, + stderr: appServerReadyPattern, +} diff --git a/e2e/e2e-utils/tests/mock-api.test.ts b/e2e/e2e-utils/tests/mock-api.test.ts new file mode 100644 index 0000000000..ba25c1254d --- /dev/null +++ b/e2e/e2e-utils/tests/mock-api.test.ts @@ -0,0 +1,53 @@ +import { execFile } from 'node:child_process' +import { promisify } from 'node:util' +import { fileURLToPath } from 'node:url' +import { expect, test } from 'vitest' + +const execFileAsync = promisify(execFile) +const preload = fileURLToPath(new URL('../mock-api.mjs', import.meta.url)) + +test('independent Node processes mock the API with networking disabled', async () => { + const script = ` + const { Socket } = await import('node:net') + Socket.prototype.connect = () => { throw new Error('Network disabled') } + const posts = await fetch('https://jsonplaceholder.typicode.com/posts').then(r => r.json()) + const user = await fetch('https://jsonplaceholder.typicode.com/users/1').then(r => r.json()) + const invalid = await fetch('https://jsonplaceholder.typicode.com/posts/invalid') + const missing = await fetch('https://jsonplaceholder.typicode.com/posts/999') + console.log(JSON.stringify({ post: posts[0].id, user: user.id, invalid: invalid.status, missing: await missing.text() })) + ` + const results = await Promise.all( + [0, 1].map(() => + execFileAsync(process.execPath, ['--import', preload, '--eval', script]), + ), + ) + for (const result of results) { + expect(JSON.parse(result.stdout)).toEqual({ + post: 1, + user: 1, + invalid: 404, + missing: '', + }) + } +}) + +test('unhandled API requests fail without reaching the network', async () => { + const script = ` + const { Socket } = await import('node:net') + let connections = 0 + Socket.prototype.connect = () => { connections++; throw new Error('Network disabled') } + try { + await fetch('https://jsonplaceholder.typicode.com/unhandled') + process.exitCode = 1 + } catch { + console.log(JSON.stringify({ connections })) + } + ` + const result = await execFileAsync(process.execPath, [ + '--import', + preload, + '--eval', + script, + ]) + expect(JSON.parse(result.stdout)).toEqual({ connections: 0 }) +}) diff --git a/e2e/e2e-utils/tests/webServer.test.ts b/e2e/e2e-utils/tests/webServer.test.ts new file mode 100644 index 0000000000..fd3a8b239c --- /dev/null +++ b/e2e/e2e-utils/tests/webServer.test.ts @@ -0,0 +1,23 @@ +import { stripVTControlCharacters } from 'node:util' +import { expect, test } from 'vitest' +import { appServerReadyPattern } from '../src/webServer' + +test.each([ + '➜ Local: http://localhost:49152/', + '\u001b[32m➜\u001b[39m \u001b[1mLocal\u001b[22m: \u001b[36mhttp://localhost:\u001b[1m49152\u001b[22m/\u001b[39m', + 'Listening on http://[::]:49152', + 'E2E app: http://localhost:49152', + 'Accepting connections at http://localhost:49152', + 'Local: https://localhost:49152/', +])('captures a bound application port from %s', (line) => { + expect( + appServerReadyPattern.exec(stripVTControlCharacters(line))?.groups + ?.E2E_APP_PORT, + ).toBe('49152') +}) + +test('does not confuse an arbitrary URL with app readiness', () => { + expect(appServerReadyPattern.test('fetching http://localhost:49152')).toBe( + false, + ) +}) diff --git a/e2e/e2e-utils/tsconfig.json b/e2e/e2e-utils/tsconfig.json index 9b21ee123b..5561f5d28f 100644 --- a/e2e/e2e-utils/tsconfig.json +++ b/e2e/e2e-utils/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "../../tsconfig.json", - "include": ["src", "vite.config.ts", "tests"] + "include": ["src", "vite.config.ts", "tests"], + "compilerOptions": { + "rewriteRelativeImportExtensions": true + } } diff --git a/e2e/eslint-plugin-start/package.json b/e2e/eslint-plugin-start/package.json index 87bc81bfe9..e3591d7d1b 100644 --- a/e2e/eslint-plugin-start/package.json +++ b/e2e/eslint-plugin-start/package.json @@ -61,6 +61,6 @@ "eslint": "^9.22.0", "react": "^19.0.0", "typescript": "^5.7.2", - "vitest": "^4.1.4" + "vitest": "catalog:" } } diff --git a/e2e/react-router/basepath-file-based/package.json b/e2e/react-router/basepath-file-based/package.json index a155cc2173..3dfbb58180 100644 --- a/e2e/react-router/basepath-file-based/package.json +++ b/e2e/react-router/basepath-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", diff --git a/e2e/react-router/basepath-file-based/playwright.config.ts b/e2e/react-router/basepath-file-based/playwright.config.ts index 6069bbe59f..4eead86444 100644 --- a/e2e/react-router/basepath-file-based/playwright.config.ts +++ b/e2e/react-router/basepath-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basepath-file-based/tests/scroll-restoration-session-storage-error.test.ts b/e2e/react-router/basepath-file-based/tests/scroll-restoration-session-storage-error.test.ts index 06b90f6528..d6a50de840 100644 --- a/e2e/react-router/basepath-file-based/tests/scroll-restoration-session-storage-error.test.ts +++ b/e2e/react-router/basepath-file-based/tests/scroll-restoration-session-storage-error.test.ts @@ -1,5 +1,41 @@ -/* eslint-disable */ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' +import type { Page } from '@playwright/test' + +async function reloadAfterStorageFailure(page: Page) { + const errors: Array = [] + page.on('pageerror', (error) => errors.push(error.message)) + const snapshot = await page.evaluate(async () => { + let failures = 0 + const setItem = Storage.prototype.setItem + Storage.prototype.setItem = function (...args) { + try { + return setItem.apply(this, args) + } catch (error) { + failures++ + throw error + } + } + const scrolled = new Promise((resolve) => + addEventListener('scroll', () => resolve(), { once: true }), + ) + scrollTo(0, 200) + await scrolled + // Handler integration; genuine reload handoff is covered by the Start suite. + dispatchEvent(new PageTransitionEvent('pagehide', { persisted: false })) + return { mode: history.scrollRestoration, failures } + }) + expect(snapshot.failures).toBeGreaterThan(0) + // Storage failure must still allow native fallback; failure to restore is not a requirement. + expect(snapshot.mode).toBe('auto') + await page.reload() + await page.waitForLoadState('networkidle') + await expect( + page.getByRole('heading', { name: 'Scroll Error Test' }), + ).toBeVisible() + expect(await page.evaluate(() => history.scrollRestoration)).toBe('manual') + expect(errors).toEqual([]) +} test.describe('Scroll Restoration with Session Storage Error', () => { test('should not crash when sessionStorage.setItem throws an error', async ({ @@ -9,22 +45,12 @@ test.describe('Scroll Restoration with Session Storage Error', () => { await page.waitForLoadState('networkidle') await page.evaluate(() => { - sessionStorage.setItem = () => { + Storage.prototype.setItem = () => { throw new Error('Test Error') } }) - await page.evaluate(() => window.scrollTo(0, 200)) - await page.waitForTimeout(150) - - await page.reload() - await page.waitForLoadState('networkidle') - - const heading = page.locator('h1:has-text("Scroll Error Test")') - await expect(heading).toBeVisible() - - const scrollPosition = await page.evaluate(() => window.scrollY) - expect(scrollPosition).not.toBe(200) + await reloadAfterStorageFailure(page) }) test('should not crash when sessionStorage quota is exceeded', async ({ @@ -47,16 +73,6 @@ test.describe('Scroll Restoration with Session Storage Error', () => { } }) - await page.evaluate(() => window.scrollTo(0, 200)) - await page.waitForTimeout(150) - - await page.reload() - await page.waitForLoadState('networkidle') - - const heading = page.locator('h1:has-text("Scroll Error Test")') - await expect(heading).toBeVisible() - - const scrollPosition = await page.evaluate(() => window.scrollY) - expect(scrollPosition).not.toBe(200) + await reloadAfterStorageFailure(page) }) }) diff --git a/e2e/react-router/basepath-file-based/tests/setup/global.setup.ts b/e2e/react-router/basepath-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basepath-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basepath-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basepath-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basepath-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-esbuild-file-based/package.json b/e2e/react-router/basic-esbuild-file-based/package.json index 2ff977a4f4..59210c24d7 100644 --- a/e2e/react-router/basic-esbuild-file-based/package.json +++ b/e2e/react-router/basic-esbuild-file-based/package.json @@ -7,7 +7,7 @@ "build": "esbuild src/main.tsx --bundle --outfile=dist/main.js && tsc --noEmit", "serve": "esbuild src/main.tsx --bundle --outfile=dist/main.js --servedir=.", "start": "dev", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -15,7 +15,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "zod": "^4.4.3" }, "devDependencies": { diff --git a/e2e/react-router/basic-esbuild-file-based/playwright.config.ts b/e2e/react-router/basic-esbuild-file-based/playwright.config.ts index ca0fb7a1da..a38252921f 100644 --- a/e2e/react-router/basic-esbuild-file-based/playwright.config.ts +++ b/e2e/react-router/basic-esbuild-file-based/playwright.config.ts @@ -1,12 +1,8 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +13,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `pnpm run build && pnpm run serve --serve=${PORT} --define:process.env.NODE_ENV=\\"test\\" --define:process.env.EXTERNAL_PORT="${EXTERNAL_PORT}"`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm run build && pnpm run serve --serve=${PORT} --define:process.env.NODE_ENV=\\"test\\"`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-esbuild-file-based/src/esbuild.config.js b/e2e/react-router/basic-esbuild-file-based/src/esbuild.config.js index 5f0f4fce03..954ddc026f 100644 --- a/e2e/react-router/basic-esbuild-file-based/src/esbuild.config.js +++ b/e2e/react-router/basic-esbuild-file-based/src/esbuild.config.js @@ -2,9 +2,5 @@ import { tanstackRouter } from '@tanstack/router-plugin/esbuild' export default { // ... - plugins: [ - tanstackRouter({ - autoCodeSplitting: true, - }), - ], + plugins: [tanstackRouter()], } diff --git a/e2e/react-router/basic-esbuild-file-based/src/posts.tsx b/e2e/react-router/basic-esbuild-file-based/src/posts.tsx index 8f74b8c9aa..97c96d77eb 100644 --- a/e2e/react-router/basic-esbuild-file-based/src/posts.tsx +++ b/e2e/react-router/basic-esbuild-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (process.env.NODE_ENV === 'test') { - queryURL = `http://localhost:${process.env.EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-esbuild-file-based/tests/app.spec.ts b/e2e/react-router/basic-esbuild-file-based/tests/app.spec.ts index 7b322a8b1d..c52191a7d4 100644 --- a/e2e/react-router/basic-esbuild-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-esbuild-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-esbuild-file-based/tests/setup/global.setup.ts b/e2e/react-router/basic-esbuild-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-esbuild-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-esbuild-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basic-esbuild-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-esbuild-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-file-based-code-splitting/package.json b/e2e/react-router/basic-file-based-code-splitting/package.json index f3654137be..82ebb90e93 100644 --- a/e2e/react-router/basic-file-based-code-splitting/package.json +++ b/e2e/react-router/basic-file-based-code-splitting/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,6 +17,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, diff --git a/e2e/react-router/basic-file-based-code-splitting/playwright.config.ts b/e2e/react-router/basic-file-based-code-splitting/playwright.config.ts index 22c9bdcd7e..4eead86444 100644 --- a/e2e/react-router/basic-file-based-code-splitting/playwright.config.ts +++ b/e2e/react-router/basic-file-based-code-splitting/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-file-based-code-splitting/src/posts.tsx b/e2e/react-router/basic-file-based-code-splitting/src/posts.tsx index ae7142c5b6..97c96d77eb 100644 --- a/e2e/react-router/basic-file-based-code-splitting/src/posts.tsx +++ b/e2e/react-router/basic-file-based-code-splitting/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-file-based-code-splitting/tests/app.spec.ts b/e2e/react-router/basic-file-based-code-splitting/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/react-router/basic-file-based-code-splitting/tests/app.spec.ts +++ b/e2e/react-router/basic-file-based-code-splitting/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-file-based-code-splitting/tests/preload.spec.ts b/e2e/react-router/basic-file-based-code-splitting/tests/preload.spec.ts index 0bc3265760..fd17fcc47b 100644 --- a/e2e/react-router/basic-file-based-code-splitting/tests/preload.spec.ts +++ b/e2e/react-router/basic-file-based-code-splitting/tests/preload.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.setup.ts b/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.teardown.ts b/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-file-based-code-splitting/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-file-based-code-splitting/tests/shared-bindings.spec.ts b/e2e/react-router/basic-file-based-code-splitting/tests/shared-bindings.spec.ts index 512943c10d..2ad4ec3e78 100644 --- a/e2e/react-router/basic-file-based-code-splitting/tests/shared-bindings.spec.ts +++ b/e2e/react-router/basic-file-based-code-splitting/tests/shared-bindings.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-file-based/package.json b/e2e/react-router/basic-file-based/package.json index be3d8add30..0f3d243432 100644 --- a/e2e/react-router/basic-file-based/package.json +++ b/e2e/react-router/basic-file-based/package.json @@ -9,7 +9,7 @@ "preview": "vite preview", "start": "vite", "test:e2e": "pnpm run test:e2e:default", - "test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e:default": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, diff --git a/e2e/react-router/basic-file-based/playwright.config.ts b/e2e/react-router/basic-file-based/playwright.config.ts index 6e4e1d7703..ea3ef9ffec 100644 --- a/e2e/react-router/basic-file-based/playwright.config.ts +++ b/e2e/react-router/basic-file-based/playwright.config.ts @@ -1,14 +1,9 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` -const command = `pnpm build && pnpm preview --port ${PORT}` +const command = `pnpm build && pnpm preview --host 0.0.0.0 --port ${PORT}` console.info('Running with mode: ', process.env.MODE || 'default') @@ -21,9 +16,6 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, @@ -31,15 +23,12 @@ export default defineConfig({ webServer: { command, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { MODE: process.env.MODE || '', VITE_MODE: process.env.MODE || '', - VITE_NODE_ENV: 'test', - VITE_EXTERNAL_PORT: String(EXTERNAL_PORT), - VITE_SERVER_PORT: String(PORT), PORT: String(PORT), }, }, diff --git a/e2e/react-router/basic-file-based/public/external.html b/e2e/react-router/basic-file-based/public/external.html new file mode 100644 index 0000000000..3b4062b778 --- /dev/null +++ b/e2e/react-router/basic-file-based/public/external.html @@ -0,0 +1,9 @@ + + + + External destination + + + Hello World + + diff --git a/e2e/react-router/basic-file-based/src/main.tsx b/e2e/react-router/basic-file-based/src/main.tsx index 12e202dae4..d6a5aef382 100644 --- a/e2e/react-router/basic-file-based/src/main.tsx +++ b/e2e/react-router/basic-file-based/src/main.tsx @@ -24,6 +24,14 @@ const router = createRouter({ defaultStaleTime: 5000, scrollRestoration: true, routeMasks: [mask], + rewrite: { + output: ({ url }) => { + if (url.pathname === '/document-navigation-target') { + return new URL(`http://127.0.0.1:${window.location.port}/external.html`) + } + return url + }, + }, }) // Register things for typesafety diff --git a/e2e/react-router/basic-file-based/src/posts.tsx b/e2e/react-router/basic-file-based/src/posts.tsx index ae7142c5b6..97c96d77eb 100644 --- a/e2e/react-router/basic-file-based/src/posts.tsx +++ b/e2e/react-router/basic-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-file-based/src/routeTree.gen.ts b/e2e/react-router/basic-file-based/src/routeTree.gen.ts index 2493a8c675..83b504992f 100644 --- a/e2e/react-router/basic-file-based/src/routeTree.gen.ts +++ b/e2e/react-router/basic-file-based/src/routeTree.gen.ts @@ -13,9 +13,12 @@ import { Route as IndexRouteImport } from './routes/index' import { Route as LayoutRouteImport } from './routes/_layout' import { Route as AnchorRouteImport } from './routes/anchor' import { Route as ComponentTypesTestRouteImport } from './routes/component-types-test' +import { Route as DocumentNavigationRouteImport } from './routes/document-navigation' +import { Route as DocumentNavigationTargetRouteImport } from './routes/document-navigation-target' import { Route as EditingARouteImport } from './routes/editing-a' import { Route as EditingBRouteImport } from './routes/editing-b' import { Route as FullpathTestRouteRouteImport } from './routes/fullpath-test/route' +import { Route as HistoryBlockingRouteImport } from './routes/history-blocking' import { Route as HoverPreloadHashRouteImport } from './routes/hover-preload-hash' import { Route as LazyErrorRouteImport } from './routes/lazy-error' import { Route as MasksRouteImport } from './routes/masks' @@ -149,6 +152,17 @@ const ComponentTypesTestRoute = ComponentTypesTestRouteImport.update({ path: '/component-types-test', getParentRoute: () => rootRouteImport, } as any) +const DocumentNavigationRoute = DocumentNavigationRouteImport.update({ + id: '/document-navigation', + path: '/document-navigation', + getParentRoute: () => rootRouteImport, +} as any) +const DocumentNavigationTargetRoute = + DocumentNavigationTargetRouteImport.update({ + id: '/document-navigation-target', + path: '/document-navigation-target', + getParentRoute: () => rootRouteImport, + } as any) const EditingARoute = EditingARouteImport.update({ id: '/editing-a', path: '/editing-a', @@ -164,6 +178,11 @@ const FullpathTestRouteRoute = FullpathTestRouteRouteImport.update({ path: '/fullpath-test', getParentRoute: () => rootRouteImport, } as any) +const HistoryBlockingRoute = HistoryBlockingRouteImport.update({ + id: '/history-blocking', + path: '/history-blocking', + getParentRoute: () => rootRouteImport, +} as any) const HoverPreloadHashRoute = HoverPreloadHashRouteImport.update({ id: '/hover-preload-hash', path: '/hover-preload-hash', @@ -787,8 +806,11 @@ export interface FileRoutesByFullPath { '/대한민국': typeof Char45824Char54620Char48124Char44397RouteRouteWithChildren '/anchor': typeof AnchorRoute '/component-types-test': typeof ComponentTypesTestRoute + '/document-navigation': typeof DocumentNavigationRoute + '/document-navigation-target': typeof DocumentNavigationTargetRoute '/editing-a': typeof EditingARoute '/editing-b': typeof EditingBRoute + '/history-blocking': typeof HistoryBlockingRoute '/hover-preload-hash': typeof HoverPreloadHashRoute '/lazy-error': typeof LazyErrorRoute '/masks': typeof MasksRouteWithChildren @@ -903,8 +925,11 @@ export interface FileRoutesByTo { '/대한민국': typeof Char45824Char54620Char48124Char44397RouteRouteWithChildren '/anchor': typeof AnchorRoute '/component-types-test': typeof ComponentTypesTestRoute + '/document-navigation': typeof DocumentNavigationRoute + '/document-navigation-target': typeof DocumentNavigationTargetRoute '/editing-a': typeof EditingARoute '/editing-b': typeof EditingBRoute + '/history-blocking': typeof HistoryBlockingRoute '/hover-preload-hash': typeof HoverPreloadHashRoute '/lazy-error': typeof LazyErrorRoute '/masks': typeof MasksRouteWithChildren @@ -1011,8 +1036,11 @@ export interface FileRoutesById { '/_layout': typeof LayoutRouteWithChildren '/anchor': typeof AnchorRoute '/component-types-test': typeof ComponentTypesTestRoute + '/document-navigation': typeof DocumentNavigationRoute + '/document-navigation-target': typeof DocumentNavigationTargetRoute '/editing-a': typeof EditingARoute '/editing-b': typeof EditingBRoute + '/history-blocking': typeof HistoryBlockingRoute '/hover-preload-hash': typeof HoverPreloadHashRoute '/lazy-error': typeof LazyErrorRoute '/masks': typeof MasksRouteWithChildren @@ -1134,8 +1162,11 @@ export interface FileRouteTypes { | '/대한민국' | '/anchor' | '/component-types-test' + | '/document-navigation' + | '/document-navigation-target' | '/editing-a' | '/editing-b' + | '/history-blocking' | '/hover-preload-hash' | '/lazy-error' | '/masks' @@ -1250,8 +1281,11 @@ export interface FileRouteTypes { | '/대한민국' | '/anchor' | '/component-types-test' + | '/document-navigation' + | '/document-navigation-target' | '/editing-a' | '/editing-b' + | '/history-blocking' | '/hover-preload-hash' | '/lazy-error' | '/masks' @@ -1357,8 +1391,11 @@ export interface FileRouteTypes { | '/_layout' | '/anchor' | '/component-types-test' + | '/document-navigation' + | '/document-navigation-target' | '/editing-a' | '/editing-b' + | '/history-blocking' | '/hover-preload-hash' | '/lazy-error' | '/masks' @@ -1480,8 +1517,11 @@ export interface RootRouteChildren { LayoutRoute: typeof LayoutRouteWithChildren AnchorRoute: typeof AnchorRoute ComponentTypesTestRoute: typeof ComponentTypesTestRoute + DocumentNavigationRoute: typeof DocumentNavigationRoute + DocumentNavigationTargetRoute: typeof DocumentNavigationTargetRoute EditingARoute: typeof EditingARoute EditingBRoute: typeof EditingBRoute + HistoryBlockingRoute: typeof HistoryBlockingRoute HoverPreloadHashRoute: typeof HoverPreloadHashRoute LazyErrorRoute: typeof LazyErrorRoute MasksRoute: typeof MasksRouteWithChildren @@ -1549,6 +1589,20 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ComponentTypesTestRouteImport parentRoute: typeof rootRouteImport } + '/document-navigation': { + id: '/document-navigation' + path: '/document-navigation' + fullPath: '/document-navigation' + preLoaderRoute: typeof DocumentNavigationRouteImport + parentRoute: typeof rootRouteImport + } + '/document-navigation-target': { + id: '/document-navigation-target' + path: '/document-navigation-target' + fullPath: '/document-navigation-target' + preLoaderRoute: typeof DocumentNavigationTargetRouteImport + parentRoute: typeof rootRouteImport + } '/editing-a': { id: '/editing-a' path: '/editing-a' @@ -1570,6 +1624,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof FullpathTestRouteRouteImport parentRoute: typeof rootRouteImport } + '/history-blocking': { + id: '/history-blocking' + path: '/history-blocking' + fullPath: '/history-blocking' + preLoaderRoute: typeof HistoryBlockingRouteImport + parentRoute: typeof rootRouteImport + } '/hover-preload-hash': { id: '/hover-preload-hash' path: '/hover-preload-hash' @@ -1650,7 +1711,7 @@ declare module '@tanstack/react-router' { '/(group)/_layout': { id: '/(group)/_layout' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupLayoutRouteImport parentRoute: typeof rootRouteImport } @@ -2878,8 +2939,11 @@ const rootRouteChildren: RootRouteChildren = { LayoutRoute: LayoutRouteWithChildren, AnchorRoute: AnchorRoute, ComponentTypesTestRoute: ComponentTypesTestRoute, + DocumentNavigationRoute: DocumentNavigationRoute, + DocumentNavigationTargetRoute: DocumentNavigationTargetRoute, EditingARoute: EditingARoute, EditingBRoute: EditingBRoute, + HistoryBlockingRoute: HistoryBlockingRoute, HoverPreloadHashRoute: HoverPreloadHashRoute, LazyErrorRoute: LazyErrorRoute, MasksRoute: MasksRouteWithChildren, diff --git a/e2e/react-router/basic-file-based/src/routes/anchor.tsx b/e2e/react-router/basic-file-based/src/routes/anchor.tsx index aafad6cb6f..cae0a3e583 100644 --- a/e2e/react-router/basic-file-based/src/routes/anchor.tsx +++ b/e2e/react-router/basic-file-based/src/routes/anchor.tsx @@ -25,6 +25,10 @@ const anchors: Array<{ title: 'Smooth Scroll', hashScrollIntoView: { behavior: 'smooth' }, }, + { + id: '/\\section', + title: 'Fragment with slashes', + }, ] as const function AnchorSection({ id, title }: { id: string; title: string }) { diff --git a/e2e/react-router/basic-file-based/src/routes/document-navigation-target.tsx b/e2e/react-router/basic-file-based/src/routes/document-navigation-target.tsx new file mode 100644 index 0000000000..905b0c31b9 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/document-navigation-target.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/document-navigation-target')({}) diff --git a/e2e/react-router/basic-file-based/src/routes/document-navigation.tsx b/e2e/react-router/basic-file-based/src/routes/document-navigation.tsx new file mode 100644 index 0000000000..66c2b704d1 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/document-navigation.tsx @@ -0,0 +1,97 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import type { AnyRouter } from '@tanstack/react-router' + +export const Route = createFileRoute('/document-navigation')({ + component: DocumentNavigation, +}) + +const adminHref = `http://127.0.0.1:${window.location.port}/external.html` + +function DocumentNavigation() { + const navigate = Route.useNavigate() + + return ( +
+ + + + + + + + Navigate to admin + + Replace with admin + + + Reload admin + + + Navigate with external mask + + + Replace with external mask + + to={`${adminHref}?value=a+b&value=a%20b#raw%2f`}> + Navigate to absolute href + + + Reload relative href + +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/history-blocking.tsx b/e2e/react-router/basic-file-based/src/routes/history-blocking.tsx new file mode 100644 index 0000000000..019893a628 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/history-blocking.tsx @@ -0,0 +1,119 @@ +import * as React from 'react' +import { + Link, + createFileRoute, + useBlocker, + useRouter, +} from '@tanstack/react-router' + +export const Route = createFileRoute('/history-blocking')({ + validateSearch: (search: Record) => ({ + step: Number(search.step) || 0, + }), + component: HistoryBlocking, +}) + +function HistoryBlocking() { + const router = useRouter() + const { step } = Route.useSearch() + const [draft, setDraft] = React.useState('') + const [ignoreBlocker, setIgnoreBlocker] = React.useState(false) + const [documentHref, setDocumentHref] = React.useState('/') + const [navigationError, setNavigationError] = React.useState('') + const { status, reset, proceed } = useBlocker({ + shouldBlockFn: () => draft.length > 0, + enableBeforeUnload: draft.length > 0, + withResolver: true, + }) + + return ( +
+

History blocking

+

Step {step}

+ + +

{draft ? 'Unsaved changes' : 'No changes'}

+

Blocker status: {status}

+ {status === 'blocked' && ( + <> + + + + )} + + {[false, true].map((replace) => ( + + ))} + {navigationError &&

{navigationError}

} + + Add history entry + + + + {[-2, -1, 0, 1, 2].map((delta) => ( + + ))} + Leave document +
+ ) +} diff --git a/e2e/react-router/basic-file-based/tests/app.spec.ts b/e2e/react-router/basic-file-based/tests/app.spec.ts index ae87d350ce..bd9c365484 100644 --- a/e2e/react-router/basic-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' test.beforeEach(async ({ page }) => { diff --git a/e2e/react-router/basic-file-based/tests/document-navigation.spec.ts b/e2e/react-router/basic-file-based/tests/document-navigation.spec.ts new file mode 100644 index 0000000000..bd81eaa44b --- /dev/null +++ b/e2e/react-router/basic-file-based/tests/document-navigation.spec.ts @@ -0,0 +1,68 @@ +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' + +const appPort = Number(process.env.E2E_APP_PORT ?? 0) +const adminHref = `http://127.0.0.1:${appPort}/external.html` + +for (const role of ['button', 'link'] as const) { + for (const { name, href, replace } of [ + { name: 'Navigate to admin', href: adminHref, replace: false }, + { name: 'Replace with admin', href: adminHref, replace: true }, + { name: 'Reload admin', href: adminHref, replace: false }, + { name: 'Navigate with external mask', href: adminHref, replace: false }, + { name: 'Replace with external mask', href: adminHref, replace: true }, + { + name: 'Navigate to absolute href', + href: `${adminHref}?value=a+b&value=a%20b#raw%2f`, + replace: false, + }, + ]) { + test(`${role}: ${name}`, async ({ page }) => { + const errors: Array = [] + page.on('pageerror', (error) => errors.push(error)) + await page.goto('/') + await page.goto('/document-navigation') + const historyLength = await page.evaluate(() => window.history.length) + const response = page.waitForResponse(href.split('#')[0]) + + const control = page.getByRole(role, { name, exact: true }) + if (role === 'link') { + await expect(control).toHaveAttribute('href', href) + } + await control.click() + + expect((await response).request().isNavigationRequest()).toBe(true) + await expect(page).toHaveURL(href) + await expect(page.locator('body')).toHaveText('Hello World') + // Cross-origin Links use native anchors, which push even with replace=true. + const replacesHistory = role === 'button' && replace + expect(await page.evaluate(() => window.history.length)).toBe( + historyLength + (replacesHistory ? 0 : 1), + ) + expect(errors).toEqual([]) + + await page.goBack() + + await expect(page).toHaveURL( + replacesHistory ? '/' : '/document-navigation', + ) + }) + } + + test(`${role}: explicit reload resolves a raw relative href in the browser`, async ({ + page, + }) => { + await page.goto('/document-navigation') + const response = page.waitForResponse((candidate) => + candidate.request().isNavigationRequest(), + ) + + await page + .getByRole(role, { name: 'Reload relative href', exact: true }) + .click() + + expect((await response).request().resourceType()).toBe('document') + await expect(page).toHaveURL('/?value=a+b&value=a%20b#raw%2f') + await expect(page.getByRole('heading')).toContainText('Welcome Home!') + }) +} diff --git a/e2e/react-router/basic-file-based/tests/fullpath-types.spec.ts b/e2e/react-router/basic-file-based/tests/fullpath-types.spec.ts index d1bd9c1c41..8f4df9f966 100644 --- a/e2e/react-router/basic-file-based/tests/fullpath-types.spec.ts +++ b/e2e/react-router/basic-file-based/tests/fullpath-types.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.describe('FullPath type/runtime match (Issues #4892, #2675, #6403)', () => { test.describe('Pathless layout routes should have parent fullPath, not empty string', () => { diff --git a/e2e/react-router/basic-file-based/tests/history-blocking.spec.ts b/e2e/react-router/basic-file-based/tests/history-blocking.spec.ts new file mode 100644 index 0000000000..df1f863a03 --- /dev/null +++ b/e2e/react-router/basic-file-based/tests/history-blocking.spec.ts @@ -0,0 +1,254 @@ +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' +import type { Page } from '@playwright/test' + +async function prepareDocumentTraversal(page: Page, delta: number) { + if (delta < 0) { + for (let i = 0; i < Math.abs(delta); i++) { + await page.goto(`/?entry=${i}`) + } + await page.goto('/history-blocking') + } else { + await page.goto('/history-blocking') + for (let i = 0; i < delta; i++) { + await page.goto(`/?entry=${i}`) + } + for (let i = 0; i < delta; i++) { + await page.goBack() + } + } + await expect( + page.getByRole('heading', { name: 'History blocking' }), + ).toBeVisible() + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + await expect(page.getByText('Unsaved changes', { exact: true })).toBeVisible() +} + +async function prepareSameDocumentTraversal(page: Page, delta: number) { + await page.goto('/history-blocking') + for (let step = 1; step <= Math.abs(delta); step++) { + await page.getByRole('link', { name: 'Add history entry' }).click() + await expect(page.getByText(`Step ${step}`, { exact: true })).toBeVisible() + } + if (delta > 0) { + for (let step = delta - 1; step >= 0; step--) { + await page + .getByRole('button', { name: 'History back', exact: true }) + .click() + await expect( + page.getByText(`Step ${step}`, { exact: true }), + ).toBeVisible() + } + } + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + await expect(page.getByText('Unsaved changes', { exact: true })).toBeVisible() +} + +function dismissUnloadDialogs(page: Page) { + const dialogs: Array = [] + page.on('dialog', async (dialog) => { + dialogs.push(dialog.type()) + await dialog.dismiss() + }) + return dialogs +} + +for (const [direction, delta] of [ + ['back', -1], + ['forward', 1], + ['go(-1)', -1], + ['go(1)', 1], + ['go(-2)', -2], + ['go(2)', 2], +] as const) { + test(`history ${direction} to another document warns before losing edits`, async ({ + page, + }) => { + await prepareDocumentTraversal(page, delta) + const dialogs = dismissUnloadDialogs(page) + const originalUrl = page.url() + + await page + .getByRole('button', { name: `History ${direction}`, exact: true }) + .click() + + await expect.poll(() => dialogs).toEqual(['beforeunload']) + await expect(page).toHaveURL(originalUrl) + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + }) + + test(`history ${direction} can explicitly bypass a document unload warning`, async ({ + page, + }) => { + await prepareDocumentTraversal(page, delta) + await page.getByLabel('Ignore blockers').check() + const dialogs = dismissUnloadDialogs(page) + + await page + .getByRole('button', { name: `History ${direction}`, exact: true }) + .click() + + await expect(page).toHaveURL(/\/\?entry=\d$/) + expect(dialogs).toEqual([]) + }) + + test(`ignored same-document ${direction} preserves the next document unload warning`, async ({ + page, + }) => { + await prepareSameDocumentTraversal(page, delta) + await page.getByLabel('Ignore blockers').check() + const dialogs = dismissUnloadDialogs(page) + + await page + .getByRole('button', { name: `History ${direction}`, exact: true }) + .click() + + await expect( + page.getByText(`Step ${delta < 0 ? 0 : delta}`, { + exact: true, + }), + ).toBeVisible() + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + await expect( + page.getByText('Blocker status: idle', { exact: true }), + ).toBeVisible() + expect(dialogs).toEqual([]) + + await page.getByRole('link', { name: 'Leave document' }).click() + + await expect.poll(() => dialogs).toEqual(['beforeunload']) + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + }) + + test(`same-document ${direction} still checks blockers by default`, async ({ + page, + }) => { + await prepareSameDocumentTraversal(page, delta) + const originalUrl = page.url() + + await page + .getByRole('button', { name: `History ${direction}`, exact: true }) + .click() + + await expect( + page.getByText('Blocker status: blocked', { exact: true }), + ).toBeVisible() + await expect( + page.getByText(`Step ${delta < 0 ? -delta : 0}`, { exact: true }), + ).toBeVisible() + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + await page.getByRole('button', { name: 'Stay here' }).click() + await expect( + page.getByText('Blocker status: idle', { exact: true }), + ).toBeVisible() + await expect(page).toHaveURL(originalUrl) + await expect( + page.getByText(`Step ${delta < 0 ? -delta : 0}`, { exact: true }), + ).toBeVisible() + }) +} + +for (const ignoreBlocker of [false, true]) { + test(`history go(0) ${ignoreBlocker ? 'can bypass' : 'preserves'} the reload warning`, async ({ + page, + }) => { + await page.goto('/history-blocking') + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + await expect( + page.getByText('Unsaved changes', { exact: true }), + ).toBeVisible() + if (ignoreBlocker) { + await page.getByLabel('Ignore blockers').check() + } + const dialogs = dismissUnloadDialogs(page) + + await page + .getByRole('button', { name: 'History go(0)', exact: true }) + .click() + + if (ignoreBlocker) { + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue('') + expect(dialogs).toEqual([]) + } else { + await expect.poll(() => dialogs).toEqual(['beforeunload']) + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + } + }) +} + +for (const action of ['Navigate document', 'Replace document']) { + test(`${action}: invalid URLs preserve the next unload warning`, async ({ + page, + }) => { + await page.goto('/history-blocking') + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + await page.getByLabel('Ignore blockers').check() + await page.getByLabel('Document destination').fill('https://[') + const dialogs = dismissUnloadDialogs(page) + + await page.getByRole('button', { name: action, exact: true }).click() + + await expect(page.getByRole('status')).toBeVisible() + expect(dialogs).toEqual([]) + await page.getByRole('link', { name: 'Leave document' }).click() + + await expect.poll(() => dialogs).toEqual(['beforeunload']) + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + }) + + test(`${action}: the current fragment preserves the next unload warning`, async ({ + page, + }) => { + await page.goto('/history-blocking?step=0#same') + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + await page.getByLabel('Ignore blockers').check() + await page.getByLabel('Document destination').fill('#same') + const dialogs = dismissUnloadDialogs(page) + + await page.getByRole('button', { name: action, exact: true }).click() + + await expect(page).toHaveURL('/history-blocking?step=0#same') + expect(dialogs).toEqual([]) + await page.getByRole('link', { name: 'Leave document' }).click() + + await expect.poll(() => dialogs).toEqual(['beforeunload']) + await expect(page.getByLabel('Draft', { exact: true })).toHaveValue( + 'Unsaved draft', + ) + }) + + for (const ignoreBlocker of [false, true]) { + test(`${action}: ${ignoreBlocker ? 'skipped' : 'accepted'} blockers need no native confirmation`, async ({ + page, + }) => { + await page.goto('/history-blocking') + await page.getByLabel('Draft', { exact: true }).fill('Unsaved draft') + if (ignoreBlocker) { + await page.getByLabel('Ignore blockers').check() + } + const dialogs = dismissUnloadDialogs(page) + + await page.getByRole('button', { name: action, exact: true }).click() + if (!ignoreBlocker) { + await page + .getByRole('button', { name: 'Continue navigation', exact: true }) + .click() + } + + await expect(page).toHaveURL('/') + expect(dialogs).toEqual([]) + }) + } +} diff --git a/e2e/react-router/basic-file-based/tests/hover-preload-hash.spec.ts b/e2e/react-router/basic-file-based/tests/hover-preload-hash.spec.ts index b090c2a6b7..1263faf391 100644 --- a/e2e/react-router/basic-file-based/tests/hover-preload-hash.spec.ts +++ b/e2e/react-router/basic-file-based/tests/hover-preload-hash.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import { toRuntimePath } from '@tanstack/router-e2e-utils' test('clicking hash link then hovering another link does not scroll back to hash', async ({ diff --git a/e2e/react-router/basic-file-based/tests/mask.spec.ts b/e2e/react-router/basic-file-based/tests/mask.spec.ts index 1b77760de6..d5076a5854 100644 --- a/e2e/react-router/basic-file-based/tests/mask.spec.ts +++ b/e2e/react-router/basic-file-based/tests/mask.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test('route masks transform params and expose masked pathname in the browser (react)', async ({ page, diff --git a/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts b/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts index dccdfd4acf..ea0e585c75 100644 --- a/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts +++ b/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' const testCases: Array<{ name: string diff --git a/e2e/react-router/basic-file-based/tests/open-redirect-prevention.spec.ts b/e2e/react-router/basic-file-based/tests/open-redirect-prevention.spec.ts index 2f0fe256cd..bbb2dac7a1 100644 --- a/e2e/react-router/basic-file-based/tests/open-redirect-prevention.spec.ts +++ b/e2e/react-router/basic-file-based/tests/open-redirect-prevention.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.describe('Open redirect prevention', () => { test.describe('CRLF injection attacks', () => { diff --git a/e2e/react-router/basic-file-based/tests/params.spec.ts b/e2e/react-router/basic-file-based/tests/params.spec.ts index a867696ff8..fa0377f3ca 100644 --- a/e2e/react-router/basic-file-based/tests/params.spec.ts +++ b/e2e/react-router/basic-file-based/tests/params.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' test.beforeEach(async ({ page }) => { diff --git a/e2e/react-router/basic-file-based/tests/redirect.spec.ts b/e2e/react-router/basic-file-based/tests/redirect.spec.ts index 1845cc16a4..aaa9c1a6b6 100644 --- a/e2e/react-router/basic-file-based/tests/redirect.spec.ts +++ b/e2e/react-router/basic-file-based/tests/redirect.spec.ts @@ -1,17 +1,13 @@ import queryString from 'node:querystring' -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import combinateImport from 'combinate' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } // somehow playwright does not correctly import default exports const combinate = (combinateImport as any).default as typeof combinateImport -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_HOST_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const EXTERNAL_ORIGIN = `http://127.0.0.1:${PORT}` test.describe('redirects', () => { const internalNavigationTestMatrix = combinate({ @@ -39,7 +35,7 @@ test.describe('redirects', () => { const requestPromise = new Promise((resolve) => { page.on('request', (request) => { if ( - request.url() === `http://localhost:${EXTERNAL_HOST_PORT}/posts` + request.url() === 'https://jsonplaceholder.typicode.com/posts' ) { requestHappened = true resolve() @@ -108,7 +104,7 @@ test.describe('redirects', () => { await page.waitForLoadState('networkidle') const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, }) if (scenario === 'navigate') { @@ -118,7 +114,7 @@ test.describe('redirects', () => { await page.goto(`/redirect/external/via-${thrower}?${q}`) } - const url = `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) @@ -184,7 +180,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, }) if (scenario === 'navigate') { @@ -197,7 +193,7 @@ test.describe('redirects', () => { ) } - const url = `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) }) @@ -254,7 +250,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, }) if (scenario === 'navigate') { @@ -267,7 +263,7 @@ test.describe('redirects', () => { ) } - const url = `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) }) diff --git a/e2e/react-router/basic-file-based/tests/relative.spec.ts b/e2e/react-router/basic-file-based/tests/relative.spec.ts index 4850d3630d..f62c248680 100644 --- a/e2e/react-router/basic-file-based/tests/relative.spec.ts +++ b/e2e/react-router/basic-file-based/tests/relative.spec.ts @@ -1,12 +1,11 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import combinateImport from 'combinate' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } // somehow playwright does not correctly import default exports const combinate = (combinateImport as any).default as typeof combinateImport -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) test.describe('relative_routing', () => { const internalNavigationTestMatrix = combinate({ diff --git a/e2e/react-router/basic-file-based/tests/scroll-into-view.spec.ts b/e2e/react-router/basic-file-based/tests/scroll-into-view.spec.ts index d1af86adfb..68dfededc2 100644 --- a/e2e/react-router/basic-file-based/tests/scroll-into-view.spec.ts +++ b/e2e/react-router/basic-file-based/tests/scroll-into-view.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' const anchors = { @@ -32,6 +33,21 @@ test.beforeEach(async ({ page }) => { await page.goto('/anchor') }) +test('slash and backslash fragment data selects the matching anchor', async ({ + page, +}) => { + const link = page.getByRole('link', { name: 'Fragment with slashes' }) + const heading = page.getByRole('heading', { name: 'Fragment with slashes' }) + await link.click() + await expect(page).toHaveURL(/#\/\\section$/) + await expect(link).toHaveClass(activeClass) + await expect(heading).toBeInViewport() + + await page.reload() + await expect(link).toHaveClass(activeClass) + await expect(heading).toBeInViewport() +}) + // Testing the `Link` component with the `hashScrollIntoView` prop test('Navigating via anchor `Link` with default hash scrolling behavior', async ({ page, diff --git a/e2e/react-router/basic-file-based/tests/search-params.spec.ts b/e2e/react-router/basic-file-based/tests/search-params.spec.ts index d6307cbcf8..a99488a47a 100644 --- a/e2e/react-router/basic-file-based/tests/search-params.spec.ts +++ b/e2e/react-router/basic-file-based/tests/search-params.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.describe('/search-params/default', () => { test('Directly visiting the route without search param set', async ({ diff --git a/e2e/react-router/basic-file-based/tests/setup/global.setup.ts b/e2e/react-router/basic-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basic-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-react-query-file-based/package.json b/e2e/react-router/basic-react-query-file-based/package.json index 6548381772..3a90a3cd6d 100644 --- a/e2e/react-router/basic-react-query-file-based/package.json +++ b/e2e/react-router/basic-react-query-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -19,7 +19,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, diff --git a/e2e/react-router/basic-react-query-file-based/playwright.config.ts b/e2e/react-router/basic-react-query-file-based/playwright.config.ts index f3083ff8b6..fbda9bd451 100644 --- a/e2e/react-router/basic-react-query-file-based/playwright.config.ts +++ b/e2e/react-router/basic-react-query-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -17,17 +12,15 @@ export default defineConfig({ workers: 1, reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-react-query-file-based/src/posts.tsx b/e2e/react-router/basic-react-query-file-based/src/posts.tsx index 1becc2c242..1f6cb8e308 100644 --- a/e2e/react-router/basic-react-query-file-based/src/posts.tsx +++ b/e2e/react-router/basic-react-query-file-based/src/posts.tsx @@ -8,11 +8,7 @@ export type PostType = { export class PostNotFoundError extends Error {} -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-react-query-file-based/tests/app.spec.ts b/e2e/react-router/basic-react-query-file-based/tests/app.spec.ts index d80e8dada5..2b42d6d589 100644 --- a/e2e/react-router/basic-react-query-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-react-query-file-based/tests/app.spec.ts @@ -1,24 +1,23 @@ -import { expect, test } from '@playwright/test' -import { getDummyServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') }) -test('GetPosts', async () => { - const port = await getDummyServerPort(packageJson.name) - const res = await fetch(`http://localhost:${port}/posts`) - - expect(res.status).toBe(200) - - const posts = await res.json() - +test('GetPosts with networking disabled', async ({ page, context }) => { + await page.goto('about:blank') + await context.setOffline(true) + const { status, posts, post } = await page.evaluate(async () => { + const response = await fetch('https://jsonplaceholder.typicode.com/posts') + const posts = await response.json() + const post = await fetch( + 'https://jsonplaceholder.typicode.com/posts/1', + ).then((r) => r.json()) + return { status: response.status, posts, post } + }) + expect(status).toBe(200) expect(posts.length).toBeGreaterThan(0) - - const postRes = await fetch(`http://localhost:${port}/posts/1`) - expect(postRes.status).toBe(200) - const post = await postRes.json() expect(post).toEqual(posts[0]) }) diff --git a/e2e/react-router/basic-react-query-file-based/tests/setup/global.setup.ts b/e2e/react-router/basic-react-query-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-react-query-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-react-query-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basic-react-query-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-react-query-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-react-query/package.json b/e2e/react-router/basic-react-query/package.json index 81eb9eb67b..8f28340f56 100644 --- a/e2e/react-router/basic-react-query/package.json +++ b/e2e/react-router/basic-react-query/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2" }, "devDependencies": { diff --git a/e2e/react-router/basic-react-query/playwright.config.ts b/e2e/react-router/basic-react-query/playwright.config.ts index ab42c7c607..4eead86444 100644 --- a/e2e/react-router/basic-react-query/playwright.config.ts +++ b/e2e/react-router/basic-react-query/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-react-query/src/posts.ts b/e2e/react-router/basic-react-query/src/posts.ts index 5e2a2d3aa3..ffc5a274b7 100644 --- a/e2e/react-router/basic-react-query/src/posts.ts +++ b/e2e/react-router/basic-react-query/src/posts.ts @@ -9,11 +9,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/react-router/basic-react-query/tests/app.spec.ts b/e2e/react-router/basic-react-query/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/react-router/basic-react-query/tests/app.spec.ts +++ b/e2e/react-router/basic-react-query/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-react-query/tests/setup/global.setup.ts b/e2e/react-router/basic-react-query/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-react-query/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-react-query/tests/setup/global.teardown.ts b/e2e/react-router/basic-react-query/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-react-query/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-scroll-restoration/package.json b/e2e/react-router/basic-scroll-restoration/package.json index d8ebcb414b..c13e92cec8 100644 --- a/e2e/react-router/basic-scroll-restoration/package.json +++ b/e2e/react-router/basic-scroll-restoration/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/react-virtual": "^3.13.0", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2" }, "devDependencies": { diff --git a/e2e/react-router/basic-scroll-restoration/playwright.config.ts b/e2e/react-router/basic-scroll-restoration/playwright.config.ts index 0c5cee43e4..6a684ac89e 100644 --- a/e2e/react-router/basic-scroll-restoration/playwright.config.ts +++ b/e2e/react-router/basic-scroll-restoration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-virtual-file-based/package.json b/e2e/react-router/basic-virtual-file-based/package.json index 891f1d6328..0343de0846 100644 --- a/e2e/react-router/basic-virtual-file-based/package.json +++ b/e2e/react-router/basic-virtual-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/virtual-file-routes": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, diff --git a/e2e/react-router/basic-virtual-file-based/playwright.config.ts b/e2e/react-router/basic-virtual-file-based/playwright.config.ts index c5de6b5611..4eead86444 100644 --- a/e2e/react-router/basic-virtual-file-based/playwright.config.ts +++ b/e2e/react-router/basic-virtual-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -22,13 +17,10 @@ export default defineConfig({ baseURL, }, - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-virtual-file-based/src/posts.tsx b/e2e/react-router/basic-virtual-file-based/src/posts.tsx index 01831e335c..cc3cb0f9c8 100644 --- a/e2e/react-router/basic-virtual-file-based/src/posts.tsx +++ b/e2e/react-router/basic-virtual-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-virtual-file-based/tests/app.spec.ts b/e2e/react-router/basic-virtual-file-based/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/react-router/basic-virtual-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-virtual-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-virtual-file-based/tests/setup/global.setup.ts b/e2e/react-router/basic-virtual-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-virtual-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-virtual-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basic-virtual-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-virtual-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/package.json b/e2e/react-router/basic-virtual-named-export-config-file-based/package.json index d3872b01e6..6bdb1248f6 100644 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/package.json +++ b/e2e/react-router/basic-virtual-named-export-config-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/virtual-file-routes": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/playwright.config.ts b/e2e/react-router/basic-virtual-named-export-config-file-based/playwright.config.ts index ab42c7c607..4eead86444 100644 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/playwright.config.ts +++ b/e2e/react-router/basic-virtual-named-export-config-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/src/posts.tsx b/e2e/react-router/basic-virtual-named-export-config-file-based/src/posts.tsx index ae7142c5b6..97c96d77eb 100644 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/src/posts.tsx +++ b/e2e/react-router/basic-virtual-named-export-config-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts b/e2e/react-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts index 0aedada786..7d2074182f 100644 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts b/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts b/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic/package.json b/e2e/react-router/basic/package.json index a8de9acc3f..4ff68f5cda 100644 --- a/e2e/react-router/basic/package.json +++ b/e2e/react-router/basic/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -16,8 +16,9 @@ "@tanstack/react-router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", - "tailwindcss": "^4.2.2" + "redaxios": "catalog:", + "tailwindcss": "^4.2.2", + "zod": "catalog:" }, "devDependencies": { "@playwright/test": "^1.61.0", diff --git a/e2e/react-router/basic/playwright.config.ts b/e2e/react-router/basic/playwright.config.ts index 22c9bdcd7e..4eead86444 100644 --- a/e2e/react-router/basic/playwright.config.ts +++ b/e2e/react-router/basic/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/basic/src/main.tsx b/e2e/react-router/basic/src/main.tsx index 36e5106654..49fa054776 100644 --- a/e2e/react-router/basic/src/main.tsx +++ b/e2e/react-router/basic/src/main.tsx @@ -1,3 +1,5 @@ +import { useState } from 'react' +import { createPortal } from 'react-dom' import ReactDOM from 'react-dom/client' import { ErrorComponent, @@ -9,12 +11,19 @@ import { createRouter, redirect, } from '@tanstack/react-router' -import { TanStackRouterDevtools } from '@tanstack/react-router-devtools' +import { + TanStackRouterDevtoolsInProd as TanStackRouterDevtools, + TanStackRouterDevtoolsPanelInProd as TanStackRouterDevtoolsPanel, +} from '@tanstack/react-router-devtools' +import { z } from 'zod' import { NotFoundError, fetchPost, fetchPosts } from './posts' import './styles.css' import type { ErrorComponentProps } from '@tanstack/react-router' const rootRoute = createRootRoute({ + validateSearch: z.object({ + devtools: z.enum(['panel', 'shadow']).optional().catch(undefined), + }), component: RootComponent, notFoundComponent: () => { return ( @@ -27,6 +36,8 @@ const rootRoute = createRootRoute({ }) function RootComponent() { + const { devtools } = rootRoute.useSearch() + return ( <>
@@ -86,12 +97,57 @@ function RootComponent() {
+
+ Devtools: + {(['floating', 'panel', 'shadow'] as const).map((mode) => ( + ({ + ...prev, + devtools: mode === 'floating' ? undefined : mode, + })} + className={ + (devtools ?? 'floating') === mode ? 'font-bold' : undefined + } + > + {mode} + + ))} +
- TanStack Logo -

- Next.js TanStack Start -

-
- Docs - -
- + {devtools === 'panel' ? ( + + ) : devtools === 'shadow' ? ( + + ) : ( + + )} ) } + +function ShadowDevtoolsPanel() { + const [shadowRoot, setShadowRoot] = useState() + + return ( +
{ + if (host) { + setShadowRoot(host.shadowRoot ?? host.attachShadow({ mode: 'open' })) + } + }} + > + {shadowRoot + ? createPortal( + , + shadowRoot, + ) + : null} +
+ ) +} const indexRoute = createRoute({ getParentRoute: () => rootRoute, path: '/', diff --git a/e2e/react-router/basic/src/posts.ts b/e2e/react-router/basic/src/posts.ts index e859645746..f72d16fee3 100644 --- a/e2e/react-router/basic/src/posts.ts +++ b/e2e/react-router/basic/src/posts.ts @@ -8,11 +8,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/react-router/basic/tests/app.spec.ts b/e2e/react-router/basic/tests/app.spec.ts index ec0e24d8a4..9c0a6b6901 100644 --- a/e2e/react-router/basic/tests/app.spec.ts +++ b/e2e/react-router/basic/tests/app.spec.ts @@ -1,8 +1,7 @@ -import { expect, test } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/basic/tests/devtools.spec.ts b/e2e/react-router/basic/tests/devtools.spec.ts new file mode 100644 index 0000000000..b8a7e803e6 --- /dev/null +++ b/e2e/react-router/basic/tests/devtools.spec.ts @@ -0,0 +1,42 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' + +for (const mode of ['panel', 'shadow', 'floating']) { + test(`devtools preserve typography and explorer indentation in ${mode} mode`, async ({ + page, + }) => { + await page.goto(mode === 'floating' ? '/' : `/?devtools=${mode}`) + if (mode === 'floating') { + await page + .getByRole('button', { name: 'Open TanStack Router Devtools' }) + .click() + } + + const panel = page.locator('.TanStackRouterDevtoolsPanel') + const router = panel.getByRole('button', { name: /^Router\s*\d+ items/ }) + const state = panel.getByRole('button', { name: /^state\s*\d+ items/ }) + await expect(router).toBeVisible() + await expect(state).toBeVisible() + await expect(router).toHaveCSS('font-size', '12px') + await expect(router).toHaveCSS('gap', '4px') + await expect( + panel.getByText('Pathname', { exact: true }).locator('..'), + ).toHaveCSS('padding-left', '8px') + + const routerBox = await router.boundingBox() + const stateBox = await state.boundingBox() + expect(stateBox!.x - routerBox!.x).toBe(18) + + if (mode !== 'floating') { + await page.addStyleTag({ content: ':root { font-size: 20px; }' }) + await expect(router).toHaveCSS('font-size', '15px') + await expect(router).toHaveCSS('gap', '5px') + + await page.addStyleTag({ + content: ':root { --tsrd-font-size: 24px; }', + }) + await expect(router).toHaveCSS('font-size', '18px') + await expect(router).toHaveCSS('gap', '6px') + } + }) +} diff --git a/e2e/react-router/basic/tests/params.spec.ts b/e2e/react-router/basic/tests/params.spec.ts index ac18f39864..f673138047 100644 --- a/e2e/react-router/basic/tests/params.spec.ts +++ b/e2e/react-router/basic/tests/params.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.describe('params operations + prefix/suffix', () => { test.beforeEach(async ({ page }) => { diff --git a/e2e/react-router/basic/tests/setup/global.setup.ts b/e2e/react-router/basic/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/basic/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/basic/tests/setup/global.teardown.ts b/e2e/react-router/basic/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/basic/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/escaped-special-strings/package.json b/e2e/react-router/escaped-special-strings/package.json index 71a3cb08ca..af401c49d3 100644 --- a/e2e/react-router/escaped-special-strings/package.json +++ b/e2e/react-router/escaped-special-strings/package.json @@ -9,7 +9,7 @@ "preview": "vite preview", "start": "vite", "test:e2e": "pnpm run test:e2e:default", - "test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e:default": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", diff --git a/e2e/react-router/escaped-special-strings/playwright.config.ts b/e2e/react-router/escaped-special-strings/playwright.config.ts index 6e4e1d7703..629ddefccf 100644 --- a/e2e/react-router/escaped-special-strings/playwright.config.ts +++ b/e2e/react-router/escaped-special-strings/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` const command = `pnpm build && pnpm preview --port ${PORT}` @@ -21,9 +16,6 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, @@ -31,15 +23,12 @@ export default defineConfig({ webServer: { command, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { MODE: process.env.MODE || '', VITE_MODE: process.env.MODE || '', - VITE_NODE_ENV: 'test', - VITE_EXTERNAL_PORT: String(EXTERNAL_PORT), - VITE_SERVER_PORT: String(PORT), PORT: String(PORT), }, }, diff --git a/e2e/react-router/escaped-special-strings/tests/setup/global.setup.ts b/e2e/react-router/escaped-special-strings/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/escaped-special-strings/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/escaped-special-strings/tests/setup/global.teardown.ts b/e2e/react-router/escaped-special-strings/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/escaped-special-strings/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/generator-cli-only/package.json b/e2e/react-router/generator-cli-only/package.json index 6bbcccf4bd..159ba05500 100644 --- a/e2e/react-router/generator-cli-only/package.json +++ b/e2e/react-router/generator-cli-only/package.json @@ -8,7 +8,7 @@ "build": "tsr generate && vite build && tsc --noEmit", "preview": "vite preview", "start": "tsr generate && vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/router-cli": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2" }, "devDependencies": { diff --git a/e2e/react-router/generator-cli-only/playwright.config.ts b/e2e/react-router/generator-cli-only/playwright.config.ts index c9d9a76ae7..4eead86444 100644 --- a/e2e/react-router/generator-cli-only/playwright.config.ts +++ b/e2e/react-router/generator-cli-only/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/generator-cli-only/src/posts.ts b/e2e/react-router/generator-cli-only/src/posts.ts index e859645746..f72d16fee3 100644 --- a/e2e/react-router/generator-cli-only/src/posts.ts +++ b/e2e/react-router/generator-cli-only/src/posts.ts @@ -8,11 +8,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/react-router/generator-cli-only/tests/app.spec.ts b/e2e/react-router/generator-cli-only/tests/app.spec.ts index 5a83a314f2..ced5ac9310 100644 --- a/e2e/react-router/generator-cli-only/tests/app.spec.ts +++ b/e2e/react-router/generator-cli-only/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/generator-cli-only/tests/setup/global.setup.ts b/e2e/react-router/generator-cli-only/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/generator-cli-only/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/generator-cli-only/tests/setup/global.teardown.ts b/e2e/react-router/generator-cli-only/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/generator-cli-only/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/i18n-paraglide/package.json b/e2e/react-router/i18n-paraglide/package.json index 31a22eb66b..d1af160f10 100644 --- a/e2e/react-router/i18n-paraglide/package.json +++ b/e2e/react-router/i18n-paraglide/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -26,7 +26,26 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + }, + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/e2e/react-router/i18n-paraglide/playwright.config.ts b/e2e/react-router/i18n-paraglide/playwright.config.ts index 91ef8fbd9f..8e94d5f9a1 100644 --- a/e2e/react-router/i18n-paraglide/playwright.config.ts +++ b/e2e/react-router/i18n-paraglide/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/issue-4759/index.html b/e2e/react-router/issue-4759/index.html new file mode 100644 index 0000000000..9609ea710b --- /dev/null +++ b/e2e/react-router/issue-4759/index.html @@ -0,0 +1,62 @@ + + + + + + Issue 4759 + + + +
+
HTML fallback
+
+ + + + diff --git a/e2e/react-router/issue-4759/package.json b/e2e/react-router/issue-4759/package.json new file mode 100644 index 0000000000..ee6a105ad5 --- /dev/null +++ b/e2e/react-router/issue-4759/package.json @@ -0,0 +1,26 @@ +{ + "name": "tanstack-router-e2e-react-issue-4759", + "private": true, + "type": "module", + "scripts": { + "build": "vite build && tsc --noEmit", + "dev": "vite --port 3000", + "dev:e2e": "vite", + "preview": "vite preview", + "start": "vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-router/issue-4759/playwright.config.ts b/e2e/react-router/issue-4759/playwright.config.ts new file mode 100644 index 0000000000..a301f62881 --- /dev/null +++ b/e2e/react-router/issue-4759/playwright.config.ts @@ -0,0 +1,24 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { baseURL }, + webServer: { + command: `VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/issue-4759/src/main.tsx b/e2e/react-router/issue-4759/src/main.tsx new file mode 100644 index 0000000000..e251178045 --- /dev/null +++ b/e2e/react-router/issue-4759/src/main.tsx @@ -0,0 +1,74 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import { + Outlet, + RouterProvider, + createRootRoute, + createRoute, + createRouter, +} from '@tanstack/react-router' + +const rootRoute = createRootRoute({ + context: () => ({ locale: 'en' }), + component: RootComponent, +}) +function RootComponent() { + const { locale } = rootRoute.useRouteContext() + return ( +
+ +
+ ) +} +const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: () => new Promise((resolve) => setTimeout(resolve, 1_000)), + component: () =>
loaded
, +}) +const routePendingRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/route-pending', + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: RoutePending, + loader: () => new Promise((resolve) => setTimeout(resolve, 1_000)), + component: () =>
loaded
, +}) +function RoutePending() { + const { locale } = routePendingRoute.useRouteContext() + return ( +
+ route pending +
+ ) +} +const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, routePendingRoute]), +}) +const usesRoutePending = window.location.pathname === '/route-pending' +function DefaultPending() { + const { locale } = indexRoute.useRouteContext() + return ( +
+ default pending +
+ ) +} + +createRoot(document.getElementById('app')!).render( + +
+ +
+
, +) diff --git a/e2e/react-router/issue-4759/tests/issue-4759.spec.ts b/e2e/react-router/issue-4759/tests/issue-4759.spec.ts new file mode 100644 index 0000000000..95689010c8 --- /dev/null +++ b/e2e/react-router/issue-4759/tests/issue-4759.spec.ts @@ -0,0 +1,39 @@ +import { expect, test } from '@playwright/test' +import type { Page } from '@playwright/test' + +async function expectNoBlankFrame( + page: Page, + pendingSource: 'default' | 'route', +) { + const pending = page.locator( + `[data-state="pending"][data-pending-source="${pendingSource}"]`, + ) + await expect(pending).toBeVisible() + await expect(pending).toHaveAttribute('data-locale', 'en') + await expect(page.locator('[data-root-locale="en"]')).toBeVisible() + + const paintStates = await page.evaluate( + () => + (globalThis as typeof globalThis & { __paintStates: Array }) + .__paintStates, + ) + + expect(paintStates).toContain('pending') + expect(paintStates).not.toContain('shell') + expect(paintStates).not.toContain('empty') + await expect(page.locator('[data-state="loaded"]')).toBeVisible() +} + +test('#4759: the initial default pending component has no blank frame before it', async ({ + page, +}) => { + await page.goto('/') + await expectNoBlankFrame(page, 'default') +}) + +test('an initial route pending component has no blank frame before it', async ({ + page, +}) => { + await page.goto('/route-pending') + await expectNoBlankFrame(page, 'route') +}) diff --git a/e2e/react-router/issue-4759/tsconfig.json b/e2e/react-router/issue-4759/tsconfig.json new file mode 100644 index 0000000000..e4ba4788a3 --- /dev/null +++ b/e2e/react-router/issue-4759/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "strict": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "resolveJsonModule": true, + "skipLibCheck": true, + "types": ["vite/client"] + }, + "exclude": ["node_modules", "dist"] +} diff --git a/e2e/react-router/issue-4759/vite.config.ts b/e2e/react-router/issue-4759/vite.config.ts new file mode 100644 index 0000000000..9ffcc67574 --- /dev/null +++ b/e2e/react-router/issue-4759/vite.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], +}) diff --git a/e2e/react-router/issue-7120/index.html b/e2e/react-router/issue-7120/index.html new file mode 100644 index 0000000000..04a3530c9d --- /dev/null +++ b/e2e/react-router/issue-7120/index.html @@ -0,0 +1,10 @@ + + + + + + Issues 7120 and 7367 + + + + diff --git a/e2e/react-router/issue-7120/package.json b/e2e/react-router/issue-7120/package.json new file mode 100644 index 0000000000..979b32556c --- /dev/null +++ b/e2e/react-router/issue-7120/package.json @@ -0,0 +1,27 @@ +{ + "name": "tanstack-router-e2e-react-issue-7120", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --port 3000", + "dev:e2e": "vite", + "build": "vite build && tsc --noEmit", + "preview": "vite preview", + "start": "vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "@tanstack/router-plugin": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-router/issue-7120/playwright.config.ts b/e2e/react-router/issue-7120/playwright.config.ts new file mode 100644 index 0000000000..a8ba116fb4 --- /dev/null +++ b/e2e/react-router/issue-7120/playwright.config.ts @@ -0,0 +1,24 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { baseURL }, + webServer: { + command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/issue-7120/src/main.tsx b/e2e/react-router/issue-7120/src/main.tsx new file mode 100644 index 0000000000..0c983251af --- /dev/null +++ b/e2e/react-router/issue-7120/src/main.tsx @@ -0,0 +1,21 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import { RouterProvider, createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +const router = createRouter({ + routeTree, + defaultViewTransition: true, +}) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/e2e/react-router/issue-7120/src/redirectGate.ts b/e2e/react-router/issue-7120/src/redirectGate.ts new file mode 100644 index 0000000000..399d303aac --- /dev/null +++ b/e2e/react-router/issue-7120/src/redirectGate.ts @@ -0,0 +1,35 @@ +type RedirectGate = { + waiting: boolean + released: boolean + release: () => void +} + +declare global { + interface Window { + redirectGate: RedirectGate + } +} + +let releasePromise!: () => void +const promise = new Promise((resolve) => { + releasePromise = resolve +}) + +const redirectGate: RedirectGate = { + waiting: false, + released: false, + release: () => { + if (!redirectGate.released) { + redirectGate.released = true + releasePromise() + } + }, +} + +window.redirectGate = redirectGate + +export async function waitForRedirectGate() { + redirectGate.waiting = true + await promise + redirectGate.waiting = false +} diff --git a/e2e/react-router/issue-7120/src/routeTree.gen.ts b/e2e/react-router/issue-7120/src/routeTree.gen.ts new file mode 100644 index 0000000000..e8c6d92110 --- /dev/null +++ b/e2e/react-router/issue-7120/src/routeTree.gen.ts @@ -0,0 +1,77 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as PostsRouteImport } from './routes/posts' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const PostsRoute = PostsRouteImport.update({ + id: '/posts', + path: '/posts', + getParentRoute: () => rootRouteImport, +} as any).lazy(() => import('./routes/posts.lazy').then((d) => d.Route)) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/posts': typeof PostsRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/posts': typeof PostsRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/posts': typeof PostsRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' | '/posts' + fileRoutesByTo: FileRoutesByTo + to: '/' | '/posts' + id: '__root__' | '/' | '/posts' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + PostsRoute: typeof PostsRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/posts': { + id: '/posts' + path: '/posts' + fullPath: '/posts' + preLoaderRoute: typeof PostsRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + PostsRoute: PostsRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/e2e/react-router/issue-7120/src/routes/__root.tsx b/e2e/react-router/issue-7120/src/routes/__root.tsx new file mode 100644 index 0000000000..2f01516a55 --- /dev/null +++ b/e2e/react-router/issue-7120/src/routes/__root.tsx @@ -0,0 +1,33 @@ +import { Outlet, createRootRoute, redirect } from '@tanstack/react-router' +import { waitForRedirectGate } from '../redirectGate' + +let shouldRedirect = true + +export const Route = createRootRoute({ + pendingMs: 0, + pendingMinMs: 500, + pendingComponent: RootPendingComponent, + beforeLoad: async ({ location }) => { + if (location.pathname !== '/' || !shouldRedirect) { + return + } + + await waitForRedirectGate() + + if (!shouldRedirect) { + return + } + + shouldRedirect = false + throw redirect({ to: '/posts', replace: true }) + }, + component: () => , +}) + +function RootPendingComponent() { + return ( +
+ Loading route +
+ ) +} diff --git a/e2e/react-router/issue-7120/src/routes/index.tsx b/e2e/react-router/issue-7120/src/routes/index.tsx new file mode 100644 index 0000000000..1626ce706b --- /dev/null +++ b/e2e/react-router/issue-7120/src/routes/index.tsx @@ -0,0 +1,5 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: () =>
Home
, +}) diff --git a/e2e/react-router/issue-7120/src/routes/posts.lazy.tsx b/e2e/react-router/issue-7120/src/routes/posts.lazy.tsx new file mode 100644 index 0000000000..dc0b0cfd7f --- /dev/null +++ b/e2e/react-router/issue-7120/src/routes/posts.lazy.tsx @@ -0,0 +1,14 @@ +import { createLazyFileRoute } from '@tanstack/react-router' + +export const Route = createLazyFileRoute('/posts')({ + component: PostsComponent, +}) + +function PostsComponent() { + return ( +
+

Posts loaded

+

The redirected lazy route rendered.

+
+ ) +} diff --git a/e2e/react-router/issue-7120/src/routes/posts.tsx b/e2e/react-router/issue-7120/src/routes/posts.tsx new file mode 100644 index 0000000000..cc0519b74e --- /dev/null +++ b/e2e/react-router/issue-7120/src/routes/posts.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/posts')({}) diff --git a/e2e/react-router/issue-7120/src/vite-env.d.ts b/e2e/react-router/issue-7120/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/e2e/react-router/issue-7120/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/e2e/react-router/issue-7120/tests/issue-7120.repro.spec.ts b/e2e/react-router/issue-7120/tests/issue-7120.repro.spec.ts new file mode 100644 index 0000000000..081ae73691 --- /dev/null +++ b/e2e/react-router/issue-7120/tests/issue-7120.repro.spec.ts @@ -0,0 +1,33 @@ +import { expect, test } from '@playwright/test' + +test('#7120 / #7367: a root redirect cannot commit a stale match during a view transition', async ({ + page, +}) => { + const pageErrors: Array = [] + const consoleErrors: Array = [] + + page.on('pageerror', (error) => { + pageErrors.push(error.message || String(error)) + }) + page.on('console', (message) => { + if (message.type() === 'error') { + consoleErrors.push(message.text()) + } + }) + + await page.goto('/') + + const pending = page.getByTestId('root-pending') + await expect(pending).toBeVisible() + expect(await page.evaluate(() => window.redirectGate.waiting)).toBe(true) + + await page.evaluate(() => window.redirectGate.release()) + + await expect(page).toHaveURL(/\/posts$/) + await expect( + page.getByRole('heading', { name: 'Posts loaded' }), + ).toBeVisible() + await expect(pending).not.toBeVisible() + expect(pageErrors).toEqual([]) + expect(consoleErrors).toEqual([]) +}) diff --git a/e2e/react-router/issue-7120/tsconfig.json b/e2e/react-router/issue-7120/tsconfig.json new file mode 100644 index 0000000000..4f6089bc08 --- /dev/null +++ b/e2e/react-router/issue-7120/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "resolveJsonModule": true, + "allowJs": true, + "skipLibCheck": true, + "types": ["vite/client"] + }, + "exclude": ["node_modules", "dist"] +} diff --git a/e2e/react-router/issue-7120/vite.config.ts b/e2e/react-router/issue-7120/vite.config.ts new file mode 100644 index 0000000000..5b1c613906 --- /dev/null +++ b/e2e/react-router/issue-7120/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { tanstackRouter } from '@tanstack/router-plugin/vite' + +export default defineConfig({ + plugins: [tanstackRouter({ target: 'react' }), react()], +}) diff --git a/e2e/react-router/issue-7457/index.html b/e2e/react-router/issue-7457/index.html new file mode 100644 index 0000000000..76369b5957 --- /dev/null +++ b/e2e/react-router/issue-7457/index.html @@ -0,0 +1,10 @@ + + + + + + Issue 7457 + + + + diff --git a/e2e/react-router/issue-7457/package.json b/e2e/react-router/issue-7457/package.json new file mode 100644 index 0000000000..838f5173e2 --- /dev/null +++ b/e2e/react-router/issue-7457/package.json @@ -0,0 +1,28 @@ +{ + "name": "tanstack-router-e2e-react-issue-7457", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --port 3000", + "dev:e2e": "vite", + "build": "vite build && tsc --noEmit", + "preview": "vite preview", + "start": "vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-query": "^5.99.0", + "@tanstack/react-router": "workspace:^", + "@tanstack/router-plugin": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-router/issue-7457/playwright.config.ts b/e2e/react-router/issue-7457/playwright.config.ts new file mode 100644 index 0000000000..a8ba116fb4 --- /dev/null +++ b/e2e/react-router/issue-7457/playwright.config.ts @@ -0,0 +1,24 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { baseURL }, + webServer: { + command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/issue-7457/src/main.tsx b/e2e/react-router/issue-7457/src/main.tsx new file mode 100644 index 0000000000..1b6805edc0 --- /dev/null +++ b/e2e/react-router/issue-7457/src/main.tsx @@ -0,0 +1,32 @@ +import { StrictMode, useEffect } from 'react' +import { createRoot } from 'react-dom/client' +import { QueryClient } from '@tanstack/react-query' +import { RouterProvider, createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +const queryClient = new QueryClient() +const router = createRouter({ + routeTree, + context: { queryClient }, + defaultPendingComponent: DefaultPendingComponent, + defaultPreloadStaleTime: 0, +}) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} + +function DefaultPendingComponent() { + useEffect(() => { + ;(globalThis as any).__pendingSeen = true + }, []) + return
loading
+} + +createRoot(document.body).render( + + + , +) diff --git a/e2e/react-router/issue-7457/src/routeTree.gen.ts b/e2e/react-router/issue-7457/src/routeTree.gen.ts new file mode 100644 index 0000000000..04a2c94ce8 --- /dev/null +++ b/e2e/react-router/issue-7457/src/routeTree.gen.ts @@ -0,0 +1,77 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as AnotherRouteImport } from './routes/another' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const AnotherRoute = AnotherRouteImport.update({ + id: '/another', + path: '/another', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/another': typeof AnotherRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/another': typeof AnotherRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/another': typeof AnotherRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' | '/another' + fileRoutesByTo: FileRoutesByTo + to: '/' | '/another' + id: '__root__' | '/' | '/another' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + AnotherRoute: typeof AnotherRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/another': { + id: '/another' + path: '/another' + fullPath: '/another' + preLoaderRoute: typeof AnotherRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + AnotherRoute: AnotherRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/e2e/react-router/issue-7457/src/routes/__root.tsx b/e2e/react-router/issue-7457/src/routes/__root.tsx new file mode 100644 index 0000000000..988ba76263 --- /dev/null +++ b/e2e/react-router/issue-7457/src/routes/__root.tsx @@ -0,0 +1,25 @@ +import { Outlet, createRootRouteWithContext } from '@tanstack/react-router' +import type { QueryClient } from '@tanstack/react-query' + +export const Route = createRootRouteWithContext<{ + queryClient: QueryClient +}>()({ + beforeLoad: async ({ context }) => { + await context.queryClient.ensureQueryData({ + queryKey: ['issue-7457-root'], + queryFn: async () => { + await new Promise((resolve) => setTimeout(resolve, 1_500)) + return true + }, + }) + }, + component: RootComponent, +}) + +function RootComponent() { + return ( +
+ +
+ ) +} diff --git a/e2e/react-router/issue-7457/src/routes/another.tsx b/e2e/react-router/issue-7457/src/routes/another.tsx new file mode 100644 index 0000000000..6b6caa55b3 --- /dev/null +++ b/e2e/react-router/issue-7457/src/routes/another.tsx @@ -0,0 +1,5 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/another')({ + component: () =>
Hello "/another"!
, +}) diff --git a/e2e/react-router/issue-7457/src/routes/index.tsx b/e2e/react-router/issue-7457/src/routes/index.tsx new file mode 100644 index 0000000000..daaae2aeed --- /dev/null +++ b/e2e/react-router/issue-7457/src/routes/index.tsx @@ -0,0 +1,8 @@ +import { createFileRoute, redirect } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + beforeLoad: () => { + throw redirect({ to: '/another', replace: true }) + }, + component: () =>
You should never see this!
, +}) diff --git a/e2e/react-router/issue-7457/src/vite-env.d.ts b/e2e/react-router/issue-7457/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/e2e/react-router/issue-7457/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts b/e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts new file mode 100644 index 0000000000..8b20fac1eb --- /dev/null +++ b/e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts @@ -0,0 +1,35 @@ +import { expect, test } from '@playwright/test' + +test('#7457: initial child redirect after async root beforeLoad does not blank', async ({ + page, +}) => { + const pageErrors: Array = [] + const consoleErrors: Array = [] + page.on('pageerror', (error) => + pageErrors.push(error.message || String(error)), + ) + page.on('console', (message) => { + if (message.type() === 'error') { + consoleErrors.push(message.text()) + } + }) + + await page.goto('/') + + await expect(page).toHaveURL(/\/another$/) + const target = page.getByText('Hello "/another"!') + await expect + .poll(async () => ({ + targetCount: await target.count(), + pageErrors: [...pageErrors], + consoleErrors: [...consoleErrors], + })) + .toEqual({ targetCount: 1, pageErrors: [], consoleErrors: [] }) + await expect(target).toBeVisible() + await expect + .poll(() => page.evaluate(() => (globalThis as any).__pendingSeen)) + .toBe(true) + await expect(page.getByTestId('app-pending')).not.toBeVisible() + expect(pageErrors).toEqual([]) + expect(consoleErrors).toEqual([]) +}) diff --git a/e2e/react-router/issue-7457/tsconfig.json b/e2e/react-router/issue-7457/tsconfig.json new file mode 100644 index 0000000000..4f6089bc08 --- /dev/null +++ b/e2e/react-router/issue-7457/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "resolveJsonModule": true, + "allowJs": true, + "skipLibCheck": true, + "types": ["vite/client"] + }, + "exclude": ["node_modules", "dist"] +} diff --git a/e2e/react-router/issue-7457/vite.config.js b/e2e/react-router/issue-7457/vite.config.js new file mode 100644 index 0000000000..9e39ea83d9 --- /dev/null +++ b/e2e/react-router/issue-7457/vite.config.js @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { tanstackRouter } from '@tanstack/router-plugin/vite' + +export default defineConfig({ + plugins: [ + tanstackRouter({ target: 'react', autoCodeSplitting: true }), + react(), + ], +}) diff --git a/e2e/react-router/js-only-file-based/package.json b/e2e/react-router/js-only-file-based/package.json index d18d4da143..39742d9c84 100644 --- a/e2e/react-router/js-only-file-based/package.json +++ b/e2e/react-router/js-only-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -16,7 +16,7 @@ "@tanstack/react-router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2" }, "devDependencies": { diff --git a/e2e/react-router/js-only-file-based/playwright.config.ts b/e2e/react-router/js-only-file-based/playwright.config.ts index 4f93bc1413..0925936d55 100644 --- a/e2e/react-router/js-only-file-based/playwright.config.ts +++ b/e2e/react-router/js-only-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -18,18 +13,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/js-only-file-based/src/posts.js b/e2e/react-router/js-only-file-based/src/posts.js index 979e5e381c..36c1c281f6 100644 --- a/e2e/react-router/js-only-file-based/src/posts.js +++ b/e2e/react-router/js-only-file-based/src/posts.js @@ -2,11 +2,7 @@ import axios from 'redaxios' export class NotFoundError extends Error {} -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/react-router/js-only-file-based/tests/app.spec.ts b/e2e/react-router/js-only-file-based/tests/app.spec.ts index 5a83a314f2..ced5ac9310 100644 --- a/e2e/react-router/js-only-file-based/tests/app.spec.ts +++ b/e2e/react-router/js-only-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/js-only-file-based/tests/setup/global.setup.ts b/e2e/react-router/js-only-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/js-only-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/js-only-file-based/tests/setup/global.teardown.ts b/e2e/react-router/js-only-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/js-only-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/match-params/package.json b/e2e/react-router/match-params/package.json index 3282e5e5c2..908be67a9d 100644 --- a/e2e/react-router/match-params/package.json +++ b/e2e/react-router/match-params/package.json @@ -6,7 +6,7 @@ "dev": "vite --port 3000", "build": "vite build && tsc --noEmit", "preview": "vite preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", diff --git a/e2e/react-router/match-params/playwright.config.ts b/e2e/react-router/match-params/playwright.config.ts index 246cf40060..9e8c1fab2b 100644 --- a/e2e/react-router/match-params/playwright.config.ts +++ b/e2e/react-router/match-params/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -14,8 +13,8 @@ export default defineConfig({ }, webServer: { command: `pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, projects: [ diff --git a/e2e/react-router/react-compiler/index.html b/e2e/react-router/react-compiler/index.html new file mode 100644 index 0000000000..0c5b6b471c --- /dev/null +++ b/e2e/react-router/react-compiler/index.html @@ -0,0 +1,12 @@ + + + + + + React Compiler useMatchRoute test + + +
+ + + diff --git a/e2e/react-router/react-compiler/package.json b/e2e/react-router/react-compiler/package.json new file mode 100644 index 0000000000..82e6fbf86b --- /dev/null +++ b/e2e/react-router/react-compiler/package.json @@ -0,0 +1,29 @@ +{ + "name": "tanstack-router-e2e-react-compiler", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --port 3000", + "dev:e2e": "vite", + "build": "vite build && tsc --noEmit", + "preview": "vite preview", + "start": "vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@playwright/test": "^1.61.0", + "@rolldown/plugin-babel": "^0.2.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-router/react-compiler/playwright.config.ts b/e2e/react-router/react-compiler/playwright.config.ts new file mode 100644 index 0000000000..a8ba116fb4 --- /dev/null +++ b/e2e/react-router/react-compiler/playwright.config.ts @@ -0,0 +1,24 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { baseURL }, + webServer: { + command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/react-compiler/src/main.tsx b/e2e/react-router/react-compiler/src/main.tsx new file mode 100644 index 0000000000..e6e549da83 --- /dev/null +++ b/e2e/react-router/react-compiler/src/main.tsx @@ -0,0 +1,73 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import { + Link, + Outlet, + RouterProvider, + createRootRoute, + createRoute, + createRouter, + linkOptions, + useMatchRoute, +} from '@tanstack/react-router' + +const links = linkOptions([ + { to: '/home', label: 'Home' }, + { to: '/about', label: 'About' }, +]) + +function useRouteName() { + const matchRoute = useMatchRoute() + + return links.find((link) => matchRoute(link))?.label ?? 'Unknown' +} + +function RootComponent() { + const matchedRoute = useRouteName() + + return ( + <> + +

+ Matched route: {matchedRoute} +

+ + + ) +} + +const rootRoute = createRootRoute({ component: RootComponent }) +const homeRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/home', +}) +const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', +}) +const router = createRouter({ + routeTree: rootRoute.addChildren([homeRoute, aboutRoute]), +}) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} + +const rootElement = document.getElementById('app') +if (!rootElement) { + throw new Error('Root element not found') +} + +createRoot(rootElement).render( + + + , +) diff --git a/e2e/react-router/react-compiler/tests/use-match-route.spec.ts b/e2e/react-router/react-compiler/tests/use-match-route.spec.ts new file mode 100644 index 0000000000..b800e3c908 --- /dev/null +++ b/e2e/react-router/react-compiler/tests/use-match-route.spec.ts @@ -0,0 +1,16 @@ +import { expect, test } from '@playwright/test' + +test('useMatchRoute updates after navigation with React Compiler', async ({ + page, +}) => { + await page.goto('/home') + await expect(page.getByTestId('matched-route')).toHaveText('Home') + + await page.getByRole('link', { name: 'About' }).click() + await expect(page).toHaveURL(/\/about$/) + await expect(page.getByTestId('matched-route')).toHaveText('About') + + await page.getByRole('link', { name: 'Home' }).click() + await expect(page).toHaveURL(/\/home$/) + await expect(page.getByTestId('matched-route')).toHaveText('Home') +}) diff --git a/e2e/react-router/react-compiler/tsconfig.json b/e2e/react-router/react-compiler/tsconfig.json new file mode 100644 index 0000000000..4f6089bc08 --- /dev/null +++ b/e2e/react-router/react-compiler/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "resolveJsonModule": true, + "allowJs": true, + "skipLibCheck": true, + "types": ["vite/client"] + }, + "exclude": ["node_modules", "dist"] +} diff --git a/e2e/react-router/react-compiler/vite.config.js b/e2e/react-router/react-compiler/vite.config.js new file mode 100644 index 0000000000..b4478aced4 --- /dev/null +++ b/e2e/react-router/react-compiler/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import react, { reactCompilerPreset } from '@vitejs/plugin-react' +import babel from '@rolldown/plugin-babel' + +export default defineConfig({ + plugins: [react(), babel({ presets: [reactCompilerPreset()] })], +}) diff --git a/e2e/react-router/rspack-basic-file-based/package.json b/e2e/react-router/rspack-basic-file-based/package.json index f54f8f83ca..5ec9ed9862 100644 --- a/e2e/react-router/rspack-basic-file-based/package.json +++ b/e2e/react-router/rspack-basic-file-based/package.json @@ -7,18 +7,18 @@ "build": "rsbuild build && tsc --noEmit", "preview": "rsbuild preview", "start": "rsbuild preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", "@tanstack/react-router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1" + "redaxios": "catalog:" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tanstack/router-e2e-utils": "workspace:^", @@ -27,6 +27,7 @@ "@types/react-dom": "^19.0.3", "postcss": "^8.5.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" } } diff --git a/e2e/react-router/rspack-basic-file-based/playwright.config.ts b/e2e/react-router/rspack-basic-file-based/playwright.config.ts index decceaef2f..4eead86444 100644 --- a/e2e/react-router/rspack-basic-file-based/playwright.config.ts +++ b/e2e/react-router/rspack-basic-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `PUBLIC_NODE_ENV="test" PUBLIC_EXTERNAL_PORT=${EXTERNAL_PORT} PUBLIC_SERVER_PORT=${PORT} pnpm build && PUBLIC_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/rspack-basic-file-based/src/posts.tsx b/e2e/react-router/rspack-basic-file-based/src/posts.tsx index a1225b7fe7..97c96d77eb 100644 --- a/e2e/react-router/rspack-basic-file-based/src/posts.tsx +++ b/e2e/react-router/rspack-basic-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.PUBLIC_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.PUBLIC_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/rspack-basic-file-based/tests/app.spec.ts b/e2e/react-router/rspack-basic-file-based/tests/app.spec.ts index 10beff655f..d230263bfe 100644 --- a/e2e/react-router/rspack-basic-file-based/tests/app.spec.ts +++ b/e2e/react-router/rspack-basic-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/rspack-basic-file-based/tests/setup/global.setup.ts b/e2e/react-router/rspack-basic-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/rspack-basic-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/rspack-basic-file-based/tests/setup/global.teardown.ts b/e2e/react-router/rspack-basic-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/rspack-basic-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json index 18e7851ac9..30c62d0af1 100644 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json +++ b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json @@ -7,18 +7,18 @@ "build": "rsbuild build && tsc --noEmit", "preview": "rsbuild preview", "start": "rsbuild preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", "@tanstack/react-router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1" + "redaxios": "catalog:" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tanstack/router-e2e-utils": "workspace:^", @@ -28,6 +28,7 @@ "@types/react-dom": "^19.0.3", "postcss": "^8.5.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" } } diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts index bf3adc082c..1c1d021f2f 100644 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts +++ b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `PUBLIC_NODE_ENV="test" PUBLIC_EXTERNAL_PORT=${EXTERNAL_PORT} PUBLIC_SERVER_PORT=${PORT} pnpm build && PUBLIC_SERVER_PORT=${PORT} pnpm start --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm start --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx index b196982420..cc3cb0f9c8 100644 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx +++ b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.PUBLIC_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.PUBLIC_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts index a689f459e3..8b808782f6 100644 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts +++ b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts b/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/package.json b/e2e/react-router/scroll-restoration-sandbox-vite/package.json index a7fc908019..51e9e70cc5 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/package.json +++ b/e2e/react-router/scroll-restoration-sandbox-vite/package.json @@ -11,7 +11,7 @@ "start": "vite", "test:e2e:browser": "VITE_APP_HISTORY=browser playwright test --config=playwright.browser.config.ts --project=chromium", "test:e2e:hash": "VITE_APP_HISTORY=hash playwright test --config=playwright.hash.config.ts --project=chromium", - "test:e2e": "rm -rf port*.txt; pnpm run test:e2e:browser && pnpm run test:e2e:hash" + "test:e2e": "pnpm run test:e2e:browser && pnpm run test:e2e:hash" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -20,7 +20,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, @@ -31,5 +31,15 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/dist-hash" + ] + } + } } } diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts b/e2e/react-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts index 972124647c..eb31d94080 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts +++ b/e2e/react-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts @@ -1,15 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, - resolveRuntimeSuffix, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort( - packageJson.name + `-${resolveRuntimeSuffix('browser')}`, -) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,18 +13,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=browser pnpm build && VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=browser pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `VITE_APP_HISTORY=browser pnpm build && VITE_APP_HISTORY=browser pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts b/e2e/react-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts index a6fa77afbf..6b160e3908 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts +++ b/e2e/react-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts @@ -1,15 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, - resolveRuntimeSuffix, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort( - packageJson.name + `-${resolveRuntimeSuffix('hash')}`, -) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,18 +13,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=hash vite build --outDir dist-hash && VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=hash pnpm preview --port ${PORT} --outDir dist-hash`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `VITE_APP_HISTORY=hash vite build --outDir dist-hash && VITE_APP_HISTORY=hash pnpm preview --port ${PORT} --outDir dist-hash`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/src/posts.tsx b/e2e/react-router/scroll-restoration-sandbox-vite/src/posts.tsx index e45ef52969..c4a2d0dcca 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/src/posts.tsx +++ b/e2e/react-router/scroll-restoration-sandbox-vite/src/posts.tsx @@ -10,11 +10,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export class PostNotFoundError extends Error {} diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/tests/app.spec.ts b/e2e/react-router/scroll-restoration-sandbox-vite/tests/app.spec.ts index f72d2d06ab..e396c28686 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/tests/app.spec.ts +++ b/e2e/react-router/scroll-restoration-sandbox-vite/tests/app.spec.ts @@ -1,7 +1,23 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import { linkOptions } from '@tanstack/react-router' import { toRuntimePath } from '@tanstack/router-e2e-utils' +type ScrollPaintTestState = { + sourceFrameScrollYs: Array + sourceWasReset: boolean + destinationMounted: boolean + destinationCommitScrollY: number | null + destinationFrameScrollYs: Array + cleanup: () => void +} + +declare global { + interface Window { + __scrollPaintTestState?: ScrollPaintTestState + } +} + test('Smoke - Renders home', async ({ page }) => { await page.goto(toRuntimePath('/')) await expect( @@ -9,6 +25,175 @@ test('Smoke - Renders home', async ({ page }) => { ).toBeVisible() }) +test('PUSH resets scroll before the destination can render a frame (#7815)', async ({ + page, +}) => { + await page.goto(toRuntimePath('/issue-7040-source')) + await expect(page.getByTestId('issue-7040-source-top')).toBeVisible() + + const sourceScrollY = await page.evaluate(async () => { + window.scrollTo(0, 500) + await new Promise((resolve) => requestAnimationFrame(() => resolve())) + return window.scrollY + }) + + expect(sourceScrollY).toBeGreaterThan(0) + + await page.evaluate((expectedSourceScrollY) => { + const root = document.querySelector('#app') + if (!root) { + throw new Error('App root not found') + } + + const geometry = document.createElement('div') + geometry.setAttribute('aria-hidden', 'true') + geometry.style.height = `${window.innerHeight + expectedSourceScrollY + 100}px` + geometry.style.pointerEvents = 'none' + geometry.style.width = '1px' + document.body.append(geometry) + + const state: ScrollPaintTestState = { + sourceFrameScrollYs: [], + sourceWasReset: false, + destinationMounted: false, + destinationCommitScrollY: null, + destinationFrameScrollYs: [], + cleanup: () => {}, + } + + const getDestinationHeading = () => + Array.from(document.querySelectorAll('h3')).find( + (heading) => heading.textContent === 'normal-page', + ) + + const commitObserver = new MutationObserver(() => { + const destinationHeading = getDestinationHeading() + + if (!destinationHeading) { + return + } + + commitObserver.disconnect() + state.destinationMounted = true + state.destinationCommitScrollY = window.scrollY + }) + + commitObserver.observe(root, { childList: true, subtree: true }) + + const handleScroll = () => { + if ( + document.querySelector('[data-testid="issue-7040-source-top"]') && + Math.abs(window.scrollY - expectedSourceScrollY) > 1 + ) { + state.sourceWasReset = true + } + } + window.addEventListener('scroll', handleScroll, { passive: true }) + + const originalScrollTo = window.scrollTo + window.scrollTo = ((...args: Array) => { + const requestedTop = + typeof args[0] === 'number' + ? args[1] + : typeof args[0] === 'object' && args[0] !== null + ? (args[0] as ScrollToOptions).top + : undefined + if ( + typeof requestedTop === 'number' && + Math.abs(requestedTop - expectedSourceScrollY) > 1 && + document.querySelector('[data-testid="issue-7040-source-top"]') + ) { + state.sourceWasReset = true + } + Reflect.apply(originalScrollTo, window, args) + }) as typeof window.scrollTo + + let animationFrameId = 0 + const recordFrame = () => { + if (getDestinationHeading()) { + state.destinationFrameScrollYs.push(window.scrollY) + } else if ( + document.querySelector('[data-testid="issue-7040-source-top"]') + ) { + state.sourceFrameScrollYs.push(window.scrollY) + } + animationFrameId = requestAnimationFrame(recordFrame) + } + animationFrameId = requestAnimationFrame(recordFrame) + + state.cleanup = () => { + commitObserver.disconnect() + cancelAnimationFrame(animationFrameId) + window.removeEventListener('scroll', handleScroll) + window.scrollTo = originalScrollTo + geometry.remove() + delete window.__scrollPaintTestState + } + window.__scrollPaintTestState = state + }, sourceScrollY) + + await page.evaluate( + () => + new Promise((resolve) => { + requestAnimationFrame(() => resolve()) + }), + ) + expect(await page.evaluate(() => window.scrollY)).toBe(sourceScrollY) + + await page + .getByRole('link', { name: 'Head-/normal-page' }) + .dispatchEvent('click') + + await page.waitForFunction(() => { + const state = window.__scrollPaintTestState + if (!state?.destinationMounted) { + return false + } + + const lastFrames = state.destinationFrameScrollYs.slice(-2) + return ( + lastFrames.length === 2 && + lastFrames.every((scrollY) => Math.abs(scrollY) <= 1) + ) + }) + + const observation = await page.evaluate(() => { + const state = window.__scrollPaintTestState + if (!state) { + throw new Error('Scroll paint observer not found') + } + + return { + sourceFrameScrollYs: state.sourceFrameScrollYs, + sourceWasReset: state.sourceWasReset, + destinationCommitScrollY: state.destinationCommitScrollY, + destinationFrameScrollYs: state.destinationFrameScrollYs, + destinationMaxScrollY: + document.documentElement.scrollHeight - window.innerHeight, + finalScrollY: window.scrollY, + } + }) + + expect(observation.sourceFrameScrollYs.length).toBeGreaterThan(0) + expect( + observation.sourceFrameScrollYs.every( + (scrollY) => Math.abs(scrollY - sourceScrollY) <= 1, + ), + ).toBe(true) + expect(observation.sourceWasReset).toBe(false) + expect(observation.destinationMaxScrollY).toBeGreaterThanOrEqual( + sourceScrollY, + ) + expect(observation.finalScrollY).toBe(0) + expect(observation.destinationFrameScrollYs.length).toBeGreaterThanOrEqual(2) + expect( + observation.destinationFrameScrollYs.every( + (scrollY) => Math.abs(scrollY) <= 1, + ), + `Destination paint opportunities: ${observation.destinationFrameScrollYs.join(', ')}, commit: ${observation.destinationCommitScrollY}, final: ${observation.finalScrollY}`, + ).toBe(true) +}) + test('restores the prior scroll position after browser back then forward', async ({ page, }) => { diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/tests/issue-7040.repro.spec.ts b/e2e/react-router/scroll-restoration-sandbox-vite/tests/issue-7040.repro.spec.ts index db335f8e2e..2db25517c8 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/tests/issue-7040.repro.spec.ts +++ b/e2e/react-router/scroll-restoration-sandbox-vite/tests/issue-7040.repro.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' import { toRuntimePath } from '@tanstack/router-e2e-utils' @@ -26,7 +27,7 @@ type ReproAttempt = { async function openFreshSourcePage(page: Page) { await page.goto(toRuntimePath('/issue-7040-source')) - await page.waitForLoadState('networkidle') + await expect(page.getByTestId('issue-7040-source-top')).toBeVisible() await page.evaluate(() => { sessionStorage.clear() @@ -34,7 +35,7 @@ async function openFreshSourcePage(page: Page) { }) await page.reload() - await page.waitForLoadState('networkidle') + await expect(page.getByTestId('issue-7040-source-top')).toBeVisible() } async function fastScrollSourcePage(page: Page) { @@ -96,7 +97,7 @@ async function clickTargetLinkImmediatelyAfterScroll(page: Page) { async function waitForTargetPageToSettle(page: Page) { await page.waitForURL('**/issue-7040-target') - await page.waitForLoadState('networkidle') + await expect(page.getByTestId('issue-7040-target-top')).toBeVisible() await page.waitForFunction(() => window.scrollY === 0) } diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts b/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts b/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/tsconfig.json b/e2e/react-router/scroll-restoration-sandbox-vite/tsconfig.json index f33b5a7aa3..5d58406b2e 100644 --- a/e2e/react-router/scroll-restoration-sandbox-vite/tsconfig.json +++ b/e2e/react-router/scroll-restoration-sandbox-vite/tsconfig.json @@ -11,5 +11,5 @@ "allowJs": true, "types": ["vite/client", "node"] }, - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist", "dist-hash"] } diff --git a/e2e/react-router/sentry-integration/package.json b/e2e/react-router/sentry-integration/package.json index e275758b83..5ebbdf31d9 100644 --- a/e2e/react-router/sentry-integration/package.json +++ b/e2e/react-router/sentry-integration/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@sentry/react": "^10.32.0", @@ -19,7 +19,7 @@ "@tanstack/react-router-devtools": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2" }, "devDependencies": { diff --git a/e2e/react-router/sentry-integration/playwright.config.ts b/e2e/react-router/sentry-integration/playwright.config.ts index 0c5cee43e4..6a684ac89e 100644 --- a/e2e/react-router/sentry-integration/playwright.config.ts +++ b/e2e/react-router/sentry-integration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/view-transitions/package.json b/e2e/react-router/view-transitions/package.json index 1f068d690a..e2d7a181e1 100644 --- a/e2e/react-router/view-transitions/package.json +++ b/e2e/react-router/view-transitions/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/router-plugin": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, @@ -27,7 +27,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-router/view-transitions/playwright.config.ts b/e2e/react-router/view-transitions/playwright.config.ts index c5de6b5611..4eead86444 100644 --- a/e2e/react-router/view-transitions/playwright.config.ts +++ b/e2e/react-router/view-transitions/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -22,13 +17,10 @@ export default defineConfig({ baseURL, }, - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-router/view-transitions/tests/app.spec.ts b/e2e/react-router/view-transitions/tests/app.spec.ts index 472bd6ed0b..6c1ccf1a6e 100644 --- a/e2e/react-router/view-transitions/tests/app.spec.ts +++ b/e2e/react-router/view-transitions/tests/app.spec.ts @@ -1,4 +1,4 @@ -import { test } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/react-router/view-transitions/tests/setup/global.setup.ts b/e2e/react-router/view-transitions/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-router/view-transitions/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-router/view-transitions/tests/setup/global.teardown.ts b/e2e/react-router/view-transitions/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-router/view-transitions/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-start/basic-auth/package.json b/e2e/react-start/basic-auth/package.json index 5976695006..f7ff609e76 100644 --- a/e2e/react-start/basic-auth/package.json +++ b/e2e/react-start/basic-auth/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "start": "node .output/server/index.mjs", "prisma-generate": "prisma generate", - "test:e2e": "exit 0; rm -rf port*.txt; pnpm run prisma-generate && playwright test --project=chromium" + "test:e2e": "exit 0; pnpm run prisma-generate && playwright test --project=chromium" }, "dependencies": { "@libsql/client": "^0.15.15", @@ -19,9 +19,10 @@ "@tanstack/react-router": "workspace:^", "@tanstack/react-router-devtools": "workspace:^", "@tanstack/react-start": "workspace:^", + "iron-session": "^9.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0" }, "devDependencies": { @@ -35,7 +36,8 @@ "dotenv": "^17.2.3", "prisma": "^7.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/basic-auth/playwright.config.ts b/e2e/react-start/basic-auth/playwright.config.ts index 18b8905468..82678ac00b 100644 --- a/e2e/react-start/basic-auth/playwright.config.ts +++ b/e2e/react-start/basic-auth/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/basic-auth/src/routes/__root.tsx b/e2e/react-start/basic-auth/src/routes/__root.tsx index 76e5f8b1d6..fb7868435d 100644 --- a/e2e/react-start/basic-auth/src/routes/__root.tsx +++ b/e2e/react-start/basic-auth/src/routes/__root.tsx @@ -14,18 +14,18 @@ import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js' import { NotFound } from '~/components/NotFound.js' import appCss from '~/styles/app.css?url' import { seo } from '~/utils/seo.js' -import { useAppSession } from '~/utils/session.js' +import { getAppSession } from '~/utils/session.js' const fetchUser = createServerFn({ method: 'GET' }).handler(async () => { // We need to auth on the server so we have access to secure cookies - const session = await useAppSession() + const session = await getAppSession() - if (!session.data.userEmail) { + if (!session.userEmail) { return null } return { - email: session.data.userEmail, + email: session.userEmail, } }) diff --git a/e2e/react-start/basic-auth/src/routes/_authed.tsx b/e2e/react-start/basic-auth/src/routes/_authed.tsx index c457cf5e57..fe73185136 100644 --- a/e2e/react-start/basic-auth/src/routes/_authed.tsx +++ b/e2e/react-start/basic-auth/src/routes/_authed.tsx @@ -3,7 +3,7 @@ import { createServerFn } from '@tanstack/react-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { Login } from '~/components/Login' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const loginFn = createServerFn({ method: 'POST', @@ -37,12 +37,11 @@ export const loginFn = createServerFn({ } // Create a session - const session = await useAppSession() + const session = await getAppSession() // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + session.userEmail = user.email + await session.save() }) export const Route = createFileRoute('/_authed')({ @@ -52,7 +51,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return } diff --git a/e2e/react-start/basic-auth/src/routes/logout.tsx b/e2e/react-start/basic-auth/src/routes/logout.tsx index a08f9c737e..0f86b0d4e3 100644 --- a/e2e/react-start/basic-auth/src/routes/logout.tsx +++ b/e2e/react-start/basic-auth/src/routes/logout.tsx @@ -1,12 +1,12 @@ import { redirect, createFileRoute } from '@tanstack/react-router' import { createServerFn } from '@tanstack/react-start' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' const logoutFn = createServerFn({ method: 'POST' }).handler(async () => { - const session = await useAppSession() + const session = await getAppSession() - session.clear() + session.destroy() throw redirect({ href: '/', diff --git a/e2e/react-start/basic-auth/src/routes/signup.tsx b/e2e/react-start/basic-auth/src/routes/signup.tsx index 817362dc05..d7d5d40129 100644 --- a/e2e/react-start/basic-auth/src/routes/signup.tsx +++ b/e2e/react-start/basic-auth/src/routes/signup.tsx @@ -4,7 +4,7 @@ import { createServerFn, useServerFn } from '@tanstack/react-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { useMutation } from '~/hooks/useMutation' import { Auth } from '~/components/Auth' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const signupFn = createServerFn({ method: 'POST', @@ -24,7 +24,7 @@ export const signupFn = createServerFn({ const password = await hashPassword(payload.password) // Create a session - const session = await useAppSession() + const session = await getAppSession() if (found) { if (found.password !== password) { @@ -36,9 +36,8 @@ export const signupFn = createServerFn({ } // Store the user's email in the session - await session.update({ - userEmail: found.email, - }) + session.userEmail = found.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ @@ -55,9 +54,8 @@ export const signupFn = createServerFn({ }) // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + session.userEmail = user.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ diff --git a/e2e/react-start/basic-auth/src/utils/session.ts b/e2e/react-start/basic-auth/src/utils/session.ts index c38bac1e48..f1deacf85b 100644 --- a/e2e/react-start/basic-auth/src/utils/session.ts +++ b/e2e/react-start/basic-auth/src/utils/session.ts @@ -1,13 +1,25 @@ -// src/services/session.server.ts -import { useSession } from '@tanstack/react-start/server' +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/react-start/server' import type { User } from '@prisma/client' type SessionUser = { userEmail: User['email'] } -export function useAppSession() { - return useSession({ - password: 'ChangeThisBeforeShippingToProdOrYouWillBeFired', - }) +export function getAppSession() { + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'test-auth-session', + // This fixture only runs locally with test credentials. + password: 'local-e2e-only-session-password-at-least-32-characters', + ttl: 60 * 60, + cookieOptions: { + httpOnly: true, + secure: false, + sameSite: 'lax', + path: '/', + }, + }, + ) } diff --git a/e2e/react-start/basic-cloudflare/package.json b/e2e/react-start/basic-cloudflare/package.json index 45ea13f9da..b9b8031ac4 100644 --- a/e2e/react-start/basic-cloudflare/package.json +++ b/e2e/react-start/basic-cloudflare/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "cf-typegen": "wrangler types", "postinstall": "WRANGLER_LOG=warn npm run --silent cf-typegen", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -29,8 +29,19 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "wrangler": "^4.74.0" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/.wrangler/deploy" + ] + } + } } } diff --git a/e2e/react-start/basic-cloudflare/playwright.config.ts b/e2e/react-start/basic-cloudflare/playwright.config.ts index a545dff891..0925936d55 100644 --- a/e2e/react-start/basic-cloudflare/playwright.config.ts +++ b/e2e/react-start/basic-cloudflare/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -14,9 +13,6 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, @@ -24,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/basic-cloudflare/tests/app.spec.ts b/e2e/react-start/basic-cloudflare/tests/app.spec.ts index add28cb73e..c9497070dd 100644 --- a/e2e/react-start/basic-cloudflare/tests/app.spec.ts +++ b/e2e/react-start/basic-cloudflare/tests/app.spec.ts @@ -1,3 +1,5 @@ +import { execFileSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' import { existsSync } from 'node:fs' import { join } from 'node:path' import { expect } from '@playwright/test' @@ -29,3 +31,19 @@ test('prerender with Cloudflare Workers runtime', async ({ page }) => { 'The value is Hello from Cloudflare', ) }) + +test('the built Cloudflare app passes a deployment dry run', () => { + const wrangler = fileURLToPath( + new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url), + ) + const output = execFileSync( + process.execPath, + [wrangler, 'deploy', '--dry-run'], + { + encoding: 'utf8', + env: { ...process.env, WRANGLER_SEND_METRICS: 'false' }, + }, + ) + expect(output).toContain('dist/server/wrangler.json') + expect(output).toContain('--dry-run: exiting now.') +}) diff --git a/e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts b/e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts b/e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-start/basic-react-query/package.json b/e2e/react-start/basic-react-query/package.json index c804a89eb3..ee37b82ba6 100644 --- a/e2e/react-start/basic-react-query/package.json +++ b/e2e/react-start/basic-react-query/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-query": "^5.90.0", @@ -20,7 +20,7 @@ "@tanstack/react-start": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "zod": "^4.4.3" }, @@ -32,9 +32,10 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/basic-react-query/playwright.config.ts b/e2e/react-start/basic-react-query/playwright.config.ts index fd2150e435..216fade4d5 100644 --- a/e2e/react-start/basic-react-query/playwright.config.ts +++ b/e2e/react-start/basic-react-query/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -18,19 +13,19 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/react-start/basic-react-query/src/routes/api.users.ts b/e2e/react-start/basic-react-query/src/routes/api.users.ts index bb37c6e68d..924c5b6860 100644 --- a/e2e/react-start/basic-react-query/src/routes/api.users.ts +++ b/e2e/react-start/basic-react-query/src/routes/api.users.ts @@ -2,11 +2,7 @@ import { createFileRoute } from '@tanstack/react-router' import axios from 'redaxios' import type { User } from '../utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users')({ server: { diff --git a/e2e/react-start/basic-react-query/src/routes/api/users.$id.ts b/e2e/react-start/basic-react-query/src/routes/api/users.$id.ts index e11e039652..febea309ea 100644 --- a/e2e/react-start/basic-react-query/src/routes/api/users.$id.ts +++ b/e2e/react-start/basic-react-query/src/routes/api/users.$id.ts @@ -2,11 +2,7 @@ import { createFileRoute } from '@tanstack/react-router' import axios from 'redaxios' import type { User } from '../../utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users/$id')({ server: { diff --git a/e2e/react-start/basic-react-query/src/utils/posts.tsx b/e2e/react-start/basic-react-query/src/utils/posts.tsx index 3fd16db69a..abb6e95b92 100644 --- a/e2e/react-start/basic-react-query/src/utils/posts.tsx +++ b/e2e/react-start/basic-react-query/src/utils/posts.tsx @@ -9,11 +9,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = createServerFn({ method: 'GET' }).handler( async () => { diff --git a/e2e/react-start/basic-react-query/src/utils/users.tsx b/e2e/react-start/basic-react-query/src/utils/users.tsx index 26b934fcb3..15216680e9 100644 --- a/e2e/react-start/basic-react-query/src/utils/users.tsx +++ b/e2e/react-start/basic-react-query/src/utils/users.tsx @@ -1,4 +1,6 @@ import { queryOptions } from '@tanstack/react-query' +import { createIsomorphicFn } from '@tanstack/react-start' +import { getRequestUrl } from '@tanstack/react-start/server' import axios from 'redaxios' export type User = { @@ -7,17 +9,16 @@ export type User = { email: string } -const PORT = - import.meta.env.VITE_SERVER_PORT || process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` +const getOrigin = createIsomorphicFn() + .server(() => getRequestUrl().origin) + .client(() => window.location.origin) export const usersQueryOptions = () => queryOptions({ queryKey: ['users'], queryFn: () => axios - .get>(DEPLOY_URL + '/api/users') + .get>(getOrigin() + '/api/users') .then((r) => r.data) .catch(() => { throw new Error('Failed to fetch users') @@ -29,7 +30,7 @@ export const userQueryOptions = (id: string) => queryKey: ['users', id], queryFn: () => axios - .get(DEPLOY_URL + '/api/users/' + id) + .get(getOrigin() + '/api/users/' + id) .then((r) => r.data) .catch(() => { throw new Error('Failed to fetch user') diff --git a/e2e/react-start/basic-react-query/tests/setup/global.setup.ts b/e2e/react-start/basic-react-query/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-start/basic-react-query/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-start/basic-react-query/tests/setup/global.teardown.ts b/e2e/react-start/basic-react-query/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-start/basic-react-query/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-start/basic-tsr-config/package.json b/e2e/react-start/basic-tsr-config/package.json index e52f908a6e..99e681ac9d 100644 --- a/e2e/react-start/basic-tsr-config/package.json +++ b/e2e/react-start/basic-tsr-config/package.json @@ -8,7 +8,7 @@ "dev:e2e": "vite dev", "build": "rimraf ./count.txt && vite build && tsc --noEmit", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -21,8 +21,10 @@ "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "srvx": "^0.11.9", - "typescript": "^6.0.2", - "vite": "^8.0.14" + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14", + "rimraf": "catalog:" } } diff --git a/e2e/react-start/basic-tsr-config/playwright.config.ts b/e2e/react-start/basic-tsr-config/playwright.config.ts index 18b8905468..82678ac00b 100644 --- a/e2e/react-start/basic-tsr-config/playwright.config.ts +++ b/e2e/react-start/basic-tsr-config/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/basic/package.json b/e2e/react-start/basic/package.json index f11df33f3f..3a1a4ea9c8 100644 --- a/e2e/react-start/basic/package.json +++ b/e2e/react-start/basic/package.json @@ -14,8 +14,6 @@ "preview": "vite preview", "preview:rsbuild": "rsbuild preview", "start": "node server.js", - "test:e2e:startDummyServer": "node -e 'import(\"./tests/setup/global.setup.ts\").then(m => m.default())' & node -e 'import(\"./tests/setup/waitForDummyServer.ts\").then(m => m.default())'", - "test:e2e:stopDummyServer": "node -e 'import(\"./tests/setup/global.teardown.ts\").then(m => m.default())'", "test:e2e:local": "playwright test --project=chromium" }, "dependencies": { @@ -24,15 +22,16 @@ "@tanstack/react-start": "workspace:^", "express": "^5.2.1", "http-proxy-middleware": "^3.0.5", + "iron-session": "^9.0.1", "js-cookie": "^3.0.5", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tailwindcss/vite": "^4.2.2", @@ -43,13 +42,26 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "zod": "^4.4.3" }, "nx": { + "targets": { + "test:e2e--vite-spa--dev": { + "dependsOn": [ + "^build" + ] + }, + "test:e2e--rsbuild-spa--dev": { + "dependsOn": [ + "^build" + ] + } + }, "metadata": { "playwrightModes": [ { @@ -62,7 +74,18 @@ }, { "toolchain": "vite", - "mode": "prerender" + "mode": "spa", + "name": "dev", + "env": { + "E2E_DEV_SERVER": "true" + } + }, + { + "toolchain": "vite", + "mode": "prerender", + "env": { + "NODE_OPTIONS": "--import=@tanstack/router-e2e-utils/mock-api" + } }, { "toolchain": "vite", @@ -86,7 +109,18 @@ }, { "toolchain": "rsbuild", - "mode": "prerender" + "mode": "spa", + "name": "dev", + "env": { + "E2E_DEV_SERVER": "true" + } + }, + { + "toolchain": "rsbuild", + "mode": "prerender", + "env": { + "NODE_OPTIONS": "--import=@tanstack/router-e2e-utils/mock-api" + } }, { "toolchain": "rsbuild", diff --git a/e2e/react-start/basic/playwright.config.ts b/e2e/react-start/basic/playwright.config.ts index db07d18608..bb4c2cb761 100644 --- a/e2e/react-start/basic/playwright.config.ts +++ b/e2e/react-start/basic/playwright.config.ts @@ -1,48 +1,42 @@ -import fs from 'node:fs' import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const mode = process.env.MODE ?? 'ssr' const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' -const e2ePortKey = process.env.E2E_PORT_KEY ?? packageJson.name + const distDir = process.env.E2E_DIST_DIR ?? 'dist' +// The dev runs start the dev server and run only the SPA shell spec +const devServer = process.env.E2E_DEV_SERVER === 'true' -if (process.env.TEST_WORKER_INDEX === undefined) { - for (const portFile of [ - `port-${e2ePortKey}.txt`, - `port-${e2ePortKey}_start.txt`, - `port-${e2ePortKey}-external.txt`, - ]) { - fs.rmSync(portFile, { force: true }) - } -} - -const PORT = await getTestServerPort(e2ePortKey) -const START_PORT = await getTestServerPort(`${e2ePortKey}_start`) -const EXTERNAL_PORT = await getDummyServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` const previewCommand = toolchain === 'rsbuild' - ? `pnpm preview:rsbuild --port ${PORT}` - : `pnpm preview --outDir ${distDir} --port ${PORT}` -const commandByMode = - mode === 'preview' - ? `pnpm run test:e2e:startDummyServer && ${previewCommand}` - : `pnpm run test:e2e:startDummyServer && pnpm start` + ? `pnpm preview:rsbuild --host 0.0.0.0 --port ${PORT}` + : `pnpm preview --host 0.0.0.0 --outDir ${distDir} --port ${PORT}` +const devCommand = + toolchain === 'rsbuild' + ? `pnpm dev:rsbuild --port ${PORT}` + : `pnpm dev:vite --port ${PORT}` +const commandByMode = devServer + ? devCommand + : mode === 'preview' + ? previewCommand + : 'pnpm start' /** * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ testDir: './tests', + ...(devServer + ? { + testMatch: 'spa-shell.spec.ts', + globalSetup: './tests/setup/dev-server.setup.ts', + } + : {}), workers: 1, reporter: [['line']], - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, @@ -50,19 +44,16 @@ export default defineConfig({ webServer: { command: commandByMode, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, MODE: mode, E2E_TOOLCHAIN: toolchain, - VITE_NODE_ENV: 'test', - VITE_EXTERNAL_PORT: String(EXTERNAL_PORT), - VITE_SERVER_PORT: String(PORT), - START_PORT: String(START_PORT), + START_PORT: '0', PORT: String(PORT), E2E_DIST_DIR: distDir, - E2E_PORT_KEY: e2ePortKey, ...(process.env.TSS_RSB_CLIENT_OUTPUT ? { TSS_RSB_CLIENT_OUTPUT: process.env.TSS_RSB_CLIENT_OUTPUT } : {}), diff --git a/e2e/react-start/basic/rsbuild.config.ts b/e2e/react-start/basic/rsbuild.config.ts index d6a9c035eb..23072b6c1b 100644 --- a/e2e/react-start/basic/rsbuild.config.ts +++ b/e2e/react-start/basic/rsbuild.config.ts @@ -7,10 +7,7 @@ const outDir = process.env.E2E_DIST_DIR ?? 'dist' const startModeConfig = getStartModeConfig() export default defineConfig({ - plugins: [ - pluginReact({ splitChunks: false }), - tanstackStart(startModeConfig), - ], + plugins: [pluginReact(), tanstackStart(startModeConfig)], output: { distPath: { root: outDir, diff --git a/e2e/react-start/basic/server.js b/e2e/react-start/basic/server.js index 69c1e4ca91..3e1ddab400 100644 --- a/e2e/react-start/basic/server.js +++ b/e2e/react-start/basic/server.js @@ -1,12 +1,12 @@ -import { toNodeHandler } from 'srvx/node' import fs from 'node:fs' import path from 'node:path' +import { toNodeHandler } from 'srvx/node' import express from 'express' import { createProxyMiddleware } from 'http-proxy-middleware' -const port = process.env.PORT || 3000 +const port = Number(process.env.PORT ?? 3000) -const startPort = process.env.START_PORT || 3001 +const startPort = Number(process.env.START_PORT ?? 0) const isSpaMode = process.env.MODE === 'spa' const isPrerender = process.env.MODE === 'prerender' @@ -49,13 +49,13 @@ export async function createStartServer() { return { app } } -export async function createSpaServer() { +export async function createSpaServer(backendPort) { const app = express() app.use( '/api', createProxyMiddleware({ - target: `http://localhost:${startPort}/api`, // Replace with your target server's URL + target: `http://localhost:${backendPort}/api`, // Replace with your target server's URL changeOrigin: false, // Needed for virtual hosted sites, }), ) @@ -63,7 +63,7 @@ export async function createSpaServer() { app.use( '/_serverFn', createProxyMiddleware({ - target: `http://localhost:${startPort}/_serverFn`, // Replace with your target server's URL + target: `http://localhost:${backendPort}/_serverFn`, // Replace with your target server's URL changeOrigin: false, // Needed for virtual hosted sites, }), ) @@ -71,31 +71,28 @@ export async function createSpaServer() { app.use(express.static(distClientDir)) app.get('/{*splat}', (req, res) => { - res.sendFile(path.resolve(distClientDir, 'index.html')) + res.sendFile('index.html', { root: distClientDir }) }) return { app } } -if (isSpaMode) { - createSpaServer().then(async ({ app }) => - app.listen(port, (error) => { - if (error) throw error - console.info(`Client Server: http://localhost:${port}`) - }), - ) - - createStartServer().then(async ({ app }) => - app.listen(startPort, (error) => { - if (error) throw error - console.info(`Start Server: http://localhost:${startPort}`) - }), - ) -} else { - createStartServer().then(async ({ app }) => - app.listen(port, (error) => { - if (error) throw error - console.info(`Start Server: http://localhost:${port}`) - }), - ) -} +// Bind the backend first so the SPA proxy receives the port actually held by it. +const { app: startApp } = await createStartServer() +const backend = startApp.listen(isSpaMode ? startPort : port, async (error) => { + if (error) { + throw error + } + const backendPort = backend.address().port + if (isSpaMode) { + const { app } = await createSpaServer(backendPort) + const frontend = app.listen(port, (frontendError) => { + if (frontendError) { + throw frontendError + } + console.info(`E2E app: http://localhost:${frontend.address().port}`) + }) + } else { + console.info(`E2E app: http://localhost:${backendPort}`) + } +}) diff --git a/e2e/react-start/basic/src/routeTree.gen.ts b/e2e/react-start/basic/src/routeTree.gen.ts index 10a40bc044..b6603dd01d 100644 --- a/e2e/react-start/basic/src/routeTree.gen.ts +++ b/e2e/react-start/basic/src/routeTree.gen.ts @@ -12,8 +12,11 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' import { Route as LayoutRouteImport } from './routes/_layout' import { Route as AsyncScriptsRouteImport } from './routes/async-scripts' +import { Route as AuthDocsRouteImport } from './routes/auth-docs' import { Route as ClientOnlyRouteImport } from './routes/client-only' import { Route as DeferredRouteImport } from './routes/deferred' +import { Route as ExecutionLocalRouteImport } from './routes/execution-local' +import { Route as ExecutionRpcRouteImport } from './routes/execution-rpc' import { Route as InlineScriptsRouteImport } from './routes/inline-scripts' import { Route as LinksRouteImport } from './routes/links' import { Route as NotFoundRouteRouteImport } from './routes/not-found/route' @@ -29,6 +32,8 @@ import { Route as TypeOnlyReexportRouteImport } from './routes/type-only-reexpor import { Route as UsersRouteImport } from './routes/users' import { Route as LayoutLayout2RouteImport } from './routes/_layout/_layout-2' import { Route as ApiUsersRouteImport } from './routes/api.users' +import { Route as AuthDocsPrivateRouteImport } from './routes/auth-docs.private' +import { Route as Issue6221DashboardRouteImport } from './routes/issue-6221.dashboard' import { Route as MultiCookieRedirectIndexRouteImport } from './routes/multi-cookie-redirect/index' import { Route as MultiCookieRedirectTargetRouteImport } from './routes/multi-cookie-redirect/target' import { Route as NotFoundIndexRouteImport } from './routes/not-found/index' @@ -61,6 +66,7 @@ import { Route as UsersUserIdRouteImport } from './routes/users.$userId' import { Route as LayoutLayout2LayoutARouteImport } from './routes/_layout/_layout-2/layout-a' import { Route as LayoutLayout2LayoutBRouteImport } from './routes/_layout/_layout-2/layout-b' import { Route as ApiUsersIdRouteImport } from './routes/api/users.$id' +import { Route as Issue6221ArticleIdRouteImport } from './routes/issue-6221.article.$id' import { Route as NotFoundDeepIndexRouteImport } from './routes/not-found/deep/index' import { Route as NotFoundDeepBRouteRouteImport } from './routes/not-found/deep/b/route' import { Route as NotFoundParentBoundaryIndexRouteImport } from './routes/not-found/parent-boundary/index' @@ -94,6 +100,11 @@ const AsyncScriptsRoute = AsyncScriptsRouteImport.update({ path: '/async-scripts', getParentRoute: () => rootRouteImport, } as any) +const AuthDocsRoute = AuthDocsRouteImport.update({ + id: '/auth-docs', + path: '/auth-docs', + getParentRoute: () => rootRouteImport, +} as any) const ClientOnlyRoute = ClientOnlyRouteImport.update({ id: '/client-only', path: '/client-only', @@ -104,6 +115,16 @@ const DeferredRoute = DeferredRouteImport.update({ path: '/deferred', getParentRoute: () => rootRouteImport, } as any) +const ExecutionLocalRoute = ExecutionLocalRouteImport.update({ + id: '/execution-local', + path: '/execution-local', + getParentRoute: () => rootRouteImport, +} as any) +const ExecutionRpcRoute = ExecutionRpcRouteImport.update({ + id: '/execution-rpc', + path: '/execution-rpc', + getParentRoute: () => rootRouteImport, +} as any) const InlineScriptsRoute = InlineScriptsRouteImport.update({ id: '/inline-scripts', path: '/inline-scripts', @@ -179,6 +200,16 @@ const ApiUsersRoute = ApiUsersRouteImport.update({ path: '/api/users', getParentRoute: () => rootRouteImport, } as any) +const AuthDocsPrivateRoute = AuthDocsPrivateRouteImport.update({ + id: '/private', + path: '/private', + getParentRoute: () => AuthDocsRoute, +} as any) +const Issue6221DashboardRoute = Issue6221DashboardRouteImport.update({ + id: '/issue-6221/dashboard', + path: '/issue-6221/dashboard', + getParentRoute: () => rootRouteImport, +} as any) const MultiCookieRedirectIndexRoute = MultiCookieRedirectIndexRouteImport.update({ id: '/multi-cookie-redirect/', @@ -346,6 +377,11 @@ const ApiUsersIdRoute = ApiUsersIdRouteImport.update({ path: '/$id', getParentRoute: () => ApiUsersRoute, } as any) +const Issue6221ArticleIdRoute = Issue6221ArticleIdRouteImport.update({ + id: '/issue-6221/article/$id', + path: '/issue-6221/article/$id', + getParentRoute: () => rootRouteImport, +} as any) const NotFoundDeepIndexRoute = NotFoundDeepIndexRouteImport.update({ id: '/', path: '/', @@ -452,8 +488,11 @@ export interface FileRoutesByFullPath { '/search-params': typeof SearchParamsRouteRouteWithChildren '/specialChars': typeof SpecialCharsRouteRouteWithChildren '/async-scripts': typeof AsyncScriptsRoute + '/auth-docs': typeof AuthDocsRouteWithChildren '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute + '/execution-local': typeof ExecutionLocalRoute + '/execution-rpc': typeof ExecutionRpcRoute '/inline-scripts': typeof InlineScriptsRoute '/links': typeof LinksRoute '/plain-ts-type-assertion': typeof PlainTsTypeAssertionRoute @@ -468,6 +507,8 @@ export interface FileRoutesByFullPath { '/not-found/parent-boundary': typeof NotFoundParentBoundaryRouteRouteWithChildren '/specialChars/malformed': typeof SpecialCharsMalformedRouteRouteWithChildren '/api/users': typeof ApiUsersRouteWithChildren + '/auth-docs/private': typeof AuthDocsPrivateRoute + '/issue-6221/dashboard': typeof Issue6221DashboardRoute '/multi-cookie-redirect/target': typeof MultiCookieRedirectTargetRoute '/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute '/not-found/via-beforeLoad-target-root': typeof NotFoundViaBeforeLoadTargetRootRoute @@ -498,6 +539,7 @@ export interface FileRoutesByFullPath { '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute '/api/users/$id': typeof ApiUsersIdRoute + '/issue-6221/article/$id': typeof Issue6221ArticleIdRoute '/not-found/parent-boundary/via-beforeLoad': typeof NotFoundParentBoundaryViaBeforeLoadRoute '/posts/$postId/deep': typeof PostsPostIdDeepRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -520,8 +562,11 @@ export interface FileRoutesByTo { '/': typeof IndexRoute '/specialChars': typeof SpecialCharsRouteRouteWithChildren '/async-scripts': typeof AsyncScriptsRoute + '/auth-docs': typeof AuthDocsRouteWithChildren '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute + '/execution-local': typeof ExecutionLocalRoute + '/execution-rpc': typeof ExecutionRpcRoute '/inline-scripts': typeof InlineScriptsRoute '/links': typeof LinksRoute '/plain-ts-type-assertion': typeof PlainTsTypeAssertionRoute @@ -531,6 +576,8 @@ export interface FileRoutesByTo { '/type-only-reexport': typeof TypeOnlyReexportRoute '/specialChars/malformed': typeof SpecialCharsMalformedRouteRouteWithChildren '/api/users': typeof ApiUsersRouteWithChildren + '/auth-docs/private': typeof AuthDocsPrivateRoute + '/issue-6221/dashboard': typeof Issue6221DashboardRoute '/multi-cookie-redirect/target': typeof MultiCookieRedirectTargetRoute '/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute '/not-found/via-beforeLoad-target-root': typeof NotFoundViaBeforeLoadTargetRootRoute @@ -560,6 +607,7 @@ export interface FileRoutesByTo { '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute '/api/users/$id': typeof ApiUsersIdRoute + '/issue-6221/article/$id': typeof Issue6221ArticleIdRoute '/not-found/parent-boundary/via-beforeLoad': typeof NotFoundParentBoundaryViaBeforeLoadRoute '/posts/$postId/deep': typeof PostsPostIdDeepRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -585,8 +633,11 @@ export interface FileRoutesById { '/specialChars': typeof SpecialCharsRouteRouteWithChildren '/_layout': typeof LayoutRouteWithChildren '/async-scripts': typeof AsyncScriptsRoute + '/auth-docs': typeof AuthDocsRouteWithChildren '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute + '/execution-local': typeof ExecutionLocalRoute + '/execution-rpc': typeof ExecutionRpcRoute '/inline-scripts': typeof InlineScriptsRoute '/links': typeof LinksRoute '/plain-ts-type-assertion': typeof PlainTsTypeAssertionRoute @@ -602,6 +653,8 @@ export interface FileRoutesById { '/specialChars/malformed': typeof SpecialCharsMalformedRouteRouteWithChildren '/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren '/api/users': typeof ApiUsersRouteWithChildren + '/auth-docs/private': typeof AuthDocsPrivateRoute + '/issue-6221/dashboard': typeof Issue6221DashboardRoute '/multi-cookie-redirect/target': typeof MultiCookieRedirectTargetRoute '/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute '/not-found/via-beforeLoad-target-root': typeof NotFoundViaBeforeLoadTargetRootRoute @@ -632,6 +685,7 @@ export interface FileRoutesById { '/_layout/_layout-2/layout-a': typeof LayoutLayout2LayoutARoute '/_layout/_layout-2/layout-b': typeof LayoutLayout2LayoutBRoute '/api/users/$id': typeof ApiUsersIdRoute + '/issue-6221/article/$id': typeof Issue6221ArticleIdRoute '/not-found/parent-boundary/via-beforeLoad': typeof NotFoundParentBoundaryViaBeforeLoadRoute '/posts_/$postId/deep': typeof PostsPostIdDeepRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -658,8 +712,11 @@ export interface FileRouteTypes { | '/search-params' | '/specialChars' | '/async-scripts' + | '/auth-docs' | '/client-only' | '/deferred' + | '/execution-local' + | '/execution-rpc' | '/inline-scripts' | '/links' | '/plain-ts-type-assertion' @@ -674,6 +731,8 @@ export interface FileRouteTypes { | '/not-found/parent-boundary' | '/specialChars/malformed' | '/api/users' + | '/auth-docs/private' + | '/issue-6221/dashboard' | '/multi-cookie-redirect/target' | '/not-found/via-beforeLoad' | '/not-found/via-beforeLoad-target-root' @@ -704,6 +763,7 @@ export interface FileRouteTypes { | '/layout-a' | '/layout-b' | '/api/users/$id' + | '/issue-6221/article/$id' | '/not-found/parent-boundary/via-beforeLoad' | '/posts/$postId/deep' | '/redirect/$target/via-beforeLoad' @@ -726,8 +786,11 @@ export interface FileRouteTypes { | '/' | '/specialChars' | '/async-scripts' + | '/auth-docs' | '/client-only' | '/deferred' + | '/execution-local' + | '/execution-rpc' | '/inline-scripts' | '/links' | '/plain-ts-type-assertion' @@ -737,6 +800,8 @@ export interface FileRouteTypes { | '/type-only-reexport' | '/specialChars/malformed' | '/api/users' + | '/auth-docs/private' + | '/issue-6221/dashboard' | '/multi-cookie-redirect/target' | '/not-found/via-beforeLoad' | '/not-found/via-beforeLoad-target-root' @@ -766,6 +831,7 @@ export interface FileRouteTypes { | '/layout-a' | '/layout-b' | '/api/users/$id' + | '/issue-6221/article/$id' | '/not-found/parent-boundary/via-beforeLoad' | '/posts/$postId/deep' | '/redirect/$target/via-beforeLoad' @@ -790,8 +856,11 @@ export interface FileRouteTypes { | '/specialChars' | '/_layout' | '/async-scripts' + | '/auth-docs' | '/client-only' | '/deferred' + | '/execution-local' + | '/execution-rpc' | '/inline-scripts' | '/links' | '/plain-ts-type-assertion' @@ -807,6 +876,8 @@ export interface FileRouteTypes { | '/specialChars/malformed' | '/_layout/_layout-2' | '/api/users' + | '/auth-docs/private' + | '/issue-6221/dashboard' | '/multi-cookie-redirect/target' | '/not-found/via-beforeLoad' | '/not-found/via-beforeLoad-target-root' @@ -837,6 +908,7 @@ export interface FileRouteTypes { | '/_layout/_layout-2/layout-a' | '/_layout/_layout-2/layout-b' | '/api/users/$id' + | '/issue-6221/article/$id' | '/not-found/parent-boundary/via-beforeLoad' | '/posts_/$postId/deep' | '/redirect/$target/via-beforeLoad' @@ -863,8 +935,11 @@ export interface RootRouteChildren { SpecialCharsRouteRoute: typeof SpecialCharsRouteRouteWithChildren LayoutRoute: typeof LayoutRouteWithChildren AsyncScriptsRoute: typeof AsyncScriptsRoute + AuthDocsRoute: typeof AuthDocsRouteWithChildren ClientOnlyRoute: typeof ClientOnlyRoute DeferredRoute: typeof DeferredRoute + ExecutionLocalRoute: typeof ExecutionLocalRoute + ExecutionRpcRoute: typeof ExecutionRpcRoute InlineScriptsRoute: typeof InlineScriptsRoute LinksRoute: typeof LinksRoute PlainTsTypeAssertionRoute: typeof PlainTsTypeAssertionRoute @@ -876,10 +951,12 @@ export interface RootRouteChildren { TypeOnlyReexportRoute: typeof TypeOnlyReexportRoute UsersRoute: typeof UsersRouteWithChildren ApiUsersRoute: typeof ApiUsersRouteWithChildren + Issue6221DashboardRoute: typeof Issue6221DashboardRoute MultiCookieRedirectTargetRoute: typeof MultiCookieRedirectTargetRoute RedirectTargetRoute: typeof RedirectTargetRouteWithChildren MultiCookieRedirectIndexRoute: typeof MultiCookieRedirectIndexRoute RedirectIndexRoute: typeof RedirectIndexRoute + Issue6221ArticleIdRoute: typeof Issue6221ArticleIdRoute PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute FooBarQuxHereRoute: typeof FooBarQuxHereRouteWithChildren } @@ -907,6 +984,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AsyncScriptsRouteImport parentRoute: typeof rootRouteImport } + '/auth-docs': { + id: '/auth-docs' + path: '/auth-docs' + fullPath: '/auth-docs' + preLoaderRoute: typeof AuthDocsRouteImport + parentRoute: typeof rootRouteImport + } '/client-only': { id: '/client-only' path: '/client-only' @@ -921,6 +1005,20 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof DeferredRouteImport parentRoute: typeof rootRouteImport } + '/execution-local': { + id: '/execution-local' + path: '/execution-local' + fullPath: '/execution-local' + preLoaderRoute: typeof ExecutionLocalRouteImport + parentRoute: typeof rootRouteImport + } + '/execution-rpc': { + id: '/execution-rpc' + path: '/execution-rpc' + fullPath: '/execution-rpc' + preLoaderRoute: typeof ExecutionRpcRouteImport + parentRoute: typeof rootRouteImport + } '/inline-scripts': { id: '/inline-scripts' path: '/inline-scripts' @@ -1026,6 +1124,20 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ApiUsersRouteImport parentRoute: typeof rootRouteImport } + '/auth-docs/private': { + id: '/auth-docs/private' + path: '/private' + fullPath: '/auth-docs/private' + preLoaderRoute: typeof AuthDocsPrivateRouteImport + parentRoute: typeof AuthDocsRoute + } + '/issue-6221/dashboard': { + id: '/issue-6221/dashboard' + path: '/issue-6221/dashboard' + fullPath: '/issue-6221/dashboard' + preLoaderRoute: typeof Issue6221DashboardRouteImport + parentRoute: typeof rootRouteImport + } '/multi-cookie-redirect/': { id: '/multi-cookie-redirect/' path: '/multi-cookie-redirect' @@ -1250,6 +1362,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ApiUsersIdRouteImport parentRoute: typeof ApiUsersRoute } + '/issue-6221/article/$id': { + id: '/issue-6221/article/$id' + path: '/issue-6221/article/$id' + fullPath: '/issue-6221/article/$id' + preLoaderRoute: typeof Issue6221ArticleIdRouteImport + parentRoute: typeof rootRouteImport + } '/not-found/deep/': { id: '/not-found/deep/' path: '/' @@ -1530,6 +1649,18 @@ const LayoutRouteChildren: LayoutRouteChildren = { const LayoutRouteWithChildren = LayoutRoute._addFileChildren(LayoutRouteChildren) +interface AuthDocsRouteChildren { + AuthDocsPrivateRoute: typeof AuthDocsPrivateRoute +} + +const AuthDocsRouteChildren: AuthDocsRouteChildren = { + AuthDocsPrivateRoute: AuthDocsPrivateRoute, +} + +const AuthDocsRouteWithChildren = AuthDocsRoute._addFileChildren( + AuthDocsRouteChildren, +) + interface PostsRouteChildren { PostsPostIdRoute: typeof PostsPostIdRoute PostsIndexRoute: typeof PostsIndexRoute @@ -1635,8 +1766,11 @@ const rootRouteChildren: RootRouteChildren = { SpecialCharsRouteRoute: SpecialCharsRouteRouteWithChildren, LayoutRoute: LayoutRouteWithChildren, AsyncScriptsRoute: AsyncScriptsRoute, + AuthDocsRoute: AuthDocsRouteWithChildren, ClientOnlyRoute: ClientOnlyRoute, DeferredRoute: DeferredRoute, + ExecutionLocalRoute: ExecutionLocalRoute, + ExecutionRpcRoute: ExecutionRpcRoute, InlineScriptsRoute: InlineScriptsRoute, LinksRoute: LinksRoute, PlainTsTypeAssertionRoute: PlainTsTypeAssertionRoute, @@ -1648,10 +1782,12 @@ const rootRouteChildren: RootRouteChildren = { TypeOnlyReexportRoute: TypeOnlyReexportRoute, UsersRoute: UsersRouteWithChildren, ApiUsersRoute: ApiUsersRouteWithChildren, + Issue6221DashboardRoute: Issue6221DashboardRoute, MultiCookieRedirectTargetRoute: MultiCookieRedirectTargetRoute, RedirectTargetRoute: RedirectTargetRouteWithChildren, MultiCookieRedirectIndexRoute: MultiCookieRedirectIndexRoute, RedirectIndexRoute: RedirectIndexRoute, + Issue6221ArticleIdRoute: Issue6221ArticleIdRoute, PostsPostIdDeepRoute: PostsPostIdDeepRoute, FooBarQuxHereRoute: FooBarQuxHereRouteWithChildren, } diff --git a/e2e/react-start/basic/src/routes/__root.tsx b/e2e/react-start/basic/src/routes/__root.tsx index d8fc0d3b24..ed521817d6 100644 --- a/e2e/react-start/basic/src/routes/__root.tsx +++ b/e2e/react-start/basic/src/routes/__root.tsx @@ -197,6 +197,9 @@ function RootDocument({ children }: { children: React.ReactNode }) { > Client Only {' '} + + Server function loader + {' '} { console.info('Fetching users... @', request.url) - const res = await axios.get>(`${queryURL}/users`) + const res = await axios.get>( + 'https://jsonplaceholder.typicode.com/users', + ) const list = res.data.slice(0, 10) diff --git a/e2e/react-start/basic/src/routes/api/users.$id.ts b/e2e/react-start/basic/src/routes/api/users.$id.ts index ac665381f1..797dffb637 100644 --- a/e2e/react-start/basic/src/routes/api/users.$id.ts +++ b/e2e/react-start/basic/src/routes/api/users.$id.ts @@ -2,19 +2,15 @@ import { createFileRoute } from '@tanstack/react-router' import axios from 'redaxios' import type { User } from '~/utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} - export const Route = createFileRoute('/api/users/$id')({ server: { handlers: { GET: async ({ request, params }) => { console.info(`Fetching users by id=${params.id}... @`, request.url) try { - const res = await axios.get(`${queryURL}/users/` + params.id) + const res = await axios.get( + `https://jsonplaceholder.typicode.com/users/${params.id}`, + ) return Response.json({ id: res.data.id, diff --git a/e2e/react-start/basic/src/routes/auth-docs.private.tsx b/e2e/react-start/basic/src/routes/auth-docs.private.tsx new file mode 100644 index 0000000000..85fc8a0fc9 --- /dev/null +++ b/e2e/react-start/basic/src/routes/auth-docs.private.tsx @@ -0,0 +1,17 @@ +import { createFileRoute, redirect } from '@tanstack/react-router' +import { getPrivateDataFn } from '../utils/auth-docs' + +export const Route = createFileRoute('/auth-docs/private')({ + beforeLoad: ({ context }) => { + if (!context.user) { + throw redirect({ to: '/auth-docs' }) + } + }, + loader: () => getPrivateDataFn(), + component: PrivatePage, +}) + +function PrivatePage() { + const message = Route.useLoaderData() + return

{message}

+} diff --git a/e2e/react-start/basic/src/routes/auth-docs.tsx b/e2e/react-start/basic/src/routes/auth-docs.tsx new file mode 100644 index 0000000000..6ea1b813ef --- /dev/null +++ b/e2e/react-start/basic/src/routes/auth-docs.tsx @@ -0,0 +1,100 @@ +import { + createFileRoute, + Outlet, + useHydrated, + useRouter, +} from '@tanstack/react-router' +import { useServerFn } from '@tanstack/react-start' +import { useState } from 'react' +import type { FormEvent } from 'react' +import { + getCurrentUserFn, + getPrivateDataFn, + loginFn, + logoutFn, +} from '../utils/auth-docs' + +export const Route = createFileRoute('/auth-docs')({ + beforeLoad: async () => ({ user: await getCurrentUserFn() }), + headers: () => ({ 'Cache-Control': 'private, no-store' }), + component: AuthDocs, +}) + +function AuthDocs() { + const hydrated = useHydrated() + const { user } = Route.useRouteContext() + const router = useRouter() + const login = useServerFn(loginFn) + const logout = useServerFn(logoutFn) + const getPrivateData = useServerFn(getPrivateDataFn) + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState('') + const [privateResult, setPrivateResult] = useState('') + + const handleSubmit = async (event: FormEvent) => { + event.preventDefault() + const formData = new FormData(event.currentTarget) + const email = formData.get('email') + const password = formData.get('password') + if (typeof email !== 'string' || typeof password !== 'string') { + return + } + setIsLoading(true) + setError('') + try { + const result = await login({ data: { email, password } }) + if (result?.error) { + setError(result.error) + return + } + await router.invalidate() + } catch { + setError('Login failed. Please try again.') + } finally { + setIsLoading(false) + } + } + + return ( +
+

{user?.email ?? 'Signed out'}

+
+
+ + + +
+

{error}

+
+ + +

{privateResult}

+ +
+ ) +} diff --git a/e2e/react-start/basic/src/routes/execution-local.tsx b/e2e/react-start/basic/src/routes/execution-local.tsx new file mode 100644 index 0000000000..477cd81740 --- /dev/null +++ b/e2e/react-start/basic/src/routes/execution-local.tsx @@ -0,0 +1,16 @@ +import { createFileRoute } from '@tanstack/react-router' +import { readOnlyOnServer } from '~/utils/execution-functions' + +// This intentionally fails during browser navigation. It is the negative case +// for the environment-functions troubleshooting guide. +export const Route = createFileRoute('/execution-local')({ + loader: () => readOnlyOnServer(), + component: Result, + errorComponent: ({ error }) => ( +

{error instanceof Error ? error.message : String(error)}

+ ), +}) + +function Result() { + return

{Route.useLoaderData()}

+} diff --git a/e2e/react-start/basic/src/routes/execution-rpc.tsx b/e2e/react-start/basic/src/routes/execution-rpc.tsx new file mode 100644 index 0000000000..f934015522 --- /dev/null +++ b/e2e/react-start/basic/src/routes/execution-rpc.tsx @@ -0,0 +1,18 @@ +import { createFileRoute, Link } from '@tanstack/react-router' +import { readThroughRpc } from '~/utils/execution-functions' + +export const Route = createFileRoute('/execution-rpc')({ + loader: () => readThroughRpc(), + component: Result, +}) + +function Result() { + return ( + <> +

{Route.useLoaderData()}

+ + Call the server-only helper directly + + + ) +} diff --git a/e2e/react-start/basic/src/routes/issue-6221.article.$id.tsx b/e2e/react-start/basic/src/routes/issue-6221.article.$id.tsx new file mode 100644 index 0000000000..c923a5f1cb --- /dev/null +++ b/e2e/react-start/basic/src/routes/issue-6221.article.$id.tsx @@ -0,0 +1,42 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import { createClientOnlyFn } from '@tanstack/react-start' + +const isAuthed = createClientOnlyFn( + () => localStorage.getItem('issue-6221-auth') === 'good', +) + +const fetchArticle = async (id: string) => { + await new Promise((resolve) => setTimeout(resolve, 1000)) + return isAuthed() + ? { + title: `Article Title for ${id}`, + content: `Article content for ${id}`, + } + : null +} + +export const Route = createFileRoute('/issue-6221/article/$id')({ + ssr: false, + loader: ({ params }) => fetchArticle(params.id), + head: ({ loaderData }) => ({ + meta: [{ title: loaderData?.title ?? 'title n/a' }], + }), + component: Article, +}) + +function Article() { + const article = Route.useLoaderData() + + return ( +
+ + Dashboard + + {article ? ( +
{article.content}
+ ) : ( +
Article Not Accessible.
+ )} +
+ ) +} diff --git a/e2e/react-start/basic/src/routes/issue-6221.dashboard.tsx b/e2e/react-start/basic/src/routes/issue-6221.dashboard.tsx new file mode 100644 index 0000000000..8c93da669c --- /dev/null +++ b/e2e/react-start/basic/src/routes/issue-6221.dashboard.tsx @@ -0,0 +1,6 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/issue-6221/dashboard')({ + head: () => ({ meta: [{ title: 'Dashboard' }] }), + component: () =>
Dashboard
, +}) diff --git a/e2e/react-start/basic/src/routes/specialChars/search.tsx b/e2e/react-start/basic/src/routes/specialChars/search.tsx index 9e4b42e888..5840d425ab 100644 --- a/e2e/react-start/basic/src/routes/specialChars/search.tsx +++ b/e2e/react-start/basic/src/routes/specialChars/search.tsx @@ -7,6 +7,9 @@ export const Route = createFileRoute('/specialChars/search')({ validateSearch: z.object({ searchParam: z.string(), }), + beforeLoad: () => ({ + beforeLoadOn: isBrowser ? 'client' : 'server', + }), loader: async () => { console.log(`[loader] Running on ${isBrowser ? 'client' : 'server'}`) return { @@ -18,11 +21,15 @@ export const Route = createFileRoute('/specialChars/search')({ function RouteComponent() { const search = Route.useSearch() + const { beforeLoadOn } = Route.useRouteContext() const { loadedOn } = Route.useLoaderData() return (
Hello "/specialChars/search"! +
+ Before load on: {beforeLoadOn} +
Loaded on: {loadedOn}
{search.searchParam}
diff --git a/e2e/react-start/basic/src/utils/auth-docs.ts b/e2e/react-start/basic/src/utils/auth-docs.ts new file mode 100644 index 0000000000..22b36ee808 --- /dev/null +++ b/e2e/react-start/basic/src/utils/auth-docs.ts @@ -0,0 +1,60 @@ +import { createServerFn } from '@tanstack/react-start' +import { redirect } from '@tanstack/react-router' +import { getCookie, setCookie } from '@tanstack/react-start/server' +import { getIronSession } from 'iron-session' + +function getSession() { + return getIronSession<{ email: string }>( + { read: getCookie, write: setCookie }, + { + cookieName: 'auth-docs-test', + password: 'authentication-docs-browser-test-secret-only-2026', + ttl: 60 * 60, + cookieOptions: { + httpOnly: true, + secure: false, + sameSite: 'lax', + path: '/', + }, + }, + ) +} + +export const getCurrentUserFn = createServerFn({ method: 'GET' }).handler( + async () => { + const session = await getSession() + return session.email ? { email: session.email } : null + }, +) + +export const loginFn = createServerFn({ method: 'POST' }) + .validator((data: { email: string; password: string }) => data) + .handler(async ({ data }) => { + // Fixed credentials belong only to this browser-test fixture. + if ( + data.email !== 'reader@example.com' || + data.password !== 'test-password' + ) { + return { error: 'Invalid credentials' } + } + const session = await getSession() + session.email = data.email + await session.save() + throw redirect({ to: '/auth-docs/private' }) + }) + +export const logoutFn = createServerFn({ method: 'POST' }).handler(async () => { + const session = await getSession() + session.destroy() + throw redirect({ to: '/auth-docs' }) +}) + +export const getPrivateDataFn = createServerFn({ method: 'GET' }).handler( + async () => { + const session = await getSession() + if (!session.email) { + throw new Error('Unauthorized') + } + return 'Private account data' + }, +) diff --git a/e2e/react-start/basic/src/utils/execution-functions.ts b/e2e/react-start/basic/src/utils/execution-functions.ts new file mode 100644 index 0000000000..97e66573d8 --- /dev/null +++ b/e2e/react-start/basic/src/utils/execution-functions.ts @@ -0,0 +1,5 @@ +import { createServerFn, createServerOnlyFn } from '@tanstack/react-start' + +export const readOnlyOnServer = createServerOnlyFn(() => 'Read on the server') + +export const readThroughRpc = createServerFn().handler(() => readOnlyOnServer()) diff --git a/e2e/react-start/basic/src/utils/posts.tsx b/e2e/react-start/basic/src/utils/posts.tsx index 4cc5dcc4c6..9fdff27673 100644 --- a/e2e/react-start/basic/src/utils/posts.tsx +++ b/e2e/react-start/basic/src/utils/posts.tsx @@ -8,18 +8,12 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} - export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) .handler(async ({ data: postId }) => { console.info(`Fetching post with id ${postId}...`) const post = await axios - .get(`${queryURL}/posts/${postId}`) + .get(`https://jsonplaceholder.typicode.com/posts/${postId}`) .then((r) => r.data) .catch((err) => { console.error(err) @@ -36,7 +30,7 @@ export const fetchPosts = createServerFn({ method: 'GET' }).handler( async () => { console.info('Fetching posts...') return axios - .get>(`${queryURL}/posts`) + .get>('https://jsonplaceholder.typicode.com/posts') .then((r) => r.data.slice(0, 10)) }, ) diff --git a/e2e/react-start/basic/src/utils/users.tsx b/e2e/react-start/basic/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/react-start/basic/src/utils/users.tsx +++ b/e2e/react-start/basic/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/react-start/basic/tests/auth-docs.spec.ts b/e2e/react-start/basic/tests/auth-docs.spec.ts new file mode 100644 index 0000000000..47a57c9da2 --- /dev/null +++ b/e2e/react-start/basic/tests/auth-docs.spec.ts @@ -0,0 +1,89 @@ +import { expect, test } from '@playwright/test' +import { isSpaMode } from './utils/isSpaMode' + +test('authentication docs pattern handles login, logout, route context, and server authorization', async ({ + page, +}) => { + await page.goto('/auth-docs/private') + await expect(page).toHaveURL(/\/auth-docs$/) + await expect(page.getByTestId('auth-docs-user')).toHaveText('Signed out') + + await page + .getByRole('button', { name: 'Request private data directly' }) + .click() + await expect(page.getByTestId('auth-docs-private-result')).toHaveText( + 'Access denied', + ) + + await page.getByLabel('Email', { exact: true }).fill('reader@example.com') + await page.getByLabel('Password', { exact: true }).fill('wrong-password') + await page.getByRole('button', { name: 'Login', exact: true }).click() + await expect(page.getByRole('alert')).toHaveText('Invalid credentials') + await expect(page.getByTestId('auth-docs-user')).toHaveText('Signed out') + + await page.getByLabel('Password', { exact: true }).fill('test-password') + await page.getByRole('button', { name: 'Login', exact: true }).click() + await expect(page).toHaveURL(/\/auth-docs\/private$/) + await expect(page.getByTestId('auth-docs-user')).toHaveText( + 'reader@example.com', + ) + await expect(page.getByTestId('auth-docs-private-page')).toHaveText( + 'Private account data', + ) + + const response = await page.reload() + expect(response?.status()).toBe(200) + if (isSpaMode) { + // The shared SPA shell must not contain authenticated account data. + expect(await response?.text()).not.toContain('reader@example.com') + expect(await response?.text()).not.toContain('Private account data') + } else { + expect(response?.headers()['cache-control']).toBe('private, no-store') + } + await expect(page.getByTestId('auth-docs-user')).toHaveText( + 'reader@example.com', + ) + await page.getByRole('button', { name: 'Logout', exact: true }).click() + await expect(page).toHaveURL(/\/auth-docs$/) + await expect(page.getByTestId('auth-docs-user')).toHaveText('Signed out') + await page + .getByRole('button', { name: 'Request private data directly' }) + .click() + await expect(page.getByTestId('auth-docs-private-result')).toHaveText( + 'Access denied', + ) + await page.goto('/auth-docs/private') + await expect(page).toHaveURL(/\/auth-docs$/) +}) + +test('the authentication form cannot submit credentials before hydration', async ({ + browser, + baseURL, +}) => { + const context = await browser.newContext({ + javaScriptEnabled: false, + baseURL, + }) + const page = await context.newPage() + try { + await page.goto('/auth-docs') + if (isSpaMode) { + // Without JavaScript, the SPA shell cannot render credential controls. + await expect(page.locator('form')).toHaveCount(0) + await expect(page.getByLabel('Email', { exact: true })).toHaveCount(0) + await expect(page.getByLabel('Password', { exact: true })).toHaveCount(0) + await expect( + page.getByRole('button', { name: 'Login', exact: true }), + ).toHaveCount(0) + } else { + await expect(page.locator('form')).toHaveAttribute('method', 'post') + await expect(page.getByLabel('Email', { exact: true })).toBeDisabled() + await expect(page.getByLabel('Password', { exact: true })).toBeDisabled() + await expect( + page.getByRole('button', { name: 'Login', exact: true }), + ).toBeDisabled() + } + } finally { + await context.close() + } +}) diff --git a/e2e/react-start/basic/tests/client-only.spec.ts b/e2e/react-start/basic/tests/client-only.spec.ts index a3b6f99442..299744f636 100644 --- a/e2e/react-start/basic/tests/client-only.spec.ts +++ b/e2e/react-start/basic/tests/client-only.spec.ts @@ -1,5 +1,6 @@ import { expect } from '@playwright/test' import { test } from '@tanstack/router-e2e-utils' +import { isSpaMode } from './utils/isSpaMode' /** * These tests verify the compiler optimization. @@ -15,7 +16,15 @@ import { test } from '@tanstack/router-e2e-utils' test('ClientOnly renders fallback on server, then client content after hydration', async ({ page, + request, }) => { + const response = await request.get('/client-only') + expect(response.status()).toBe(200) + const html = await response.text() + expect(html).not.toContain('data-testid="window-size"') + if (!isSpaMode) { + expect(html).toContain('Loading window size...') + } // Navigate directly to the client-only route // If the compiler optimization isn't working, this would crash the server // because WindowSize.tsx accesses `window` at module scope diff --git a/e2e/react-start/basic/tests/environment-functions.spec.ts b/e2e/react-start/basic/tests/environment-functions.spec.ts new file mode 100644 index 0000000000..410b1d999e --- /dev/null +++ b/e2e/react-start/basic/tests/environment-functions.spec.ts @@ -0,0 +1,46 @@ +import { expect, test } from '@playwright/test' +import { isSpaMode } from './utils/isSpaMode' + +const guardError = + 'createServerOnlyFn() functions can only be called on the server!' + +test('a server-only loader works on the server but rejects client navigation', async ({ + page, + request, +}) => { + const direct = await request.get('/execution-local') + expect(direct.status()).toBe(200) + if (!isSpaMode) { + expect(await direct.text()).toContain('Read on the server') + } + await page.goto('/execution-rpc') + await expect(page.getByTestId('execution-result')).toHaveText( + 'Read on the server', + ) + await page + .getByRole('link', { name: 'Call the server-only helper directly' }) + .click() + await expect(page.getByRole('alert')).toHaveText(guardError) +}) + +test('a server function preserves the loader result on direct requests and navigation', async ({ + page, + request, +}) => { + const direct = await request.get('/execution-rpc') + expect(direct.status()).toBe(200) + if (!isSpaMode) { + expect(await direct.text()).toContain('Read on the server') + } + await page.goto('/') + await page + .getByRole('link', { name: 'Server function loader', exact: true }) + .click() + await expect(page.getByTestId('execution-result')).toHaveText( + 'Read on the server', + ) + await page.reload() + await expect(page.getByTestId('execution-result')).toHaveText( + 'Read on the server', + ) +}) diff --git a/e2e/react-start/basic/tests/fixture-api.spec.ts b/e2e/react-start/basic/tests/fixture-api.spec.ts new file mode 100644 index 0000000000..6c9b26dc4c --- /dev/null +++ b/e2e/react-start/basic/tests/fixture-api.spec.ts @@ -0,0 +1,11 @@ +import { expect, test } from '@playwright/test' + +test('server API receives canned users without a fixture listener', async ({ + request, +}) => { + const response = await request.get('/api/users') + expect(response.ok()).toBe(true) + const users = await response.json() + expect(users).toHaveLength(10) + expect(users[0]).toMatchObject({ id: 1, name: 'Leanne Graham' }) +}) diff --git a/e2e/react-start/basic/tests/issue-6221-head.spec.ts b/e2e/react-start/basic/tests/issue-6221-head.spec.ts new file mode 100644 index 0000000000..96274ce0f9 --- /dev/null +++ b/e2e/react-start/basic/tests/issue-6221-head.spec.ts @@ -0,0 +1,41 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' +import { isPreview } from './utils/isPreview' +import { isSpaMode } from './utils/isSpaMode' + +// Ported to React from the regression app in +// https://github.com/TanStack/router/pull/6222 +test.skip( + isSpaMode || isPreview, + 'head() coverage for an ssr:false route requires the SSR test mode', +) + +test('browser back uses fresh loaderData for both the body and head (#6221)', async ({ + page, +}) => { + await page.goto('/') + await page.evaluate(() => localStorage.setItem('issue-6221-auth', 'good')) + + await page.goto('/issue-6221/article/1') + + await expect(page.getByTestId('issue-6221-article')).toHaveText( + 'Article content for 1', + ) + await expect(page).toHaveTitle('Article Title for 1') + + await page.evaluate(() => localStorage.removeItem('issue-6221-auth')) + await page.reload() + await expect(page.getByText('Article Not Accessible.')).toBeVisible() + await expect(page).toHaveTitle('title n/a') + + await page.evaluate(() => localStorage.setItem('issue-6221-auth', 'good')) + await page.getByTestId('issue-6221-dashboard-link').click() + await expect(page.getByTestId('issue-6221-dashboard')).toBeVisible() + await expect(page).toHaveTitle('Dashboard') + + await page.goBack() + await expect(page.getByTestId('issue-6221-article')).toHaveText( + 'Article content for 1', + ) + await expect(page).toHaveTitle('Article Title for 1') +}) diff --git a/e2e/react-start/basic/tests/redirect.spec.ts b/e2e/react-start/basic/tests/redirect.spec.ts index 34ba7b6ea9..010ecec155 100644 --- a/e2e/react-start/basic/tests/redirect.spec.ts +++ b/e2e/react-start/basic/tests/redirect.spec.ts @@ -1,20 +1,15 @@ import queryString from 'node:querystring' -import { expect, type Page } from '@playwright/test' +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' import combinateImport from 'combinate' -import { - getDummyServerPort, - getTestServerPort, - test, -} from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from './utils/getE2EPortKey.ts' +import type { Page } from '@playwright/test' // somehow playwright does not correctly import default exports const combinate = (combinateImport as any).default as typeof combinateImport -const e2ePortKey = getE2EPortKey() -const PORT = await getTestServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) -const EXTERNAL_HOST_PORT = await getDummyServerPort(e2ePortKey) +const EXTERNAL_ORIGIN = `http://127.0.0.1:${PORT}` const POSTS_URL = `http://localhost:${PORT}/posts` async function waitForRouterIdle(page: Page) { @@ -111,7 +106,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, }) if (scenario === 'navigate') { @@ -124,7 +119,7 @@ test.describe('redirects', () => { await page.goto(`/redirect/external/via-${thrower}?${q}`) } - const url = `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) @@ -147,7 +142,7 @@ test.describe('redirects', () => { }) => { let fullPageLoad = false const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, reloadDocument, }) @@ -170,10 +165,7 @@ test.describe('redirects', () => { await page.goto(`/redirect/${target}/serverFn/via-${thrower}?${q}`) } - const url = - target === 'internal' - ? POSTS_URL - : `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = target === 'internal' ? POSTS_URL : `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) @@ -202,7 +194,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, reloadDocument, }) @@ -219,10 +211,7 @@ test.describe('redirects', () => { await button.click() - const url = - target === 'internal' - ? POSTS_URL - : `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = target === 'internal' ? POSTS_URL : `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) if (target === 'internal') { diff --git a/e2e/react-start/basic/tests/setup/dev-server.setup.ts b/e2e/react-start/basic/tests/setup/dev-server.setup.ts new file mode 100644 index 0000000000..d16ff0bb54 --- /dev/null +++ b/e2e/react-start/basic/tests/setup/dev-server.setup.ts @@ -0,0 +1,19 @@ +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' + +export default async function setup() { + const port = Number(process.env.E2E_APP_PORT ?? 0) + const baseURL = `http://localhost:${port}` + + await waitForServer(baseURL) + await preOptimizeDevServer({ + baseURL, + warmup: async (page) => { + await page.getByRole('heading').getByText('Welcome Home').waitFor() + await page.goto(`${baseURL}/specialChars/search?searchParam=warmup`) + await page.getByTestId('special-search-loaded-info').waitFor() + await page.goto(`${baseURL}/posts`) + await page.getByRole('link', { name: 'sunt aut facere repe' }).waitFor() + await page.waitForLoadState('networkidle') + }, + }) +} diff --git a/e2e/react-start/basic/tests/setup/global.setup.ts b/e2e/react-start/basic/tests/setup/global.setup.ts deleted file mode 100644 index cd38c35885..0000000000 --- a/e2e/react-start/basic/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -export default async function setup() { - await e2eStartDummyServer(getE2EPortKey()) -} diff --git a/e2e/react-start/basic/tests/setup/global.teardown.ts b/e2e/react-start/basic/tests/setup/global.teardown.ts deleted file mode 100644 index 36e5c92858..0000000000 --- a/e2e/react-start/basic/tests/setup/global.teardown.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -export default async function teardown() { - try { - await e2eStopDummyServer(getE2EPortKey()) - } catch {} -} diff --git a/e2e/react-start/basic/tests/setup/waitForDummyServer.ts b/e2e/react-start/basic/tests/setup/waitForDummyServer.ts deleted file mode 100644 index 88c18fd79e..0000000000 --- a/e2e/react-start/basic/tests/setup/waitForDummyServer.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { getDummyServerPort } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -const timeoutMs = 10_000 -const retryIntervalMs = 100 - -export default async function waitForDummyServer() { - const port = await getDummyServerPort(getE2EPortKey()) - const deadline = Date.now() + timeoutMs - - while (Date.now() < deadline) { - try { - const response = await fetch(`http://localhost:${port}/`) - - if (response.ok) { - return - } - } catch {} - - await new Promise((resolve) => setTimeout(resolve, retryIntervalMs)) - } - - throw new Error(`Timed out waiting for dummy server on port ${port}`) -} diff --git a/e2e/react-start/basic/tests/spa-shell.spec.ts b/e2e/react-start/basic/tests/spa-shell.spec.ts new file mode 100644 index 0000000000..f42195e762 --- /dev/null +++ b/e2e/react-start/basic/tests/spa-shell.spec.ts @@ -0,0 +1,53 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' +import { isSpaMode } from './utils/isSpaMode' + +// The prod SPA run and the dev SPA runs (`E2E_DEV_SERVER`) all run this file. +// The dev runs run nothing else. +test.skip(!isSpaMode, 'only SPA mode answers documents with the shell') + +// Its loader and beforeLoad report where they ran. +const searchRoute = '/specialChars/search?searchParam=shell' + +test('a document request gets the shell, not the rendered route', async ({ + request, +}) => { + const response = await request.get(searchRoute) + + expect(response.status()).toBe(200) + const html = await response.text() + // The root route's document renders... + expect(html).toContain('This Route Does Not Exist') + // ...but not the matched route, nor its loader's output. + expect(html).not.toContain('special-search-loaded-info') + expect(html).not.toContain('Loaded on: server') +}) + +test('the route loads in the browser', async ({ page }) => { + await page.goto(searchRoute) + + await expect(page.getByTestId('special-search-loaded-info')).toHaveText( + 'Loaded on: client', + ) + await expect(page.getByTestId('special-search-before-load-info')).toHaveText( + 'Before load on: client', + ) + await expect(page.getByTestId('special-search-param')).toHaveText('shell') +}) + +test('client navigation works from the shell', async ({ page }) => { + await page.goto('/') + await expect(page.getByRole('heading')).toContainText('Welcome Home') + await expect(page.getByTestId('router-status')).toHaveText('idle') + + // A full page load would drop this. + await page.evaluate(() => { + ;(window as any).__spaShellPage = true + }) + await page.getByRole('link', { name: 'Posts' }).click() + await page.waitForURL('/posts') + await expect( + page.getByRole('link', { name: 'sunt aut facere repe' }), + ).toBeVisible() + expect(await page.evaluate(() => (window as any).__spaShellPage)).toBe(true) +}) diff --git a/e2e/react-start/basic/tests/special-characters.spec.ts b/e2e/react-start/basic/tests/special-characters.spec.ts index 7cf50c39c8..188d1f10a6 100644 --- a/e2e/react-start/basic/tests/special-characters.spec.ts +++ b/e2e/react-start/basic/tests/special-characters.spec.ts @@ -104,11 +104,16 @@ test.describe('Unicode route rendering', () => { const loadedOn = await page .getByTestId('special-search-loaded-info') .textContent() + const beforeLoadOn = await page + .getByTestId('special-search-before-load-info') + .textContent() if (isSpaMode) { expect(loadedOn).toBe('Loaded on: client') + expect(beforeLoadOn).toBe('Before load on: client') } else { expect(loadedOn).toBe('Loaded on: server') + expect(beforeLoadOn).toBe('Before load on: server') } }) diff --git a/e2e/react-start/basic/tests/utils/getE2EPortKey.ts b/e2e/react-start/basic/tests/utils/getE2EPortKey.ts deleted file mode 100644 index 48be6a9027..0000000000 --- a/e2e/react-start/basic/tests/utils/getE2EPortKey.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getPackageName } from './getPackageName.ts' - -export function getE2EPortKey() { - return process.env.E2E_PORT_KEY ?? getPackageName() -} diff --git a/e2e/react-start/clerk-basic/package.json b/e2e/react-start/clerk-basic/package.json index 137a0e7fda..7838b4cee1 100644 --- a/e2e/react-start/clerk-basic/package.json +++ b/e2e/react-start/clerk-basic/package.json @@ -8,7 +8,7 @@ "dev:e2e": "vite dev", "build": "exit 0; vite build", "start": "node .output/server/index.mjs", - "test:e2e": "exit 0; rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "exit 0; playwright test --project=chromium" }, "dependencies": { "@clerk/tanstack-react-start": "^0.19.0", @@ -17,7 +17,7 @@ "@tanstack/react-start": "workspace:^", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0" }, "devDependencies": { @@ -29,7 +29,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/clerk-basic/playwright.config.ts b/e2e/react-start/clerk-basic/playwright.config.ts index 18b8905468..82678ac00b 100644 --- a/e2e/react-start/clerk-basic/playwright.config.ts +++ b/e2e/react-start/clerk-basic/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/clerk-basic/src/routes/_authed.tsx b/e2e/react-start/clerk-basic/src/routes/_authed.tsx index 226ae0829f..440d0e3f3c 100644 --- a/e2e/react-start/clerk-basic/src/routes/_authed.tsx +++ b/e2e/react-start/clerk-basic/src/routes/_authed.tsx @@ -8,7 +8,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return (
diff --git a/e2e/react-start/csp/package.json b/e2e/react-start/csp/package.json index 22ffb81237..fd8987bcef 100644 --- a/e2e/react-start/csp/package.json +++ b/e2e/react-start/csp/package.json @@ -8,7 +8,7 @@ "dev:e2e": "vite dev", "build": "vite build && tsc --noEmit", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -22,8 +22,9 @@ "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/csp/playwright.config.ts b/e2e/react-start/csp/playwright.config.ts index 5f9de5709e..87b32e1f50 100644 --- a/e2e/react-start/csp/playwright.config.ts +++ b/e2e/react-start/csp/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/css-inline/package.json b/e2e/react-start/css-inline/package.json index 5e0b6d104d..6c5dd031c6 100644 --- a/e2e/react-start/css-inline/package.json +++ b/e2e/react-start/css-inline/package.json @@ -20,24 +20,65 @@ "express": "^5.2.1", "react": "^19.0.0", "react-dom": "^19.0.0", - "srvx": "^0.11.9" + "srvx": "^1.0.0" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { "targets": { "test:e2e": { - "parallelism": false + "parallelism": false, + "outputs": [ + "...", + "{projectRoot}/dist-vite-ssr", + "{projectRoot}/dist-vite-ssr-transform-assets", + "{projectRoot}/dist-vite-transform-assets-ssr", + "{projectRoot}/dist-rsbuild-ssr", + "{projectRoot}/dist-rsbuild-ssr-transform-assets", + "{projectRoot}/dist-rsbuild-transform-assets-ssr" + ] + }, + "build": { + "outputs": [ + "...", + "{projectRoot}/dist-vite-ssr", + "{projectRoot}/dist-rsbuild-ssr" + ] + }, + "test:e2e--vite-ssr": { + "outputs": [ + "...", + "{projectRoot}/dist-vite-ssr" + ] + }, + "test:e2e--vite-ssr--transform-assets": { + "outputs": [ + "...", + "{projectRoot}/dist-vite-ssr-transform-assets" + ] + }, + "test:e2e--rsbuild-ssr": { + "outputs": [ + "...", + "{projectRoot}/dist-rsbuild-ssr" + ] + }, + "test:e2e--rsbuild-ssr--transform-assets": { + "outputs": [ + "...", + "{projectRoot}/dist-rsbuild-ssr-transform-assets" + ] } }, "metadata": { diff --git a/e2e/react-start/css-inline/playwright.config.ts b/e2e/react-start/css-inline/playwright.config.ts index b5d78f3608..78e7b75252 100644 --- a/e2e/react-start/css-inline/playwright.config.ts +++ b/e2e/react-start/css-inline/playwright.config.ts @@ -1,7 +1,5 @@ -import fs from 'node:fs' import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' const inlineCssTransformAssets = @@ -18,15 +16,8 @@ const transformAssetsSuffix = isInlineCssTransformAssets : '' const distDir = process.env.E2E_DIST_DIR ?? `dist-${toolchain}${transformAssetsSuffix}-ssr` -const e2ePortKey = - process.env.E2E_PORT_KEY ?? - `${packageJson.name}-${toolchain}${transformAssetsSuffix}` -if (process.env.TEST_WORKER_INDEX === undefined) { - fs.rmSync(`port-${e2ePortKey}.txt`, { force: true }) -} - -const PORT = await getTestServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -40,8 +31,8 @@ export default defineConfig({ webServer: { command: `pnpm build:${toolchain} && pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { E2E_DIST_DIR: distDir, diff --git a/e2e/react-start/css-inline/rsbuild.config.ts b/e2e/react-start/css-inline/rsbuild.config.ts index 2fd1208250..8957fc9a06 100644 --- a/e2e/react-start/css-inline/rsbuild.config.ts +++ b/e2e/react-start/css-inline/rsbuild.config.ts @@ -8,7 +8,7 @@ const transformInlineCssAssets = export default defineConfig({ plugins: [ - pluginReact({ splitChunks: false }), + pluginReact(), tanstackStart({ server: { build: { diff --git a/e2e/react-start/css-inline/server.js b/e2e/react-start/css-inline/server.js index fcdec3b888..27b2357284 100644 --- a/e2e/react-start/css-inline/server.js +++ b/e2e/react-start/css-inline/server.js @@ -3,7 +3,7 @@ import path from 'node:path' import express from 'express' import { toNodeHandler } from 'srvx/node' -const port = process.env.PORT || 3000 +const port = Number(process.env.PORT ?? 3000) const distDir = process.env.E2E_DIST_DIR || 'dist-vite-ssr' const distClientDir = path.resolve(distDir, 'client') @@ -37,8 +37,10 @@ async function createStartServer() { } createStartServer().then((app) => { - app.listen(port, (error) => { - if (error) throw error - console.info(`Start Server: http://localhost:${port}`) + const httpServer = app.listen(port, (error) => { + if (error) { + throw error + } + console.info(`E2E app: http://localhost:${httpServer.address().port}`) }) }) diff --git a/e2e/react-start/css-inline/src/routes/app/dashboard/index.tsx b/e2e/react-start/css-inline/src/routes/app/dashboard/index.tsx index a796656b3d..35205cc9cf 100644 --- a/e2e/react-start/css-inline/src/routes/app/dashboard/index.tsx +++ b/e2e/react-start/css-inline/src/routes/app/dashboard/index.tsx @@ -3,6 +3,9 @@ import { NestedPanel } from '~/components/NestedPanel' import styles from '~/styles/dashboard-index.module.css' export const Route = createFileRoute('/app/dashboard/')({ + head: () => ({ + meta: [{ title: 'Inline CSS dashboard' }], + }), component: DashboardIndex, }) diff --git a/e2e/react-start/css-inline/tests/css-inline.spec.ts b/e2e/react-start/css-inline/tests/css-inline.spec.ts index 339fedd4ca..89d7d3992f 100644 --- a/e2e/react-start/css-inline/tests/css-inline.spec.ts +++ b/e2e/react-start/css-inline/tests/css-inline.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { test } from '@tanstack/router-e2e-utils' +import { collectBrowserErrors, test } from '@tanstack/router-e2e-utils' const buildUrl = (baseURL: string, pathname: string) => baseURL.replace(/\/$/, '') + pathname @@ -151,6 +151,23 @@ test('client navigation preserves the SSR inline shell stylesheet', async ({ await page.goto(buildUrl(baseURL!, '/')) await waitForHydration(page) + const inlineStyle = page.locator('style[data-tsr-inline-css]') + await expect(inlineStyle).toHaveCount(1) + const original = await inlineStyle.evaluateHandle( + (style: HTMLStyleElement) => { + const mutations: Array = [] + const observer = new MutationObserver((records) => { + mutations.push(...records) + }) + observer.observe(style, { + childList: true, + characterData: true, + subtree: true, + }) + return { style, sheet: style.sheet, observer, mutations } + }, + ) + await expect.poll(() => getInlineCssTexts(page)).toHaveLength(1) await expect .poll(() => getInlineCssTexts(page)) @@ -161,6 +178,28 @@ test('client navigation preserves the SSR inline shell stylesheet', async ({ await page.getByTestId('nav-dashboard').click() await page.waitForURL('**/app/dashboard') + await expect(page).toHaveTitle('Inline CSS dashboard') + await expect(page.getByTestId('dashboard-card')).toBeVisible() + + await page.getByTestId('nav-home').click() + await expect(page).toHaveTitle('Inline CSS E2E') + await expect(page.getByTestId('home')).toBeVisible() + + // #8250: unchanged CSS text can hide a redundant innerHTML write that + // replaces the stylesheet or fails under Trusted Types. Observe native DOM + // mutations and CSSOM identity without patching the innerHTML setter. + expect( + await original.evaluate(({ style, sheet, observer, mutations }) => { + const mutationCount = mutations.length + observer.takeRecords().length + observer.disconnect() + return { + connected: style.isConnected, + sameSheet: style.sheet === sheet, + mutationCount, + } + }), + ).toEqual({ connected: true, sameSheet: true, mutationCount: 0 }) + await original.dispose() await expect.poll(() => getInlineCssTexts(page)).toHaveLength(1) await expect @@ -170,3 +209,45 @@ test('client navigation preserves the SSR inline shell stylesheet', async ({ .poll(() => getStyle(page, 'shell', 'background-color')) .toBe('rgb(240, 249, 255)') }) + +test('client navigation preserves inline CSS with Trusted Types enforced', async ({ + page, +}) => { + const browserErrors = collectBrowserErrors(page) + const csp = "require-trusted-types-for 'script'; trusted-types 'none'" + await page.route('/', async (route) => { + const response = await route.fetch() + await route.fulfill({ + response, + headers: { ...response.headers(), 'content-security-policy': csp }, + }) + }) + + const response = await page.goto('/') + expect(response?.headers()['content-security-policy']).toBe(csp) + expect(await page.evaluate(() => 'trustedTypes' in window)).toBe(true) + await waitForHydration(page) + + const violations = await page.evaluateHandle(() => { + const directives: Array = [] + document.addEventListener('securitypolicyviolation', (event) => { + directives.push(event.effectiveDirective) + }) + return directives + }) + + await page.getByTestId('nav-dashboard').click() + await expect(page).toHaveTitle('Inline CSS dashboard') + await expect(page.getByTestId('dashboard-card')).toBeVisible() + await expect + .poll(() => getStyle(page, 'shell', 'background-color')) + .toBe('rgb(240, 249, 255)') + + await page.getByTestId('nav-home').click() + await expect(page).toHaveTitle('Inline CSS E2E') + await expect(page.getByTestId('home')).toBeVisible() + + expect(await violations.jsonValue()).toEqual([]) + expect(browserErrors).toEqual([]) + await violations.dispose() +}) diff --git a/e2e/react-start/css-modules/.gitignore b/e2e/react-start/css-modules/.gitignore index 229709a89d..a1fbca128d 100644 --- a/e2e/react-start/css-modules/.gitignore +++ b/e2e/react-start/css-modules/.gitignore @@ -3,3 +3,4 @@ dist test-results playwright-report port*.txt +.cloudflare diff --git a/e2e/react-start/css-modules/cloudflare.config.ts b/e2e/react-start/css-modules/cloudflare.config.ts new file mode 100644 index 0000000000..e2bd5e13f1 --- /dev/null +++ b/e2e/react-start/css-modules/cloudflare.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'cf/config' + +// Used by rsbuild-plugin-cloudflare (E2E_RSBUILD_CLOUDFLARE=true). +// The Vite Cloudflare variant still reads wrangler.jsonc. +export default defineConfig({ + worker: { + name: 'tanstack-start-css-modules', + entrypoint: '@tanstack/react-start/server-entry', + compatibilityDate: '2026-11-01', + }, +}) diff --git a/e2e/react-start/css-modules/package.json b/e2e/react-start/css-modules/package.json index 381fa13b3a..25c11d7321 100644 --- a/e2e/react-start/css-modules/package.json +++ b/e2e/react-start/css-modules/package.json @@ -12,6 +12,8 @@ "dev:e2e:basepath": "VITE_BASE_PATH=/my-app vite dev --port $PORT", "dev:cloudflare": "echo 'Cloudflare dev mode has React duplication issues - use build+preview instead' && exit 1", "dev:e2e:cloudflare": "echo 'Cloudflare dev mode has React duplication issues - use build+preview instead' && exit 1", + "dev:e2e:rsbuild": "rsbuild dev --port $PORT", + "dev:e2e:rsbuild-cloudflare": "E2E_RSBUILD_CLOUDFLARE=true rsbuild dev --port $PORT", "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", @@ -19,13 +21,16 @@ "test:e2e:dev:nitro": "MODE=dev VITE_CONFIG=nitro playwright test --project=chromium", "test:e2e:dev:basepath": "MODE=dev VITE_CONFIG=basepath playwright test --project=chromium", "_test:e2e:dev:cloudflare": "MODE=dev VITE_CONFIG=cloudflare playwright test --project=chromium", + "test:e2e:dev:rsbuild": "MODE=dev VITE_CONFIG=rsbuild playwright test --project=chromium", + "test:e2e:dev:rsbuild-cloudflare": "MODE=dev VITE_CONFIG=rsbuild-cloudflare playwright test --project=chromium", "test:e2e:prod:default": "MODE=prod playwright test --project=chromium", "test:e2e:prod": "pnpm run test:e2e:prod:default && pnpm run test:e2e:prod:css-code-split-false", "test:e2e:prod:css-code-split-false": "MODE=prod VITE_CSS_CODE_SPLIT=false playwright test tests/css.prod.spec.ts --project=chromium", - "test:e2e": "rm -rf port*.txt; pnpm run test:e2e:dev && pnpm run test:e2e:prod", - "test:e2e:nitro": "rm -rf port*.txt; pnpm run test:e2e:dev:nitro", - "test:e2e:basepath": "rm -rf port*.txt; pnpm run test:e2e:dev:basepath", - "_test:e2e:cloudflare": "echo 'Cloudflare dev mode disabled - React duplication issues' && exit 0" + "test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:prod", + "test:e2e:nitro": "pnpm run test:e2e:dev:nitro", + "test:e2e:basepath": "pnpm run test:e2e:dev:basepath", + "_test:e2e:cloudflare": "echo 'Cloudflare dev mode disabled - React duplication issues' && exit 0", + "build:rsbuild": "rsbuild build && tsc --noEmit" }, "dependencies": { "@tanstack/react-router": "workspace:*", @@ -36,16 +41,36 @@ "devDependencies": { "@cloudflare/vite-plugin": "^1.29.0", "@playwright/test": "^1.61.0", + "@rsbuild/core": "^2.3.1", + "@rsbuild/plugin-react": "^2.0.0", + "@rsbuild/plugin-sass": "^2.0.1", "@tanstack/router-e2e-utils": "workspace:*", "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", + "@typescript/native": "npm:typescript@^7.0.2", "@vitejs/plugin-react": "^6.0.1", - "nitro": "^3.0.260311-beta", + "cf": "1.0.0-beta.28", + "nitro": "^3.0.260903-beta", + "rsbuild-plugin-cloudflare": "^0.0.4", "sass": "^1.97.2", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "wrangler": "^4.74.0" + }, + "nx": { + "metadata": { + "playwrightModes": [ + { + "toolchain": "vite", + "mode": "ssr" + }, + { + "toolchain": "rsbuild", + "mode": "ssr" + } + ] + } } } diff --git a/e2e/react-start/css-modules/playwright.config.ts b/e2e/react-start/css-modules/playwright.config.ts index 644798ca99..7e7ad3d9b3 100644 --- a/e2e/react-start/css-modules/playwright.config.ts +++ b/e2e/react-start/css-modules/playwright.config.ts @@ -1,37 +1,41 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const mode = process.env.MODE ?? 'prod' const isDev = mode === 'dev' +const distDir = process.env.E2E_DIST_DIR const viteConfig = process.env.VITE_CONFIG // 'nitro' | 'basepath' | 'cloudflare' | undefined -const PORT = await getTestServerPort( - viteConfig ? `${packageJson.name}-${viteConfig}` : packageJson.name, -) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) // When using basepath config, the app is served at /my-app const basePath = viteConfig === 'basepath' ? '/my-app' : '' const baseURL = `http://localhost:${PORT}${basePath}` // Select the appropriate dev command based on VITE_CONFIG -const devCommand = viteConfig ? `pnpm dev:e2e:${viteConfig}` : 'pnpm dev:e2e' +const devCommand = viteConfig + ? `pnpm dev:e2e:${viteConfig}` + : 'pnpm dev:e2e --port 0' export default defineConfig({ testDir: './tests', + testMatch: isDev ? '**/*.dev.spec.ts' : '**/*.prod.spec.ts', workers: 1, reporter: [['line']], globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { baseURL, }, webServer: { - command: isDev ? devCommand : `pnpm build && PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: isDev + ? devCommand + : distDir + ? `pnpm exec srvx --prod --dir=. -s ${distDir}/client --entry ${distDir}/server/server.js` + : `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { VITE_NODE_ENV: 'test', diff --git a/e2e/react-start/css-modules/rsbuild.config.ts b/e2e/react-start/css-modules/rsbuild.config.ts new file mode 100644 index 0000000000..499ed67ebc --- /dev/null +++ b/e2e/react-start/css-modules/rsbuild.config.ts @@ -0,0 +1,63 @@ +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' +import { pluginSass } from '@rsbuild/plugin-sass' +import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' +import { cloudflare } from 'rsbuild-plugin-cloudflare' + +// E2E_RSBUILD_CLOUDFLARE: Set to 'true' to run the SSR environment in workerd +const useCloudflare = process.env.E2E_RSBUILD_CLOUDFLARE === 'true' + +export default defineConfig({ + plugins: [ + pluginReact(), + pluginSass(), + ...(useCloudflare + ? [ + cloudflare({ + rsbuildEnvironment: { name: 'ssr' }, + inspectorPort: false, + }), + ] + : []), + tanstackStart(), + ], + output: { + distPath: { + root: process.env.E2E_DIST_DIR ?? 'dist-rsbuild-ssr', + }, + }, + tools: { + rspack(config, { environment }) { + if (environment.name === 'ssr') { + config.output ??= {} + config.output.filename = 'server.js' + } + if (environment.name !== 'client') { + return + } + config.optimization ??= {} + // Extract the shared component and its helper into their own chunks so + // a route depends on a shared chunk that depends on another shared chunk. + config.optimization.splitChunks = { + cacheGroups: { + sharedHeader: { + test: /[\\/]src[\\/]components[\\/]/, + chunks: 'async', + minChunks: 2, + minSize: 0, + enforce: true, + name: 'shared-header', + }, + sharedFormat: { + test: /[\\/]src[\\/]utils[\\/]/, + chunks: 'async', + minChunks: 2, + minSize: 0, + enforce: true, + name: 'shared-format', + }, + }, + } + }, + }, +}) diff --git a/e2e/react-start/css-modules/src/components/Header.module.css b/e2e/react-start/css-modules/src/components/Header.module.css new file mode 100644 index 0000000000..e6878a5410 --- /dev/null +++ b/e2e/react-start/css-modules/src/components/Header.module.css @@ -0,0 +1,14 @@ +.header { + --repro-shared-header: 1; + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + align-items: center; + height: 64px; + padding-inline: 16px; + background: #e4f2e9; +} + +.header h1 { + margin: 0; + font-size: 24px; +} diff --git a/e2e/react-start/css-modules/src/components/Header.tsx b/e2e/react-start/css-modules/src/components/Header.tsx new file mode 100644 index 0000000000..f16b12e8ff --- /dev/null +++ b/e2e/react-start/css-modules/src/components/Header.tsx @@ -0,0 +1,11 @@ +import { formatTitle } from '../utils/formatTitle' +import styles from './Header.module.css' + +export function Header({ title }: { title: string }) { + return ( +
+

{formatTitle(title)}

+ +
+ ) +} diff --git a/e2e/react-start/css-modules/src/routeTree.gen.ts b/e2e/react-start/css-modules/src/routeTree.gen.ts index 822118990d..2789a3490a 100644 --- a/e2e/react-start/css-modules/src/routeTree.gen.ts +++ b/e2e/react-start/css-modules/src/routeTree.gen.ts @@ -10,6 +10,9 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' +import { Route as AlphaRouteImport } from './routes/alpha' +import { Route as BetaRouteImport } from './routes/beta' +import { Route as GammaRouteImport } from './routes/gamma' import { Route as ModulesRouteImport } from './routes/modules' import { Route as QuotesRouteImport } from './routes/quotes' import { Route as SassMixinRouteImport } from './routes/sass-mixin' @@ -19,6 +22,21 @@ const IndexRoute = IndexRouteImport.update({ path: '/', getParentRoute: () => rootRouteImport, } as any) +const AlphaRoute = AlphaRouteImport.update({ + id: '/alpha', + path: '/alpha', + getParentRoute: () => rootRouteImport, +} as any) +const BetaRoute = BetaRouteImport.update({ + id: '/beta', + path: '/beta', + getParentRoute: () => rootRouteImport, +} as any) +const GammaRoute = GammaRouteImport.update({ + id: '/gamma', + path: '/gamma', + getParentRoute: () => rootRouteImport, +} as any) const ModulesRoute = ModulesRouteImport.update({ id: '/modules', path: '/modules', @@ -37,12 +55,18 @@ const SassMixinRoute = SassMixinRouteImport.update({ export interface FileRoutesByFullPath { '/': typeof IndexRoute + '/alpha': typeof AlphaRoute + '/beta': typeof BetaRoute + '/gamma': typeof GammaRoute '/modules': typeof ModulesRoute '/quotes': typeof QuotesRoute '/sass-mixin': typeof SassMixinRoute } export interface FileRoutesByTo { '/': typeof IndexRoute + '/alpha': typeof AlphaRoute + '/beta': typeof BetaRoute + '/gamma': typeof GammaRoute '/modules': typeof ModulesRoute '/quotes': typeof QuotesRoute '/sass-mixin': typeof SassMixinRoute @@ -50,20 +74,36 @@ export interface FileRoutesByTo { export interface FileRoutesById { __root__: typeof rootRouteImport '/': typeof IndexRoute + '/alpha': typeof AlphaRoute + '/beta': typeof BetaRoute + '/gamma': typeof GammaRoute '/modules': typeof ModulesRoute '/quotes': typeof QuotesRoute '/sass-mixin': typeof SassMixinRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' | '/modules' | '/quotes' | '/sass-mixin' + fullPaths: + '/' | '/alpha' | '/beta' | '/gamma' | '/modules' | '/quotes' | '/sass-mixin' fileRoutesByTo: FileRoutesByTo - to: '/' | '/modules' | '/quotes' | '/sass-mixin' - id: '__root__' | '/' | '/modules' | '/quotes' | '/sass-mixin' + to: + '/' | '/alpha' | '/beta' | '/gamma' | '/modules' | '/quotes' | '/sass-mixin' + id: + | '__root__' + | '/' + | '/alpha' + | '/beta' + | '/gamma' + | '/modules' + | '/quotes' + | '/sass-mixin' fileRoutesById: FileRoutesById } export interface RootRouteChildren { IndexRoute: typeof IndexRoute + AlphaRoute: typeof AlphaRoute + BetaRoute: typeof BetaRoute + GammaRoute: typeof GammaRoute ModulesRoute: typeof ModulesRoute QuotesRoute: typeof QuotesRoute SassMixinRoute: typeof SassMixinRoute @@ -78,6 +118,27 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/alpha': { + id: '/alpha' + path: '/alpha' + fullPath: '/alpha' + preLoaderRoute: typeof AlphaRouteImport + parentRoute: typeof rootRouteImport + } + '/beta': { + id: '/beta' + path: '/beta' + fullPath: '/beta' + preLoaderRoute: typeof BetaRouteImport + parentRoute: typeof rootRouteImport + } + '/gamma': { + id: '/gamma' + path: '/gamma' + fullPath: '/gamma' + preLoaderRoute: typeof GammaRouteImport + parentRoute: typeof rootRouteImport + } '/modules': { id: '/modules' path: '/modules' @@ -104,6 +165,9 @@ declare module '@tanstack/react-router' { const rootRouteChildren: RootRouteChildren = { IndexRoute: IndexRoute, + AlphaRoute: AlphaRoute, + BetaRoute: BetaRoute, + GammaRoute: GammaRoute, ModulesRoute: ModulesRoute, QuotesRoute: QuotesRoute, SassMixinRoute: SassMixinRoute, diff --git a/e2e/react-start/css-modules/src/routes/alpha.tsx b/e2e/react-start/css-modules/src/routes/alpha.tsx new file mode 100644 index 0000000000..e894cd758f --- /dev/null +++ b/e2e/react-start/css-modules/src/routes/alpha.tsx @@ -0,0 +1,13 @@ +import { createFileRoute } from '@tanstack/react-router' +import { Header } from '../components/Header' +import styles from '../styles/alpha.module.css' + +export const Route = createFileRoute('/alpha')({ component: Alpha }) + +function Alpha() { + return ( +
+
+
+ ) +} diff --git a/e2e/react-start/css-modules/src/routes/beta.tsx b/e2e/react-start/css-modules/src/routes/beta.tsx new file mode 100644 index 0000000000..4f139ac41a --- /dev/null +++ b/e2e/react-start/css-modules/src/routes/beta.tsx @@ -0,0 +1,13 @@ +import { createFileRoute } from '@tanstack/react-router' +import { Header } from '../components/Header' +import styles from '../styles/beta.module.css' + +export const Route = createFileRoute('/beta')({ component: Beta }) + +function Beta() { + return ( +
+
+
+ ) +} diff --git a/e2e/react-start/css-modules/src/routes/gamma.tsx b/e2e/react-start/css-modules/src/routes/gamma.tsx new file mode 100644 index 0000000000..a8e036b85f --- /dev/null +++ b/e2e/react-start/css-modules/src/routes/gamma.tsx @@ -0,0 +1,8 @@ +import { createFileRoute } from '@tanstack/react-router' +import { formatTitle } from '../utils/formatTitle' + +export const Route = createFileRoute('/gamma')({ component: Gamma }) + +function Gamma() { + return
{formatTitle('Gamma')}
+} diff --git a/e2e/react-start/css-modules/src/styles/alpha.module.css b/e2e/react-start/css-modules/src/styles/alpha.module.css new file mode 100644 index 0000000000..12a606a8d3 --- /dev/null +++ b/e2e/react-start/css-modules/src/styles/alpha.module.css @@ -0,0 +1,4 @@ +.page { + --repro-alpha: 1; + border: 4px solid #226844; +} diff --git a/e2e/react-start/css-modules/src/styles/beta.module.css b/e2e/react-start/css-modules/src/styles/beta.module.css new file mode 100644 index 0000000000..719686a76b --- /dev/null +++ b/e2e/react-start/css-modules/src/styles/beta.module.css @@ -0,0 +1,4 @@ +.page { + --repro-beta: 1; + border: 4px solid #ac344c; +} diff --git a/e2e/react-start/css-modules/src/utils/formatTitle.ts b/e2e/react-start/css-modules/src/utils/formatTitle.ts new file mode 100644 index 0000000000..d0325ac63e --- /dev/null +++ b/e2e/react-start/css-modules/src/utils/formatTitle.ts @@ -0,0 +1,3 @@ +export function formatTitle(title: string) { + return `${title} (repro-format-title)` +} diff --git a/e2e/react-start/css-modules/tests/setup/global.setup.ts b/e2e/react-start/css-modules/tests/setup/global.setup.ts index e8879c0165..7c0fce762a 100644 --- a/e2e/react-start/css-modules/tests/setup/global.setup.ts +++ b/e2e/react-start/css-modules/tests/setup/global.setup.ts @@ -1,20 +1,10 @@ -import { - e2eStartDummyServer, - getTestServerPort, - preOptimizeDevServer, - waitForServer, -} from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' export default async function setup() { - await e2eStartDummyServer(packageJson.name) - if (process.env.MODE !== 'dev') return const viteConfig = process.env.VITE_CONFIG // 'nitro' | 'basepath' | 'cloudflare' | undefined - const port = await getTestServerPort( - viteConfig ? `${packageJson.name}-${viteConfig}` : packageJson.name, - ) + const port = Number(process.env.E2E_APP_PORT ?? 0) const basePath = viteConfig === 'basepath' ? '/my-app' : '' const baseURL = `http://localhost:${port}${basePath}` diff --git a/e2e/react-start/css-modules/tests/setup/global.teardown.ts b/e2e/react-start/css-modules/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-start/css-modules/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-start/css-modules/tests/shared-css.prod.spec.ts b/e2e/react-start/css-modules/tests/shared-css.prod.spec.ts new file mode 100644 index 0000000000..9a9595f819 --- /dev/null +++ b/e2e/react-start/css-modules/tests/shared-css.prod.spec.ts @@ -0,0 +1,94 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' +import type { Page } from '@playwright/test' + +test.skip( + process.env.VITE_CSS_CODE_SPLIT === 'false', + 'Route stylesheet isolation requires CSS code splitting', +) +test.use({ javaScriptEnabled: false }) + +async function getStylesheetContent(page: Page) { + const hrefs = await page + .locator('link[rel="stylesheet"]') + .evaluateAll((links: Array) => + links.map((link) => link.href), + ) + expect(hrefs.length).toBeGreaterThan(0) + const stylesheets = await Promise.all( + hrefs.map(async (href) => { + const response = await page.request.get(href) + expect(response.ok()).toBe(true) + return response.text() + }), + ) + return stylesheets.join('\n') +} + +for (const route of ['alpha', 'beta']) { + test(`${route} has complete and isolated CSS without JavaScript`, async ({ + page, + }) => { + await page.goto(`/${route}`) + + const header = page.getByTestId('shared-header') + await expect(header).toHaveCSS('display', 'grid') + await expect(header).toHaveCSS('height', '64px') + await expect(page.getByTestId('route-page')).toHaveCSS( + `--repro-${route}`, + '1', + ) + + const css = await getStylesheetContent(page) + expect(css).toContain('--repro-shared-header') + expect(css).toContain(`--repro-${route}`) + expect(css).not.toContain(`--repro-${route === 'alpha' ? 'beta' : 'alpha'}`) + }) +} + +function getScriptPreloadHrefs(html: string) { + return Array.from(html.matchAll(/]*>/g), (match) => match[0]) + .filter( + (tag) => + /\brel="modulepreload"/.test(tag) || + (/\brel="preload"/.test(tag) && /\bas="script"/.test(tag)), + ) + .map((tag) => tag.match(/\bhref="([^"]+)"/)?.[1]) + .filter((href): href is string => !!href) +} + +test('alpha preloads the shared header chunk and the chunk it depends on', async ({ + page, +}) => { + const response = await page.request.get('/alpha') + expect(response.ok()).toBe(true) + + const hrefs = getScriptPreloadHrefs(await response.text()) + expect(hrefs.length).toBeGreaterThan(0) + + const scripts = await Promise.all( + hrefs.map(async (href) => { + const script = await page.request.get(href) + expect(script.ok()).toBe(true) + return script.text() + }), + ) + + expect(scripts.some((code) => code.includes('shared-header'))).toBe(true) + expect(scripts.some((code) => code.includes('repro-format-title'))).toBe(true) +}) + +test('home does not load the shared header or route styles', async ({ + page, +}) => { + await page.goto('/') + await expect(page.getByTestId('global-styled')).toHaveCSS( + 'background-color', + 'rgb(59, 130, 246)', + ) + + const css = await getStylesheetContent(page) + expect(css).not.toContain('--repro-shared-header') + expect(css).not.toContain('--repro-alpha') + expect(css).not.toContain('--repro-beta') +}) diff --git a/e2e/react-start/css-modules/vite.config.ts b/e2e/react-start/css-modules/vite.config.ts index 9923ab3384..c9c27f7f9a 100644 --- a/e2e/react-start/css-modules/vite.config.ts +++ b/e2e/react-start/css-modules/vite.config.ts @@ -21,6 +21,7 @@ export default defineConfig(async () => { port: 3000, }, build: { + outDir: process.env.E2E_DIST_DIR ?? 'dist', cssCodeSplit, }, plugins: [ diff --git a/e2e/react-start/custom-basepath/express-server.ts b/e2e/react-start/custom-basepath/express-server.ts index 1884c5eb5a..b9bf393466 100644 --- a/e2e/react-start/custom-basepath/express-server.ts +++ b/e2e/react-start/custom-basepath/express-server.ts @@ -1,5 +1,6 @@ import express from 'express' import { toNodeHandler } from 'srvx/node' +import type { AddressInfo } from 'node:net' import type { NodeHttp1Handler } from 'srvx' const DEVELOPMENT = process.env.NODE_ENV === 'development' @@ -40,7 +41,11 @@ if (DEVELOPMENT) { }) } -app.listen(PORT, (error) => { - if (error) throw error - console.log(`Server is running on http://localhost:${PORT}`) +const httpServer = app.listen(PORT, (error) => { + if (error) { + throw error + } + console.log( + `E2E app: http://localhost:${(httpServer.address() as AddressInfo).port}`, + ) }) diff --git a/e2e/react-start/custom-basepath/package.json b/e2e/react-start/custom-basepath/package.json index 4bf492acca..e93949eea2 100644 --- a/e2e/react-start/custom-basepath/package.json +++ b/e2e/react-start/custom-basepath/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "tsx express-server.ts", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -17,7 +17,7 @@ "express": "^5.2.1", "react": "^19.0.0", "react-dom": "^19.0.0", - "redaxios": "^0.5.1" + "redaxios": "catalog:" }, "devDependencies": { "@playwright/test": "^1.61.0", @@ -29,10 +29,11 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "cross-env": "^10.0.0", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", "tsx": "^4.20.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/custom-basepath/playwright.config.ts b/e2e/react-start/custom-basepath/playwright.config.ts index 5095425f47..e113ce64ad 100644 --- a/e2e/react-start/custom-basepath/playwright.config.ts +++ b/e2e/react-start/custom-basepath/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}/custom/basepath` /** @@ -18,19 +13,19 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/react-start/custom-basepath/src/routes/api.users.ts b/e2e/react-start/custom-basepath/src/routes/api.users.ts index 9e055549ef..6fc8cde830 100644 --- a/e2e/react-start/custom-basepath/src/routes/api.users.ts +++ b/e2e/react-start/custom-basepath/src/routes/api.users.ts @@ -3,11 +3,7 @@ import axios from 'redaxios' import type { User } from '~/utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users')({ server: { diff --git a/e2e/react-start/custom-basepath/src/routes/api/users.$id.ts b/e2e/react-start/custom-basepath/src/routes/api/users.$id.ts index 57682660fd..81c071afb5 100644 --- a/e2e/react-start/custom-basepath/src/routes/api/users.$id.ts +++ b/e2e/react-start/custom-basepath/src/routes/api/users.$id.ts @@ -2,11 +2,7 @@ import axios from 'redaxios' import type { User } from '~/utils/users' import { createFileRoute } from '@tanstack/react-router' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users/$id')({ server: { diff --git a/e2e/react-start/custom-basepath/src/utils/posts.tsx b/e2e/react-start/custom-basepath/src/utils/posts.tsx index 4cc5dcc4c6..d9b98a8c9c 100644 --- a/e2e/react-start/custom-basepath/src/utils/posts.tsx +++ b/e2e/react-start/custom-basepath/src/utils/posts.tsx @@ -8,11 +8,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) diff --git a/e2e/react-start/custom-basepath/src/utils/users.tsx b/e2e/react-start/custom-basepath/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/react-start/custom-basepath/src/utils/users.tsx +++ b/e2e/react-start/custom-basepath/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/react-start/custom-basepath/tests/setup/global.setup.ts b/e2e/react-start/custom-basepath/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/react-start/custom-basepath/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/react-start/custom-basepath/tests/setup/global.teardown.ts b/e2e/react-start/custom-basepath/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/react-start/custom-basepath/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/react-start/custom-server-rsbuild/express-server.ts b/e2e/react-start/custom-server-rsbuild/express-server.ts index 23784f2efc..68537956b4 100644 --- a/e2e/react-start/custom-server-rsbuild/express-server.ts +++ b/e2e/react-start/custom-server-rsbuild/express-server.ts @@ -1,5 +1,6 @@ import express from 'express' import { toNodeHandler } from 'srvx/node' +import type { AddressInfo } from 'node:net' import type { NodeHttp1Handler } from 'srvx' const DEVELOPMENT = process.env.NODE_ENV === 'development' @@ -58,9 +59,13 @@ if (DEVELOPMENT) { }) const httpServer = app.listen(PORT, async (error) => { - if (error) throw error + if (error) { + throw error + } await devServer.afterListen() - console.log(`Server is running on http://localhost:${PORT}`) + console.log( + `E2E app: http://localhost:${(httpServer.address() as AddressInfo).port}`, + ) }) devServer.connectWebSocket({ server: httpServer }) } else { @@ -75,8 +80,12 @@ if (DEVELOPMENT) { next(error) } }) - app.listen(PORT, (error) => { - if (error) throw error - console.log(`Server is running on http://localhost:${PORT}`) + const httpServer = app.listen(PORT, (error) => { + if (error) { + throw error + } + console.log( + `E2E app: http://localhost:${(httpServer.address() as AddressInfo).port}`, + ) }) } diff --git a/e2e/react-start/custom-server-rsbuild/package.json b/e2e/react-start/custom-server-rsbuild/package.json index 87acfacd05..1c5b3af393 100644 --- a/e2e/react-start/custom-server-rsbuild/package.json +++ b/e2e/react-start/custom-server-rsbuild/package.json @@ -10,7 +10,7 @@ "start": "tsx express-server.ts", "test:e2e:dev": "cross-env MODE=dev playwright test --project=chromium", "test:e2e:prod": "cross-env MODE=prod playwright test --project=chromium", - "test:e2e": "rm -rf port*.txt && pnpm run test:e2e:dev && pnpm run test:e2e:prod" + "test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:prod" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -21,7 +21,7 @@ }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tanstack/router-e2e-utils": "workspace:^", @@ -30,9 +30,10 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "cross-env": "^10.0.0", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", "tsx": "^4.20.3", - "typescript": "^6.0.2" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" } } diff --git a/e2e/react-start/custom-server-rsbuild/playwright.config.ts b/e2e/react-start/custom-server-rsbuild/playwright.config.ts index eb8b43f648..f0542500fd 100644 --- a/e2e/react-start/custom-server-rsbuild/playwright.config.ts +++ b/e2e/react-start/custom-server-rsbuild/playwright.config.ts @@ -1,11 +1,9 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } const mode = process.env.MODE ?? 'prod' const isDev = mode === 'dev' -const PORT = await getTestServerPort(`${packageJson.name}-${mode}`) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -15,8 +13,8 @@ export default defineConfig({ use: { baseURL }, webServer: { command: isDev ? 'pnpm dev:e2e' : 'pnpm build && pnpm start', - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: { stdout: /E2E app: http:\/\/localhost:(?\d+)/ }, + reuseExistingServer: false, stdout: 'pipe', env: { PORT: String(PORT), diff --git a/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts b/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts index dec3a6d0fc..5f9aa96e16 100644 --- a/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts +++ b/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts @@ -28,7 +28,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' // explicit prefix. export default defineConfig({ plugins: [ - pluginReact({ splitChunks: false }), + pluginReact(), tanstackStart({ rsbuild: { installDevServerMiddleware: false, diff --git a/e2e/react-start/deferred-hydration/package.json b/e2e/react-start/deferred-hydration/package.json index b225528b49..5a33407435 100644 --- a/e2e/react-start/deferred-hydration/package.json +++ b/e2e/react-start/deferred-hydration/package.json @@ -26,21 +26,28 @@ "react-dom": "^19.0.0" }, "devDependencies": { - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { "targets": { "test:e2e": { "parallelism": false + }, + "build": { + "outputs": [ + "...", + "{projectRoot}/dist-vite-ssr" + ] } }, "metadata": { diff --git a/e2e/react-start/deferred-hydration/playwright.config.ts b/e2e/react-start/deferred-hydration/playwright.config.ts index 0125792d4b..d88c59fc9d 100644 --- a/e2e/react-start/deferred-hydration/playwright.config.ts +++ b/e2e/react-start/deferred-hydration/playwright.config.ts @@ -1,12 +1,9 @@ -import fs from 'node:fs' import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' const distDir = process.env.E2E_DIST_DIR ?? `dist-${toolchain}-ssr` -const e2ePortKey = - process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` + const mode = process.env.MODE ?? 'prod' const isDev = mode === 'dev' const serverEntryFile = toolchain === 'rsbuild' ? 'index.js' : 'server.js' @@ -14,11 +11,7 @@ const startCommand = `pnpm exec srvx --prod --dir=. -s ${distDir}/client --entry const devCommand = toolchain === 'rsbuild' ? 'pnpm dev:rsbuild' : 'pnpm dev:vite' -if (process.env.TEST_WORKER_INDEX === undefined) { - fs.rmSync(`port-${e2ePortKey}.txt`, { force: true }) -} - -const PORT = await getTestServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -26,12 +19,11 @@ export default defineConfig({ workers: 1, reporter: [['line']], globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { baseURL }, webServer: { command: isDev ? `${devCommand} --port ${PORT}` : startCommand, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { E2E_DIST_DIR: distDir, @@ -40,7 +32,6 @@ export default defineConfig({ PORT: String(PORT), VITE_SERVER_PORT: String(PORT), E2E_TOOLCHAIN: toolchain, - E2E_PORT_KEY: e2ePortKey, }, }, projects: [ diff --git a/e2e/react-start/deferred-hydration/rsbuild.config.ts b/e2e/react-start/deferred-hydration/rsbuild.config.ts index 6279705adb..a9d1942a6f 100644 --- a/e2e/react-start/deferred-hydration/rsbuild.config.ts +++ b/e2e/react-start/deferred-hydration/rsbuild.config.ts @@ -5,7 +5,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' const outDir = process.env.E2E_DIST_DIR ?? 'dist-rsbuild-ssr' export default defineConfig({ - plugins: [pluginReact({ splitChunks: false }), tanstackStart()], + plugins: [pluginReact(), tanstackStart()], output: { distPath: { root: outDir, diff --git a/e2e/react-start/deferred-hydration/tests/setup/global.setup.ts b/e2e/react-start/deferred-hydration/tests/setup/global.setup.ts index 1117664a14..704bbef3e2 100644 --- a/e2e/react-start/deferred-hydration/tests/setup/global.setup.ts +++ b/e2e/react-start/deferred-hydration/tests/setup/global.setup.ts @@ -1,24 +1,11 @@ -import { - e2eStartDummyServer, - getTestServerPort, - preOptimizeDevServer, - waitForServer, -} from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -function getE2EPortKey() { - const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' - return process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` -} +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' export default async function setup() { - if (process.env.MODE !== 'dev') return + if (process.env.MODE !== 'dev') { + return + } - const e2ePortKey = getE2EPortKey() - - await e2eStartDummyServer(e2ePortKey) - - const port = await getTestServerPort(e2ePortKey) + const port = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${port}` await waitForServer(baseURL) diff --git a/e2e/react-start/deferred-hydration/tests/setup/global.teardown.ts b/e2e/react-start/deferred-hydration/tests/setup/global.teardown.ts deleted file mode 100644 index df79f50e82..0000000000 --- a/e2e/react-start/deferred-hydration/tests/setup/global.teardown.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -function getE2EPortKey() { - const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' - return process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` -} - -export default async function teardown() { - if (process.env.MODE !== 'dev') return - - await e2eStopDummyServer(getE2EPortKey()) -} diff --git a/e2e/react-start/dev-ssr-styles/package.json b/e2e/react-start/dev-ssr-styles/package.json index 829eddedd3..a5300e836e 100644 --- a/e2e/react-start/dev-ssr-styles/package.json +++ b/e2e/react-start/dev-ssr-styles/package.json @@ -22,13 +22,9 @@ "test:e2e:dev:nitro": "MODE=dev VITE_USE_NITRO=true playwright test --project=chromium", "test:e2e:dev:disabled:nitro": "MODE=dev SSR_STYLES=disabled VITE_USE_NITRO=true playwright test --project=chromium", "test:e2e:dev:custom-basepath:nitro": "MODE=dev SSR_STYLES=custom-basepath VITE_USE_NITRO=true playwright test --project=chromium", - "test:e2e:dev:bundled-dev:nitro": "MODE=dev VITE_USE_NITRO=true E2E_VITE_BUNDLED_DEV=true playwright test --project=chromium", - "test:e2e:dev:disabled:bundled-dev:nitro": "MODE=dev SSR_STYLES=disabled VITE_USE_NITRO=true E2E_VITE_BUNDLED_DEV=true playwright test --project=chromium", - "test:e2e:dev:custom-basepath:bundled-dev:nitro": "MODE=dev SSR_STYLES=custom-basepath VITE_USE_NITRO=true E2E_VITE_BUNDLED_DEV=true playwright test --project=chromium", "test:e2e:bundled-dev": "pnpm run test:e2e:dev:bundled-dev && pnpm run test:e2e:dev:disabled:bundled-dev && pnpm run test:e2e:dev:custom-basepath:bundled-dev", - "test:e2e:nitro:bundled-dev": "pnpm run test:e2e:dev:bundled-dev:nitro && pnpm run test:e2e:dev:disabled:bundled-dev:nitro && pnpm run test:e2e:dev:custom-basepath:bundled-dev:nitro", - "test:e2e": "rm -rf port*.txt; pnpm run test:e2e:dev && pnpm run test:e2e:dev:disabled && pnpm run test:e2e:dev:custom-basepath && pnpm run test:e2e:bundled-dev", - "test:e2e:nitro": "rm -rf port*.txt; pnpm run test:e2e:dev:nitro && pnpm run test:e2e:dev:disabled:nitro && pnpm run test:e2e:dev:custom-basepath:nitro && pnpm run test:e2e:nitro:bundled-dev" + "test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:dev:disabled && pnpm run test:e2e:dev:custom-basepath && pnpm run test:e2e:bundled-dev", + "test:e2e:nitro": "pnpm run test:e2e:dev:nitro && pnpm run test:e2e:dev:disabled:nitro && pnpm run test:e2e:dev:custom-basepath:nitro" }, "dependencies": { "@tanstack/react-router": "workspace:*", @@ -44,9 +40,10 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "nitro": "^3.0.260311-beta", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "nitro": "^3.0.260903-beta", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "zod": "^4.4.3" } diff --git a/e2e/react-start/dev-ssr-styles/playwright.config.ts b/e2e/react-start/dev-ssr-styles/playwright.config.ts index a1fdd7c3ef..71cc8ed2da 100644 --- a/e2e/react-start/dev-ssr-styles/playwright.config.ts +++ b/e2e/react-start/dev-ssr-styles/playwright.config.ts @@ -1,6 +1,5 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' import { ssrStylesMode, useNitro, viteBundledDev } from './env' const mode = process.env.MODE ?? 'prod' @@ -9,24 +8,13 @@ const isDev = mode === 'dev' // Build a unique port key per dimension combination (ssrStyles mode + nitro) // e.g. "...dev-ssr-styles", "...dev-ssr-styles-disabled", "...dev-ssr-styles-nitro", // "...dev-ssr-styles-disabled-nitro" -function getPortKey() { - let key = packageJson.name - if (ssrStylesMode !== 'default') { - key += `-${ssrStylesMode}` - } - if (useNitro) { - key += '-nitro' - } - if (viteBundledDev) { - key += '-bundled-dev' - } - return key -} -const PORT = await getTestServerPort(getPortKey()) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` // Select the appropriate dev command based on SSR_STYLES + VITE_USE_NITRO +// package.json omits bundled Nitro runs because its asset plugin produces +// invalid Vite client code. Re-enable those tests once the upstream fix lands. function getDevCommand() { const scriptParts = ['dev:e2e'] if (ssrStylesMode !== 'default') { @@ -44,7 +32,6 @@ export default defineConfig({ reporter: [['line']], globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { baseURL, @@ -52,8 +39,8 @@ export default defineConfig({ webServer: { command: isDev ? getDevCommand() : `pnpm build && PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { VITE_NODE_ENV: 'test', diff --git a/e2e/react-start/dev-ssr-styles/src/components/CodeSplitStyledBox.tsx b/e2e/react-start/dev-ssr-styles/src/components/CodeSplitStyledBox.tsx new file mode 100644 index 0000000000..49d2f96c39 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/components/CodeSplitStyledBox.tsx @@ -0,0 +1,9 @@ +import styles from '../styles/code-split-route.module.css' + +export function CodeSplitStyledBox() { + return ( +
+ This box should have a blue background when dev styles are enabled. +
+ ) +} diff --git a/e2e/react-start/dev-ssr-styles/src/routeTree.gen.ts b/e2e/react-start/dev-ssr-styles/src/routeTree.gen.ts index dceedffdc1..96c0a37142 100644 --- a/e2e/react-start/dev-ssr-styles/src/routeTree.gen.ts +++ b/e2e/react-start/dev-ssr-styles/src/routeTree.gen.ts @@ -10,33 +10,63 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' +import { Route as CssImportOrderRouteImport } from './routes/css-import-order' +import { Route as InlineCssRouteImport } from './routes/inline-css' +import { Route as ModuleStateRouteImport } from './routes/module-state' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) +const CssImportOrderRoute = CssImportOrderRouteImport.update({ + id: '/css-import-order', + path: '/css-import-order', + getParentRoute: () => rootRouteImport, +} as any) +const InlineCssRoute = InlineCssRouteImport.update({ + id: '/inline-css', + path: '/inline-css', + getParentRoute: () => rootRouteImport, +} as any) +const ModuleStateRoute = ModuleStateRouteImport.update({ + id: '/module-state', + path: '/module-state', + getParentRoute: () => rootRouteImport, +} as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute + '/css-import-order': typeof CssImportOrderRoute + '/inline-css': typeof InlineCssRoute + '/module-state': typeof ModuleStateRoute } export interface FileRoutesByTo { '/': typeof IndexRoute + '/css-import-order': typeof CssImportOrderRoute + '/inline-css': typeof InlineCssRoute + '/module-state': typeof ModuleStateRoute } export interface FileRoutesById { __root__: typeof rootRouteImport '/': typeof IndexRoute + '/css-import-order': typeof CssImportOrderRoute + '/inline-css': typeof InlineCssRoute + '/module-state': typeof ModuleStateRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' + fullPaths: '/' | '/css-import-order' | '/inline-css' | '/module-state' fileRoutesByTo: FileRoutesByTo - to: '/' - id: '__root__' | '/' + to: '/' | '/css-import-order' | '/inline-css' | '/module-state' + id: '__root__' | '/' | '/css-import-order' | '/inline-css' | '/module-state' fileRoutesById: FileRoutesById } export interface RootRouteChildren { IndexRoute: typeof IndexRoute + CssImportOrderRoute: typeof CssImportOrderRoute + InlineCssRoute: typeof InlineCssRoute + ModuleStateRoute: typeof ModuleStateRoute } declare module '@tanstack/react-router' { @@ -48,11 +78,35 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/css-import-order': { + id: '/css-import-order' + path: '/css-import-order' + fullPath: '/css-import-order' + preLoaderRoute: typeof CssImportOrderRouteImport + parentRoute: typeof rootRouteImport + } + '/inline-css': { + id: '/inline-css' + path: '/inline-css' + fullPath: '/inline-css' + preLoaderRoute: typeof InlineCssRouteImport + parentRoute: typeof rootRouteImport + } + '/module-state': { + id: '/module-state' + path: '/module-state' + fullPath: '/module-state' + preLoaderRoute: typeof ModuleStateRouteImport + parentRoute: typeof rootRouteImport + } } } const rootRouteChildren: RootRouteChildren = { IndexRoute: IndexRoute, + CssImportOrderRoute: CssImportOrderRoute, + InlineCssRoute: InlineCssRoute, + ModuleStateRoute: ModuleStateRoute, } export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) diff --git a/e2e/react-start/dev-ssr-styles/src/routes/css-import-order.tsx b/e2e/react-start/dev-ssr-styles/src/routes/css-import-order.tsx new file mode 100644 index 0000000000..345254bb8c --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/routes/css-import-order.tsx @@ -0,0 +1,17 @@ +import { createFileRoute } from '@tanstack/react-router' +import '../styles/css-import-order.css' + +export const Route = createFileRoute('/css-import-order')({ + component: CssImportOrder, +}) + +function CssImportOrder() { + return ( +
+

CSS import order

+
+ The route stylesheet should override its imported base stylesheet. +
+
+ ) +} diff --git a/e2e/react-start/dev-ssr-styles/src/routes/index.tsx b/e2e/react-start/dev-ssr-styles/src/routes/index.tsx index f5fadf464d..62fb237750 100644 --- a/e2e/react-start/dev-ssr-styles/src/routes/index.tsx +++ b/e2e/react-start/dev-ssr-styles/src/routes/index.tsx @@ -1,4 +1,5 @@ import { createFileRoute } from '@tanstack/react-router' +import { CodeSplitStyledBox } from '../components/CodeSplitStyledBox' export const Route = createFileRoute('/')({ component: Home, @@ -8,9 +9,7 @@ function Home() { return (

Dev SSR Styles Test

-
- This box should have a blue background when dev styles are enabled. -
+
) } diff --git a/e2e/react-start/dev-ssr-styles/src/routes/inline-css.tsx b/e2e/react-start/dev-ssr-styles/src/routes/inline-css.tsx new file mode 100644 index 0000000000..ffc59128e0 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/routes/inline-css.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' +import embeddedCss from '../styles/embedded.css?inline' + +export const Route = createFileRoute('/inline-css')({ + loader: () => embeddedCss, + component: InlineCss, +}) + +function InlineCss() { + const css = Route.useLoaderData() + return ( +
+
+ Inline styles must not change the page layout. +
+
{css}
+
+ ) +} diff --git a/e2e/react-start/dev-ssr-styles/src/routes/module-state.ts b/e2e/react-start/dev-ssr-styles/src/routes/module-state.ts new file mode 100644 index 0000000000..546217efc3 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/routes/module-state.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' + +const instanceId = crypto.randomUUID() + +export const Route = createFileRoute('/module-state')({ + server: { + handlers: { + GET: () => new Response(instanceId), + }, + }, +}) diff --git a/e2e/react-start/dev-ssr-styles/src/styles/app.css b/e2e/react-start/dev-ssr-styles/src/styles/app.css index 06b48f8a7c..4285da0c86 100644 --- a/e2e/react-start/dev-ssr-styles/src/styles/app.css +++ b/e2e/react-start/dev-ssr-styles/src/styles/app.css @@ -5,9 +5,10 @@ body { background-color: #f0f4f8; } -.styled-box { - background-color: #3b82f6; - color: white; - padding: 24px; - border-radius: 12px; +@layer utilities { + .inline-css-layout { + margin: 12px; + padding: 24px; + border: 3px solid black; + } } diff --git a/e2e/react-start/dev-ssr-styles/src/styles/code-split-route.module.css b/e2e/react-start/dev-ssr-styles/src/styles/code-split-route.module.css new file mode 100644 index 0000000000..d6a50211ee --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/code-split-route.module.css @@ -0,0 +1,7 @@ +.styledBox { + background-color: #3b82f6; + background-image: url('./ssr-background.svg?no-inline'); + color: white; + padding: 24px; + border-radius: 12px; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css b/e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css new file mode 100644 index 0000000000..4f73ddab9c --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css @@ -0,0 +1,5 @@ +.css-import-order { + --css-import-base-marker: issue-7794; + background-color: #ffffff; + color: #000000; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/css-import-order.css b/e2e/react-start/dev-ssr-styles/src/styles/css-import-order.css new file mode 100644 index 0000000000..afcb4797d9 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/css-import-order.css @@ -0,0 +1,7 @@ +@import './css-import-base.css'; + +.css-import-order { + background-color: #111827; + color: #ffffff; + padding: 24px; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/embedded-preflight.css b/e2e/react-start/dev-ssr-styles/src/styles/embedded-preflight.css new file mode 100644 index 0000000000..13810d6c98 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/embedded-preflight.css @@ -0,0 +1,6 @@ +* { + --embedded-preflight-marker: 1; + margin: 0; + padding: 0; + border: 0 solid; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/embedded-theme.css b/e2e/react-start/dev-ssr-styles/src/styles/embedded-theme.css new file mode 100644 index 0000000000..171ed5e174 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/embedded-theme.css @@ -0,0 +1,3 @@ +:root { + --embedded-theme-marker: 1; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/embedded-utilities.css b/e2e/react-start/dev-ssr-styles/src/styles/embedded-utilities.css new file mode 100644 index 0000000000..01f81c3b86 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/embedded-utilities.css @@ -0,0 +1,3 @@ +.embedded-utility { + --embedded-utilities-marker: 1; +} diff --git a/e2e/react-start/dev-ssr-styles/src/styles/embedded.css b/e2e/react-start/dev-ssr-styles/src/styles/embedded.css new file mode 100644 index 0000000000..7b6b68c48d --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/embedded.css @@ -0,0 +1,3 @@ +@import './embedded-theme.css' layer(theme); +@import './embedded-preflight.css' layer(base); +@import './embedded-utilities.css' layer(utilities); diff --git a/e2e/react-start/dev-ssr-styles/src/styles/ssr-background.svg b/e2e/react-start/dev-ssr-styles/src/styles/ssr-background.svg new file mode 100644 index 0000000000..7916b3ef16 --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/src/styles/ssr-background.svg @@ -0,0 +1 @@ + diff --git a/e2e/react-start/dev-ssr-styles/tests/app.spec.ts b/e2e/react-start/dev-ssr-styles/tests/app.spec.ts index cb1ba0b29b..f5b72a1bca 100644 --- a/e2e/react-start/dev-ssr-styles/tests/app.spec.ts +++ b/e2e/react-start/dev-ssr-styles/tests/app.spec.ts @@ -1,6 +1,6 @@ import { expect } from '@playwright/test' import { DEV_STYLES_ATTR } from '@tanstack/router-core' -import { test } from '@tanstack/router-e2e-utils' +import { createHmrFileEditor, test } from '@tanstack/router-e2e-utils' import { ssrStylesMode } from '../env' // Whitelist errors that can occur in CI: @@ -14,14 +14,60 @@ const whitelistErrors = [ test.describe(`dev.ssrStyles (mode=${ssrStylesMode})`, () => { test.use({ whitelistErrors }) + test('unchanged SSR requests reuse evaluated modules', async ({ + request, + }) => { + const first = await request.get('/module-state') + const second = await request.get('/module-state') + expect(first.ok()).toBeTruthy() + expect(second.ok()).toBeTruthy() + expect(await second.text()).toBe(await first.text()) + }) + test('page renders correctly', async ({ page }) => { + const runtimeErrors: Array = [] + page.on('pageerror', (error) => { + runtimeErrors.push(error.message) + }) await page.goto('/') await expect(page.getByTestId('home-heading')).toHaveText( 'Dev SSR Styles Test', ) + expect(runtimeErrors).toEqual([]) }) if (ssrStylesMode === 'default') { + test('dev CSS order is stable after client modules load', async ({ + page, + }) => { + const cssBodies: Array> = [] + page.on('response', (response) => { + if ( + new URL(response.url()).pathname.endsWith( + '/@tanstack-start/styles.css', + ) + ) { + cssBodies.push(response.text()) + } + }) + + await page.goto('/css-import-order') + await expect(page.getByTestId('css-import-order')).toBeVisible() + await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(1) + + await page.reload() + await expect(page.getByTestId('css-import-order')).toBeVisible() + await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(2) + + const [initialCss, reloadedCss] = await Promise.all(cssBodies.slice(0, 2)) + expect(reloadedCss).toBe(initialCss) + expect(initialCss).toContain('/* /src/styles/app.css */') + expect(initialCss).toContain('/* /src/styles/css-import-order.css */') + expect(initialCss.indexOf('/* /src/styles/app.css */')).toBeLessThan( + initialCss.indexOf('/* /src/styles/css-import-order.css */'), + ) + }) + test.describe('default (enabled, basepath = vite base)', () => { test.use({ javaScriptEnabled: false, whitelistErrors }) @@ -52,7 +98,9 @@ test.describe(`dev.ssrStyles (mode=${ssrStylesMode})`, () => { expect(href).toMatch(/^\/@tanstack-start\/styles\.css/) }) - test('CSS is applied on initial page load (SSR)', async ({ page }) => { + test('CSS from a code-split route component is applied during SSR', async ({ + page, + }) => { await page.goto('/') const element = page.getByTestId('styled-box') @@ -64,6 +112,81 @@ test.describe(`dev.ssrStyles (mode=${ssrStylesMode})`, () => { ) expect(backgroundColor).toBe('rgb(59, 130, 246)') }) + + test('SSR CSS updates after a stylesheet edit', async ({ page }) => { + const editor = createHmrFileEditor({ + rootDir: import.meta.dirname, + files: { css: '../src/styles/code-split-route.module.css' }, + }) + await editor.capturePromise + const expectSsrColor = async (color: string) => { + await expect(async () => { + await page.reload() + await expect(page.getByTestId('styled-box')).toHaveCSS( + 'background-color', + color, + ) + }).toPass({ timeout: 20_000 }) + } + try { + await page.goto('/') + await expect(page.getByTestId('styled-box')).toHaveCSS( + 'background-color', + 'rgb(59, 130, 246)', + ) + await editor.replaceText('css', '#3b82f6', '#ef4444') + await expectSsrColor('rgb(239, 68, 68)') + } finally { + await editor.restoreFiles() + // Finish the restore before another test reads the SSR stylesheet. + await expectSsrColor('rgb(59, 130, 246)') + } + }) + + test('assets referenced by SSR CSS are available before hydration', async ({ + page, + }) => { + await page.goto('/') + const backgroundImage = await page + .getByTestId('styled-box') + .evaluate((element) => getComputedStyle(element).backgroundImage) + const assetUrl = backgroundImage.match(/^url\("(.+)"\)$/)?.[1] + expect(assetUrl).toBeDefined() + const response = await page.request.get(assetUrl!) + expect(response.ok()).toBeTruthy() + expect(response.headers()['content-type']).toContain('image/svg+xml') + expect(await response.text()).toContain(' { + await page.goto('/css-import-order') + + const element = page.getByTestId('css-import-order') + await expect(element).toBeVisible() + + // css-import-order.css imports a white base rule, then overrides it + // with this dark background. Collecting the imported file separately + // appends the white rule and reverses the intended cascade. + const backgroundColor = await element.evaluate( + (el) => getComputedStyle(el).backgroundColor, + ) + expect(backgroundColor).toBe('rgb(17, 24, 39)') + + const devStylesHref = await page + .locator(`link[${DEV_STYLES_ATTR}]`) + .getAttribute('href') + expect(devStylesHref).toBeTruthy() + + const cssResponse = await page.request.get( + new URL(devStylesHref!, page.url()).href, + ) + expect(cssResponse.ok()).toBeTruthy() + + const css = await cssResponse.text() + expect(css.match(/--css-import-base-marker/g)).toHaveLength(1) + }) }) } diff --git a/e2e/react-start/dev-ssr-styles/tests/inline-css.spec.ts b/e2e/react-start/dev-ssr-styles/tests/inline-css.spec.ts new file mode 100644 index 0000000000..c564a9977a --- /dev/null +++ b/e2e/react-start/dev-ssr-styles/tests/inline-css.spec.ts @@ -0,0 +1,35 @@ +import { expect } from '@playwright/test' +import { DEV_STYLES_ATTR } from '@tanstack/router-core' +import { test } from '@tanstack/router-e2e-utils' +import { ssrStylesMode } from '../env' + +test.describe('server inline CSS with layered imports', () => { + test.skip(ssrStylesMode !== 'default', 'Requires the default dev stylesheet') + test.use({ javaScriptEnabled: false }) + + test('keeps layered inline imports out of the global dev stylesheet', async ({ + page, + }) => { + await page.goto('/inline-css') + const embeddedCss = await page.getByTestId('embedded-css').textContent() + for (const layer of ['theme', 'base', 'utilities']) { + expect(embeddedCss).toContain(`@layer ${layer}`) + } + for (const marker of ['theme', 'preflight', 'utilities']) { + expect(embeddedCss).toContain(`--embedded-${marker}-marker`) + } + + const href = await page + .locator(`link[${DEV_STYLES_ATTR}]`) + .getAttribute('href') + expect(href).toBeTruthy() + const response = await page.request.get(new URL(href!, page.url()).href) + expect(response.ok()).toBeTruthy() + expect(await response.text()).not.toContain('--embedded-') + + const layout = page.getByTestId('inline-css-layout') + await expect(layout).toHaveCSS('padding-top', '24px') + await expect(layout).toHaveCSS('margin-top', '12px') + await expect(layout).toHaveCSS('border-top-width', '3px') + }) +}) diff --git a/e2e/react-start/dev-ssr-styles/tests/setup/global.setup.ts b/e2e/react-start/dev-ssr-styles/tests/setup/global.setup.ts index 2bfd33163d..43fad46254 100644 --- a/e2e/react-start/dev-ssr-styles/tests/setup/global.setup.ts +++ b/e2e/react-start/dev-ssr-styles/tests/setup/global.setup.ts @@ -1,39 +1,45 @@ -import { - e2eStartDummyServer, - getTestServerPort, - preOptimizeDevServer, - waitForServer, -} from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } -import { ssrStylesMode, useNitro, viteBundledDev } from '../../env' - -function getPortKey() { - let key = packageJson.name - if (ssrStylesMode !== 'default') { - key += `-${ssrStylesMode}` - } - if (useNitro) { - key += '-nitro' - } - if (viteBundledDev) { - key += '-bundled-dev' - } - return key -} +import { chromium, expect } from '@playwright/test' +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' +import { ssrStylesMode } from '../../env' export default async function setup() { - const portKey = getPortKey() + if (process.env.MODE !== 'dev') { + return + } - await e2eStartDummyServer(portKey) - - if (process.env.MODE !== 'dev') return - - const port = await getTestServerPort(portKey) + const port = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${port}` await waitForServer(baseURL) - await preOptimizeDevServer({ - baseURL, - readyTestId: 'home-heading', - }) + + // Check cold SSR before the browser warmup can populate the client graph. + const browser = await chromium.launch() + try { + const page = await browser.newPage({ javaScriptEnabled: false }) + const backgroundAsset = + ssrStylesMode !== 'disabled' + ? page.waitForResponse( + (response) => + new URL(response.url()).pathname.includes('ssr-background'), + { timeout: 60_000 }, + ) + : undefined + await page.goto(baseURL, { timeout: 60_000 }) + await expect(page.getByTestId('home-heading')).toHaveText( + 'Dev SSR Styles Test', + { timeout: 30_000 }, + ) + if (ssrStylesMode !== 'disabled') { + expect((await backgroundAsset!).ok()).toBeTruthy() + await expect(page.getByTestId('styled-box')).toHaveCSS( + 'background-color', + 'rgb(59, 130, 246)', + { timeout: 30_000 }, + ) + } + } finally { + await browser.close() + } + + await preOptimizeDevServer({ baseURL, readyTestId: 'home-heading' }) } diff --git a/e2e/react-start/dev-ssr-styles/tests/setup/global.teardown.ts b/e2e/react-start/dev-ssr-styles/tests/setup/global.teardown.ts deleted file mode 100644 index 0e44fca325..0000000000 --- a/e2e/react-start/dev-ssr-styles/tests/setup/global.teardown.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } -import { ssrStylesMode, useNitro, viteBundledDev } from '../../env' - -function getPortKey() { - let key = packageJson.name - if (ssrStylesMode !== 'default') { - key += `-${ssrStylesMode}` - } - if (useNitro) { - key += '-nitro' - } - if (viteBundledDev) { - key += '-bundled-dev' - } - return key -} - -export default async function teardown() { - await e2eStopDummyServer(getPortKey()) -} diff --git a/e2e/react-start/dev-ssr-styles/vite.config.ts b/e2e/react-start/dev-ssr-styles/vite.config.ts index 555137b543..df5ea34504 100644 --- a/e2e/react-start/dev-ssr-styles/vite.config.ts +++ b/e2e/react-start/dev-ssr-styles/vite.config.ts @@ -20,7 +20,7 @@ export default defineConfig(async () => { return { resolve: { tsconfigPaths: true }, - experimental: viteBundledDev ? { bundledDev: true } : undefined, + experimental: { bundledDev: viteBundledDev }, server: { port: 3000, }, diff --git a/e2e/react-start/early-hints/package.json b/e2e/react-start/early-hints/package.json index a1a0efbd37..1615b99430 100644 --- a/e2e/react-start/early-hints/package.json +++ b/e2e/react-start/early-hints/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "gen-certs": "node --import tsx tests/gen-certs.ts", "start": "pnpm gen-certs && srvx --prod --tls --cert=tests/.tmp/tls/server.crt --key=tests/.tmp/tls/server.key -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -27,9 +27,20 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "node-forge": "^1.3.1", - "srvx": "0.11.15", + "srvx": "^1.0.0", "tsx": "4.20.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/tests/.tmp/tls" + ] + } + } } } diff --git a/e2e/react-start/early-hints/playwright.config.ts b/e2e/react-start/early-hints/playwright.config.ts index a2435bcf7b..b3606d5586 100644 --- a/e2e/react-start/early-hints/playwright.config.ts +++ b/e2e/react-start/early-hints/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `https://localhost:${PORT}` export default defineConfig({ @@ -17,8 +16,8 @@ export default defineConfig({ webServer: { command: `pnpm build && pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', ignoreHTTPSErrors: true, env: { diff --git a/e2e/react-start/early-hints/tests/early-hints-protocol.spec.ts b/e2e/react-start/early-hints/tests/early-hints-protocol.spec.ts index df0984079e..6d2d31d836 100644 --- a/e2e/react-start/early-hints/tests/early-hints-protocol.spec.ts +++ b/e2e/react-start/early-hints/tests/early-hints-protocol.spec.ts @@ -1,7 +1,5 @@ -import { expect, test } from '@playwright/test' import { connect } from 'node:http2' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { expect, test } from '@playwright/test' import type { IncomingHttpHeaders } from 'node:http2' type Http2Response = { @@ -48,14 +46,14 @@ function linkHeader(headers: IncomingHttpHeaders): string { function earlyHintsLinkHeader(response: Http2Response): string { expect(response.earlyHints.length).toBe(1) - return linkHeader(response.earlyHints[0]!) + return linkHeader(response.earlyHints[0]) } test.describe('Early Hints - HTTP/2 Protocol', () => { let baseURL: string test.beforeAll(async () => { - const PORT = await getTestServerPort(packageJson.name) + const PORT = Number(process.env.E2E_APP_PORT ?? 0) baseURL = `https://localhost:${PORT}` }) @@ -105,7 +103,9 @@ test.describe('Early Hints - HTTP/2 Protocol', () => { const response = await makeRequest(baseURL, '/') const link = earlyHintsLinkHeader(response) - expect(link).toMatch(/<[^>]+>;\s*rel=modulepreload;\s*as=script/) + expect(link).toMatch( + /<[^>]+>;\s*rel=modulepreload;\s*as=script;\s*fetchpriority=low/, + ) }) test('CSS module assets are included in early hints', async () => { @@ -137,7 +137,7 @@ test.describe('Early Hints - HTTP/2 Protocol', () => { expect(response.earlyHints.length).toBe(1) - const link = linkHeader(response.earlyHints[0]!) + const link = linkHeader(response.earlyHints[0]) expect(link).toContain('rel=modulepreload; as=script') expect(link).toContain('; rel=preconnect') @@ -147,7 +147,7 @@ test.describe('Early Hints - HTTP/2 Protocol', () => { const response = await makeRequest(baseURL, '/') const link = linkHeader(response.finalHeaders) - expect(link).toContain('rel=modulepreload; as=script') + expect(link).toContain('rel=modulepreload; as=script; fetchpriority=low') expect(link).toContain('; rel=preconnect') }) diff --git a/e2e/react-start/flamegraph-bench/package.json b/e2e/react-start/flamegraph-bench/package.json index 768c5f05b8..72410b13e1 100644 --- a/e2e/react-start/flamegraph-bench/package.json +++ b/e2e/react-start/flamegraph-bench/package.json @@ -14,15 +14,16 @@ "@tanstack/react-start": "workspace:*", "react": "^19.0.0", "react-dom": "^19.0.0", - "srvx": "^0.11.9" + "srvx": "^1.0.0" }, "devDependencies": { "@platformatic/flame": "latest", "@vitejs/plugin-react": "^6.0.1", - "nitro": "^3.0.260311-beta", + "nitro": "^3.0.260903-beta", "autocannon": "^8.0.0", "concurrently": "9.2.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/hmr/package.json b/e2e/react-start/hmr/package.json index 7c5b6133c1..76a5d86b1f 100644 --- a/e2e/react-start/hmr/package.json +++ b/e2e/react-start/hmr/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tailwindcss/vite": "^4.2.2", @@ -31,7 +31,8 @@ "@types/react-dom": "^19.0.3", "tailwindcss": "^4.2.2", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { diff --git a/e2e/react-start/hmr/playwright.config.ts b/e2e/react-start/hmr/playwright.config.ts index c159aad328..5840ec157a 100644 --- a/e2e/react-start/hmr/playwright.config.ts +++ b/e2e/react-start/hmr/playwright.config.ts @@ -1,13 +1,11 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' -const e2ePortKey = - process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` + const distDir = process.env.E2E_DIST_DIR ?? 'dist' const viteBundledDev = process.env.E2E_VITE_BUNDLED_DEV === 'true' -const PORT = await getTestServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` const devCommand = toolchain === 'rsbuild' ? 'pnpm dev:rsbuild' : 'pnpm dev:vite' @@ -18,7 +16,6 @@ export default defineConfig({ reporter: [['line']], globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { baseURL, @@ -26,15 +23,14 @@ export default defineConfig({ webServer: { command: `${devCommand} --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { VITE_NODE_ENV: 'test', PORT: String(PORT), E2E_TOOLCHAIN: toolchain, E2E_DIST_DIR: distDir, - E2E_PORT_KEY: e2ePortKey, E2E_VITE_BUNDLED_DEV: String(viteBundledDev), }, }, diff --git a/e2e/react-start/hmr/rsbuild.config.ts b/e2e/react-start/hmr/rsbuild.config.ts index 126e7d9888..2f3829f661 100644 --- a/e2e/react-start/hmr/rsbuild.config.ts +++ b/e2e/react-start/hmr/rsbuild.config.ts @@ -5,7 +5,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' const outDir = process.env.E2E_DIST_DIR ?? 'dist' export default defineConfig({ - plugins: [pluginReact({ splitChunks: false }), tanstackStart()], + plugins: [pluginReact(), tanstackStart()], output: { distPath: { root: outDir, diff --git a/e2e/react-start/hmr/tests/app.spec.ts b/e2e/react-start/hmr/tests/app.spec.ts index 6c70843c04..645c9b06f3 100644 --- a/e2e/react-start/hmr/tests/app.spec.ts +++ b/e2e/react-start/hmr/tests/app.spec.ts @@ -38,6 +38,21 @@ const routeFilePaths = { type RouteFileKey = keyof typeof routeFilePaths +const rootLoaderBlock = " loader: () => ({\n crumb: 'Home',\n }),\n" +const redirectRootLoaderBlock = + " staleTime: Infinity,\n loader: () => ({\n crumb:\n typeof window === 'undefined'\n ? 'Home Armed'\n : (window.sessionStorage.getItem('hmr-root-crumb') ?? 'Home Armed'),\n }),\n" +const childBeforeLoadBlock = + " beforeLoad: () => ({\n greeting: 'Hello',\n }),\n" +const childLoaderBlock = " loader: () => ({\n crumb: 'Child',\n }),\n" +const failingChildOnStayBlock = + " onStay: () => {\n ;(window as any).__TSR_HMR_FAILURE_RAN__ = true\n throw new Error('intentional HMR lifecycle failure')\n },\n" +const pendingNavigationChildLoaderBlock = + " loader: async () => {\n if (typeof window !== 'undefined') {\n const gate = (window as any).__TSR_HMR_PENDING_NAV_GATE__\n if (gate) {\n ;(window as any).__TSR_HMR_PENDING_NAV_GATE__ = undefined\n ;(window as any).__TSR_HMR_PENDING_NAV_EVENTS__.push('loader-start')\n await gate\n ;(window as any).__TSR_HMR_PENDING_NAV_EVENTS__.push('loader-end')\n }\n }\n return { crumb: 'Child' }\n },\n" +const pendingNavigationChildOnStayBlock = + " onStay: () => {\n ;(window as any).__TSR_HMR_PENDING_NAV_EVENTS__.push('onStay')\n throw new Error('intentional HMR failure after pending navigation')\n },\n" +const redirectChildBeforeLoadBlock = + " beforeLoad: () => {\n throw redirect({ to: '/' })\n },\n" + const routeFiles = Object.fromEntries( Object.entries(routeFilePaths).map(([key, relativePath]) => [ key, @@ -141,6 +156,8 @@ function normalizeRouteSource(routeFileKey: RouteFileKey, source: string) { } if (routeFileKey === 'root') { + next = next.replace(redirectRootLoaderBlock, rootLoaderBlock) + for (const marker of [ 'root-component-inline-baseline', 'root-component-inline-updated', @@ -209,30 +226,36 @@ function normalizeRouteSource(routeFileKey: RouteFileKey, source: string) { } if (routeFileKey === 'child') { - const beforeLoadBlock = - " beforeLoad: () => ({\n greeting: 'Hello',\n }),\n" - const loaderBlock = " loader: () => ({\n crumb: 'Child',\n }),\n" - next = replaceAll(next, "greeting: 'Hi'", "greeting: 'Hello'") + next = next.replace(failingChildOnStayBlock, '') + next = next.replace(pendingNavigationChildOnStayBlock, '') + next = next.replace(pendingNavigationChildLoaderBlock, childLoaderBlock) + next = next.replace(redirectChildBeforeLoadBlock, childBeforeLoadBlock) + next = next.replace( + "import { createFileRoute, redirect } from '@tanstack/react-router'", + "import { createFileRoute } from '@tanstack/react-router'", + ) + next = replaceAll(next, "crumb: 'Child Recovered'", "crumb: 'Child'") + next = replaceAll(next, "crumb: 'Child Failed'", "crumb: 'Child'") next = replaceAll(next, "crumb: 'Child Updated Again'", "crumb: 'Child'") next = replaceAll(next, "crumb: 'Child Updated'", "crumb: 'Child'") - if (!next.includes(beforeLoadBlock)) { + if (!next.includes(childBeforeLoadBlock)) { next = next.replace( ' component: Child,\n', - `${beforeLoadBlock} component: Child,\n`, + `${childBeforeLoadBlock} component: Child,\n`, ) } - if (!next.includes(loaderBlock)) { + if (!next.includes(childLoaderBlock)) { const withLoaderAfterBeforeLoad = next.replace( - `${beforeLoadBlock} component: Child,\n`, - `${beforeLoadBlock}${loaderBlock} component: Child,\n`, + `${childBeforeLoadBlock} component: Child,\n`, + `${childBeforeLoadBlock}${childLoaderBlock} component: Child,\n`, ) next = withLoaderAfterBeforeLoad === next ? next.replace( ' component: Child,\n', - `${loaderBlock} component: Child,\n`, + `${childLoaderBlock} component: Child,\n`, ) : withLoaderAfterBeforeLoad } @@ -584,8 +607,18 @@ test.describe('react-start hmr', () => { test('preserves local state for code-split route component HMR', async ({ page, }) => { + // Hydration can finish before Vite connects its HMR socket. + const hmrReady = + (process.env.E2E_TOOLCHAIN ?? 'vite') === 'vite' + ? page.waitForEvent('websocket').then((socket) => { + return socket.waitForEvent('framereceived', ({ payload }) => { + return JSON.parse(String(payload)).type === 'connected' + }) + }) + : Promise.resolve() await page.goto('/') await page.getByTestId('hydrated').waitFor({ state: 'visible' }) + await hmrReady await page.getByTestId('increment').click() await page.getByTestId('message').fill('hmr state') @@ -661,6 +694,178 @@ test.describe('react-start hmr', () => { await expect(page.getByTestId('child')).toHaveText('child') }) + test('publishes a failed route refresh and accepts the next HMR update', async ({ + page, + }) => { + await page.goto('/child') + await page.getByTestId('hydrated').waitFor({ state: 'visible' }) + await page.getByTestId('root-message').fill('preserved through failure') + await expect(page.getByTestId('crumb-/child')).toHaveText('Child') + + await page.evaluate(() => { + ;(window as any).__TSR_HMR_FAILURE_RAN__ = false + }) + + await rewriteRouteFile( + page, + 'child', + (source) => + source.replace( + childLoaderBlock, + `${failingChildOnStayBlock} loader: () => ({\n crumb: 'Child Failed',\n }),\n`, + ), + async () => { + await waitForRouteModuleUpdate(page, '/child', 'Child Failed') + await page.waitForFunction( + () => (window as any).__TSR_HMR_FAILURE_RAN__ === true, + ) + }, + ) + + await expect(page.getByTestId('crumb-/child')).toHaveText('Child Failed') + await expect(page.getByTestId('root-message')).toHaveValue( + 'preserved through failure', + ) + + await rewriteRouteFile( + page, + 'child', + (source) => + source + .replace(failingChildOnStayBlock, '') + .replace("crumb: 'Child Failed'", "crumb: 'Child Recovered'"), + async () => { + await waitForRouteModuleUpdate(page, '/child', 'Child Recovered') + await hmrExpect(page.getByTestId('crumb-/child')).toHaveText( + 'Child Recovered', + ) + }, + ) + + await expect(page.getByTestId('root-message')).toHaveValue( + 'preserved through failure', + ) + }) + + test('rematerializes retained routes when an HMR update redirects', async ({ + page, + }) => { + await page.goto('/child') + await page.getByTestId('hydrated').waitFor({ state: 'visible' }) + await page.getByTestId('root-message').fill('preserved through redirect') + + await rewriteRouteFile( + page, + 'root', + (source) => source.replace(rootLoaderBlock, redirectRootLoaderBlock), + async () => { + await waitForRouteModuleUpdate(page, '__root__', 'Home Armed') + await hmrExpect(page.getByTestId('crumb-__root__')).toHaveText( + 'Home Armed', + ) + }, + ) + + await page.evaluate(() => { + window.sessionStorage.setItem('hmr-root-crumb', 'Home Redirected') + }) + + await rewriteRouteFile( + page, + 'child', + (source) => + source + .replace( + "import { createFileRoute } from '@tanstack/react-router'", + "import { createFileRoute, redirect } from '@tanstack/react-router'", + ) + .replace(childBeforeLoadBlock, redirectChildBeforeLoadBlock), + async () => { + await hmrExpect(page).toHaveURL((url) => url.pathname === '/') + await hmrExpect(page.getByTestId('crumb-__root__')).toHaveText( + 'Home Redirected', + ) + }, + ) + + await expect(page.getByTestId('root-message')).toHaveValue( + 'preserved through redirect', + ) + }) + + test('waits for a pending navigation before applying an HMR refresh', async ({ + page, + }) => { + await page.goto('/') + await page.getByTestId('hydrated').waitFor({ state: 'visible' }) + await page.getByTestId('root-message').fill('preserved while pending') + + await page.evaluate(() => { + let release!: () => void + const gate = new Promise((resolve) => { + release = resolve + }) + ;(window as any).__TSR_HMR_PENDING_NAV_EVENTS__ = [] + ;(window as any).__TSR_HMR_PENDING_NAV_GATE__ = gate + ;(window as any).__TSR_HMR_RELEASE_PENDING_NAV__ = release + }) + + await rewriteRouteFile( + page, + 'child', + (source) => + source.replace(childLoaderBlock, pendingNavigationChildLoaderBlock), + async () => { + await page.waitForFunction(() => { + const loader = (window as any).__TSR_ROUTER__?.routesById?.['/child'] + ?.options?.loader + return String(loader).includes('__TSR_HMR_PENDING_NAV_GATE__') + }) + }, + ) + + await page.getByTestId('child-link').click() + await page.waitForFunction( + () => + (window as any).__TSR_HMR_PENDING_NAV_EVENTS__?.[0] === 'loader-start', + ) + + await rewriteRouteFile( + page, + 'child', + (source) => + source.replace( + pendingNavigationChildLoaderBlock, + `${pendingNavigationChildOnStayBlock}${pendingNavigationChildLoaderBlock}`, + ), + async () => { + await page.waitForFunction(() => { + const onStay = (window as any).__TSR_ROUTER__?.routesById?.['/child'] + ?.options?.onStay + return String(onStay).includes( + 'intentional HMR failure after pending navigation', + ) + }) + }, + ) + + await page.evaluate(() => { + ;(window as any).__TSR_HMR_RELEASE_PENDING_NAV__() + }) + + await page.waitForFunction(() => + (window as any).__TSR_HMR_PENDING_NAV_EVENTS__?.includes('onStay'), + ) + await hmrExpect(page.getByTestId('child')).toHaveText('child') + await hmrExpect(page.getByTestId('crumb-/child')).toHaveText('Child') + expect( + await page.evaluate(() => (window as any).__TSR_HMR_PENDING_NAV_EVENTS__), + ).toEqual(['loader-start', 'loader-end', 'onStay']) + await expect(page.getByTestId('root-message')).toHaveValue( + 'preserved while pending', + ) + }) + test('adds a createFileRoute property during HMR', async ({ page }) => { await page.goto('/') await page.getByTestId('hydrated').waitFor({ state: 'visible' }) @@ -727,6 +932,7 @@ test.describe('react-start hmr', () => { await waitForRouteModuleUpdate(page, '/child', 'Child Updated') }, ) + await waitForHydrationSafeReload(page, '/child', 'Child Updated') // Second edit: change child loader again while still on / await replaceRouteTextAndWait( diff --git a/e2e/react-start/hmr/tests/setup/global.setup.ts b/e2e/react-start/hmr/tests/setup/global.setup.ts index fb9aad22ae..32207ab79f 100644 --- a/e2e/react-start/hmr/tests/setup/global.setup.ts +++ b/e2e/react-start/hmr/tests/setup/global.setup.ts @@ -1,22 +1,7 @@ -import { - e2eStartDummyServer, - getTestServerPort, - preOptimizeDevServer, - waitForServer, -} from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -function getE2EPortKey() { - const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' - return process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` -} +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' export default async function setup() { - const e2ePortKey = getE2EPortKey() - - await e2eStartDummyServer(e2ePortKey) - - const port = await getTestServerPort(e2ePortKey) + const port = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${port}` await waitForServer(baseURL) diff --git a/e2e/react-start/hmr/tests/setup/global.teardown.ts b/e2e/react-start/hmr/tests/setup/global.teardown.ts deleted file mode 100644 index e17856dd82..0000000000 --- a/e2e/react-start/hmr/tests/setup/global.teardown.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -function getE2EPortKey() { - const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' - return process.env.E2E_PORT_KEY ?? `${packageJson.name}-${toolchain}` -} - -export default async function teardown() { - await e2eStopDummyServer(getE2EPortKey()) -} diff --git a/e2e/react-start/i18n-paraglide/package.json b/e2e/react-start/i18n-paraglide/package.json index 39e5d3e137..ca65ead76d 100644 --- a/e2e/react-start/i18n-paraglide/package.json +++ b/e2e/react-start/i18n-paraglide/package.json @@ -8,7 +8,7 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js", "build": "vite build && tsc --noEmit", "preview": "vite preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -27,7 +27,26 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + }, + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/e2e/react-start/i18n-paraglide/playwright.config.ts b/e2e/react-start/i18n-paraglide/playwright.config.ts index 38690f09d8..972522350e 100644 --- a/e2e/react-start/i18n-paraglide/playwright.config.ts +++ b/e2e/react-start/i18n-paraglide/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/import-protection-custom-config/package.json b/e2e/react-start/import-protection-custom-config/package.json index ff0e9e7bdf..c088eff106 100644 --- a/e2e/react-start/import-protection-custom-config/package.json +++ b/e2e/react-start/import-protection-custom-config/package.json @@ -8,8 +8,8 @@ "dev:e2e": "vite dev", "build": "vite build && tsc --noEmit", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e:mockMode": "rm -rf port*.txt; playwright test --project=chromium", - "test:e2e:errorMode": "rm -rf port*.txt; BEHAVIOR=error playwright test --project=chromium", + "test:e2e:mockMode": "playwright test --project=chromium", + "test:e2e:errorMode": "BEHAVIOR=error playwright test --project=chromium", "test:e2e": "pnpm run test:e2e:mockMode && pnpm run test:e2e:errorMode" }, "dependencies": { @@ -25,8 +25,23 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "{projectRoot}/dist", + "{projectRoot}/test-results", + "{projectRoot}/webserver-build.log", + "{projectRoot}/violations.*.json", + "{projectRoot}/error-build.log", + "{projectRoot}/error-*-result.json" + ] + } + } } } diff --git a/e2e/react-start/import-protection-custom-config/playwright.config.ts b/e2e/react-start/import-protection-custom-config/playwright.config.ts index 31a55ba3bc..ab90f2911f 100644 --- a/e2e/react-start/import-protection-custom-config/playwright.config.ts +++ b/e2e/react-start/import-protection-custom-config/playwright.config.ts @@ -1,9 +1,8 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' +import { appServerReady } from '@tanstack/router-e2e-utils' import { isErrorMode } from './tests/utils/isErrorMode' -import packageJson from './package.json' with { type: 'json' } -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` console.log('running in error mode:', isErrorMode.toString()) @@ -27,8 +26,8 @@ export default defineConfig({ : { webServer: { command: `rm -f webserver-build.log violations.build.json violations.dev.json && VITE_SERVER_PORT=${PORT} pnpm build > webserver-build.log 2>&1 && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', cwd: import.meta.dirname, }, diff --git a/e2e/react-start/import-protection-custom-config/tests/error-mode.setup.ts b/e2e/react-start/import-protection-custom-config/tests/error-mode.setup.ts index 3e666ca1df..5032988d0c 100644 --- a/e2e/react-start/import-protection-custom-config/tests/error-mode.setup.ts +++ b/e2e/react-start/import-protection-custom-config/tests/error-mode.setup.ts @@ -1,14 +1,14 @@ +import { execSync, spawn } from 'node:child_process' import fs from 'node:fs' import path from 'node:path' -import { execSync, spawn } from 'node:child_process' -import { chromium } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { stripVTControlCharacters } from 'node:util' +import { appServerReadyPattern } from '@tanstack/router-e2e-utils' +import { chromium, expect } from '@playwright/test' import type { FullConfig } from '@playwright/test' async function waitForHttpOk(url: string, timeoutMs: number): Promise { const start = Date.now() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + while (true) { if (Date.now() - start > timeoutMs) { throw new Error(`Timed out waiting for ${url}`) @@ -84,8 +84,7 @@ function captureBuild(cwd: string): void { } async function captureDevErrors(cwd: string): Promise { - const port = await getTestServerPort(`${packageJson.name}_error_dev`) - const baseURL = `http://localhost:${port}` + const port = 0 const logChunks: Array = [] const child = spawn('pnpm', ['exec', 'vite', 'dev', '--port', String(port)], { @@ -99,10 +98,23 @@ async function captureDevErrors(cwd: string): Promise { stdio: ['ignore', 'pipe', 'pipe'], }) - child.stdout?.on('data', (d: Buffer) => logChunks.push(d.toString())) - child.stderr?.on('data', (d: Buffer) => logChunks.push(d.toString())) + child.stdout.on('data', (d: Buffer) => logChunks.push(d.toString())) + child.stderr.on('data', (d: Buffer) => logChunks.push(d.toString())) try { + await expect + .poll( + () => + appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )?.groups?.E2E_APP_PORT, + { timeout: 30_000 }, + ) + .toBeTruthy() + const port = appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )!.groups!.E2E_APP_PORT + const baseURL = `http://localhost:${port}` await waitForHttpOk(baseURL, 30_000) const browser = await chromium.launch() diff --git a/e2e/react-start/import-protection-custom-config/tests/violations.setup.ts b/e2e/react-start/import-protection-custom-config/tests/violations.setup.ts index c5187fe074..89c8bb2b9a 100644 --- a/e2e/react-start/import-protection-custom-config/tests/violations.setup.ts +++ b/e2e/react-start/import-protection-custom-config/tests/violations.setup.ts @@ -1,9 +1,9 @@ +import { spawn } from 'node:child_process' import fs from 'node:fs' import path from 'node:path' -import { spawn } from 'node:child_process' -import { chromium } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { stripVTControlCharacters } from 'node:util' +import { chromium, expect } from '@playwright/test' +import { appServerReadyPattern } from '@tanstack/router-e2e-utils' import { extractViolationsFromLog } from './violations.utils' import type { FullConfig } from '@playwright/test' @@ -12,7 +12,6 @@ import type { Violation } from './violations.utils' async function waitForHttpOk(url: string, timeoutMs: number): Promise { const start = Date.now() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition while (true) { if (Date.now() - start > timeoutMs) { throw new Error(`Timed out waiting for ${url}`) @@ -119,7 +118,6 @@ async function runDevPass( cwd: string, port: number, ): Promise> { - const baseURL = `http://localhost:${port}` const logChunks: Array = [] const child = startDevServer(cwd, port) @@ -127,6 +125,19 @@ async function runDevPass( child.stderr?.on('data', (d: Buffer) => logChunks.push(d.toString())) try { + await expect + .poll( + () => + appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )?.groups?.E2E_APP_PORT, + { timeout: 30_000 }, + ) + .toBeTruthy() + const port = appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )!.groups!.E2E_APP_PORT + const baseURL = `http://localhost:${port}` await waitForHttpOk(baseURL, 30_000) const browser = await chromium.launch() @@ -146,7 +157,7 @@ async function runDevPass( } async function captureDevViolations(cwd: string): Promise { - const port = await getTestServerPort(`${packageJson.name}_dev`) + const port = 0 const coldViolations = await runDevPass(cwd, port) diff --git a/e2e/react-start/import-protection/package.json b/e2e/react-start/import-protection/package.json index 0efd1c2048..ad06ba41ea 100644 --- a/e2e/react-start/import-protection/package.json +++ b/e2e/react-start/import-protection/package.json @@ -11,10 +11,7 @@ "build": "pnpm build:vite", "build:vite": "vite build && tsc --noEmit", "build:rsbuild": "rsbuild build && tsc --noEmit", - "start": "node server.js", - "test:e2e:mockMode": "rm -rf node_modules/.vite; rm -rf port*.txt; playwright test --project=chromium", - "test:e2e:errorMode": "rm -rf node_modules/.vite; rm -rf port*.txt; BEHAVIOR=error playwright test --project=chromium", - "test:e2e": "pnpm run test:e2e:mockMode && pnpm run test:e2e:errorMode" + "start": "node server.js" }, "dependencies": { "@tanstack/react-router": "workspace:^", @@ -25,15 +22,16 @@ }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { @@ -57,6 +55,7 @@ "toolchain": "vite", "mode": "ssr", "env": { + "E2E_BUILD_LOG": "webserver-build.vite-ssr.log", "E2E_VITE_BUNDLED_DEV": "false" } }, @@ -65,12 +64,16 @@ "mode": "ssr", "name": "bundled-dev", "env": { + "E2E_BUILD_LOG": "webserver-build.vite-ssr-bundled-dev.log", "E2E_VITE_BUNDLED_DEV": "true" } }, { "toolchain": "rsbuild", - "mode": "ssr" + "mode": "ssr", + "env": { + "E2E_BUILD_LOG": "webserver-build.rsbuild-ssr.log" + } } ] } diff --git a/e2e/react-start/import-protection/playwright.config.ts b/e2e/react-start/import-protection/playwright.config.ts index ac239f36fe..6a3df630c3 100644 --- a/e2e/react-start/import-protection/playwright.config.ts +++ b/e2e/react-start/import-protection/playwright.config.ts @@ -1,18 +1,19 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' +import { appServerReady } from '@tanstack/router-e2e-utils' import { isErrorMode } from './tests/utils/isErrorMode' -import packageJson from './package.json' with { type: 'json' } +import { getViolationArtifactName } from './tests/violations.utils' -const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' const viteBundledDev = process.env.E2E_VITE_BUNDLED_DEV === 'true' -const e2ePortKey = - process.env.E2E_PORT_KEY ?? - `${packageJson.name}-${toolchain}${viteBundledDev ? '-bundled-dev' : ''}` + const distDir = process.env.E2E_DIST_DIR ?? 'dist' -const PORT = await getTestServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` -const buildCommand = - toolchain === 'rsbuild' ? 'pnpm build:rsbuild' : 'pnpm build:vite' +const violationArtifacts = [ + getViolationArtifactName('build'), + getViolationArtifactName('dev'), + getViolationArtifactName('dev.cold'), + getViolationArtifactName('dev.warm'), +].join(' ') console.log('running in error mode:', isErrorMode.toString()) @@ -36,16 +37,15 @@ export default defineConfig({ ? {} : { webServer: { - command: `rm -f webserver-build.log webserver-dev.log violations.build.json violations.dev.json && VITE_SERVER_PORT=${PORT} PORT=${PORT} ${buildCommand} > webserver-build.log 2>&1 && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `rm -f webserver-dev.log ${violationArtifacts} && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', cwd: import.meta.dirname, env: { PORT: String(PORT), VITE_SERVER_PORT: String(PORT), E2E_DIST_DIR: distDir, - E2E_PORT_KEY: e2ePortKey, E2E_VITE_BUNDLED_DEV: String(viteBundledDev), }, }, diff --git a/e2e/react-start/import-protection/src/routes/index.tsx b/e2e/react-start/import-protection/src/routes/index.tsx index c05ed1a7e3..ef8544dc3c 100644 --- a/e2e/react-start/import-protection/src/routes/index.tsx +++ b/e2e/react-start/import-protection/src/routes/index.tsx @@ -1,4 +1,4 @@ -import { createFileRoute } from '@tanstack/react-router' +import { createFileRoute, useHydrated } from '@tanstack/react-router' // This import chain triggers a file-based violation in the CLIENT env: // index.tsx -> violations/edge-a.ts -> violations/secret.server.ts import { getWrappedSecret } from '../violations/edge-a' @@ -25,10 +25,12 @@ export const Route = createFileRoute('/')({ }) function Home() { + const hydrated = useHydrated() return (

Import Protection E2E

App loaded successfully with mock mode

+

{hydrated ? 'hydrated' : 'ssr'}

{getWrappedSecret()}

{getWrappedSecret1()}

{getServerOnlyDataViaEdge()}

diff --git a/e2e/react-start/import-protection/src/violations/cross-boundary-safe/session-util.ts b/e2e/react-start/import-protection/src/violations/cross-boundary-safe/session-util.ts index ab44237539..d74bc6430b 100644 --- a/e2e/react-start/import-protection/src/violations/cross-boundary-safe/session-util.ts +++ b/e2e/react-start/import-protection/src/violations/cross-boundary-safe/session-util.ts @@ -6,7 +6,7 @@ import { getRequest } from '@tanstack/react-start/server' // so the compiler should prune this import from the client bundle. // // This mirrors the real-world pattern of a session utility that wraps -// `useSession` from `@tanstack/react-start/server`. +// `getCookie` from `@tanstack/react-start/server`. export function getSessionData() { const req = getRequest() return { method: req.method } diff --git a/e2e/react-start/import-protection/tests/error-mode.setup.ts b/e2e/react-start/import-protection/tests/error-mode.setup.ts index c844d59e73..e562128eea 100644 --- a/e2e/react-start/import-protection/tests/error-mode.setup.ts +++ b/e2e/react-start/import-protection/tests/error-mode.setup.ts @@ -1,9 +1,9 @@ +import { execSync, spawn } from 'node:child_process' import fs from 'node:fs' import path from 'node:path' -import { execSync, spawn } from 'node:child_process' -import { chromium } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { stripVTControlCharacters } from 'node:util' +import { appServerReadyPattern } from '@tanstack/router-e2e-utils' +import { chromium, expect } from '@playwright/test' import type { FullConfig } from '@playwright/test' /** @@ -20,14 +20,10 @@ import type { FullConfig } from '@playwright/test' */ const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' -const viteBundledDev = process.env.E2E_VITE_BUNDLED_DEV === 'true' -const e2ePortKey = - process.env.E2E_PORT_KEY ?? - `${packageJson.name}-${toolchain}${viteBundledDev ? '-bundled-dev' : ''}` async function waitForHttpOk(url: string, timeoutMs: number): Promise { const start = Date.now() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + while (true) { if (Date.now() - start > timeoutMs) { throw new Error(`Timed out waiting for ${url}`) @@ -122,8 +118,7 @@ async function captureDev(cwd: string): Promise { if (fs.existsSync(p)) fs.unlinkSync(p) } - const port = await getTestServerPort(`${e2ePortKey}-error-dev`) - const baseURL = `http://localhost:${port}` + const port = 0 const logFile = path.resolve(cwd, 'error-dev.log') const out = fs.createWriteStream(logFile) @@ -145,10 +140,28 @@ async function captureDev(cwd: string): Promise { stdio: ['ignore', 'pipe', 'pipe'], }) - child.stdout?.on('data', (d: Buffer) => out.write(d)) - child.stderr?.on('data', (d: Buffer) => out.write(d)) + const logChunks: Array = [] + const record = (data: Buffer) => { + logChunks.push(data.toString()) + out.write(data) + } + child.stdout.on('data', record) + child.stderr.on('data', record) try { + await expect + .poll( + () => + appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )?.groups?.E2E_APP_PORT, + { timeout: 30_000 }, + ) + .toBeTruthy() + const port = appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )!.groups!.E2E_APP_PORT + const baseURL = `http://localhost:${port}` await waitForHttpOk(baseURL, 30_000) const browser = await chromium.launch() diff --git a/e2e/react-start/import-protection/tests/import-protection.spec.ts b/e2e/react-start/import-protection/tests/import-protection.spec.ts index cdc9aea32c..16b5b073eb 100644 --- a/e2e/react-start/import-protection/tests/import-protection.spec.ts +++ b/e2e/react-start/import-protection/tests/import-protection.spec.ts @@ -2,6 +2,7 @@ import path from 'node:path' import fs from 'node:fs' import { expect } from '@playwright/test' import { test } from '@tanstack/router-e2e-utils' +import { getViolationArtifactName } from './violations.utils' import type { Violation } from './violations.utils' import type { Page } from '@playwright/test' @@ -37,7 +38,7 @@ function normalizeKeyPath(value: string): string { async function readViolations( type: 'build' | 'dev' | 'dev.cold' | 'dev.warm', ): Promise> { - const filename = `violations.${type}.json` + const filename = getViolationArtifactName(type) const violationsPath = path.resolve(import.meta.dirname, '..', filename) const mod = await import(violationsPath, { with: { type: 'json' }, @@ -161,7 +162,8 @@ test('client-only violations route loads in mock mode', async ({ page }) => { }) for (const mode of ['build', 'dev'] as const) { - test(`violations.${mode}.json is written during ${mode}`, async () => { + const artifactName = getViolationArtifactName(mode) + test(`${artifactName} is written during ${mode}`, async () => { const violations = await readViolations(mode) expect(violations.length).toBeGreaterThan(0) }) @@ -204,7 +206,7 @@ test('build log does not contain mock-edge missing export warnings', () => { const buildLogPath = path.resolve( import.meta.dirname, '..', - 'webserver-build.log', + process.env.E2E_BUILD_LOG ?? 'webserver-build.log', ) if (!fs.existsSync(buildLogPath)) { diff --git a/e2e/react-start/import-protection/tests/violations.setup.ts b/e2e/react-start/import-protection/tests/violations.setup.ts index 02796227a7..d0f4f70d03 100644 --- a/e2e/react-start/import-protection/tests/violations.setup.ts +++ b/e2e/react-start/import-protection/tests/violations.setup.ts @@ -1,24 +1,22 @@ +import { spawn } from 'node:child_process' import fs from 'node:fs' import path from 'node:path' -import { spawn } from 'node:child_process' -import { chromium } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { stripVTControlCharacters } from 'node:util' +import { chromium, expect } from '@playwright/test' +import { appServerReadyPattern } from '@tanstack/router-e2e-utils' -import { extractViolationsFromLog } from './violations.utils' +import { + extractViolationsFromLog, + getViolationArtifactName, +} from './violations.utils' import type { FullConfig } from '@playwright/test' import type { Violation } from './violations.utils' -const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' const viteBundledDev = process.env.E2E_VITE_BUNDLED_DEV === 'true' -const e2ePortKey = - process.env.E2E_PORT_KEY ?? - `${packageJson.name}-${toolchain}${viteBundledDev ? '-bundled-dev' : ''}` async function waitForHttpOk(url: string, timeoutMs: number): Promise { const start = Date.now() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition while (true) { if (Date.now() - start > timeoutMs) { throw new Error(`Timed out waiting for ${url}`) @@ -174,6 +172,20 @@ async function navigateAllRoutes( const context = await browser.newContext() const page = await context.newPage() + // Safe factory imports must actually compile and hydrate. A crashed lazy + // compiler must not pass simply because it emitted no violation diagnostics. + await page.goto(baseURL) + await expect(page.getByTestId('hydration-status')).toHaveText('hydrated', { + timeout: 30_000, + }) + for (const testId of [ + 'factory-safe', + 'cross-boundary-safe-sf', + 'cross-boundary-safe-mw', + ]) { + await expect(page.getByTestId(testId)).toHaveText('function') + } + for (const [route, testId, expectedViolation] of routeDefinitions) { try { // Prefer 'networkidle' (ensures route chunks are actually fetched), but @@ -211,7 +223,6 @@ async function runDevPass( cwd: string, port: number, ): Promise> { - const baseURL = `http://localhost:${port}` const logChunks: Array = [] const child = startDevServer(cwd, port) @@ -219,6 +230,19 @@ async function runDevPass( child.stderr?.on('data', (d: Buffer) => logChunks.push(d.toString())) try { + await expect + .poll( + () => + appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )?.groups?.E2E_APP_PORT, + { timeout: 30_000 }, + ) + .toBeTruthy() + const port = appServerReadyPattern.exec( + stripVTControlCharacters(logChunks.join('')), + )!.groups!.E2E_APP_PORT + const baseURL = `http://localhost:${port}` await waitForHttpOk(baseURL, 30_000) const browser = await chromium.launch() @@ -244,28 +268,22 @@ async function runDevPass( * modules are pre-transformed so resolveId/transform paths differ. */ async function captureDevViolations(cwd: string): Promise { - const coldViolations = await runDevPass( - cwd, - await getTestServerPort(`${e2ePortKey}-violations-cold`), - ) + const coldViolations = await runDevPass(cwd, 0) fs.writeFileSync( - path.resolve(cwd, 'violations.dev.json'), + path.resolve(cwd, getViolationArtifactName('dev')), JSON.stringify(coldViolations, null, 2), ) fs.writeFileSync( - path.resolve(cwd, 'violations.dev.cold.json'), + path.resolve(cwd, getViolationArtifactName('dev.cold')), JSON.stringify(coldViolations, null, 2), ) // Warm pass: the .vite cache from the cold run is still on disk. - const warmViolations = await runDevPass( - cwd, - await getTestServerPort(`${e2ePortKey}-violations-warm`), - ) + const warmViolations = await runDevPass(cwd, 0) fs.writeFileSync( - path.resolve(cwd, 'violations.dev.warm.json'), + path.resolve(cwd, getViolationArtifactName('dev.warm')), JSON.stringify(warmViolations, null, 2), ) } @@ -275,19 +293,22 @@ export default async function globalSetup(config: FullConfig) { // This file lives in ./tests; fixture root is one directory up. const cwd = path.resolve(import.meta.dirname, '..') - // webServer.command writes build output to this file. - const logFile = path.resolve(cwd, 'webserver-build.log') + // The Nx build dependency writes build output to this file. + const logFile = path.resolve( + cwd, + process.env.E2E_BUILD_LOG ?? 'webserver-build.log', + ) if (!fs.existsSync(logFile)) { // If the log doesn't exist, leave an empty violations file. - fs.writeFileSync(path.resolve(cwd, 'violations.build.json'), '[]') + fs.writeFileSync(path.resolve(cwd, getViolationArtifactName('build')), '[]') return } const text = fs.readFileSync(logFile, 'utf-8') const violations = extractViolationsFromLog(text) fs.writeFileSync( - path.resolve(cwd, 'violations.build.json'), + path.resolve(cwd, getViolationArtifactName('build')), JSON.stringify(violations, null, 2), ) diff --git a/e2e/react-start/import-protection/tests/violations.utils.ts b/e2e/react-start/import-protection/tests/violations.utils.ts index c08a9b7a82..006c51543b 100644 --- a/e2e/react-start/import-protection/tests/violations.utils.ts +++ b/e2e/react-start/import-protection/tests/violations.utils.ts @@ -21,6 +21,15 @@ export type Violation = { message?: string } +export type ViolationArtifact = 'build' | 'dev' | 'dev.cold' | 'dev.warm' + +export function getViolationArtifactName(artifact: ViolationArtifact): string { + const modeKey = process.env.E2E_MODE_KEY + return modeKey + ? `violations.${modeKey}.${artifact}.json` + : `violations.${artifact}.json` +} + export function stripAnsi(input: string): string { // eslint-disable-next-line no-control-regex return input.replace(/\u001b\[[0-9;]*m/g, '') diff --git a/e2e/react-start/issue-8049/package.json b/e2e/react-start/issue-8049/package.json new file mode 100644 index 0000000000..be848d434c --- /dev/null +++ b/e2e/react-start/issue-8049/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-react-start-e2e-issue-8049", + "private": true, + "type": "module", + "scripts": { + "build": "vite build && tsc --noEmit", + "dev": "vite dev --port 3000", + "dev:e2e": "vite dev", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "@tanstack/react-start": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-start/issue-8049/playwright.config.ts b/e2e/react-start/issue-8049/playwright.config.ts new file mode 100644 index 0000000000..46bfbe552e --- /dev/null +++ b/e2e/react-start/issue-8049/playwright.config.ts @@ -0,0 +1,25 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = + Number(process.env.VITE_SERVER_PORT) || Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { baseURL }, + webServer: { + command: `VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/examples/react/start-nativescript/src/routeTree.gen.ts b/e2e/react-start/issue-8049/src/routeTree.gen.ts similarity index 59% rename from examples/react/start-nativescript/src/routeTree.gen.ts rename to e2e/react-start/issue-8049/src/routeTree.gen.ts index 83570125d6..9f42873a9b 100644 --- a/examples/react/start-nativescript/src/routeTree.gen.ts +++ b/e2e/react-start/issue-8049/src/routeTree.gen.ts @@ -10,53 +10,43 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' -import { Route as SearchRouteImport } from './routes/search' -import { Route as ItemsItemIdRouteImport } from './routes/items.$itemId' +import { Route as TestRouteImport } from './routes/test' const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, } as any) -const SearchRoute = SearchRouteImport.update({ - id: '/search', - path: '/search', - getParentRoute: () => rootRouteImport, -} as any) -const ItemsItemIdRoute = ItemsItemIdRouteImport.update({ - id: '/items/$itemId', - path: '/items/$itemId', +const TestRoute = TestRouteImport.update({ + id: '/test', + path: '/test', getParentRoute: () => rootRouteImport, } as any) export interface FileRoutesByFullPath { '/': typeof IndexRoute - '/search': typeof SearchRoute - '/items/$itemId': typeof ItemsItemIdRoute + '/test': typeof TestRoute } export interface FileRoutesByTo { '/': typeof IndexRoute - '/search': typeof SearchRoute - '/items/$itemId': typeof ItemsItemIdRoute + '/test': typeof TestRoute } export interface FileRoutesById { __root__: typeof rootRouteImport '/': typeof IndexRoute - '/search': typeof SearchRoute - '/items/$itemId': typeof ItemsItemIdRoute + '/test': typeof TestRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' | '/search' | '/items/$itemId' + fullPaths: '/' | '/test' fileRoutesByTo: FileRoutesByTo - to: '/' | '/search' | '/items/$itemId' - id: '__root__' | '/' | '/search' | '/items/$itemId' + to: '/' | '/test' + id: '__root__' | '/' | '/test' fileRoutesById: FileRoutesById } export interface RootRouteChildren { IndexRoute: typeof IndexRoute - SearchRoute: typeof SearchRoute - ItemsItemIdRoute: typeof ItemsItemIdRoute + TestRoute: typeof TestRoute } declare module '@tanstack/react-router' { @@ -68,18 +58,11 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/search': { - id: '/search' - path: '/search' - fullPath: '/search' - preLoaderRoute: typeof SearchRouteImport - parentRoute: typeof rootRouteImport - } - '/items/$itemId': { - id: '/items/$itemId' - path: '/items/$itemId' - fullPath: '/items/$itemId' - preLoaderRoute: typeof ItemsItemIdRouteImport + '/test': { + id: '/test' + path: '/test' + fullPath: '/test' + preLoaderRoute: typeof TestRouteImport parentRoute: typeof rootRouteImport } } @@ -87,8 +70,7 @@ declare module '@tanstack/react-router' { const rootRouteChildren: RootRouteChildren = { IndexRoute: IndexRoute, - SearchRoute: SearchRoute, - ItemsItemIdRoute: ItemsItemIdRoute, + TestRoute: TestRoute, } export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) diff --git a/examples/react/start-nativescript/src/router.tsx b/e2e/react-start/issue-8049/src/router.tsx similarity index 66% rename from examples/react/start-nativescript/src/router.tsx rename to e2e/react-start/issue-8049/src/router.tsx index 9c4362f0d1..db215b280b 100644 --- a/examples/react/start-nativescript/src/router.tsx +++ b/e2e/react-start/issue-8049/src/router.tsx @@ -5,9 +5,10 @@ export function getRouter() { return createRouter({ routeTree, defaultPreload: 'intent', - native: { - defaultStackBehavior: 'reuse', - }, + defaultPreloadStaleTime: 0, + defaultPendingMs: 0, + defaultPendingMinMs: 0, + defaultPendingComponent: () =>
Pending
, }) } diff --git a/e2e/react-start/issue-8049/src/routes/__root.tsx b/e2e/react-start/issue-8049/src/routes/__root.tsx new file mode 100644 index 0000000000..d04f508640 --- /dev/null +++ b/e2e/react-start/issue-8049/src/routes/__root.tsx @@ -0,0 +1,37 @@ +import { + HeadContent, + Link, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import type { ReactNode } from 'react' + +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + ], + }), + shellComponent: RootDocument, +}) + +function RootDocument({ children }: { children: ReactNode }) { + return ( + + + + + +
+ + {children} +
+ + + + ) +} diff --git a/e2e/react-start/issue-8049/src/routes/index.tsx b/e2e/react-start/issue-8049/src/routes/index.tsx new file mode 100644 index 0000000000..be54bce8de --- /dev/null +++ b/e2e/react-start/issue-8049/src/routes/index.tsx @@ -0,0 +1,5 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: () =>
Home Page
, +}) diff --git a/e2e/react-start/issue-8049/src/routes/test.tsx b/e2e/react-start/issue-8049/src/routes/test.tsx new file mode 100644 index 0000000000..cca03da69f --- /dev/null +++ b/e2e/react-start/issue-8049/src/routes/test.tsx @@ -0,0 +1,5 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/test')({ + component: () =>
Test Page
, +}) diff --git a/e2e/react-start/issue-8049/tests/issue-8049.spec.ts b/e2e/react-start/issue-8049/tests/issue-8049.spec.ts new file mode 100644 index 0000000000..2560267109 --- /dev/null +++ b/e2e/react-start/issue-8049/tests/issue-8049.spec.ts @@ -0,0 +1,75 @@ +import { expect, test } from '@playwright/test' + +test('#8049: revisiting loaded split routes transitions without pending or blank paint', async ({ + page, +}) => { + await page.addInitScript(() => { + const scope = globalThis as typeof globalThis & { + __paintStates: Array + __recordPaintStates: boolean + } + scope.__paintStates = [] + scope.__recordPaintStates = false + + function recordPaintState() { + if (scope.__recordPaintStates) { + const state = document.querySelector('[data-state="home"]') + ? 'home' + : document.querySelector('[data-state="test"]') + ? 'test' + : document.querySelector('[data-state="pending"]') + ? 'pending' + : document.querySelector('[data-state="shell"]') + ? 'shell' + : 'empty' + scope.__paintStates.push(state) + } + requestAnimationFrame(recordPaintState) + } + + requestAnimationFrame(recordPaintState) + }) + await page.goto('/') + await expect(page.getByText('Home Page')).toBeVisible() + await page.waitForTimeout(1_000) + + await page.getByRole('link', { name: 'Test' }).click() + await expect(page.getByText('Test Page')).toBeVisible() + await page.getByRole('link', { name: 'Home' }).click() + await expect(page.getByText('Home Page')).toBeVisible() + + await page.evaluate( + () => + new Promise((resolve) => { + const scope = globalThis as typeof globalThis & { + __paintStates: Array + __recordPaintStates: boolean + } + scope.__paintStates = [] + scope.__recordPaintStates = true + requestAnimationFrame(() => resolve()) + }), + ) + + await page.getByRole('link', { name: 'Test' }).click() + await expect(page.getByText('Test Page')).toBeVisible() + const paintStates = await page.evaluate( + () => + new Promise>((resolve) => { + requestAnimationFrame(() => { + const scope = globalThis as typeof globalThis & { + __paintStates: Array + __recordPaintStates: boolean + } + scope.__recordPaintStates = false + resolve(scope.__paintStates) + }) + }), + ) + + expect(paintStates[0]).toBe('home') + expect(paintStates).toContain('test') + expect(paintStates).not.toContain('pending') + expect(paintStates).not.toContain('shell') + expect(paintStates).not.toContain('empty') +}) diff --git a/e2e/react-start/issue-8049/tsconfig.json b/e2e/react-start/issue-8049/tsconfig.json new file mode 100644 index 0000000000..0a82952b9a --- /dev/null +++ b/e2e/react-start/issue-8049/tsconfig.json @@ -0,0 +1,13 @@ +{ + "include": ["**/*.ts", "**/*.tsx"], + "compilerOptions": { + "strict": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "resolveJsonModule": true, + "skipLibCheck": true, + "noEmit": true + } +} diff --git a/e2e/react-start/issue-8049/vite.config.ts b/e2e/react-start/issue-8049/vite.config.ts new file mode 100644 index 0000000000..f13cf79861 --- /dev/null +++ b/e2e/react-start/issue-8049/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [tanstackStart(), viteReact()], +}) diff --git a/e2e/react-start/query-integration/package.json b/e2e/react-start/query-integration/package.json index a2a325f9c8..694289ccc2 100644 --- a/e2e/react-start/query-integration/package.json +++ b/e2e/react-start/query-integration/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/react-query": "^5.90.0", @@ -32,7 +32,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/query-integration/playwright.config.ts b/e2e/react-start/query-integration/playwright.config.ts index 4d86a1dbe7..82678ac00b 100644 --- a/e2e/react-start/query-integration/playwright.config.ts +++ b/e2e/react-start/query-integration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { derivePort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await derivePort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/react-start/response-reconciliation/.gitignore b/e2e/react-start/response-reconciliation/.gitignore new file mode 100644 index 0000000000..16187ac1de --- /dev/null +++ b/e2e/react-start/response-reconciliation/.gitignore @@ -0,0 +1,24 @@ +node_modules +package-lock.json +yarn.lock + +.DS_Store +.cache +.tanstack +.env +.vercel +.output +/build/ +/api/ +/server/build +/public/build + +# Sentry Config File +.env.sentry-build-plugin +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +/dist/ +/dist-*/ +/port-*.txt diff --git a/e2e/react-start/response-reconciliation/.prettierignore b/e2e/react-start/response-reconciliation/.prettierignore new file mode 100644 index 0000000000..40a96e8819 --- /dev/null +++ b/e2e/react-start/response-reconciliation/.prettierignore @@ -0,0 +1,4 @@ +**/build +**/public +pnpm-lock.yaml +routeTree.gen.ts diff --git a/e2e/react-start/response-reconciliation/package.json b/e2e/react-start/response-reconciliation/package.json new file mode 100644 index 0000000000..7ba0224962 --- /dev/null +++ b/e2e/react-start/response-reconciliation/package.json @@ -0,0 +1,84 @@ +{ + "name": "tanstack-react-start-e2e-response-reconciliation", + "private": true, + "sideEffects": false, + "type": "module", + "scripts": { + "dev": "pnpm dev:vite --port 3000", + "dev:e2e": "pnpm dev:vite", + "dev:vite": "vite dev", + "dev:rsbuild": "rsbuild dev", + "build": "pnpm build:vite", + "build:vite": "vite build && tsc --noEmit", + "build:rsbuild": "rsbuild build && tsc --noEmit", + "preview": "vite preview", + "start": "node server.js", + "test:e2e:local": "pnpm build && playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/react-router": "workspace:*", + "@tanstack/react-start": "workspace:*", + "react": "^19.2.3", + "react-dom": "^19.2.3" + }, + "devDependencies": { + "@playwright/test": "^1.57.0", + "@rsbuild/core": "^2.3.1", + "@rsbuild/plugin-react": "^2.0.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/node": "25.0.9", + "@types/react": "^19.2.8", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "srvx": "^1.0.0", + "typescript": "^6.0.2", + "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "parallelism": false + }, + "test:e2e--vite-ssr": { + "parallelism": false + }, + "test:e2e--vite-ssr--custom-entry": { + "parallelism": false + }, + "test:e2e--rsbuild-ssr": { + "parallelism": false + }, + "test:e2e--rsbuild-ssr--custom-entry": { + "parallelism": false + } + }, + "metadata": { + "playwrightModes": [ + { + "toolchain": "vite", + "mode": "ssr" + }, + { + "toolchain": "vite", + "mode": "ssr", + "name": "custom-entry", + "env": { + "TSS_E2E_SERVER_ENTRY": "server-entry" + } + }, + { + "toolchain": "rsbuild", + "mode": "ssr" + }, + { + "toolchain": "rsbuild", + "mode": "ssr", + "name": "custom-entry", + "env": { + "TSS_E2E_SERVER_ENTRY": "server-entry" + } + } + ] + } + } +} diff --git a/e2e/react-start/response-reconciliation/playwright.config.ts b/e2e/react-start/response-reconciliation/playwright.config.ts new file mode 100644 index 0000000000..d4c9c58f43 --- /dev/null +++ b/e2e/react-start/response-reconciliation/playwright.config.ts @@ -0,0 +1,37 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' +const distDir = process.env.E2E_DIST_DIR ?? 'dist' +const serverEntry = process.env.TSS_E2E_SERVER_ENTRY ?? '' + +export const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + use: { + baseURL, + }, + webServer: { + command: `pnpm start`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + env: { + PORT: String(PORT), + VITE_SERVER_PORT: String(PORT), + E2E_DIST_DIR: distDir, + E2E_TOOLCHAIN: toolchain, + TSS_E2E_SERVER_ENTRY: serverEntry, + }, + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-start/response-reconciliation/rsbuild.config.ts b/e2e/react-start/response-reconciliation/rsbuild.config.ts new file mode 100644 index 0000000000..38f44ef9fb --- /dev/null +++ b/e2e/react-start/response-reconciliation/rsbuild.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' + +const serverEntry = process.env.TSS_E2E_SERVER_ENTRY +const outDir = process.env.E2E_DIST_DIR ?? 'dist' + +export default defineConfig({ + plugins: [ + pluginReact(), + tanstackStart({ + server: serverEntry ? { entry: serverEntry } : undefined, + }), + ], + output: { + distPath: { + root: outDir, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/server.js b/e2e/react-start/response-reconciliation/server.js new file mode 100644 index 0000000000..324a462bec --- /dev/null +++ b/e2e/react-start/response-reconciliation/server.js @@ -0,0 +1,62 @@ +import fs from 'node:fs' +import path from 'node:path' +import { spawn } from 'node:child_process' +import { pathToFileURL } from 'node:url' + +const distDir = process.env.E2E_DIST_DIR || 'dist' + +function resolveDistClientDir() { + return path.resolve(distDir, 'client') +} + +function resolveDistServerEntryPath() { + if (process.env.TSS_E2E_SERVER_ENTRY) { + const customEntryPath = path.resolve( + distDir, + 'server', + `${process.env.TSS_E2E_SERVER_ENTRY}.js`, + ) + if (fs.existsSync(customEntryPath)) { + return customEntryPath + } + } + + const serverJsPath = path.resolve(distDir, 'server', 'server.js') + if (fs.existsSync(serverJsPath)) { + return serverJsPath + } + + const indexJsPath = path.resolve(distDir, 'server', 'index.js') + if (fs.existsSync(indexJsPath)) { + return indexJsPath + } + + return serverJsPath +} + +export function start() { + const child = spawn( + 'srvx', + ['--prod', '-s', resolveDistClientDir(), resolveDistServerEntryPath()], + { + stdio: 'inherit', + shell: process.platform === 'win32', + }, + ) + + child.on('exit', (code, signal) => { + if (signal) { + process.kill(process.pid, signal) + return + } + + process.exit(code ?? 0) + }) +} + +if ( + process.argv[1] && + import.meta.url === pathToFileURL(process.argv[1]).href +) { + start() +} diff --git a/e2e/react-start/response-reconciliation/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/response-reconciliation/src/components/DefaultCatchBoundary.tsx new file mode 100644 index 0000000000..f3d691814f --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/components/DefaultCatchBoundary.tsx @@ -0,0 +1,20 @@ +import { ErrorComponent, Link, useRouter } from '@tanstack/react-router' +import type { ErrorComponentProps } from '@tanstack/react-router' + +export function DefaultCatchBoundary({ error }: ErrorComponentProps) { + const router = useRouter() + + return ( +
+ + + Home +
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/components/NotFound.tsx b/e2e/react-start/response-reconciliation/src/components/NotFound.tsx new file mode 100644 index 0000000000..0b720f0e37 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/components/NotFound.tsx @@ -0,0 +1,10 @@ +import { Link } from '@tanstack/react-router' + +export function NotFound({ children }: { children?: React.ReactNode }) { + return ( +
+ {children ||

The page you are looking for does not exist.

} + Start Over +
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/response-wrapper.ts b/e2e/react-start/response-reconciliation/src/response-wrapper.ts new file mode 100644 index 0000000000..db9733d5e6 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/response-wrapper.ts @@ -0,0 +1,33 @@ +import { getRequestHeader } from '@tanstack/react-start/server' + +let installed = false + +/** + * Stand-in for libraries that wrap the global Response and pipe stream bodies, + * such as varlock's leak prevention: afterwards `new Response(stream).body` is + * a new stream that reads `stream`. Only requests that send + * `x-wrap-response: true` are affected. + */ +export function installResponseWrapper() { + if (installed) { + return + } + installed = true + globalThis.Response = new Proxy(globalThis.Response, { + construct(target, [body, init], newTarget) { + if (body instanceof ReadableStream && wrapsResponses()) { + body = body.pipeThrough(new TransformStream()) + } + return Reflect.construct(target, [body, init], newTarget) + }, + }) +} + +function wrapsResponses() { + try { + return getRequestHeader('x-wrap-response') === 'true' + } catch { + // Responses created outside a request are never wrapped. + return false + } +} diff --git a/e2e/react-start/response-reconciliation/src/routeTree.gen.ts b/e2e/react-start/response-reconciliation/src/routeTree.gen.ts new file mode 100644 index 0000000000..3dbb6301c3 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routeTree.gen.ts @@ -0,0 +1,625 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as ServerFunctionsRouteImport } from './routes/server-functions' +import { Route as SsrRouteImport } from './routes/ssr' +import { Route as StreamedRouteImport } from './routes/streamed' +import { Route as ApiBaseRouteImport } from './routes/api/base' +import { Route as ApiBulkHeadersRouteImport } from './routes/api/bulk-headers' +import { Route as ApiClearReturnedHeadersRouteImport } from './routes/api/clear-returned-headers' +import { Route as ApiDirectMutationVisibleRouteImport } from './routes/api/direct-mutation-visible' +import { Route as ApiExplicitSetCookieHeaderRouteImport } from './routes/api/explicit-set-cookie-header' +import { Route as ApiFramingErrorRouteImport } from './routes/api/framing-error' +import { Route as ApiGetResponseHeaderHelperRouteImport } from './routes/api/get-response-header-helper' +import { Route as ApiGetResponseHeadersHelperRouteImport } from './routes/api/get-response-headers-helper' +import { Route as ApiMultipleCookiesRouteImport } from './routes/api/multiple-cookies' +import { Route as ApiNullBodyStatusRouteImport } from './routes/api/null-body-status' +import { Route as ApiReadonlyAfterNextRouteImport } from './routes/api/readonly-after-next' +import { Route as ApiRedirectWithCookiesRouteImport } from './routes/api/redirect-with-cookies' +import { Route as ApiRemoveReturnedHeaderRouteImport } from './routes/api/remove-returned-header' +import { Route as ApiReplaceAfterDirectMutationRouteImport } from './routes/api/replace-after-direct-mutation' +import { Route as ApiReplaceExplicitSetCookieRouteImport } from './routes/api/replace-explicit-set-cookie' +import { Route as ApiRouteAfterNextRouteImport } from './routes/api/route-after-next' +import { Route as ApiRouteBeforeNextRouteImport } from './routes/api/route-before-next' +import { Route as ApiSameBoundaryConflictRouteImport } from './routes/api/same-boundary-conflict' +import { Route as ApiStatusContractsRouteImport } from './routes/api/status-contracts' +import { Route as ApiThrowAfterStatusRouteImport } from './routes/api/throw-after-status' +import { Route as ApiTrackedStreamRouteImport } from './routes/api/tracked-stream' +import { Route as ApiTrackedStreamStatusRouteImport } from './routes/api/tracked-stream-status' +import { Route as ApiTwoReturnedResponsesRouteImport } from './routes/api/two-returned-responses' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const ServerFunctionsRoute = ServerFunctionsRouteImport.update({ + id: '/server-functions', + path: '/server-functions', + getParentRoute: () => rootRouteImport, +} as any) +const SsrRoute = SsrRouteImport.update({ + id: '/ssr', + path: '/ssr', + getParentRoute: () => rootRouteImport, +} as any) +const StreamedRoute = StreamedRouteImport.update({ + id: '/streamed', + path: '/streamed', + getParentRoute: () => rootRouteImport, +} as any) +const ApiBaseRoute = ApiBaseRouteImport.update({ + id: '/api/base', + path: '/api/base', + getParentRoute: () => rootRouteImport, +} as any) +const ApiBulkHeadersRoute = ApiBulkHeadersRouteImport.update({ + id: '/api/bulk-headers', + path: '/api/bulk-headers', + getParentRoute: () => rootRouteImport, +} as any) +const ApiClearReturnedHeadersRoute = ApiClearReturnedHeadersRouteImport.update({ + id: '/api/clear-returned-headers', + path: '/api/clear-returned-headers', + getParentRoute: () => rootRouteImport, +} as any) +const ApiDirectMutationVisibleRoute = + ApiDirectMutationVisibleRouteImport.update({ + id: '/api/direct-mutation-visible', + path: '/api/direct-mutation-visible', + getParentRoute: () => rootRouteImport, + } as any) +const ApiExplicitSetCookieHeaderRoute = + ApiExplicitSetCookieHeaderRouteImport.update({ + id: '/api/explicit-set-cookie-header', + path: '/api/explicit-set-cookie-header', + getParentRoute: () => rootRouteImport, + } as any) +const ApiFramingErrorRoute = ApiFramingErrorRouteImport.update({ + id: '/api/framing-error', + path: '/api/framing-error', + getParentRoute: () => rootRouteImport, +} as any) +const ApiGetResponseHeaderHelperRoute = + ApiGetResponseHeaderHelperRouteImport.update({ + id: '/api/get-response-header-helper', + path: '/api/get-response-header-helper', + getParentRoute: () => rootRouteImport, + } as any) +const ApiGetResponseHeadersHelperRoute = + ApiGetResponseHeadersHelperRouteImport.update({ + id: '/api/get-response-headers-helper', + path: '/api/get-response-headers-helper', + getParentRoute: () => rootRouteImport, + } as any) +const ApiMultipleCookiesRoute = ApiMultipleCookiesRouteImport.update({ + id: '/api/multiple-cookies', + path: '/api/multiple-cookies', + getParentRoute: () => rootRouteImport, +} as any) +const ApiNullBodyStatusRoute = ApiNullBodyStatusRouteImport.update({ + id: '/api/null-body-status', + path: '/api/null-body-status', + getParentRoute: () => rootRouteImport, +} as any) +const ApiReadonlyAfterNextRoute = ApiReadonlyAfterNextRouteImport.update({ + id: '/api/readonly-after-next', + path: '/api/readonly-after-next', + getParentRoute: () => rootRouteImport, +} as any) +const ApiRedirectWithCookiesRoute = ApiRedirectWithCookiesRouteImport.update({ + id: '/api/redirect-with-cookies', + path: '/api/redirect-with-cookies', + getParentRoute: () => rootRouteImport, +} as any) +const ApiRemoveReturnedHeaderRoute = ApiRemoveReturnedHeaderRouteImport.update({ + id: '/api/remove-returned-header', + path: '/api/remove-returned-header', + getParentRoute: () => rootRouteImport, +} as any) +const ApiReplaceAfterDirectMutationRoute = + ApiReplaceAfterDirectMutationRouteImport.update({ + id: '/api/replace-after-direct-mutation', + path: '/api/replace-after-direct-mutation', + getParentRoute: () => rootRouteImport, + } as any) +const ApiReplaceExplicitSetCookieRoute = + ApiReplaceExplicitSetCookieRouteImport.update({ + id: '/api/replace-explicit-set-cookie', + path: '/api/replace-explicit-set-cookie', + getParentRoute: () => rootRouteImport, + } as any) +const ApiRouteAfterNextRoute = ApiRouteAfterNextRouteImport.update({ + id: '/api/route-after-next', + path: '/api/route-after-next', + getParentRoute: () => rootRouteImport, +} as any) +const ApiRouteBeforeNextRoute = ApiRouteBeforeNextRouteImport.update({ + id: '/api/route-before-next', + path: '/api/route-before-next', + getParentRoute: () => rootRouteImport, +} as any) +const ApiSameBoundaryConflictRoute = ApiSameBoundaryConflictRouteImport.update({ + id: '/api/same-boundary-conflict', + path: '/api/same-boundary-conflict', + getParentRoute: () => rootRouteImport, +} as any) +const ApiStatusContractsRoute = ApiStatusContractsRouteImport.update({ + id: '/api/status-contracts', + path: '/api/status-contracts', + getParentRoute: () => rootRouteImport, +} as any) +const ApiThrowAfterStatusRoute = ApiThrowAfterStatusRouteImport.update({ + id: '/api/throw-after-status', + path: '/api/throw-after-status', + getParentRoute: () => rootRouteImport, +} as any) +const ApiTrackedStreamRoute = ApiTrackedStreamRouteImport.update({ + id: '/api/tracked-stream', + path: '/api/tracked-stream', + getParentRoute: () => rootRouteImport, +} as any) +const ApiTrackedStreamStatusRoute = ApiTrackedStreamStatusRouteImport.update({ + id: '/api/tracked-stream-status', + path: '/api/tracked-stream-status', + getParentRoute: () => rootRouteImport, +} as any) +const ApiTwoReturnedResponsesRoute = ApiTwoReturnedResponsesRouteImport.update({ + id: '/api/two-returned-responses', + path: '/api/two-returned-responses', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/server-functions': typeof ServerFunctionsRoute + '/ssr': typeof SsrRoute + '/streamed': typeof StreamedRoute + '/api/base': typeof ApiBaseRoute + '/api/bulk-headers': typeof ApiBulkHeadersRoute + '/api/clear-returned-headers': typeof ApiClearReturnedHeadersRoute + '/api/direct-mutation-visible': typeof ApiDirectMutationVisibleRoute + '/api/explicit-set-cookie-header': typeof ApiExplicitSetCookieHeaderRoute + '/api/framing-error': typeof ApiFramingErrorRoute + '/api/get-response-header-helper': typeof ApiGetResponseHeaderHelperRoute + '/api/get-response-headers-helper': typeof ApiGetResponseHeadersHelperRoute + '/api/multiple-cookies': typeof ApiMultipleCookiesRoute + '/api/null-body-status': typeof ApiNullBodyStatusRoute + '/api/readonly-after-next': typeof ApiReadonlyAfterNextRoute + '/api/redirect-with-cookies': typeof ApiRedirectWithCookiesRoute + '/api/remove-returned-header': typeof ApiRemoveReturnedHeaderRoute + '/api/replace-after-direct-mutation': typeof ApiReplaceAfterDirectMutationRoute + '/api/replace-explicit-set-cookie': typeof ApiReplaceExplicitSetCookieRoute + '/api/route-after-next': typeof ApiRouteAfterNextRoute + '/api/route-before-next': typeof ApiRouteBeforeNextRoute + '/api/same-boundary-conflict': typeof ApiSameBoundaryConflictRoute + '/api/status-contracts': typeof ApiStatusContractsRoute + '/api/throw-after-status': typeof ApiThrowAfterStatusRoute + '/api/tracked-stream': typeof ApiTrackedStreamRoute + '/api/tracked-stream-status': typeof ApiTrackedStreamStatusRoute + '/api/two-returned-responses': typeof ApiTwoReturnedResponsesRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/server-functions': typeof ServerFunctionsRoute + '/ssr': typeof SsrRoute + '/streamed': typeof StreamedRoute + '/api/base': typeof ApiBaseRoute + '/api/bulk-headers': typeof ApiBulkHeadersRoute + '/api/clear-returned-headers': typeof ApiClearReturnedHeadersRoute + '/api/direct-mutation-visible': typeof ApiDirectMutationVisibleRoute + '/api/explicit-set-cookie-header': typeof ApiExplicitSetCookieHeaderRoute + '/api/framing-error': typeof ApiFramingErrorRoute + '/api/get-response-header-helper': typeof ApiGetResponseHeaderHelperRoute + '/api/get-response-headers-helper': typeof ApiGetResponseHeadersHelperRoute + '/api/multiple-cookies': typeof ApiMultipleCookiesRoute + '/api/null-body-status': typeof ApiNullBodyStatusRoute + '/api/readonly-after-next': typeof ApiReadonlyAfterNextRoute + '/api/redirect-with-cookies': typeof ApiRedirectWithCookiesRoute + '/api/remove-returned-header': typeof ApiRemoveReturnedHeaderRoute + '/api/replace-after-direct-mutation': typeof ApiReplaceAfterDirectMutationRoute + '/api/replace-explicit-set-cookie': typeof ApiReplaceExplicitSetCookieRoute + '/api/route-after-next': typeof ApiRouteAfterNextRoute + '/api/route-before-next': typeof ApiRouteBeforeNextRoute + '/api/same-boundary-conflict': typeof ApiSameBoundaryConflictRoute + '/api/status-contracts': typeof ApiStatusContractsRoute + '/api/throw-after-status': typeof ApiThrowAfterStatusRoute + '/api/tracked-stream': typeof ApiTrackedStreamRoute + '/api/tracked-stream-status': typeof ApiTrackedStreamStatusRoute + '/api/two-returned-responses': typeof ApiTwoReturnedResponsesRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/server-functions': typeof ServerFunctionsRoute + '/ssr': typeof SsrRoute + '/streamed': typeof StreamedRoute + '/api/base': typeof ApiBaseRoute + '/api/bulk-headers': typeof ApiBulkHeadersRoute + '/api/clear-returned-headers': typeof ApiClearReturnedHeadersRoute + '/api/direct-mutation-visible': typeof ApiDirectMutationVisibleRoute + '/api/explicit-set-cookie-header': typeof ApiExplicitSetCookieHeaderRoute + '/api/framing-error': typeof ApiFramingErrorRoute + '/api/get-response-header-helper': typeof ApiGetResponseHeaderHelperRoute + '/api/get-response-headers-helper': typeof ApiGetResponseHeadersHelperRoute + '/api/multiple-cookies': typeof ApiMultipleCookiesRoute + '/api/null-body-status': typeof ApiNullBodyStatusRoute + '/api/readonly-after-next': typeof ApiReadonlyAfterNextRoute + '/api/redirect-with-cookies': typeof ApiRedirectWithCookiesRoute + '/api/remove-returned-header': typeof ApiRemoveReturnedHeaderRoute + '/api/replace-after-direct-mutation': typeof ApiReplaceAfterDirectMutationRoute + '/api/replace-explicit-set-cookie': typeof ApiReplaceExplicitSetCookieRoute + '/api/route-after-next': typeof ApiRouteAfterNextRoute + '/api/route-before-next': typeof ApiRouteBeforeNextRoute + '/api/same-boundary-conflict': typeof ApiSameBoundaryConflictRoute + '/api/status-contracts': typeof ApiStatusContractsRoute + '/api/throw-after-status': typeof ApiThrowAfterStatusRoute + '/api/tracked-stream': typeof ApiTrackedStreamRoute + '/api/tracked-stream-status': typeof ApiTrackedStreamStatusRoute + '/api/two-returned-responses': typeof ApiTwoReturnedResponsesRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/' + | '/server-functions' + | '/ssr' + | '/streamed' + | '/api/base' + | '/api/bulk-headers' + | '/api/clear-returned-headers' + | '/api/direct-mutation-visible' + | '/api/explicit-set-cookie-header' + | '/api/framing-error' + | '/api/get-response-header-helper' + | '/api/get-response-headers-helper' + | '/api/multiple-cookies' + | '/api/null-body-status' + | '/api/readonly-after-next' + | '/api/redirect-with-cookies' + | '/api/remove-returned-header' + | '/api/replace-after-direct-mutation' + | '/api/replace-explicit-set-cookie' + | '/api/route-after-next' + | '/api/route-before-next' + | '/api/same-boundary-conflict' + | '/api/status-contracts' + | '/api/throw-after-status' + | '/api/tracked-stream' + | '/api/tracked-stream-status' + | '/api/two-returned-responses' + fileRoutesByTo: FileRoutesByTo + to: + | '/' + | '/server-functions' + | '/ssr' + | '/streamed' + | '/api/base' + | '/api/bulk-headers' + | '/api/clear-returned-headers' + | '/api/direct-mutation-visible' + | '/api/explicit-set-cookie-header' + | '/api/framing-error' + | '/api/get-response-header-helper' + | '/api/get-response-headers-helper' + | '/api/multiple-cookies' + | '/api/null-body-status' + | '/api/readonly-after-next' + | '/api/redirect-with-cookies' + | '/api/remove-returned-header' + | '/api/replace-after-direct-mutation' + | '/api/replace-explicit-set-cookie' + | '/api/route-after-next' + | '/api/route-before-next' + | '/api/same-boundary-conflict' + | '/api/status-contracts' + | '/api/throw-after-status' + | '/api/tracked-stream' + | '/api/tracked-stream-status' + | '/api/two-returned-responses' + id: + | '__root__' + | '/' + | '/server-functions' + | '/ssr' + | '/streamed' + | '/api/base' + | '/api/bulk-headers' + | '/api/clear-returned-headers' + | '/api/direct-mutation-visible' + | '/api/explicit-set-cookie-header' + | '/api/framing-error' + | '/api/get-response-header-helper' + | '/api/get-response-headers-helper' + | '/api/multiple-cookies' + | '/api/null-body-status' + | '/api/readonly-after-next' + | '/api/redirect-with-cookies' + | '/api/remove-returned-header' + | '/api/replace-after-direct-mutation' + | '/api/replace-explicit-set-cookie' + | '/api/route-after-next' + | '/api/route-before-next' + | '/api/same-boundary-conflict' + | '/api/status-contracts' + | '/api/throw-after-status' + | '/api/tracked-stream' + | '/api/tracked-stream-status' + | '/api/two-returned-responses' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + ServerFunctionsRoute: typeof ServerFunctionsRoute + SsrRoute: typeof SsrRoute + StreamedRoute: typeof StreamedRoute + ApiBaseRoute: typeof ApiBaseRoute + ApiBulkHeadersRoute: typeof ApiBulkHeadersRoute + ApiClearReturnedHeadersRoute: typeof ApiClearReturnedHeadersRoute + ApiDirectMutationVisibleRoute: typeof ApiDirectMutationVisibleRoute + ApiExplicitSetCookieHeaderRoute: typeof ApiExplicitSetCookieHeaderRoute + ApiFramingErrorRoute: typeof ApiFramingErrorRoute + ApiGetResponseHeaderHelperRoute: typeof ApiGetResponseHeaderHelperRoute + ApiGetResponseHeadersHelperRoute: typeof ApiGetResponseHeadersHelperRoute + ApiMultipleCookiesRoute: typeof ApiMultipleCookiesRoute + ApiNullBodyStatusRoute: typeof ApiNullBodyStatusRoute + ApiReadonlyAfterNextRoute: typeof ApiReadonlyAfterNextRoute + ApiRedirectWithCookiesRoute: typeof ApiRedirectWithCookiesRoute + ApiRemoveReturnedHeaderRoute: typeof ApiRemoveReturnedHeaderRoute + ApiReplaceAfterDirectMutationRoute: typeof ApiReplaceAfterDirectMutationRoute + ApiReplaceExplicitSetCookieRoute: typeof ApiReplaceExplicitSetCookieRoute + ApiRouteAfterNextRoute: typeof ApiRouteAfterNextRoute + ApiRouteBeforeNextRoute: typeof ApiRouteBeforeNextRoute + ApiSameBoundaryConflictRoute: typeof ApiSameBoundaryConflictRoute + ApiStatusContractsRoute: typeof ApiStatusContractsRoute + ApiThrowAfterStatusRoute: typeof ApiThrowAfterStatusRoute + ApiTrackedStreamRoute: typeof ApiTrackedStreamRoute + ApiTrackedStreamStatusRoute: typeof ApiTrackedStreamStatusRoute + ApiTwoReturnedResponsesRoute: typeof ApiTwoReturnedResponsesRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/server-functions': { + id: '/server-functions' + path: '/server-functions' + fullPath: '/server-functions' + preLoaderRoute: typeof ServerFunctionsRouteImport + parentRoute: typeof rootRouteImport + } + '/ssr': { + id: '/ssr' + path: '/ssr' + fullPath: '/ssr' + preLoaderRoute: typeof SsrRouteImport + parentRoute: typeof rootRouteImport + } + '/streamed': { + id: '/streamed' + path: '/streamed' + fullPath: '/streamed' + preLoaderRoute: typeof StreamedRouteImport + parentRoute: typeof rootRouteImport + } + '/api/base': { + id: '/api/base' + path: '/api/base' + fullPath: '/api/base' + preLoaderRoute: typeof ApiBaseRouteImport + parentRoute: typeof rootRouteImport + } + '/api/bulk-headers': { + id: '/api/bulk-headers' + path: '/api/bulk-headers' + fullPath: '/api/bulk-headers' + preLoaderRoute: typeof ApiBulkHeadersRouteImport + parentRoute: typeof rootRouteImport + } + '/api/clear-returned-headers': { + id: '/api/clear-returned-headers' + path: '/api/clear-returned-headers' + fullPath: '/api/clear-returned-headers' + preLoaderRoute: typeof ApiClearReturnedHeadersRouteImport + parentRoute: typeof rootRouteImport + } + '/api/direct-mutation-visible': { + id: '/api/direct-mutation-visible' + path: '/api/direct-mutation-visible' + fullPath: '/api/direct-mutation-visible' + preLoaderRoute: typeof ApiDirectMutationVisibleRouteImport + parentRoute: typeof rootRouteImport + } + '/api/explicit-set-cookie-header': { + id: '/api/explicit-set-cookie-header' + path: '/api/explicit-set-cookie-header' + fullPath: '/api/explicit-set-cookie-header' + preLoaderRoute: typeof ApiExplicitSetCookieHeaderRouteImport + parentRoute: typeof rootRouteImport + } + '/api/framing-error': { + id: '/api/framing-error' + path: '/api/framing-error' + fullPath: '/api/framing-error' + preLoaderRoute: typeof ApiFramingErrorRouteImport + parentRoute: typeof rootRouteImport + } + '/api/get-response-header-helper': { + id: '/api/get-response-header-helper' + path: '/api/get-response-header-helper' + fullPath: '/api/get-response-header-helper' + preLoaderRoute: typeof ApiGetResponseHeaderHelperRouteImport + parentRoute: typeof rootRouteImport + } + '/api/get-response-headers-helper': { + id: '/api/get-response-headers-helper' + path: '/api/get-response-headers-helper' + fullPath: '/api/get-response-headers-helper' + preLoaderRoute: typeof ApiGetResponseHeadersHelperRouteImport + parentRoute: typeof rootRouteImport + } + '/api/multiple-cookies': { + id: '/api/multiple-cookies' + path: '/api/multiple-cookies' + fullPath: '/api/multiple-cookies' + preLoaderRoute: typeof ApiMultipleCookiesRouteImport + parentRoute: typeof rootRouteImport + } + '/api/null-body-status': { + id: '/api/null-body-status' + path: '/api/null-body-status' + fullPath: '/api/null-body-status' + preLoaderRoute: typeof ApiNullBodyStatusRouteImport + parentRoute: typeof rootRouteImport + } + '/api/readonly-after-next': { + id: '/api/readonly-after-next' + path: '/api/readonly-after-next' + fullPath: '/api/readonly-after-next' + preLoaderRoute: typeof ApiReadonlyAfterNextRouteImport + parentRoute: typeof rootRouteImport + } + '/api/redirect-with-cookies': { + id: '/api/redirect-with-cookies' + path: '/api/redirect-with-cookies' + fullPath: '/api/redirect-with-cookies' + preLoaderRoute: typeof ApiRedirectWithCookiesRouteImport + parentRoute: typeof rootRouteImport + } + '/api/remove-returned-header': { + id: '/api/remove-returned-header' + path: '/api/remove-returned-header' + fullPath: '/api/remove-returned-header' + preLoaderRoute: typeof ApiRemoveReturnedHeaderRouteImport + parentRoute: typeof rootRouteImport + } + '/api/replace-after-direct-mutation': { + id: '/api/replace-after-direct-mutation' + path: '/api/replace-after-direct-mutation' + fullPath: '/api/replace-after-direct-mutation' + preLoaderRoute: typeof ApiReplaceAfterDirectMutationRouteImport + parentRoute: typeof rootRouteImport + } + '/api/replace-explicit-set-cookie': { + id: '/api/replace-explicit-set-cookie' + path: '/api/replace-explicit-set-cookie' + fullPath: '/api/replace-explicit-set-cookie' + preLoaderRoute: typeof ApiReplaceExplicitSetCookieRouteImport + parentRoute: typeof rootRouteImport + } + '/api/route-after-next': { + id: '/api/route-after-next' + path: '/api/route-after-next' + fullPath: '/api/route-after-next' + preLoaderRoute: typeof ApiRouteAfterNextRouteImport + parentRoute: typeof rootRouteImport + } + '/api/route-before-next': { + id: '/api/route-before-next' + path: '/api/route-before-next' + fullPath: '/api/route-before-next' + preLoaderRoute: typeof ApiRouteBeforeNextRouteImport + parentRoute: typeof rootRouteImport + } + '/api/same-boundary-conflict': { + id: '/api/same-boundary-conflict' + path: '/api/same-boundary-conflict' + fullPath: '/api/same-boundary-conflict' + preLoaderRoute: typeof ApiSameBoundaryConflictRouteImport + parentRoute: typeof rootRouteImport + } + '/api/status-contracts': { + id: '/api/status-contracts' + path: '/api/status-contracts' + fullPath: '/api/status-contracts' + preLoaderRoute: typeof ApiStatusContractsRouteImport + parentRoute: typeof rootRouteImport + } + '/api/throw-after-status': { + id: '/api/throw-after-status' + path: '/api/throw-after-status' + fullPath: '/api/throw-after-status' + preLoaderRoute: typeof ApiThrowAfterStatusRouteImport + parentRoute: typeof rootRouteImport + } + '/api/tracked-stream': { + id: '/api/tracked-stream' + path: '/api/tracked-stream' + fullPath: '/api/tracked-stream' + preLoaderRoute: typeof ApiTrackedStreamRouteImport + parentRoute: typeof rootRouteImport + } + '/api/tracked-stream-status': { + id: '/api/tracked-stream-status' + path: '/api/tracked-stream-status' + fullPath: '/api/tracked-stream-status' + preLoaderRoute: typeof ApiTrackedStreamStatusRouteImport + parentRoute: typeof rootRouteImport + } + '/api/two-returned-responses': { + id: '/api/two-returned-responses' + path: '/api/two-returned-responses' + fullPath: '/api/two-returned-responses' + preLoaderRoute: typeof ApiTwoReturnedResponsesRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + ServerFunctionsRoute: ServerFunctionsRoute, + SsrRoute: SsrRoute, + StreamedRoute: StreamedRoute, + ApiBaseRoute: ApiBaseRoute, + ApiBulkHeadersRoute: ApiBulkHeadersRoute, + ApiClearReturnedHeadersRoute: ApiClearReturnedHeadersRoute, + ApiDirectMutationVisibleRoute: ApiDirectMutationVisibleRoute, + ApiExplicitSetCookieHeaderRoute: ApiExplicitSetCookieHeaderRoute, + ApiFramingErrorRoute: ApiFramingErrorRoute, + ApiGetResponseHeaderHelperRoute: ApiGetResponseHeaderHelperRoute, + ApiGetResponseHeadersHelperRoute: ApiGetResponseHeadersHelperRoute, + ApiMultipleCookiesRoute: ApiMultipleCookiesRoute, + ApiNullBodyStatusRoute: ApiNullBodyStatusRoute, + ApiReadonlyAfterNextRoute: ApiReadonlyAfterNextRoute, + ApiRedirectWithCookiesRoute: ApiRedirectWithCookiesRoute, + ApiRemoveReturnedHeaderRoute: ApiRemoveReturnedHeaderRoute, + ApiReplaceAfterDirectMutationRoute: ApiReplaceAfterDirectMutationRoute, + ApiReplaceExplicitSetCookieRoute: ApiReplaceExplicitSetCookieRoute, + ApiRouteAfterNextRoute: ApiRouteAfterNextRoute, + ApiRouteBeforeNextRoute: ApiRouteBeforeNextRoute, + ApiSameBoundaryConflictRoute: ApiSameBoundaryConflictRoute, + ApiStatusContractsRoute: ApiStatusContractsRoute, + ApiThrowAfterStatusRoute: ApiThrowAfterStatusRoute, + ApiTrackedStreamRoute: ApiTrackedStreamRoute, + ApiTrackedStreamStatusRoute: ApiTrackedStreamStatusRoute, + ApiTwoReturnedResponsesRoute: ApiTwoReturnedResponsesRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { startInstance } from './start.ts' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + config: Awaited> + } +} diff --git a/e2e/react-start/response-reconciliation/src/router.tsx b/e2e/react-start/response-reconciliation/src/router.tsx new file mode 100644 index 0000000000..c5c2209e5a --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/router.tsx @@ -0,0 +1,13 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +import { DefaultCatchBoundary } from './components/DefaultCatchBoundary' +import { NotFound } from './components/NotFound' + +export function getRouter() { + return createRouter({ + routeTree, + defaultErrorComponent: DefaultCatchBoundary, + defaultNotFoundComponent: () => , + scrollRestoration: true, + }) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/__root.tsx b/e2e/react-start/response-reconciliation/src/routes/__root.tsx new file mode 100644 index 0000000000..a562991887 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/__root.tsx @@ -0,0 +1,57 @@ +/// +import * as React from 'react' +import { + HeadContent, + Link, + Outlet, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary' +import { NotFound } from '~/components/NotFound' +import '~/styles/app.css' + +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + ], + }), + errorComponent: (props) => { + return ( + + + + ) + }, + notFoundComponent: () => , + component: RootComponent, +}) + +function RootComponent() { + return ( + + + + ) +} + +function RootDocument({ children }: { children: React.ReactNode }) { + return ( + + + + + + + {children} + + + + ) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/api/-response.ts b/e2e/react-start/response-reconciliation/src/routes/api/-response.ts new file mode 100644 index 0000000000..54082c10f6 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/-response.ts @@ -0,0 +1,85 @@ +import { createMiddleware } from '@tanstack/react-start' +import { + getResponseHeader, + setResponseHeader, + setResponseStatus, +} from '@tanstack/react-start/server' + +function getScenario(request: Request) { + const url = new URL(request.url) + return url.pathname.split('/').pop() || '' +} + +export function baseResponse(scenario: string) { + return new Response(scenario, { + headers: { 'x-handler': scenario, 'x-base': 'yes' }, + }) +} + +export const routeBoundaryMiddleware = createMiddleware().server( + async ({ next, request }) => { + const scenario = getScenario(request) + + if (scenario === 'route-before-next') { + setResponseHeader('x-route-before', 'yes') + setResponseStatus(234, 'route-before') + return next() + } + + if (scenario === 'route-after-next') { + const result = await next() + setResponseHeader('x-route-after', 'yes') + setResponseStatus(233, 'route-after') + return result + } + + if (scenario === 'direct-mutation-visible') { + const result = await next() + result.response.headers.set('x-direct-visible', 'yes') + setResponseHeader( + 'x-direct-read', + getResponseHeader('x-direct-visible') || 'missing', + ) + return result + } + + if (scenario === 'replace-after-direct-mutation') { + const result = await next() + result.response.headers.set('x-direct-a', 'yes') + setResponseHeader('x-helper-delta', 'yes') + return new Response('replacement', { + status: 202, + headers: { 'x-response-b': 'yes' }, + }) + } + + if (scenario === 'two-returned-responses') { + await next() + setResponseHeader('x-helper-after-a', 'yes') + return new Response('response-b', { + headers: { 'x-response-b': 'yes' }, + }) + } + + if (scenario === 'readonly-after-next') { + const result = await next() + setResponseHeader('x-readonly-after', 'yes') + return result + } + + return next() + }, +) + +export const returnedResponseMiddleware = createMiddleware().server( + async ({ next, request }) => { + if (getScenario(request) === 'two-returned-responses') { + await next() + return new Response('response-a', { + headers: { 'x-response-a': 'yes' }, + }) + } + + return next() + }, +) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/-tracked-streams.ts b/e2e/react-start/response-reconciliation/src/routes/api/-tracked-streams.ts new file mode 100644 index 0000000000..1ccde76367 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/-tracked-streams.ts @@ -0,0 +1,2 @@ +// Ids of tracked response streams that were cancelled, kept by the server. +export const cancelledStreams = new Set() diff --git a/e2e/react-start/response-reconciliation/src/routes/api/-upstream.ts b/e2e/react-start/response-reconciliation/src/routes/api/-upstream.ts new file mode 100644 index 0000000000..0018376035 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/-upstream.ts @@ -0,0 +1,14 @@ +// An upstream reply whose headers describe its own body and client. Start must +// not copy them onto the error body it generates for this failure. +export function createUpstreamFailure() { + return new Response('

upstream

', { + status: 502, + headers: { + 'content-encoding': 'gzip', + 'content-length': '999', + 'content-type': 'text/html', + 'set-cookie': 'upstream-session=leaked; Path=/', + 'x-upstream': 'yes', + }, + }) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/api/base.ts b/e2e/react-start/response-reconciliation/src/routes/api/base.ts new file mode 100644 index 0000000000..62f706a9f1 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/base.ts @@ -0,0 +1,10 @@ +import { createFileRoute } from '@tanstack/react-router' +import { baseResponse } from './-response' + +export const Route = createFileRoute('/api/base')({ + server: { + handlers: { + GET: () => baseResponse('base'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/bulk-headers.ts b/e2e/react-start/response-reconciliation/src/routes/api/bulk-headers.ts new file mode 100644 index 0000000000..db7ded6c54 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/bulk-headers.ts @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseHeaders } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/bulk-headers')({ + server: { + handlers: { + GET: () => { + const headers = new Headers({ + 'x-bulk-one': '1', + 'x-bulk-two': '2', + }) + headers.append('set-cookie', 'bulk-one=1; Path=/') + headers.append('set-cookie', 'bulk-two=2; Path=/') + setResponseHeaders(headers) + return new Response('bulk', { headers: { 'x-keep': 'yes' } }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/clear-returned-headers.ts b/e2e/react-start/response-reconciliation/src/routes/api/clear-returned-headers.ts new file mode 100644 index 0000000000..fd3b88c172 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/clear-returned-headers.ts @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' +import { clearResponseHeaders } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/clear-returned-headers')({ + server: { + handlers: { + GET: () => { + clearResponseHeaders() + return new Response('clear', { + headers: { 'x-clear-one': '1', 'x-clear-two': '2' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/direct-mutation-visible.ts b/e2e/react-start/response-reconciliation/src/routes/api/direct-mutation-visible.ts new file mode 100644 index 0000000000..96823887e5 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/direct-mutation-visible.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { baseResponse, routeBoundaryMiddleware } from './-response' + +export const Route = createFileRoute('/api/direct-mutation-visible')({ + server: { + middleware: [routeBoundaryMiddleware], + handlers: { + GET: () => baseResponse('direct-mutation-visible'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/explicit-set-cookie-header.ts b/e2e/react-start/response-reconciliation/src/routes/api/explicit-set-cookie-header.ts new file mode 100644 index 0000000000..3ea2bc6d75 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/explicit-set-cookie-header.ts @@ -0,0 +1,16 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseHeader } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/explicit-set-cookie-header')({ + server: { + handlers: { + GET: () => { + setResponseHeader('set-cookie', [ + 'explicit-one=1; Path=/', + 'explicit-two=2; Path=/', + ]) + return new Response('explicit') + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/framing-error.ts b/e2e/react-start/response-reconciliation/src/routes/api/framing-error.ts new file mode 100644 index 0000000000..baeab15780 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/framing-error.ts @@ -0,0 +1,16 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseHeader } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/framing-error')({ + server: { + handlers: { + GET: async () => { + // Headers for a compressed file whose read then fails. + setResponseHeader('content-encoding', 'gzip') + setResponseHeader('content-length', '2') + await Promise.resolve() + throw new Error('File read failed') + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/get-response-header-helper.ts b/e2e/react-start/response-reconciliation/src/routes/api/get-response-header-helper.ts new file mode 100644 index 0000000000..b597882ff6 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/get-response-header-helper.ts @@ -0,0 +1,17 @@ +import { createFileRoute } from '@tanstack/react-router' +import { + getResponseHeader, + setResponseHeader, +} from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/get-response-header-helper')({ + server: { + handlers: { + GET: () => { + setResponseHeader('x-helper-visible', 'yes') + const value = getResponseHeader('x-helper-visible') || 'missing' + return new Response(value, { headers: { 'x-read-after-set': value } }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/get-response-headers-helper.ts b/e2e/react-start/response-reconciliation/src/routes/api/get-response-headers-helper.ts new file mode 100644 index 0000000000..168d38bad4 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/get-response-headers-helper.ts @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/react-router' +import { + getResponseHeaders, + setResponseHeader, +} from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/get-response-headers-helper')({ + server: { + handlers: { + GET: () => { + setResponseHeader('x-headers-helper-visible', 'yes') + // Exercise an untyped caller mutating its detached snapshot. + const headers = getResponseHeaders() as Headers + const value = headers.get('x-headers-helper-visible') || 'missing' + headers.set('x-headers-snapshot-write', 'ignored') + return new Response(value, { headers: { 'x-headers-read': value } }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/multiple-cookies.ts b/e2e/react-start/response-reconciliation/src/routes/api/multiple-cookies.ts new file mode 100644 index 0000000000..eebf7a167e --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/multiple-cookies.ts @@ -0,0 +1,14 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setCookie } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/multiple-cookies')({ + server: { + handlers: { + GET: () => { + setCookie('route-one', '1', { path: '/' }) + setCookie('route-two', '2', { path: '/' }) + return new Response('cookies') + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/null-body-status.ts b/e2e/react-start/response-reconciliation/src/routes/api/null-body-status.ts new file mode 100644 index 0000000000..d11056e7a8 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/null-body-status.ts @@ -0,0 +1,18 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseStatus } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/null-body-status')({ + server: { + handlers: { + GET: ({ request }) => { + const statusParam = new URL(request.url).searchParams.get('status') + const status = + statusParam === '205' ? 205 : statusParam === '304' ? 304 : 204 + setResponseStatus(status) + return new Response('should-drop', { + headers: { 'x-null-body': 'yes' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/readonly-after-next.ts b/e2e/react-start/response-reconciliation/src/routes/api/readonly-after-next.ts new file mode 100644 index 0000000000..7b42955052 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/readonly-after-next.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { routeBoundaryMiddleware } from './-response' + +export const Route = createFileRoute('/api/readonly-after-next')({ + server: { + middleware: [routeBoundaryMiddleware], + handlers: { + GET: () => fetch('data:text/plain,readonly'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/redirect-with-cookies.ts b/e2e/react-start/response-reconciliation/src/routes/api/redirect-with-cookies.ts new file mode 100644 index 0000000000..5b0072f35a --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/redirect-with-cookies.ts @@ -0,0 +1,18 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setCookie } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/redirect-with-cookies')({ + server: { + handlers: { + GET: () => { + setCookie('redirect-one', '1', { path: '/' }) + setCookie('redirect-two', '2', { path: '/' }) + setCookie('redirect-three', '3', { path: '/' }) + return new Response(null, { + status: 307, + headers: { Location: '/api/base' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/remove-returned-header.ts b/e2e/react-start/response-reconciliation/src/routes/api/remove-returned-header.ts new file mode 100644 index 0000000000..96f82bf98d --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/remove-returned-header.ts @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' +import { removeResponseHeader } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/remove-returned-header')({ + server: { + handlers: { + GET: () => { + removeResponseHeader('x-remove-me') + return new Response('remove', { + headers: { 'x-remove-me': 'response', 'x-keep': 'yes' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/replace-after-direct-mutation.ts b/e2e/react-start/response-reconciliation/src/routes/api/replace-after-direct-mutation.ts new file mode 100644 index 0000000000..890280483d --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/replace-after-direct-mutation.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { baseResponse, routeBoundaryMiddleware } from './-response' + +export const Route = createFileRoute('/api/replace-after-direct-mutation')({ + server: { + middleware: [routeBoundaryMiddleware], + handlers: { + GET: () => baseResponse('replace-after-direct-mutation'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/replace-explicit-set-cookie.ts b/e2e/react-start/response-reconciliation/src/routes/api/replace-explicit-set-cookie.ts new file mode 100644 index 0000000000..97df27d915 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/replace-explicit-set-cookie.ts @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseHeader } from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/replace-explicit-set-cookie')({ + server: { + handlers: { + GET: () => { + setResponseHeader('set-cookie', 'explicit-new=1; Path=/') + return new Response('explicit', { + headers: { 'set-cookie': 'explicit-old=1; Path=/' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/route-after-next.ts b/e2e/react-start/response-reconciliation/src/routes/api/route-after-next.ts new file mode 100644 index 0000000000..7d3650147f --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/route-after-next.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { baseResponse, routeBoundaryMiddleware } from './-response' + +export const Route = createFileRoute('/api/route-after-next')({ + server: { + middleware: [routeBoundaryMiddleware], + handlers: { + GET: () => baseResponse('route-after-next'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/route-before-next.ts b/e2e/react-start/response-reconciliation/src/routes/api/route-before-next.ts new file mode 100644 index 0000000000..b52c7642af --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/route-before-next.ts @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { baseResponse, routeBoundaryMiddleware } from './-response' + +export const Route = createFileRoute('/api/route-before-next')({ + server: { + middleware: [routeBoundaryMiddleware], + handlers: { + GET: () => baseResponse('route-before-next'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/same-boundary-conflict.ts b/e2e/react-start/response-reconciliation/src/routes/api/same-boundary-conflict.ts new file mode 100644 index 0000000000..7ac086d652 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/same-boundary-conflict.ts @@ -0,0 +1,21 @@ +import { createFileRoute } from '@tanstack/react-router' +import { + setResponseHeader, + setResponseStatus, +} from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/same-boundary-conflict')({ + server: { + handlers: { + GET: () => { + setResponseStatus(235, 'same-boundary') + setResponseHeader('x-conflict', 'helper') + return new Response('conflict', { + status: 201, + statusText: 'response-status', + headers: { 'x-conflict': 'response' }, + }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/status-contracts.ts b/e2e/react-start/response-reconciliation/src/routes/api/status-contracts.ts new file mode 100644 index 0000000000..43fd72ec07 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/status-contracts.ts @@ -0,0 +1,42 @@ +import { createFileRoute } from '@tanstack/react-router' +import { setResponseStatus } from '@tanstack/react-start/server' +import { createUpstreamFailure } from './-upstream' + +export const Route = createFileRoute('/api/status-contracts')({ + server: { + handlers: { + GET: async ({ request }) => { + const scenario = new URL(request.url).searchParams.get('scenario') + + if (scenario === 'invalid-status-return') { + setResponseStatus(999, 'Ignored') + return new Response('missing', { + status: 404, + statusText: 'Not Found', + }) + } + + if (scenario === 'invalid-status-throw') { + setResponseStatus(101) + throw new Error('Unexpected status contract failure') + } + + if (scenario === 'slow') { + await new Promise((resolve) => setTimeout(resolve, 150)) + return new Response('slow result') + } + + if (scenario === 'helper-success-crash') { + setResponseStatus(201, 'Created') + throw new Error('Crash after a success status') + } + + if (scenario === 'upstream-error-cause') { + throw new Error('Upstream failed', { cause: createUpstreamFailure() }) + } + + return new Response(`Unknown scenario: ${scenario}`, { status: 400 }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/throw-after-status.ts b/e2e/react-start/response-reconciliation/src/routes/api/throw-after-status.ts new file mode 100644 index 0000000000..9d93d75b61 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/throw-after-status.ts @@ -0,0 +1,26 @@ +import { createFileRoute } from '@tanstack/react-router' +import { + setCookie, + setResponseHeader, + setResponseStatus, +} from '@tanstack/react-start/server' + +export const Route = createFileRoute('/api/throw-after-status')({ + server: { + handlers: { + GET: ({ request }) => { + const url = new URL(request.url) + setResponseStatus(401, 'Unauthorized') + setResponseHeader('x-error-helper', 'yes') + setCookie('throw-after-status', '1', { path: '/' }) + if (url.searchParams.get('throw') === 'response') { + throw new Response('Unauthorized response', { + status: 200, + headers: { 'x-thrown-response': 'yes' }, + }) + } + throw new Error('Unauthorized route') + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream-status.ts b/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream-status.ts new file mode 100644 index 0000000000..1aaffd8d36 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream-status.ts @@ -0,0 +1,13 @@ +import { createFileRoute } from '@tanstack/react-router' +import { cancelledStreams } from './-tracked-streams' + +export const Route = createFileRoute('/api/tracked-stream-status')({ + server: { + handlers: { + GET: ({ request }) => { + const id = new URL(request.url).searchParams.get('id') ?? '' + return Response.json({ cancelled: cancelledStreams.has(id) }) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream.ts b/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream.ts new file mode 100644 index 0000000000..640074a035 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/tracked-stream.ts @@ -0,0 +1,23 @@ +import { createFileRoute } from '@tanstack/react-router' +import { cancelledStreams } from './-tracked-streams' + +export const Route = createFileRoute('/api/tracked-stream')({ + server: { + handlers: { + // A body that never ends, like a live feed. Only cancellation stops it. + GET: ({ request }) => { + const id = new URL(request.url).searchParams.get('id') ?? '' + return new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('tracked')) + }, + cancel() { + cancelledStreams.add(id) + }, + }), + ) + }, + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/api/two-returned-responses.ts b/e2e/react-start/response-reconciliation/src/routes/api/two-returned-responses.ts new file mode 100644 index 0000000000..f433778fd8 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/api/two-returned-responses.ts @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' +import { + baseResponse, + returnedResponseMiddleware, + routeBoundaryMiddleware, +} from './-response' + +export const Route = createFileRoute('/api/two-returned-responses')({ + server: { + middleware: [routeBoundaryMiddleware, returnedResponseMiddleware], + handlers: { + GET: () => baseResponse('two-returned-responses'), + }, + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/routes/index.tsx b/e2e/react-start/response-reconciliation/src/routes/index.tsx new file mode 100644 index 0000000000..ab938397e9 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/index.tsx @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + headers: () => ({ 'x-route-header': 'present' }), + component: Home, +}) + +function Home() { + return ( +
+

Response Reconciliation E2E

+

This app contains HTTP-level regression tests.

+
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/server-functions.tsx b/e2e/react-start/response-reconciliation/src/routes/server-functions.tsx new file mode 100644 index 0000000000..580309b31e --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/server-functions.tsx @@ -0,0 +1,285 @@ +import { ClientOnly, createFileRoute, redirect } from '@tanstack/react-router' +import { + createMiddleware, + createServerFn, + useServerFn, +} from '@tanstack/react-start' +import * as React from 'react' +import { + getResponseHeader, + setCookie, + setResponseHeader, + setResponseHeaders, + setResponseStatus, +} from '@tanstack/react-start/server' + +const functionAfterNextMiddleware = createMiddleware({ + type: 'function', +}).server(async ({ next }) => { + const result = await next() + setResponseHeader('x-function-after', 'yes') + setResponseStatus(236, 'function-after') + return result +}) + +const rawResponseAfterNextMiddleware = createMiddleware({ + type: 'function', +}).server(async ({ next }) => { + const result = await next() + setResponseHeader('x-function-raw-after', 'yes') + setResponseStatus(237, 'function-raw-after') + return result +}) + +const throwStatusMiddleware = createMiddleware({ + type: 'function', +}).server(() => { + setResponseStatus(401, 'Unauthorized') + setResponseHeader('x-function-error-middleware', 'yes') + throw new Error('Unauthorized function middleware') +}) + +const replacementMiddleware = createMiddleware({ + type: 'function', +}).server(async ({ next }) => { + const result = await next() + const resultWithResponse = result as typeof result & { result?: unknown } + if (!(resultWithResponse.result instanceof Response)) { + throw new Error('Expected replacement test to observe a Response') + } + resultWithResponse.result.headers.set('x-function-a', 'yes') + setResponseHeader('x-function-helper-delta', 'yes') + // Function middleware types don't model raw Response replacement, but the + // middleware executor supports it; this fixture deliberately exercises that + // runtime path. + return new Response('function-b', { + headers: { 'x-function-b': 'yes' }, + }) as never +}) + +const globalSerializedFn = createServerFn().handler(() => { + return { ok: true } +}) + +const functionAfterNextFn = createServerFn() + .middleware([functionAfterNextMiddleware]) + .handler(() => { + return { ok: true } + }) + +const rawResponseAfterNextFn = createServerFn() + .middleware([rawResponseAfterNextMiddleware]) + .handler(() => { + return new Response('raw function body', { + headers: { 'x-function-raw': 'yes' }, + }) + }) + +const replacementFn = createServerFn() + .middleware([replacementMiddleware]) + .handler(() => { + return new Response('function-a') + }) + +const multipleCookiesFn = createServerFn().handler(() => { + setCookie('fn-one', '1', { path: '/' }) + setCookie('fn-two', '2', { path: '/' }) + return { ok: true } +}) + +const rawMultipleCookiesFn = createServerFn().handler(() => { + setCookie('fn-raw-helper-one', '1', { path: '/' }) + setCookie('fn-raw-helper-two', '2', { path: '/' }) + const headers = new Headers() + headers.append('set-cookie', 'fn-raw-returned-one=1; Path=/') + headers.append('set-cookie', 'fn-raw-returned-two=2; Path=/') + return new Response('raw cookie body', { headers }) +}) + +const explicitCookieHeaderFn = createServerFn().handler(() => { + setResponseHeader('set-cookie', [ + 'fn-explicit-one=1; Path=/', + 'fn-explicit-two=2; Path=/', + ]) + return { ok: true } +}) + +const throwAfterStatusFn = createServerFn().handler(() => { + setResponseStatus(401, 'Unauthorized') + setResponseHeader('x-function-error', 'yes') + throw new Error('Unauthorized function') +}) + +const throwAfterFramingFn = createServerFn().handler(async () => { + // Headers for a compressed file whose read then fails. + setResponseHeader('content-encoding', 'gzip') + setResponseHeader('content-length', '2') + await Promise.resolve() + throw new Error('File read failed') +}) + +const throwAfterMiddlewareStatusFn = createServerFn() + .middleware([throwStatusMiddleware]) + .handler(() => { + return { ok: true } + }) + +const transportProtectedFn = createServerFn().handler(() => { + setResponseHeaders( + new Headers({ + 'content-type': 'text/plain', + 'x-tss-serialized': 'false', + 'x-user-header': 'yes', + }), + ) + return { ok: true } +}) + +const readAfterSetFn = createServerFn().handler(() => { + setResponseHeader('x-read-after-set', 'yes') + setResponseHeader( + 'x-read-after-set-value', + getResponseHeader('x-read-after-set') || 'missing', + ) + return { ok: true } +}) + +const returnRedirectFn = createServerFn().handler(() => { + setResponseStatus(302, 'Continue') + setResponseHeaders( + new Headers({ + 'content-type': 'text/plain', + 'x-tss-raw': 'true', + 'x-tss-serialized': 'true', + location: '/middleware-target', + }), + ) + setCookie('rpc-redirect', 'committed', { path: '/' }) + return redirect({ to: '/' }) +}) + +const throwRedirectFn = createServerFn().handler(() => { + setResponseStatus(302, 'Continue') + setResponseHeaders( + new Headers({ + 'content-type': 'text/plain', + 'x-tss-raw': 'true', + 'x-tss-serialized': 'true', + location: '/middleware-target', + }), + ) + setCookie('rpc-redirect', 'committed', { path: '/' }) + throw redirect({ to: '/' }) +}) + +const bodylessStatusFn = createServerFn().handler(() => { + setResponseStatus(204, 'No Content') + setResponseHeader('x-bodyless-status', 'ignored') + return { ok: true } +}) + +const throwZeroFn = createServerFn().handler(() => { + throw 0 +}) + +const throwResponseFn = createServerFn().handler(() => { + throw new Response('teapot', { status: 418 }) +}) + +const helperLocationFn = createServerFn().handler(() => { + setResponseStatus(302) + setResponseHeader('location', '/api/base') + return { ok: true } +}) + +export const Route = createFileRoute('/server-functions')({ + component: ServerFunctions, +}) + +function ServerFunctions() { + return ( +
+

Server Functions

+ + + + + + + + + + + + + + + + + + + + +
+ ) +} + +function ServerFunctionButton({ + name, + fn, +}: { + name: string + fn: (...args: Array) => Promise +}) { + const serverFn = useServerFn(fn) + const [result, setResult] = React.useState('idle') + + return ( +
+ + {result} +
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/ssr.tsx b/e2e/react-start/response-reconciliation/src/routes/ssr.tsx new file mode 100644 index 0000000000..c0cb69c8ec --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/ssr.tsx @@ -0,0 +1,29 @@ +import { createFileRoute } from '@tanstack/react-router' +import { createServerFn } from '@tanstack/react-start' +import { + setCookie, + setResponseHeader, + setResponseStatus, +} from '@tanstack/react-start/server' + +const setSsrResponseFn = createServerFn().handler(() => { + setResponseStatus(238, 'ssr-loader') + setResponseHeader('x-ssr-loader', 'yes') + setCookie('ssr-one', '1', { path: '/' }) + setCookie('ssr-two', '2', { path: '/' }) + return { message: 'ssr response' } +}) + +export const Route = createFileRoute('/ssr')({ + loader: () => setSsrResponseFn(), + component: SsrRoute, +}) + +function SsrRoute() { + const data = Route.useLoaderData() + return ( +
+

{data.message}

+
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/routes/streamed.tsx b/e2e/react-start/response-reconciliation/src/routes/streamed.tsx new file mode 100644 index 0000000000..8d6a6227cd --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/routes/streamed.tsx @@ -0,0 +1,25 @@ +import { Await, createFileRoute } from '@tanstack/react-router' +import { Suspense } from 'react' + +export const Route = createFileRoute('/streamed')({ + loader: () => ({ + deferred: new Promise((resolve) => + setTimeout(() => resolve('streamed after the shell'), 100), + ), + }), + component: StreamedRoute, +}) + +function StreamedRoute() { + const { deferred } = Route.useLoaderData() + return ( +
+

Streamed document

+ loading

}> + + {(value) =>

{value}

} +
+
+
+ ) +} diff --git a/e2e/react-start/response-reconciliation/src/server-entry.ts b/e2e/react-start/response-reconciliation/src/server-entry.ts new file mode 100644 index 0000000000..cbee8ad31a --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/server-entry.ts @@ -0,0 +1,84 @@ +import { + createStartHandler, + defaultStreamHandler, + getResponseStatus, + handleStartError, +} from '@tanstack/react-start/server' +import handler, { createServerEntry } from '@tanstack/react-start/server-entry' + +const uncaughtFetch = createStartHandler(defaultStreamHandler) + +// Reproduce #7647's custom stream handler that preserves middleware status. +const preserveStatusFetch = createStartHandler(async (ctx) => { + const result = await defaultStreamHandler(ctx) + const response = result instanceof Response ? result : result.response + const status = getResponseStatus() + if (status === response.status) { + return result + } + + const headers = new Headers(response.headers) + headers.set('x-stream-response-rebuilt', 'yes') + const replacement = new Response(response.body, { + status, + statusText: response.statusText, + headers, + }) + return result instanceof Response + ? replacement + : { ...result, response: replacement } +}) + +function markCustomServerEntry(response: Response): Response { + try { + response.headers.set('x-custom-server-entry', 'yes') + return response + } catch { + const headers = new Headers(response.headers) + headers.set('x-custom-server-entry', 'yes') + return new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers, + }) + } +} + +export default createServerEntry({ + async fetch(request, opts) { + if (request.headers.get('x-reconciliation-scenario') === 'issue-7647') { + return markCustomServerEntry(await preserveStatusFetch(request, opts)) + } + + if (request.headers.get('x-custom-handle-errors') === 'false') { + try { + return markCustomServerEntry(await uncaughtFetch(request, opts)) + } catch (error) { + if (request.headers.get('x-custom-handle-start-error') === 'true') { + return markCustomServerEntry(handleStartError(error)) + } + return markCustomServerEntry( + new Response(error instanceof Error ? error.message : 'error', { + status: 555, + headers: { + 'x-custom-entry-catch': 'yes', + }, + }), + ) + } + } + + try { + return markCustomServerEntry(await handler.fetch(request, opts)) + } catch (error) { + return markCustomServerEntry( + new Response(error instanceof Error ? error.message : 'error', { + status: 556, + headers: { + 'x-custom-entry-catch': 'unexpected', + }, + }), + ) + } + }, +}) diff --git a/e2e/react-start/response-reconciliation/src/start.ts b/e2e/react-start/response-reconciliation/src/start.ts new file mode 100644 index 0000000000..2ac158b799 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/start.ts @@ -0,0 +1,170 @@ +import { createMiddleware, createStart } from '@tanstack/react-start' +import { + clearResponseHeaders, + setCookie, + getCookie, + setResponseHeader, + setResponseHeaders, + setResponseStatus, +} from '@tanstack/react-start/server' +import { createUpstreamFailure } from './routes/api/-upstream' +import { installResponseWrapper } from './response-wrapper' + +const globalResponseMiddleware = createMiddleware().server( + async ({ next, request }) => { + if (request.headers.get('x-wrap-response') === 'true') { + installResponseWrapper() + } + + const scenario = + request.headers.get('x-reconciliation-scenario') || + getCookie('reconciliation-scenario') + + if (scenario === 'issue-7647') { + setResponseStatus(418) + setResponseHeader('x-middleware-header', 'present') + setResponseHeader('cache-control', 'no-store') + return next() + } + + if (scenario === 'global-before') { + setResponseHeaders( + new Headers({ + 'x-global-before': 'yes', + 'x-global-common': 'before', + }), + ) + setResponseStatus(231, 'global-before') + return next() + } + + if (scenario === 'global-after') { + const result = await next() + setResponseHeader('x-global-after', 'yes') + setResponseHeader('x-global-common', 'after') + setResponseStatus(232, 'global-after') + return result + } + + if (scenario === 'global-multiple-cookies') { + setCookie('global-one', '1', { path: '/' }) + setCookie('global-two', '2', { path: '/' }) + return next() + } + + if (scenario === 'global-upstream-cause') { + throw new Error('Upstream failed', { cause: createUpstreamFailure() }) + } + + if (scenario === 'global-location-error') { + throw Object.assign(new Error('Moved error'), { + status: 302, + headers: { location: '/api/base' }, + }) + } + + if (scenario === 'global-same-body-wrapper') { + const result = await next() + const wrapped = new Response(result.response.body, result.response) + clearResponseHeaders() + setResponseHeader('x-same-body-wrapper', 'yes') + return { ...result, response: wrapped } + } + + if (scenario === 'global-copy') { + // Session middleware copies the response to add a header (#8627). + const result = await next() + const headers = new Headers(result.response.headers) + headers.set('x-global-copy', 'yes') + return { + ...result, + response: new Response(result.response.body, { + status: result.response.status, + statusText: result.response.statusText, + headers, + }), + } + } + + if (scenario === 'global-piped-copy') { + const result = await next() + const response = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + response.headers.set('x-global-piped-copy', 'yes') + return { ...result, response } + } + + if (scenario === 'global-representation') { + // Representation metadata computed from the body, as by ETag middleware. + const result = await next() + const body = await result.response.text() + const response = new Response(body, result.response) + response.headers.set('x-body-length', String(body.length)) + return { ...result, response } + } + + if (scenario === 'global-assigned-transform-not-modified') { + // Transform the body in place, then answer an ETag match instead. + const result = await next() + result.response = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + return new Response(null, { status: 304 }) + } + + if (scenario === 'global-timeout') { + // Keep working after next() while the handler the inner timeout + // abandoned is still running. + const result = await next() + await sleep(400) + return result + } + + if (scenario === 'global-throw') { + setResponseStatus(401, 'Unauthorized') + setResponseHeader('x-global-error', 'yes') + throw new Error('Unauthorized global middleware') + } + + if (scenario === 'global-throw-string') { + throw 'global string' + } + + if (scenario === 'global-throw-response') { + throw Response.json({ denied: true }, { status: 403 }) + } + + return next() + }, +) + +const sleep = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)) + +const globalTimeoutMiddleware = createMiddleware().server( + ({ next, request }) => { + const scenario = + request.headers.get('x-reconciliation-scenario') || + getCookie('reconciliation-scenario') + if (scenario !== 'global-timeout') { + return next() + } + return Promise.race([ + next(), + sleep(50).then( + () => + new Response('timeout', { + status: 504, + headers: { 'x-timeout-fallback': 'yes' }, + }), + ), + ]) + }, +) + +export const startInstance = createStart(() => ({ + requestMiddleware: [globalResponseMiddleware, globalTimeoutMiddleware], +})) diff --git a/e2e/react-start/response-reconciliation/src/styles/app.css b/e2e/react-start/response-reconciliation/src/styles/app.css new file mode 100644 index 0000000000..a38fb439a6 --- /dev/null +++ b/e2e/react-start/response-reconciliation/src/styles/app.css @@ -0,0 +1,12 @@ +html { + color-scheme: light dark; + font-family: system-ui, sans-serif; +} + +body { + margin: 0; +} + +main { + padding: 16px; +} diff --git a/e2e/react-start/response-reconciliation/tests/response-reconciliation.spec.ts b/e2e/react-start/response-reconciliation/tests/response-reconciliation.spec.ts new file mode 100644 index 0000000000..728b0782c5 --- /dev/null +++ b/e2e/react-start/response-reconciliation/tests/response-reconciliation.spec.ts @@ -0,0 +1,1038 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' +import type { APIResponse, Page, Response } from '@playwright/test' + +type TestResponse = APIResponse | Response + +function header(response: TestResponse, name: string) { + return response.headers()[name.toLowerCase()] ?? null +} + +async function setCookieValues(response: TestResponse) { + return (await Promise.resolve(response.headersArray())) + .filter((item) => item.name.toLowerCase() === 'set-cookie') + .map((item) => item.value) +} + +function expectCookie(cookies: Array, name: string, value: string) { + expect( + cookies.filter((cookie) => cookie.startsWith(`${name}=${value};`)), + ).toHaveLength(1) +} + +async function invokeServerFunction( + page: Page, + name: string, + scenario?: string, +) { + await page.goto( + scenario + ? `/server-functions?scenario=${encodeURIComponent(scenario)}` + : '/server-functions', + ) + await expect(page.getByTestId('server-functions-hydrated')).toBeAttached() + await page.evaluate((value) => { + document.cookie = value + ? `reconciliation-scenario=${value}; Path=/` + : 'reconciliation-scenario=; Max-Age=0; Path=/' + }, scenario) + const responsePromise = page.waitForResponse((response) => + response.url().includes('/_serverFn/'), + ) + await page.getByTestId(`server-function-${name}`).click() + const response = await responsePromise + await expect( + page.getByTestId(`server-function-${name}-result`), + ).not.toHaveText('pending') + return response +} + +async function invokeJsonServerFunction( + page: Page, + name: string, + scenario?: string, +) { + const response = await invokeServerFunction(page, name, scenario) + const request = response.request() + expect(request.headers()['x-tsr-serverfn']).toBe('true') + const postData = request.postData() + if (postData) { + expect(postData).not.toContain('x-reconciliation-scenario') + } + return response +} + +async function expectServerFunctionResult( + page: Page, + name: string, + result: string | RegExp, +) { + await expect(page.getByTestId(`server-function-${name}-result`)).toHaveText( + result, + ) +} + +test.describe('server routes', () => { + test('uses expected server entry mode', async ({ request }) => { + const response = await request.get('/api/base') + + if (process.env.TSS_E2E_SERVER_ENTRY) { + expect(header(response, 'x-custom-server-entry')).toBe('yes') + } else { + expect(header(response, 'x-custom-server-entry')).toBe(null) + } + }) + + test('global request middleware cookies are preserved on server routes', async ({ + request, + }) => { + const response = await request.get('/api/base', { + headers: { 'x-reconciliation-scenario': 'global-multiple-cookies' }, + }) + const cookies = await setCookieValues(response) + + expectCookie(cookies, 'global-one', '1') + expectCookie(cookies, 'global-two', '2') + }) + + test('regression #5407: global middleware setResponseHeaders and status apply before next', async ({ + request, + }) => { + const response = await request.get('/api/base', { + headers: { 'x-reconciliation-scenario': 'global-before' }, + }) + + expect(response.status()).toBe(231) + expect(response.statusText()).toBe('global-before') + expect(header(response, 'x-global-before')).toBe('yes') + expect(header(response, 'x-global-common')).toBe('before') + expect(header(response, 'x-base')).toBe('yes') + }) + + test('global middleware helper changes apply after next', async ({ + request, + }) => { + const response = await request.get('/api/base', { + headers: { 'x-reconciliation-scenario': 'global-after' }, + }) + + expect(response.status()).toBe(232) + expect(response.statusText()).toBe('global-after') + expect(header(response, 'x-global-after')).toBe('yes') + expect(header(response, 'x-global-common')).toBe('after') + expect(header(response, 'x-base')).toBe('yes') + }) + + test('route middleware helper changes apply before and after next', async ({ + request, + }) => { + const before = await request.get('/api/route-before-next') + expect(before.status()).toBe(234) + expect(before.statusText()).toBe('route-before') + expect(header(before, 'x-route-before')).toBe('yes') + expect(header(before, 'x-handler')).toBe('route-before-next') + + const after = await request.get('/api/route-after-next') + expect(after.status()).toBe(233) + expect(after.statusText()).toBe('route-after') + expect(header(after, 'x-route-after')).toBe('yes') + expect(header(after, 'x-handler')).toBe('route-after-next') + }) + + test('helper changes overlay same-boundary returned response conflicts', async ({ + request, + }) => { + const response = await request.get('/api/same-boundary-conflict') + + expect(response.status()).toBe(235) + expect(response.statusText()).toBe('same-boundary') + expect(header(response, 'x-conflict')).toBe('helper') + await expect(response.text()).resolves.toBe('conflict') + }) + + test('setResponseHeaders accepts Headers and preserves multiple cookies', async ({ + request, + }) => { + const response = await request.get('/api/bulk-headers') + const cookies = await setCookieValues(response) + + expect(header(response, 'x-bulk-one')).toBe('1') + expect(header(response, 'x-bulk-two')).toBe('2') + expect(header(response, 'x-keep')).toBe('yes') + expectCookie(cookies, 'bulk-one', '1') + expectCookie(cookies, 'bulk-two', '2') + }) + + test('remove and clear helpers can remove returned response headers', async ({ + request, + }) => { + const removed = await request.get('/api/remove-returned-header') + expect(header(removed, 'x-remove-me')).toBe(null) + expect(header(removed, 'x-keep')).toBe('yes') + + const cleared = await request.get('/api/clear-returned-headers') + expect(header(cleared, 'x-clear-one')).toBe(null) + expect(header(cleared, 'x-clear-two')).toBe(null) + }) + + test('getResponseHeader and getResponseHeaders read helper writes immediately', async ({ + request, + }) => { + const headerResponse = await request.get('/api/get-response-header-helper') + expect(header(headerResponse, 'x-read-after-set')).toBe('yes') + await expect(headerResponse.text()).resolves.toBe('yes') + + const headersResponse = await request.get( + '/api/get-response-headers-helper', + ) + expect(header(headersResponse, 'x-headers-read')).toBe('yes') + expect(header(headersResponse, 'x-headers-snapshot-write')).toBe(null) + await expect(headersResponse.text()).resolves.toBe('yes') + }) + + test('getResponseHeader sees direct current response header mutation', async ({ + request, + }) => { + const response = await request.get('/api/direct-mutation-visible') + + expect(header(response, 'x-direct-visible')).toBe('yes') + expect(header(response, 'x-direct-read')).toBe('yes') + }) + + test('response replacement carries helper deltas but not old response mutations', async ({ + request, + }) => { + const response = await request.get('/api/replace-after-direct-mutation') + + expect(response.status()).toBe(202) + expect(header(response, 'x-direct-a')).toBe(null) + expect(header(response, 'x-helper-delta')).toBe('yes') + expect(header(response, 'x-response-b')).toBe('yes') + await expect(response.text()).resolves.toBe('replacement') + }) + + test('later returned response replaces earlier response metadata', async ({ + request, + }) => { + const response = await request.get('/api/two-returned-responses') + + expect(header(response, 'x-response-a')).toBe(null) + expect(header(response, 'x-response-b')).toBe('yes') + expect(header(response, 'x-helper-after-a')).toBe('yes') + await expect(response.text()).resolves.toBe('response-b') + }) + + test('readonly responses reconcile through clone fallback', async ({ + request, + }) => { + const response = await request.get('/api/readonly-after-next') + + expect(header(response, 'x-readonly-after')).toBe('yes') + await expect(response.text()).resolves.toBe('readonly') + }) + + for (const status of [204, 205, 304]) { + test(`null-body status ${status} drops the response body`, async ({ + request, + }) => { + const response = await request.get( + `/api/null-body-status?status=${status}`, + ) + + expect(response.status()).toBe(status) + expect(header(response, 'x-null-body')).toBe('yes') + await expect(response.text()).resolves.toBe('') + }) + } + + test('out-of-range setResponseStatus keeps the returned status', async ({ + request, + }) => { + const response = await request.get( + '/api/status-contracts?scenario=invalid-status-return', + ) + + expect(response.status()).toBe(404) + expect(response.statusText()).toBe('Not Found') + await expect(response.text()).resolves.toBe('missing') + }) + + test('out-of-range setResponseStatus keeps the uncaught error status', async ({ + request, + }) => { + const response = await request.get( + '/api/status-contracts?scenario=invalid-status-throw', + ) + + expect(response.status()).toBe(500) + await expect(response.json()).resolves.toMatchObject({ + status: 500, + unhandled: true, + }) + }) + + test('a timeout fallback survives the handler it abandoned while an outer middleware awaits', async ({ + request, + }) => { + const response = await request.get('/api/status-contracts?scenario=slow', { + headers: { 'x-reconciliation-scenario': 'global-timeout' }, + }) + + expect(response.status()).toBe(504) + expect(header(response, 'x-timeout-fallback')).toBe('yes') + await expect(response.text()).resolves.toBe('timeout') + }) + + test('a helper success status does not hide an uncaught error', async ({ + request, + }) => { + const response = await request.get( + '/api/status-contracts?scenario=helper-success-crash', + ) + + expect(response.status()).toBe(500) + await expect(response.json()).resolves.toMatchObject({ + status: 500, + unhandled: true, + }) + }) + + test('errors caused by an upstream response adopt only its status', async ({ + request, + }) => { + const response = await request.get( + '/api/status-contracts?scenario=upstream-error-cause', + ) + const body = await response.body() + + expect(response.status()).toBe(502) + expect(header(response, 'x-upstream')).toBeNull() + expect(header(response, 'content-type')).toContain('application/json') + expect(header(response, 'content-encoding')).toBeNull() + const contentLength = header(response, 'content-length') + if (contentLength !== null) { + expect(Number(contentLength)).toBe(body.byteLength) + } + expect(await setCookieValues(response)).toEqual([]) + expect(JSON.parse(body.toString())).toMatchObject({ status: 502 }) + }) + + test('regression #5107: thrown errors preserve explicit response status and headers', async ({ + request, + }) => { + const response = await request.get('/api/throw-after-status') + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-error-helper')).toBe('yes') + expect(header(response, 'content-type')).toContain('application/json') + if (process.env.TSS_E2E_SERVER_ENTRY) { + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe(null) + } + await expect(response.json()).resolves.toMatchObject({ status: 401 }) + }) + + test('thrown responses preserve explicit response status and headers', async ({ + request, + }) => { + const response = await request.get('/api/throw-after-status?throw=response') + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-error-helper')).toBe('yes') + expect(header(response, 'x-thrown-response')).toBe('yes') + if (process.env.TSS_E2E_SERVER_ENTRY) { + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe(null) + } + await expect(response.text()).resolves.toBe('Unauthorized response') + }) + + test('custom server entry can opt out of automatic error responses', async ({ + request, + }) => { + test.skip(!process.env.TSS_E2E_SERVER_ENTRY, 'custom server entry only') + + const response = await request.get('/api/throw-after-status', { + headers: { 'x-custom-handle-errors': 'false' }, + }) + + expect(response.status()).toBe(555) + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe('yes') + await expect(response.text()).resolves.toBe('Unauthorized route') + }) + + test('custom server entry can recover Start error response state', async ({ + request, + }) => { + test.skip(!process.env.TSS_E2E_SERVER_ENTRY, 'custom server entry only') + + const response = await request.get('/api/throw-after-status', { + headers: { + 'x-custom-handle-errors': 'false', + 'x-custom-handle-start-error': 'true', + }, + }) + const cookies = await setCookieValues(response) + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-error-helper')).toBe('yes') + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe(null) + expectCookie(cookies, 'throw-after-status', '1') + await expect(response.json()).resolves.toMatchObject({ status: 401 }) + }) + + test('custom server entry can recover thrown response state', async ({ + request, + }) => { + test.skip(!process.env.TSS_E2E_SERVER_ENTRY, 'custom server entry only') + + const response = await request.get( + '/api/throw-after-status?throw=response', + { + headers: { + 'x-custom-handle-errors': 'false', + 'x-custom-handle-start-error': 'true', + }, + }, + ) + const cookies = await setCookieValues(response) + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-error-helper')).toBe('yes') + expect(header(response, 'x-thrown-response')).toBe('yes') + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe(null) + expectCookie(cookies, 'throw-after-status', '1') + await expect(response.text()).resolves.toBe('Unauthorized response') + }) + + test('custom server entry can opt out of SSR request middleware error responses', async ({ + request, + }) => { + test.skip(!process.env.TSS_E2E_SERVER_ENTRY, 'custom server entry only') + + const response = await request.get('/ssr', { + headers: { + 'x-custom-handle-errors': 'false', + 'x-reconciliation-scenario': 'global-throw', + }, + }) + + expect(response.status()).toBe(555) + expect(header(response, 'x-custom-server-entry')).toBe('yes') + expect(header(response, 'x-custom-entry-catch')).toBe('yes') + await expect(response.text()).resolves.toBe( + 'Unauthorized global middleware', + ) + }) + + test('regression #5464: multiple Set-Cookie headers are preserved', async ({ + request, + }) => { + const response = await request.get('/api/multiple-cookies') + const cookies = await setCookieValues(response) + + expectCookie(cookies, 'route-one', '1') + expectCookie(cookies, 'route-two', '2') + }) + + test('explicit Set-Cookie header values are preserved and replace response values', async ({ + request, + }) => { + const explicit = await request.get('/api/explicit-set-cookie-header') + const explicitCookies = await setCookieValues(explicit) + expectCookie(explicitCookies, 'explicit-one', '1') + expectCookie(explicitCookies, 'explicit-two', '2') + + const replaced = await request.get('/api/replace-explicit-set-cookie') + const replacedCookies = await setCookieValues(replaced) + expectCookie(replacedCookies, 'explicit-new', '1') + expect( + replacedCookies.some((cookie) => cookie.startsWith('explicit-old=1;')), + ).toBe(false) + }) + + test('cookies survive redirect responses', async ({ request }) => { + const response = await request.get('/api/redirect-with-cookies', { + maxRedirects: 0, + }) + const cookies = await setCookieValues(response) + + expect(response.status()).toBe(307) + expect(header(response, 'location')).toBe('/api/base') + expectCookie(cookies, 'redirect-one', '1') + expectCookie(cookies, 'redirect-two', '2') + expectCookie(cookies, 'redirect-three', '3') + }) + + test('generated errors drop framing headers that helpers set for the failed body', async ({ + request, + }) => { + const response = await request.get('/api/framing-error') + + expect(response.status()).toBe(500) + expect(header(response, 'content-encoding')).toBeNull() + expect(header(response, 'content-length')).not.toBe('2') + expect(await response.json()).toMatchObject({ + status: 500, + unhandled: true, + }) + }) + + test('HEAD keeps the body for middleware until the response leaves the pipeline', async ({ + request, + }) => { + const headers = { 'x-reconciliation-scenario': 'global-representation' } + const get = await request.get('/api/base', { headers }) + const head = await request.head('/api/base', { headers }) + + expect(head.status()).toBe(get.status()) + expect(Number(header(get, 'x-body-length'))).toBeGreaterThan(0) + expect(header(head, 'x-body-length')).toBe(header(get, 'x-body-length')) + expect(await head.body()).toHaveLength(0) + }) + + test('a response that middleware assigned is disposed when it returns another', async ({ + request, + }) => { + const id = crypto.randomUUID() + const response = await request.get(`/api/tracked-stream?id=${id}`, { + headers: { + 'x-reconciliation-scenario': 'global-assigned-transform-not-modified', + }, + }) + + expect(response.status()).toBe(304) + await expect + .poll(async () => + (await request.get(`/api/tracked-stream-status?id=${id}`)).json(), + ) + .toEqual({ cancelled: true }) + }) +}) + +test.describe('SSR document responses', () => { + test('regression #7647: middleware status and headers survive alongside route headers', async ({ + request, + }) => { + const response = await request.get('/', { + headers: { + accept: 'text/html', + 'x-reconciliation-scenario': 'issue-7647', + }, + }) + + expect(response.status()).toBe(418) + expect(header(response, 'x-middleware-header')).toBe('present') + expect(header(response, 'cache-control')).toBe('no-store') + expect(header(response, 'x-route-header')).toBe('present') + expect(header(response, 'content-type')).toContain('text/html') + // Custom-entry modes must actually reconstruct the streamed response. + expect(header(response, 'x-stream-response-rebuilt')).toBe( + process.env.TSS_E2E_SERVER_ENTRY ? 'yes' : null, + ) + const html = await response.text() + expect(html).toContain('Response Reconciliation E2E') + }) + + test('loader helper headers, status, and cookies reconcile onto document response', async ({ + request, + }) => { + const response = await request.get('/ssr') + const cookies = await setCookieValues(response) + + expect(response.status()).toBe(238) + expect(response.statusText()).toBe('ssr-loader') + expect(header(response, 'x-ssr-loader')).toBe('yes') + expect(header(response, 'content-type')).toContain('text/html') + expectCookie(cookies, 'ssr-one', '1') + expectCookie(cookies, 'ssr-two', '2') + await expect(response.text()).resolves.toContain('ssr response') + }) + + test('regression #5464: SSR document responses preserve multiple Set-Cookie headers', async ({ + request, + }) => { + const response = await request.get('/ssr', { + headers: { 'x-reconciliation-scenario': 'global-multiple-cookies' }, + }) + const cookies = await setCookieValues(response) + + expectCookie(cookies, 'global-one', '1') + expectCookie(cookies, 'global-two', '2') + expectCookie(cookies, 'ssr-one', '1') + expectCookie(cookies, 'ssr-two', '2') + }) + + test('global middleware after next reconciles onto document response', async ({ + request, + }) => { + const response = await request.get('/ssr', { + headers: { 'x-reconciliation-scenario': 'global-after' }, + }) + + expect(response.status()).toBe(232) + expect(response.statusText()).toBe('global-after') + expect(header(response, 'x-global-after')).toBe('yes') + expect(header(response, 'x-ssr-loader')).toBe('yes') + }) + + test('middleware can stream the document through a body transform', async ({ + request, + }) => { + const response = await request.get('/streamed', { + headers: { 'x-reconciliation-scenario': 'global-piped-copy' }, + }) + + expect(response.status()).toBe(200) + expect(header(response, 'x-global-piped-copy')).toBe('yes') + const html = await response.text() + expect(html).toContain('streamed after the shell') + expect(html).toContain('') + }) + + test('HEAD documents keep their body for middleware until the response leaves the pipeline', async ({ + request, + }) => { + const headers = { 'x-reconciliation-scenario': 'global-representation' } + const get = await request.get('/', { headers }) + const head = await request.head('/', { headers }) + + expect(head.status()).toBe(get.status()) + expect(Number(header(get, 'x-body-length'))).toBeGreaterThan(0) + expect(header(head, 'x-body-length')).toBe(header(get, 'x-body-length')) + expect(await head.body()).toHaveLength(0) + }) + + test('regression #8627: middleware can copy the document when Response is wrapped', async ({ + request, + }) => { + const response = await request.get('/streamed', { + headers: { + 'x-reconciliation-scenario': 'global-copy', + 'x-wrap-response': 'true', + }, + }) + + expect(response.status()).toBe(200) + expect(header(response, 'x-global-copy')).toBe('yes') + const html = await response.text() + expect(html).toContain('streamed after the shell') + expect(html).toContain('') + }) + + test('regression #8627: loader helpers reconcile onto the document when Response is wrapped', async ({ + request, + }) => { + const response = await request.get('/ssr', { + headers: { 'x-wrap-response': 'true' }, + }) + const cookies = await setCookieValues(response) + + expect(response.status()).toBe(238) + expect(header(response, 'x-ssr-loader')).toBe('yes') + expectCookie(cookies, 'ssr-one', '1') + const html = await response.text() + expect(html).toContain('ssr response') + expect(html).toContain('') + }) +}) + +test.describe('server functions', () => { + test('global request middleware helper changes reconcile onto serialized responses', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-before', + ) + + expect(response.status()).toBe(231) + expect(response.statusText()).toBe('global-before') + expect(header(response, 'x-global-before')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'globalSerialized', '{"ok":true}') + }) + + test('global request middleware helper changes after next reconcile onto serialized responses', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-after', + ) + + expect(response.status()).toBe(232) + expect(response.statusText()).toBe('global-after') + expect(header(response, 'x-global-after')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'globalSerialized', '{"ok":true}') + }) + + test('function middleware helper changes after next reconcile onto serialized responses', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'functionAfterNext') + + expect(response.status()).toBe(236) + expect(response.statusText()).toBe('function-after') + expect(header(response, 'x-function-after')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'functionAfterNext', '{"ok":true}') + }) + + test('raw server function responses reconcile helper changes after next', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'rawResponseAfterNext', + ) + + expect(response.status()).toBe(237) + expect(response.statusText()).toBe('function-raw-after') + expect(header(response, 'x-function-raw')).toBe('yes') + expect(header(response, 'x-function-raw-after')).toBe('yes') + expect(header(response, 'x-tss-raw')).toBe('true') + await expect(response.text()).resolves.toBe('raw function body') + await expectServerFunctionResult( + page, + 'rawResponseAfterNext', + '237:raw function body', + ) + }) + + test('function response replacement carries helper deltas only', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'replacement') + + expect(header(response, 'x-function-a')).toBe(null) + expect(header(response, 'x-function-b')).toBe('yes') + expect(header(response, 'x-function-helper-delta')).toBe('yes') + await expect(response.text()).resolves.toBe('function-b') + await expectServerFunctionResult(page, 'replacement', '200:function-b') + }) + + test('server function preserves multiple Set-Cookie headers', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'multipleCookies') + const cookies = await setCookieValues(response) + + expectCookie(cookies, 'fn-one', '1') + expectCookie(cookies, 'fn-two', '2') + await expectServerFunctionResult(page, 'multipleCookies', '{"ok":true}') + }) + + test('raw server function responses preserve multiple Set-Cookie headers', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'rawMultipleCookies') + const cookies = await setCookieValues(response) + + expect(header(response, 'x-tss-raw')).toBe('true') + expectCookie(cookies, 'fn-raw-returned-one', '1') + expectCookie(cookies, 'fn-raw-returned-two', '2') + expectCookie(cookies, 'fn-raw-helper-one', '1') + expectCookie(cookies, 'fn-raw-helper-two', '2') + await expect(response.text()).resolves.toBe('raw cookie body') + await expectServerFunctionResult( + page, + 'rawMultipleCookies', + '200:raw cookie body', + ) + }) + + test('server function explicit Set-Cookie header arrays are preserved', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'explicitCookieHeader', + ) + const cookies = await setCookieValues(response) + + expectCookie(cookies, 'fn-explicit-one', '1') + expectCookie(cookies, 'fn-explicit-two', '2') + await expectServerFunctionResult( + page, + 'explicitCookieHeader', + '{"ok":true}', + ) + }) + + test.describe('expected error responses', () => { + test.use({ + // A second RegExp would make Playwright read the array as a fixture + // tuple, so all expected statuses share one pattern. + whitelistErrors: [ + /Failed to load resource: the server responded with a status of (401 \(Unauthorized\)|403 \([^)]*\)|418 \([^)]*\)|500 \([^)]*\)|502 \([^)]*\))/, + ], + }) + + test('a server function that throws a Response rejects with it on the client', async ({ + page, + }) => { + const response = await invokeServerFunction(page, 'throwResponse') + + expect(response.status()).toBe(418) + expect(header(response, 'x-tss-raw')).toBe('thrown') + await expectServerFunctionResult( + page, + 'throwResponse', + 'thrown 418:teapot', + ) + }) + + test('server function thrown errors preserve explicit response status', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'throwAfterStatus') + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-function-error')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'throwAfterStatus', /Unauthorized/) + }) + + test('server function errors drop framing headers that helpers set for the failed body', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'throwAfterFraming') + + expect(header(response, 'content-encoding')).toBeNull() + expect(header(response, 'content-length')).not.toBe('2') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult( + page, + 'throwAfterFraming', + 'File read failed', + ) + }) + + test('server function request middleware errors caused by an upstream response adopt only its status', async ({ + page, + context, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-upstream-cause', + ) + + expect(response.status()).toBe(502) + expect(header(response, 'x-upstream')).toBeNull() + expect(header(response, 'content-type')).toContain('application/json') + expect(header(response, 'content-encoding')).toBeNull() + expect(await setCookieValues(response)).toEqual([]) + expect(await context.cookies()).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({ name: 'upstream-session' }), + ]), + ) + await expectServerFunctionResult( + page, + 'globalSerialized', + 'Upstream failed', + ) + }) + + test('serialized errors drop a Location from error metadata', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-location-error', + ) + + // Error metadata below 400 falls back to 500, and Location is dropped. + expect(response.status()).toBe(500) + expect(header(response, 'location')).toBeNull() + expect(response.request().redirectedTo()).toBeNull() + await expectServerFunctionResult(page, 'globalSerialized', 'Moved error') + }) + + test('server function request middleware errors are serialized', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-throw', + ) + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-global-error')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'globalSerialized', /Unauthorized/) + }) + + test('a string thrown by request middleware rejects the server function call with it', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-throw-string', + ) + + expect(response.status()).toBe(500) + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult( + page, + 'globalSerialized', + 'thrown:"global string"', + ) + }) + + test('a Response thrown by request middleware rejects the server function call with it', async ({ + page, + }) => { + const response = await invokeServerFunction( + page, + 'globalSerialized', + 'global-throw-response', + ) + + expect(response.status()).toBe(403) + expect(header(response, 'x-tss-raw')).toBe('thrown') + await expectServerFunctionResult( + page, + 'globalSerialized', + 'thrown 403:{"denied":true}', + ) + }) + + test('regression #5107: function middleware thrown errors preserve explicit response status', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'throwAfterMiddlewareStatus', + ) + + expect(response.status()).toBe(401) + expect(response.statusText()).toBe('Unauthorized') + expect(header(response, 'x-function-error-middleware')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult( + page, + 'throwAfterMiddlewareStatus', + /Unauthorized/, + ) + }) + }) + + test('a server function that throws 0 rejects on the client', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'throwZero') + + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'throwZero', 'thrown:0') + }) + + test('serialized server function replies keep their body when a helper selects 204', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'bodylessStatus') + + expect(response.status()).toBe(200) + expect(header(response, 'x-bodyless-status')).toBe('ignored') + expect(header(response, 'x-tss-serialized')).toBe('true') + await expectServerFunctionResult(page, 'bodylessStatus', '{"ok":true}') + }) + + test('serialized replies drop a helper Location so fetch does not follow it', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'helperLocation') + + expect(response.status()).toBe(302) + expect(header(response, 'location')).toBeNull() + expect(response.request().redirectedTo()).toBeNull() + await expectServerFunctionResult(page, 'helperLocation', '{"ok":true}') + }) + + test('same-body wrapper responses keep serialized transport headers', async ({ + page, + }) => { + const response = await invokeJsonServerFunction( + page, + 'globalSerialized', + 'global-same-body-wrapper', + ) + + expect(header(response, 'x-same-body-wrapper')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + expect(header(response, 'content-type')).toContain('application/json') + await expectServerFunctionResult(page, 'globalSerialized', '{"ok":true}') + }) + + test('transport headers win over user helpers while user headers persist', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'transportProtected') + + expect(header(response, 'x-user-header')).toBe('yes') + expect(header(response, 'x-tss-serialized')).toBe('true') + expect(header(response, 'content-type')).toContain('application/json') + await expectServerFunctionResult(page, 'transportProtected', '{"ok":true}') + }) + + for (const name of ['returnRedirect', 'throwRedirect']) { + test(`server function ${name} navigates through the client with helper status and headers`, async ({ + page, + context, + }) => { + await page.goto('/server-functions') + await expect(page.getByTestId('server-functions-hydrated')).toBeAttached() + const responsePromise = page.waitForResponse((response) => + response.url().includes('/_serverFn/'), + ) + await page.getByTestId(`server-function-${name}`).click() + const response = await responsePromise + + expect(response.status()).toBe(302) + expect(header(response, 'location')).toBeNull() + expect(header(response, 'content-type')).toContain('application/json') + expect(header(response, 'x-tss-raw')).toBeNull() + expect(header(response, 'x-tss-serialized')).toBeNull() + expect(response.request().redirectedTo()).toBeNull() + // Playwright cannot expose a 302 body, even without Location. Successful + // client navigation verifies that Start decoded the redirect envelope. + await expect(page).toHaveURL('/') + await expect( + page.getByRole('heading', { name: 'Response Reconciliation E2E' }), + ).toBeVisible() + expect(await context.cookies()).toEqual( + expect.arrayContaining([ + expect.objectContaining({ name: 'rpc-redirect', value: 'committed' }), + ]), + ) + }) + } + + test('server function getResponseHeader sees helper writes immediately', async ({ + page, + }) => { + const response = await invokeJsonServerFunction(page, 'readAfterSet') + + expect(header(response, 'x-read-after-set')).toBe('yes') + expect(header(response, 'x-read-after-set-value')).toBe('yes') + await expectServerFunctionResult(page, 'readAfterSet', '{"ok":true}') + }) +}) diff --git a/e2e/react-start/response-reconciliation/tsconfig.json b/e2e/react-start/response-reconciliation/tsconfig.json new file mode 100644 index 0000000000..3824b148e1 --- /dev/null +++ b/e2e/react-start/response-reconciliation/tsconfig.json @@ -0,0 +1,22 @@ +{ + "include": ["**/*.ts", "**/*.tsx", "public/script*.js"], + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "isolatedModules": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "target": "ES2022", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "~/*": ["./src/*"] + }, + "noEmit": true, + "types": ["vite/client"] + } +} diff --git a/e2e/react-start/response-reconciliation/vite.config.ts b/e2e/react-start/response-reconciliation/vite.config.ts new file mode 100644 index 0000000000..355e12a2f7 --- /dev/null +++ b/e2e/react-start/response-reconciliation/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' + +const serverEntry = process.env.TSS_E2E_SERVER_ENTRY +const outDir = process.env.E2E_DIST_DIR ?? 'dist' + +export default defineConfig({ + resolve: { tsconfigPaths: true }, + build: { + outDir, + }, + plugins: [ + tanstackStart({ + server: serverEntry ? { entry: serverEntry } : undefined, + }), + viteReact(), + ], +}) diff --git a/e2e/react-start/root-document-hydration/.gitignore b/e2e/react-start/root-document-hydration/.gitignore new file mode 100644 index 0000000000..229709a89d --- /dev/null +++ b/e2e/react-start/root-document-hydration/.gitignore @@ -0,0 +1,5 @@ +node_modules +dist +test-results +playwright-report +port*.txt diff --git a/e2e/react-start/root-document-hydration/.prettierignore b/e2e/react-start/root-document-hydration/.prettierignore new file mode 100644 index 0000000000..083bdb7c4c --- /dev/null +++ b/e2e/react-start/root-document-hydration/.prettierignore @@ -0,0 +1 @@ +src/routeTree.gen.ts diff --git a/e2e/react-start/root-document-hydration/package.json b/e2e/react-start/root-document-hydration/package.json new file mode 100644 index 0000000000..9dcfcb6fbc --- /dev/null +++ b/e2e/react-start/root-document-hydration/package.json @@ -0,0 +1,40 @@ +{ + "name": "tanstack-react-start-e2e-root-document-hydration", + "private": true, + "sideEffects": false, + "type": "module", + "scripts": { + "dev": "vite dev --port 3000", + "dev:e2e": "vite dev --port $PORT", + "build": "vite build && tsc --noEmit", + "start": "pnpx srvx --prod -s ../client dist/server/server.js", + "test:e2e:dev": "MODE=dev playwright test --project=chromium", + "test:e2e:prod": "MODE=prod playwright test --project=chromium", + "test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:prod" + }, + "dependencies": { + "@tanstack/react-router": "workspace:*", + "@tanstack/react-start": "workspace:*", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:*", + "@types/node": "^22.10.2", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "parallelism": false + } + } + } +} diff --git a/e2e/react-start/root-document-hydration/playwright.config.ts b/e2e/react-start/root-document-hydration/playwright.config.ts new file mode 100644 index 0000000000..13dda4e328 --- /dev/null +++ b/e2e/react-start/root-document-hydration/playwright.config.ts @@ -0,0 +1,37 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const isDev = process.env.MODE === 'dev' +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + + use: { + baseURL, + }, + + webServer: { + command: isDev + ? 'pnpm dev:e2e --port 0' + : `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + env: { + PORT: String(PORT), + }, + }, + + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + ], +}) diff --git a/e2e/react-start/root-document-hydration/src/routeTree.gen.ts b/e2e/react-start/root-document-hydration/src/routeTree.gen.ts new file mode 100644 index 0000000000..dceedffdc1 --- /dev/null +++ b/e2e/react-start/root-document-hydration/src/routeTree.gen.ts @@ -0,0 +1,68 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' + fileRoutesByTo: FileRoutesByTo + to: '/' + id: '__root__' | '/' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + } +} diff --git a/e2e/react-start/root-document-hydration/src/router.tsx b/e2e/react-start/root-document-hydration/src/router.tsx new file mode 100644 index 0000000000..58f4d54e88 --- /dev/null +++ b/e2e/react-start/root-document-hydration/src/router.tsx @@ -0,0 +1,6 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + return createRouter({ routeTree }) +} diff --git a/e2e/react-start/root-document-hydration/src/routes/__root.tsx b/e2e/react-start/root-document-hydration/src/routes/__root.tsx new file mode 100644 index 0000000000..2dc235e951 --- /dev/null +++ b/e2e/react-start/root-document-hydration/src/routes/__root.tsx @@ -0,0 +1,36 @@ +import { + HeadContent, + Outlet, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import { useEffect } from 'react' + +export const Route = createRootRoute({ + pendingComponent: () => null, + component: RootComponent, +}) + +function RootComponent() { + useEffect(() => { + document.documentElement.dataset.hydrated = 'true' + }, []) + + return ( + + + + + +
+ ', endIndex) - - expect(endIndex).toBeGreaterThan(-1) - expect(lastScriptOpen).toBeGreaterThan(lastScriptClose) - expect(slowAsyncPayloadIndex).toBeGreaterThan(-1) - expect(slowAsyncPayloadIndex).toBeLessThan(endIndex) - expect(html.slice(lastScriptOpen, endIndex)).toContain('.return(void 0)') - expect(endIndex).toBeLessThan(html.indexOf('')) - }) + expect(syncQueryChunk).toBeDefined() + expect(syncQueryChunk).toContain('sync-value-2') + expect(syncQueryChunk).toContain('sync-value-3') }) diff --git a/e2e/react-start/streaming-ssr/tests/router-html-buffer.spec.ts b/e2e/react-start/streaming-ssr/tests/router-html-buffer.spec.ts new file mode 100644 index 0000000000..a9cf8a8142 --- /dev/null +++ b/e2e/react-start/streaming-ssr/tests/router-html-buffer.spec.ts @@ -0,0 +1,34 @@ +import { + STREAM_PART_SELECTOR, + expect, + test, + testWithHydration, +} from '../../../streaming-ssr-assertions' + +const runBufferReproduction = + process.env.RUN_SSR_ROUTER_HTML_BUFFER_REPRO === 'true' + +test.describe('SSR router HTML buffer', () => { + test.skip( + !runBufferReproduction, + 'The 17 MiB ASCII reproduction is intentionally opt-in: pnpm test:e2e:buffer-repro', + ) + + testWithHydration( + 'hydrates a large deferred loader payload from server state', + async ({ page }) => { + const response = await page.goto('/router-html-buffer') + + expect(response?.ok()).toBe(true) + await expect(page.getByTestId('router-html-payload-length')).toHaveText( + '17825792', + ) + await expect(page.locator(STREAM_PART_SELECTOR)).toHaveCount(0) + + await page.getByTestId('router-html-payload-check').click() + await expect(page.getByTestId('router-html-payload-result')).toHaveText( + 'server:17825792:x', + ) + }, + ) +}) diff --git a/e2e/react-start/streaming-ssr/tests/slow-render.spec.ts b/e2e/react-start/streaming-ssr/tests/slow-render.spec.ts index c3631a7fc0..0d5a87363f 100644 --- a/e2e/react-start/streaming-ssr/tests/slow-render.spec.ts +++ b/e2e/react-start/streaming-ssr/tests/slow-render.spec.ts @@ -1,73 +1 @@ -import { expect, test, testWithHydration } from './fixtures' - -test.describe('Slow render (render takes longer than serialization)', () => { - test('all data eventually renders with server source', async ({ page }) => { - await page.goto('/slow-render') - await page.waitForLoadState('networkidle') - - // Quick data should be available with server source - await expect(page.getByTestId('quick-data')).toContainText('Quick:') - await expect(page.getByTestId('quick-source')).toContainText( - 'Quick data source: server', - ) - await expect(page.getByTestId('loader-source')).toContainText( - 'Loader source: server', - ) - - // Deferred data should resolve with server source - await expect(page.getByTestId('deferred-resolved')).toContainText( - 'Deferred resolved!', - { timeout: 5000 }, - ) - await expect(page.getByTestId('deferred-resolved')).toContainText( - 'source: server', - { timeout: 5000 }, - ) - - // Slow components should have rendered - await expect(page.getByTestId('slow-component-1')).toBeVisible() - await expect(page.getByTestId('slow-component-2')).toBeVisible() - await expect(page.getByTestId('slow-component-3')).toBeVisible() - }) - - testWithHydration('hydration works after slow render', async ({ page }) => { - await page.goto('/slow-render') - await page.waitForLoadState('networkidle') - - // Wait for content and verify server source - await expect(page.getByTestId('slow-component-1')).toBeVisible() - await expect(page.getByTestId('loader-source')).toContainText( - 'Loader source: server', - ) - }) - - test('client-side navigation works', async ({ page }) => { - await page.goto('/') - await page.waitForLoadState('networkidle') - - // Navigate via nav link - await page.getByRole('link', { name: 'Slow Render' }).first().click() - await expect(page).toHaveURL('/slow-render') - - await expect(page.getByTestId('quick-data')).toBeVisible({ timeout: 10000 }) - }) - - test('all data sources are server - proves SSR streaming works', async ({ - page, - }) => { - await page.goto('/slow-render') - await page.waitForLoadState('networkidle') - - // Wait for deferred content - await expect(page.getByTestId('deferred-resolved')).toBeVisible({ - timeout: 5000, - }) - - // Verify all sources are server - await expect(page.getByTestId('quick-source')).toContainText('server') - await expect(page.getByTestId('loader-source')).toContainText('server') - await expect(page.getByTestId('deferred-resolved')).toContainText( - 'source: server', - ) - }) -}) +import '../../../streaming-ssr-specs/slow-render' diff --git a/e2e/react-start/streaming-ssr/tests/stream.spec.ts b/e2e/react-start/streaming-ssr/tests/stream.spec.ts index 5e4c134f82..a51614f09a 100644 --- a/e2e/react-start/streaming-ssr/tests/stream.spec.ts +++ b/e2e/react-start/streaming-ssr/tests/stream.spec.ts @@ -1,46 +1 @@ -import { expect, test, testWithHydration } from './fixtures' - -test.describe('ReadableStream streaming', () => { - testWithHydration('promise data resolves correctly', async ({ page }) => { - await page.goto('/stream') - - // Promise should resolve - await expect(page.getByTestId('promise-data')).toContainText( - 'promise-resolved', - { timeout: 5000 }, - ) - }) - - testWithHydration('stream chunks arrive incrementally', async ({ page }) => { - await page.goto('/stream') - - // Wait for stream to complete - await expect(page.getByTestId('stream-complete')).toBeVisible({ - timeout: 10000, - }) - - // All chunks should be present - await expect(page.getByTestId('stream-chunk-0')).toContainText('chunk-0') - await expect(page.getByTestId('stream-chunk-1')).toContainText('chunk-1') - await expect(page.getByTestId('stream-chunk-2')).toContainText('chunk-2') - await expect(page.getByTestId('stream-chunk-3')).toContainText('chunk-3') - await expect(page.getByTestId('stream-chunk-4')).toContainText('chunk-4') - }) - - testWithHydration( - 'client-side navigation to stream route works', - async ({ page }) => { - await page.goto('/') - await page.waitForLoadState('networkidle') - - // Navigate via nav link - await page.getByRole('link', { name: 'Stream' }).first().click() - await expect(page).toHaveURL('/stream') - - // Wait for stream to complete - await expect(page.getByTestId('stream-complete')).toBeVisible({ - timeout: 10000, - }) - }, - ) -}) +import '../../../streaming-ssr-specs/stream' diff --git a/e2e/react-start/streaming-ssr/tests/sync-only.spec.ts b/e2e/react-start/streaming-ssr/tests/sync-only.spec.ts index a0060a07ee..0e9278d3f2 100644 --- a/e2e/react-start/streaming-ssr/tests/sync-only.spec.ts +++ b/e2e/react-start/streaming-ssr/tests/sync-only.spec.ts @@ -1,84 +1 @@ -import { expect } from '@playwright/test' -import { test, testWithHydration } from './fixtures' - -/** - * Tests for synchronous serialization - no deferred data, no streaming. - * This is the most common case where all loader data is immediately available. - * The hydration scripts should be included in the initial HTML response. - */ - -test('Sync-only route renders with loader data', async ({ page }) => { - await page.goto('/sync-only') - - // Verify the page content is rendered - await expect(page.getByTestId('sync-title')).toContainText( - 'Synchronous Serialization Test', - ) - await expect(page.getByTestId('sync-message')).toContainText( - 'Hello from sync loader!', - ) - - // Verify loader data items are rendered - await expect(page.getByTestId('sync-item-item-1')).toBeVisible() - await expect(page.getByTestId('sync-item-item-2')).toBeVisible() - await expect(page.getByTestId('sync-item-item-3')).toBeVisible() - - // Verify data came from server (proves SSR streaming worked) - await expect(page.getByTestId('sync-source')).toContainText('Source: server') -}) - -testWithHydration('Sync-only route hydrates correctly', async ({ page }) => { - await page.goto('/sync-only') - - // Verify client-side navigation works (proves hydration succeeded) - await page.getByRole('navigation').getByRole('link', { name: 'Home' }).click() - await expect(page.getByTestId('index-title')).toBeVisible() - - // Navigate back to sync-only via client-side navigation (use nav link to be specific) - await page - .getByRole('navigation') - .getByRole('link', { name: 'Sync Only' }) - .click() - await expect(page.getByTestId('sync-title')).toBeVisible() -}) - -test('Sync-only route has bootstrap scripts in initial HTML', async ({ - page, -}) => { - // Intercept the response to check the raw HTML - let responseHtml = '' - await page.route('/sync-only', async (route) => { - const response = await route.fetch() - responseHtml = await response.text() - await route.fulfill({ response }) - }) - - await page.goto('/sync-only') - - // Wait for page to load - await expect(page.getByTestId('sync-title')).toBeVisible() - - // The HTML should contain the bootstrap scripts - // $_TSR.router should be present (the dehydrated router state) - expect(responseHtml).toContain('$_TSR') - expect(responseHtml).toContain('$_TSR.router') - // The serialization end marker should be present - expect(responseHtml).toContain('$_TSR.e()') - - // SSR should include the barrier script tag in the HTML (rendered by ) - // This is the critical marker transformStreamWithRouter can scan for. - expect(responseHtml).toContain('$tsr-stream-barrier') -}) - -test('Navigating to sync-only from home page', async ({ page }) => { - await page.goto('/') - - await page.getByTestId('link-sync-only').click() - - await expect(page.getByTestId('sync-title')).toContainText( - 'Synchronous Serialization Test', - ) - await expect(page.getByTestId('sync-message')).toContainText( - 'Hello from sync loader!', - ) -}) +import '../../../streaming-ssr-specs/sync-only' diff --git a/e2e/react-start/streaming-ssr/vite.config.ts b/e2e/react-start/streaming-ssr/vite.config.ts index 275bfacde2..0590c197a5 100644 --- a/e2e/react-start/streaming-ssr/vite.config.ts +++ b/e2e/react-start/streaming-ssr/vite.config.ts @@ -1,9 +1,10 @@ import { defineConfig } from 'vite' import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' export default defineConfig({ server: { port: 3000, }, - plugins: [tanstackStart()], + plugins: [tanstackStart(), viteReact()], }) diff --git a/e2e/react-start/transform-asset-urls/package.json b/e2e/react-start/transform-asset-urls/package.json index 979f7c4f76..e0a5ffec59 100644 --- a/e2e/react-start/transform-asset-urls/package.json +++ b/e2e/react-start/transform-asset-urls/package.json @@ -16,19 +16,19 @@ "manual:both:options": "TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform pnpm manual:both", "manual:both:options:transform": "TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform pnpm manual:both", "manual:both:options:createTransform": "TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform pnpm manual:both", - "test:e2e:string": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=string playwright test --project=chromium", - "test:e2e:function": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=function playwright test --project=chromium", - "test:e2e:options": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform playwright test --project=chromium", - "test:e2e:options:transform": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform playwright test --project=chromium", - "test:e2e:options:createTransform": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform playwright test --project=chromium", - "test:e2e:options:transform:cache-true:warmup-true": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", - "test:e2e:options:transform:cache-true:warmup-false": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", - "test:e2e:options:transform:cache-false:warmup-true": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", - "test:e2e:options:transform:cache-false:warmup-false": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", - "test:e2e:options:createTransform:cache-true:warmup-true": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", - "test:e2e:options:createTransform:cache-true:warmup-false": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", - "test:e2e:options:createTransform:cache-false:warmup-true": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", - "test:e2e:options:createTransform:cache-false:warmup-false": "rm -rf dist; rm -rf port*.txt; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", + "test:e2e:string": "rm -rf dist; TRANSFORM_ASSETS_MODE=string playwright test --project=chromium", + "test:e2e:function": "rm -rf dist; TRANSFORM_ASSETS_MODE=function playwright test --project=chromium", + "test:e2e:options": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform playwright test --project=chromium", + "test:e2e:options:transform": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform playwright test --project=chromium", + "test:e2e:options:createTransform": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform playwright test --project=chromium", + "test:e2e:options:transform:cache-true:warmup-true": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", + "test:e2e:options:transform:cache-true:warmup-false": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", + "test:e2e:options:transform:cache-false:warmup-true": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", + "test:e2e:options:transform:cache-false:warmup-false": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=transform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", + "test:e2e:options:createTransform:cache-true:warmup-true": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", + "test:e2e:options:createTransform:cache-true:warmup-false": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=true TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", + "test:e2e:options:createTransform:cache-false:warmup-true": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=true playwright test --project=chromium", + "test:e2e:options:createTransform:cache-false:warmup-false": "rm -rf dist; TRANSFORM_ASSETS_MODE=options TRANSFORM_ASSETS_OPTIONS_KIND=createTransform TRANSFORM_ASSETS_OPTIONS_CACHE=false TRANSFORM_ASSETS_OPTIONS_WARMUP=false playwright test --project=chromium", "test:e2e:options:matrix": "pnpm test:e2e:options:transform:cache-true:warmup-true && pnpm test:e2e:options:transform:cache-true:warmup-false && pnpm test:e2e:options:transform:cache-false:warmup-true && pnpm test:e2e:options:transform:cache-false:warmup-false && pnpm test:e2e:options:createTransform:cache-true:warmup-true && pnpm test:e2e:options:createTransform:cache-true:warmup-false && pnpm test:e2e:options:createTransform:cache-false:warmup-true && pnpm test:e2e:options:createTransform:cache-false:warmup-false", "test:e2e": "pnpm test:e2e:string && pnpm test:e2e:function && pnpm test:e2e:options:matrix" }, @@ -46,8 +46,9 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/react-start/transform-asset-urls/playwright.config.ts b/e2e/react-start/transform-asset-urls/playwright.config.ts index bbef6838fe..209a7e0596 100644 --- a/e2e/react-start/transform-asset-urls/playwright.config.ts +++ b/e2e/react-start/transform-asset-urls/playwright.config.ts @@ -1,12 +1,10 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const APP_PORT = await getTestServerPort(packageJson.name) -const CDN_PORT = await getTestServerPort(`${packageJson.name}_cdn`) +const APP_PORT = Number(process.env.E2E_APP_PORT ?? 0) +const CDN_PORT = Number(process.env.E2E_CDN_PORT ?? 0) const baseURL = `http://localhost:${APP_PORT}` -const cdnOrigin = `http://localhost:${CDN_PORT}` const transformMode = process.env.TRANSFORM_ASSETS_MODE || 'string' const optionsKind = process.env.TRANSFORM_ASSETS_OPTIONS_KIND || 'createTransform' @@ -26,8 +24,11 @@ export default defineConfig({ { // CDN server — serves built client assets on a separate port with CORS command: `node tests/cdn-server.mjs`, - url: `http://localhost:${CDN_PORT}/health`, - reuseExistingServer: !process.env.CI, + wait: { + stdout: + /CDN Server: (?http:\/\/localhost:(?\d+))/, + }, + reuseExistingServer: false, stdout: 'pipe', env: { CDN_PORT: String(CDN_PORT), @@ -37,12 +38,11 @@ export default defineConfig({ // App server — builds the project then starts the srvx server // with CDN_ORIGIN so that transformAssets rewrites manifest URLs command: `pnpm build && pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { PORT: String(APP_PORT), - CDN_ORIGIN: cdnOrigin, TRANSFORM_ASSETS_MODE: transformMode, TRANSFORM_ASSETS_OPTIONS_KIND: optionsKind, TRANSFORM_ASSETS_OPTIONS_CACHE: optionsCache, diff --git a/e2e/react-start/transform-asset-urls/src/server.ts b/e2e/react-start/transform-asset-urls/src/server.ts index 241fc2fe51..a51f29ad66 100644 --- a/e2e/react-start/transform-asset-urls/src/server.ts +++ b/e2e/react-start/transform-asset-urls/src/server.ts @@ -83,4 +83,18 @@ const handler = createStartHandler( : defaultStreamHandler, ) -export default createServerEntry({ fetch: handler }) +export default createServerEntry({ + fetch(request, options) { + const scriptUrl = request.headers.get('x-test-script-url') + if (scriptUrl) { + return createStartHandler({ + handler: defaultStreamHandler, + transformAssets: ({ kind, url }) => ({ + href: kind === 'script' ? scriptUrl : url, + }), + })(request, options) + } + + return handler(request, options) + }, +}) diff --git a/e2e/react-start/transform-asset-urls/tests/cdn-server.mjs b/e2e/react-start/transform-asset-urls/tests/cdn-server.mjs index ea9bf62cd0..280c626867 100644 --- a/e2e/react-start/transform-asset-urls/tests/cdn-server.mjs +++ b/e2e/react-start/transform-asset-urls/tests/cdn-server.mjs @@ -3,7 +3,7 @@ import path from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) -const port = process.env.CDN_PORT || 3002 +const port = Number(process.env.CDN_PORT ?? 0) const app = express() @@ -36,7 +36,7 @@ app.use((req, res, next) => { app.use(express.static(path.resolve(__dirname, '..', 'dist', 'client'))) -app.listen(port, (error) => { +const server = app.listen(port, (error) => { if (error) throw error - console.info(`CDN Server: http://localhost:${port}`) + console.info(`CDN Server: http://localhost:${server.address().port}`) }) diff --git a/e2e/react-start/transform-asset-urls/tests/script-url-escaping.spec.ts b/e2e/react-start/transform-asset-urls/tests/script-url-escaping.spec.ts new file mode 100644 index 0000000000..22251df671 --- /dev/null +++ b/e2e/react-start/transform-asset-urls/tests/script-url-escaping.spec.ts @@ -0,0 +1,46 @@ +import { expect, test } from '@playwright/test' + +for (const [name, scriptUrl] of [ + [ + 'closing script tag', + '', endIndex) + const scriptCloseIndex = html.indexOf('', endIndex) + const bodyCloseIndex = html.indexOf('', scriptCloseIndex) + const htmlCloseIndex = html.indexOf('', bodyCloseIndex) + + expect(endIndex).toBeGreaterThan(-1) + expect(scriptOpenIndex).toBeGreaterThan(previousScriptCloseIndex) + expect(scriptCloseIndex).toBeGreaterThan(endIndex) + expect(payloadIndex).toBeGreaterThan(-1) + expect(payloadIndex).toBeLessThan(endIndex) + expect(html.slice(endIndex, scriptCloseIndex)).toContain(LATE_RECORD_CLOSE) + expect(scriptCloseIndex).toBeLessThan(bodyCloseIndex) + expect(bodyCloseIndex).toBeLessThan(htmlCloseIndex) +} + +async function verifyHydration( + page: Page, + { timeout = 10_000 }: { timeout?: number } = {}, +) { + const button = page.getByTestId('hydration-check-btn') + const status = page.getByTestId('hydration-status') + + await expect(button).toBeVisible() + await expect(async () => { + await button.click() + await expect(status).toHaveText('hydrated', { timeout: 100 }) + }).toPass({ timeout }) + + await expect(page.locator(STREAM_PART_SELECTOR)).toHaveCount(0) + await expect( + page.locator('script').filter({ hasText: STREAM_BOUNDARY_MARKER }), + ).toHaveCount(0) +} + +export { test } + +export const testWithHydration = test.extend({ + page: async ({ page }, use) => { + await use(page) + await verifyHydration(page) + }, +}) + +export { expect } diff --git a/e2e/streaming-ssr-fixtures/index.ts b/e2e/streaming-ssr-fixtures/index.ts new file mode 100644 index 0000000000..a70ef94459 --- /dev/null +++ b/e2e/streaming-ssr-fixtures/index.ts @@ -0,0 +1,381 @@ +export type SourceMarker = 'server' | 'client' + +export type ServerData = { + name: string + timestamp: number + source: 'server' +} + +export type DeferredMessage = { + message: string + source: SourceMarker +} + +export type QueryType = 'sync' | 'fast-async' | 'slow-async' + +export type QueryData = { + type: QueryType + id: number + value: string + source: SourceMarker +} + +export const deferredDataMessage = 'Deferred data loaded!' +export const deferredDataDelay = 1000 +export const deferredServerDelay = 800 +export const deferredImmediateName = 'Fast User' +export const deferredSlowName = 'Slow User' +export const deferredErrorMessage = 'Error in deferred object' + +export const fastSerialStaticData = 'This is static data' +export const fastSerialSmallValue = 'small-data' + +export const syncOnlyMessage = 'Hello from sync loader!' +export const syncOnlyItems = ['item-1', 'item-2', 'item-3'] as const + +export const slowRenderDeferredMessage = 'Deferred resolved!' +export const slowRenderDeferredDelay = 50 +export const slowRenderQuickName = 'Quick data' +export const slowRenderComponents = [ + 'Slow component 1', + 'Slow component 2', + 'Slow component 3', +] as const + +export const nestedLevelDelays = [200, 400, 600] as const +export const nestedPlainDelay = 300 +export const nestedPlainMessage = 'Plain deferred resolved!' + +export const streamPromiseValue = 'promise-resolved' +export const streamPromiseDelay = 150 +export const streamChunkDelay = 200 +export const streamChunks = Array.from({ length: 5 }, (_, i) => `chunk-${i}`) + +export const routerHtmlPayloadChars = 17 * 1024 * 1024 +export const routerHtmlPayloadChar = 'x' +export const routerHtmlPayloadDelay = 100 + +export const manyPromiseItems = [ + { + key: 'immediate1', + testId: 'immediate-1', + label: 'Immediate 1', + value: 'immediate-1', + delayMs: 0, + }, + { + key: 'immediate2', + testId: 'immediate-2', + label: 'Immediate 2', + value: 'immediate-2', + delayMs: 10, + }, + { + key: 'immediate3', + testId: 'immediate-3', + label: 'Immediate 3', + value: 'immediate-3', + delayMs: 20, + }, + { + key: 'fast1', + testId: 'fast-1', + label: 'Fast 1', + value: 'fast-1', + delayMs: 50, + }, + { + key: 'fast2', + testId: 'fast-2', + label: 'Fast 2', + value: 'fast-2', + delayMs: 75, + }, + { + key: 'fast3', + testId: 'fast-3', + label: 'Fast 3', + value: 'fast-3', + delayMs: 100, + }, + { + key: 'fast4', + testId: 'fast-4', + label: 'Fast 4', + value: 'fast-4', + delayMs: 125, + }, + { + key: 'medium1', + testId: 'medium-1', + label: 'Medium 1', + value: 'medium-1', + delayMs: 150, + }, + { + key: 'medium2', + testId: 'medium-2', + label: 'Medium 2', + value: 'medium-2', + delayMs: 200, + }, + { + key: 'medium3', + testId: 'medium-3', + label: 'Medium 3', + value: 'medium-3', + delayMs: 250, + }, + { + key: 'slow1', + testId: 'slow-1', + label: 'Slow 1', + value: 'slow-1', + delayMs: 300, + }, + { + key: 'slow2', + testId: 'slow-2', + label: 'Slow 2', + value: 'slow-2', + delayMs: 400, + }, + { + key: 'slow3', + testId: 'slow-3', + label: 'Slow 3', + value: 'slow-3', + delayMs: 500, + }, + { + key: 'verySlow1', + testId: 'very-slow-1', + label: 'Very Slow 1', + value: 'very-slow-1', + delayMs: 600, + }, + { + key: 'verySlow2', + testId: 'very-slow-2', + label: 'Very Slow 2', + value: 'very-slow-2', + delayMs: 800, + }, +] as const + +export const concurrentBatchCount = 5 +export const concurrentBatchDelays = [100, 200, 300] as const + +export const queryHeavyItems = [ + { + type: 'sync', + id: 1, + value: 'sync-value-1', + delayMs: 0, + testId: 'sync-query-1', + fallback: 'Loading sync 1...', + }, + { + type: 'sync', + id: 2, + value: 'sync-value-2', + delayMs: 0, + testId: 'sync-query-2', + fallback: 'Loading sync 2...', + }, + { + type: 'sync', + id: 3, + value: 'sync-value-3', + delayMs: 0, + testId: 'sync-query-3', + fallback: 'Loading sync 3...', + }, + { + type: 'fast-async', + id: 1, + value: 'fast-async-1', + delayMs: 50, + testId: 'fast-async-query-1', + fallback: 'Loading fast 1...', + }, + { + type: 'fast-async', + id: 2, + value: 'fast-async-2', + delayMs: 75, + testId: 'fast-async-query-2', + fallback: 'Loading fast 2...', + }, + { + type: 'fast-async', + id: 3, + value: 'fast-async-3', + delayMs: 100, + testId: 'fast-async-query-3', + fallback: 'Loading fast 3...', + }, + { + type: 'slow-async', + id: 1, + value: 'slow-async-1', + delayMs: 200, + testId: 'slow-async-query-1', + fallback: 'Loading slow 1...', + }, + { + type: 'slow-async', + id: 2, + value: 'slow-async-2', + delayMs: 300, + testId: 'slow-async-query-2', + fallback: 'Loading slow 2...', + }, + { + type: 'slow-async', + id: 3, + value: 'slow-async-3', + delayMs: 400, + testId: 'slow-async-query-3', + fallback: 'Loading slow 3...', + }, +] as const + +export function sourceMarker(): SourceMarker { + return typeof window === 'undefined' ? 'server' : 'client' +} + +export function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)) +} + +export function makeServerData(name: string): ServerData { + return { + name, + timestamp: Date.now(), + source: 'server', + } +} + +export function makeDeferred(value: T, delayMs: number): Promise { + return new Promise((resolve) => setTimeout(() => resolve(value), delayMs)) +} + +export function makeDeferredMessage( + message: string, + delayMs: number, +): Promise { + return makeDeferred({ message, source: sourceMarker() }, delayMs) +} + +export function makeFastSerialSmallData() { + return { + value: fastSerialSmallValue, + timestamp: Date.now(), + source: 'server' as const, + } +} + +export function makeSyncOnlyData() { + return { + message: syncOnlyMessage, + timestamp: Date.now(), + items: syncOnlyItems, + source: sourceMarker(), + } +} + +export function makeLevelData(level: number) { + return { level, timestamp: Date.now() } +} + +export function makeQueryData(item: { + type: QueryType + id: number + value: string +}): QueryData { + return { + type: item.type, + id: item.id, + value: item.value, + source: sourceMarker(), + } +} + +export function createManyPromises() { + return Object.fromEntries( + manyPromiseItems.map((item) => [ + item.key, + makeDeferred(item.value, item.delayMs), + ]), + ) as Record<(typeof manyPromiseItems)[number]['key'], Promise> +} + +export function createConcurrentPromises( + count: number, + delayMs: number, +): Array> { + const sharedPromise = delay(delayMs) + return Array.from({ length: count }, (_, i) => + sharedPromise.then(() => `concurrent-${i + 1}`), + ) +} + +export function createConcurrentLoaderData() { + const batch1 = createConcurrentPromises( + concurrentBatchCount, + concurrentBatchDelays[0], + ) + const batch2 = createConcurrentPromises( + concurrentBatchCount, + concurrentBatchDelays[1], + ) + const batch3 = createConcurrentPromises( + concurrentBatchCount, + concurrentBatchDelays[2], + ) + + return { + concurrent1_1: batch1[0], + concurrent1_2: batch1[1], + concurrent1_3: batch1[2], + concurrent1_4: batch1[3], + concurrent1_5: batch1[4], + concurrent2_1: batch2[0], + concurrent2_2: batch2[1], + concurrent2_3: batch2[2], + concurrent2_4: batch2[3], + concurrent2_5: batch2[4], + concurrent3_1: batch3[0], + concurrent3_2: batch3[1], + concurrent3_3: batch3[2], + concurrent3_4: batch3[3], + concurrent3_5: batch3[4], + } +} + +export function createStreamPromise(): Promise { + return makeDeferred(streamPromiseValue, streamPromiseDelay) +} + +export function createChunkStream(): ReadableStream { + return new ReadableStream({ + async start(controller) { + for (const chunk of streamChunks) { + await delay(streamChunkDelay) + controller.enqueue(chunk) + } + controller.close() + }, + }) +} + +export function createRouterHtmlPayload() { + return makeDeferred( + { + value: routerHtmlPayloadChar.repeat(routerHtmlPayloadChars), + source: sourceMarker(), + }, + routerHtmlPayloadDelay, + ) +} diff --git a/e2e/streaming-ssr-specs/client-navigation.ts b/e2e/streaming-ssr-specs/client-navigation.ts new file mode 100644 index 0000000000..759f8e0282 --- /dev/null +++ b/e2e/streaming-ssr-specs/client-navigation.ts @@ -0,0 +1,372 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Client-side navigation between all routes', () => { + test.beforeEach(async ({ page }) => { + // Start from home page + await page.goto('/') + await page.waitForLoadState('networkidle') + }) + + test('home -> sync-only -> home works', async ({ page }) => { + // Navigate to sync-only + await page + .getByRole('navigation') + .getByRole('link', { name: 'Sync Only' }) + .click() + await expect(page).toHaveURL('/sync-only') + await expect(page.getByTestId('sync-message')).toBeVisible() + + // Navigate back to home + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + await expect(page.getByTestId('index-title')).toBeVisible() + }) + + test('home -> deferred -> home works', async ({ page }) => { + // Navigate to deferred (use exact: true to avoid matching "Nested Deferred") + await page + .getByRole('navigation') + .getByRole('link', { name: 'Deferred', exact: true }) + .click() + await expect(page).toHaveURL('/deferred') + await expect(page.getByTestId('immediate-data')).toBeVisible() + + // Wait for deferred data + await expect(page.getByTestId('deferred-data')).toBeVisible({ + timeout: 5000, + }) + + // Navigate back to home + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) + + test('home -> stream -> home works (no stream locking error)', async ({ + page, + }) => { + // This test specifically validates the ReadableStream locking fix + // Console errors are monitored by the fixture automatically + + // Navigate to stream + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + + // Wait for stream to start (at least one chunk or promise resolved) + await expect(page.getByTestId('promise-data')).toBeVisible({ + timeout: 5000, + }) + + // Navigate back without waiting for stream completion. + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) + + test('home -> stream -> wait for completion -> home works', async ({ + page, + }) => { + // Navigate to stream + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + + // Wait for stream to complete + await expect(page.getByTestId('stream-complete')).toBeVisible({ + timeout: 10000, + }) + + // Navigate back to home + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + await expect(page.getByTestId('index-title')).toBeVisible() + }) + + test('home -> stream -> home -> stream again works (fresh stream each time)', async ({ + page, + }) => { + // Console errors are monitored by the fixture automatically + + // First navigation to stream + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + await expect(page.getByTestId('promise-data')).toBeVisible({ + timeout: 5000, + }) + + // Navigate back to home + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + + // Second navigation to stream - should get fresh stream without errors + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + + // Wait for stream to complete + await expect(page.getByTestId('stream-complete')).toBeVisible({ + timeout: 10000, + }) + + // Verify all chunks are present + await expect(page.getByTestId('stream-chunk-0')).toBeVisible() + await expect(page.getByTestId('stream-chunk-4')).toBeVisible() + }) + + test('home -> fast-serial -> home works', async ({ page }) => { + await page + .getByRole('navigation') + .getByRole('link', { name: 'Fast Serial' }) + .click() + await expect(page).toHaveURL('/fast-serial') + await expect(page.getByTestId('server-data')).toBeVisible() + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) + + test('home -> slow-render -> home works', async ({ page }) => { + await page + .getByRole('navigation') + .getByRole('link', { name: 'Slow Render' }) + .click() + await expect(page).toHaveURL('/slow-render') + await expect(page.getByTestId('quick-data')).toBeVisible() + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) + + test('home -> nested-deferred -> home works', async ({ page }) => { + await page + .getByRole('navigation') + .getByRole('link', { name: 'Nested Deferred' }) + .click() + await expect(page).toHaveURL('/nested-deferred') + + // Wait for all levels to load + await expect(page.getByTestId('level3-data')).toBeVisible({ timeout: 5000 }) + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) + + test('navigation without waiting for route data works', async ({ page }) => { + // Console errors are monitored by the fixture automatically + + // Change routes as soon as each URL updates, without waiting for route data. + await page + .getByRole('navigation') + .getByRole('link', { name: 'Sync Only' }) + .click() + await expect(page).toHaveURL('/sync-only') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Deferred', exact: true }) + .click() + await expect(page).toHaveURL('/deferred') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Fast Serial' }) + .click() + await expect(page).toHaveURL('/fast-serial') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Slow Render' }) + .click() + await expect(page).toHaveURL('/slow-render') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Nested Deferred' }) + .click() + await expect(page).toHaveURL('/nested-deferred') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) +}) + +test.describe('Direct navigation followed by client navigation', () => { + test('direct to stream -> client nav to deferred works', async ({ page }) => { + // Direct navigation to stream + await page.goto('/stream') + await expect(page.getByTestId('promise-data')).toBeVisible({ + timeout: 5000, + }) + + // Client navigation to deferred (use exact: true) + await page + .getByRole('navigation') + .getByRole('link', { name: 'Deferred', exact: true }) + .click() + await expect(page).toHaveURL('/deferred') + await expect(page.getByTestId('immediate-data')).toBeVisible() + }) + + test('direct to deferred -> client nav to stream works', async ({ page }) => { + // Console errors are monitored by the fixture automatically + + // Direct navigation to deferred + await page.goto('/deferred') + await expect(page.getByTestId('immediate-data')).toBeVisible() + + // Client navigation to stream + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + await expect(page.getByTestId('stream-complete')).toBeVisible({ + timeout: 10000, + }) + }) + + test('direct to sync-only -> client nav to all routes works', async ({ + page, + }) => { + await page.goto('/sync-only') + await expect(page.getByTestId('sync-message')).toBeVisible() + + // Navigate through all routes + await page + .getByRole('navigation') + .getByRole('link', { name: 'Deferred', exact: true }) + .click() + await expect(page).toHaveURL('/deferred') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Stream' }) + .click() + await expect(page).toHaveURL('/stream') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Fast Serial' }) + .click() + await expect(page).toHaveURL('/fast-serial') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Home' }) + .click() + await expect(page).toHaveURL('/') + }) +}) + +testWithHydration.describe('Hydration after client navigation', () => { + testWithHydration( + 'interactive elements work after navigating to deferred', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Deferred', exact: true }) + .click() + await expect(page).toHaveURL('/deferred') + + // Wait for the page to be fully loaded + await expect(page.getByTestId('immediate-data')).toBeVisible() + }, + ) + + testWithHydration( + 'interactive elements work after navigating to fast-serial', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Fast Serial' }) + .click() + await expect(page).toHaveURL('/fast-serial') + + // Wait for page to load + await expect(page.getByTestId('server-data')).toBeVisible() + }, + ) + + testWithHydration( + 'interactive elements work after navigating to nested-deferred', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Nested Deferred' }) + .click() + await expect(page).toHaveURL('/nested-deferred') + + // Wait for page to load + await expect(page.getByTestId('plain-deferred')).toBeVisible({ + timeout: 5000, + }) + }, + ) + + testWithHydration( + 'interactive elements work after navigating to slow-render', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + await page + .getByRole('navigation') + .getByRole('link', { name: 'Slow Render' }) + .click() + await expect(page).toHaveURL('/slow-render') + + // Wait for page to load (slow-render has blocking loops) + await expect(page.getByTestId('quick-data')).toBeVisible() + }, + ) +}) diff --git a/e2e/streaming-ssr-specs/concurrent.ts b/e2e/streaming-ssr-specs/concurrent.ts new file mode 100644 index 0000000000..ef14f80367 --- /dev/null +++ b/e2e/streaming-ssr-specs/concurrent.ts @@ -0,0 +1,86 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Concurrent promise resolution (15 promises in 3 batches)', () => { + test('all concurrent promises resolve correctly', async ({ page }) => { + await page.goto('/concurrent') + + // Batch 1 (5 promises at 100ms) + await expect(page.getByTestId('concurrent-1-1')).toContainText( + 'concurrent-1', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-1-2')).toContainText( + 'concurrent-2', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-1-3')).toContainText( + 'concurrent-3', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-1-4')).toContainText( + 'concurrent-4', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-1-5')).toContainText( + 'concurrent-5', + { timeout: 5000 }, + ) + + // Batch 2 (5 promises at 200ms) + await expect(page.getByTestId('concurrent-2-1')).toContainText( + 'concurrent-1', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-2-2')).toContainText( + 'concurrent-2', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-2-3')).toContainText( + 'concurrent-3', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-2-4')).toContainText( + 'concurrent-4', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-2-5')).toContainText( + 'concurrent-5', + { timeout: 5000 }, + ) + + // Batch 3 (5 promises at 300ms) + await expect(page.getByTestId('concurrent-3-1')).toContainText( + 'concurrent-1', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-3-2')).toContainText( + 'concurrent-2', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-3-3')).toContainText( + 'concurrent-3', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-3-4')).toContainText( + 'concurrent-4', + { timeout: 5000 }, + ) + await expect(page.getByTestId('concurrent-3-5')).toContainText( + 'concurrent-5', + { timeout: 5000 }, + ) + }) + + testWithHydration( + 'hydration works with concurrent resolutions', + async ({ page }) => { + await page.goto('/concurrent') + await page.waitForLoadState('networkidle') + + // Wait for all batches + await expect(page.getByTestId('concurrent-3-5')).toBeVisible({ + timeout: 5000, + }) + }, + ) +}) diff --git a/e2e/streaming-ssr-specs/deferred-rejection.ts b/e2e/streaming-ssr-specs/deferred-rejection.ts new file mode 100644 index 0000000000..3e944b1c0c --- /dev/null +++ b/e2e/streaming-ssr-specs/deferred-rejection.ts @@ -0,0 +1,21 @@ +import { expect, test } from '../streaming-ssr-assertions' + +test.use({ + whitelistErrors: ['Error in deferred object'], +}) + +test('rejected deferred Await renders the route error boundary without killing SSR', async ({ + page, +}) => { + await page.goto('/deferred-rejection') + + await expect(page.getByTestId('deferred-error-boundary')).toContainText( + 'Error in deferred object', + { timeout: 5000 }, + ) + + await page.goto('/sync-only') + await expect(page.getByTestId('sync-message')).toContainText( + 'Hello from sync loader!', + ) +}) diff --git a/e2e/streaming-ssr-specs/deferred.ts b/e2e/streaming-ssr-specs/deferred.ts new file mode 100644 index 0000000000..abece0b43e --- /dev/null +++ b/e2e/streaming-ssr-specs/deferred.ts @@ -0,0 +1,113 @@ +import { + expect, + expectDeferredRouteResponseOrder, + test, + testWithHydration, +} from '../streaming-ssr-assertions' + +test.describe('Deferred data streaming', () => { + test('finishes the router stream after renderer output', async ({ + baseURL, + }) => { + await expectDeferredRouteResponseOrder(baseURL) + }) + + test('renders immediate and deferred server data', async ({ page }) => { + await page.goto('/deferred') + + // Immediate loader data is rendered. + await expect(page.getByTestId('immediate-data')).toBeVisible() + await expect(page.getByTestId('immediate-data')).toContainText( + 'Immediate: Fast User', + ) + + // Verify immediate data came from server + await expect(page.getByTestId('immediate-source')).toContainText( + 'Immediate source: server', + ) + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + + // Deferred data should eventually appear with server source + await expect(page.getByTestId('deferred-data')).toContainText( + 'Deferred data loaded!', + { timeout: 5000 }, + ) + await expect(page.getByTestId('deferred-data')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('deferred-server-data')).toContainText( + 'Server: Slow User', + { timeout: 5000 }, + ) + await expect(page.getByTestId('deferred-server-data')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + }) + + testWithHydration( + 'hydration works - interactive elements respond', + async ({ page }) => { + await page.goto('/deferred') + await page.waitForLoadState('networkidle') + + // Wait for all deferred content to load + await expect(page.getByTestId('deferred-data')).toBeVisible({ + timeout: 5000, + }) + + // Verify all data came from server after hydration + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + await expect(page.getByTestId('deferred-data')).toContainText( + 'source: server', + ) + }, + ) + + test('client-side navigation to deferred route works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via client-side routing using nav link + await page.getByRole('link', { name: 'Deferred' }).first().click() + await expect(page).toHaveURL('/deferred') + + // Data should load + await expect(page.getByTestId('immediate-data')).toContainText('Fast User') + await expect(page.getByTestId('deferred-data')).toContainText( + 'Deferred data loaded!', + { timeout: 5000 }, + ) + }) + + test('all data sources are server', async ({ page }) => { + await page.goto('/deferred') + + // Wait for all deferred content + await expect(page.getByTestId('deferred-data')).toBeVisible({ + timeout: 5000, + }) + await expect(page.getByTestId('deferred-server-data')).toBeVisible({ + timeout: 5000, + }) + + // Count all elements showing 'server' source - should be 4: + // 1. immediate-source + // 2. loader-source + // 3. deferred-data (contains "source: server") + // 4. deferred-server-data (contains "source: server") + await expect(page.getByTestId('immediate-source')).toContainText('server') + await expect(page.getByTestId('loader-source')).toContainText('server') + await expect(page.getByTestId('deferred-data')).toContainText( + 'source: server', + ) + await expect(page.getByTestId('deferred-server-data')).toContainText( + 'source: server', + ) + }) +}) diff --git a/e2e/streaming-ssr-specs/fast-serial.ts b/e2e/streaming-ssr-specs/fast-serial.ts new file mode 100644 index 0000000000..03201f0a55 --- /dev/null +++ b/e2e/streaming-ssr-specs/fast-serial.ts @@ -0,0 +1,74 @@ +import { + expect, + expectRouterHydrationMarkers, + test, + testWithHydration, +} from '../streaming-ssr-assertions' + +test.describe('Fast serialization (serialization completes before render)', () => { + test('initial HTML contains router bootstrap + barrier', async ({ page }) => { + let responseHtml = '' + await page.route('/fast-serial', async (route) => { + const response = await route.fetch() + responseHtml = await response.text() + await route.fulfill({ response }) + }) + + await page.goto('/fast-serial') + await expect(page.getByTestId('server-data')).toBeVisible() + + expectRouterHydrationMarkers(responseHtml) + }) + + test('renders all server data', async ({ page }) => { + await page.goto('/fast-serial') + await page.waitForLoadState('networkidle') + + // All data should be visible + await expect(page.getByTestId('server-data')).toContainText('small-data') + await expect(page.getByTestId('static-data')).toContainText( + 'This is static data', + ) + await expect(page.getByTestId('loader-timestamp')).toBeVisible() + + // Verify the loader and server function ran during SSR. + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + await expect(page.getByTestId('server-fn-source')).toContainText( + 'Server function source: server', + ) + }) + + testWithHydration('hydration works correctly', async ({ page }) => { + await page.goto('/fast-serial') + await page.waitForLoadState('networkidle') + + // Verify data came from server after hydration + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + }) + + test('direct navigation renders correctly', async ({ page }) => { + // Direct navigation (SSR) + await page.goto('/fast-serial') + + // Should render without errors and show server source + await expect(page.getByTestId('server-data')).toBeVisible() + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + }) + + test('client-side navigation works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Fast Serial' }).first().click() + await expect(page).toHaveURL('/fast-serial') + + await expect(page.getByTestId('server-data')).toContainText('small-data') + }) +}) diff --git a/e2e/streaming-ssr-specs/home.ts b/e2e/streaming-ssr-specs/home.ts new file mode 100644 index 0000000000..d85e19bfa7 --- /dev/null +++ b/e2e/streaming-ssr-specs/home.ts @@ -0,0 +1,34 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Home page', () => { + testWithHydration( + 'renders index page with all navigation links', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + await expect(page.getByTestId('index-title')).toContainText( + 'Streaming SSR Test Scenarios', + ) + // Check links exist (they're in the nav and the body) + await expect( + page.getByRole('link', { name: 'Deferred' }).first(), + ).toBeVisible() + await expect( + page.getByRole('link', { name: 'Stream' }).first(), + ).toBeVisible() + }, + ) + + testWithHydration( + 'navigation from home to routes works', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Use the link in the content (not nav) + await page.getByTestId('link-deferred').click() + await expect(page).toHaveURL('/deferred') + }, + ) +}) diff --git a/e2e/streaming-ssr-specs/many-promises.ts b/e2e/streaming-ssr-specs/many-promises.ts new file mode 100644 index 0000000000..768859c7e4 --- /dev/null +++ b/e2e/streaming-ssr-specs/many-promises.ts @@ -0,0 +1,82 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Many promises streaming (15 deferred)', () => { + test('all 15 promises eventually resolve', async ({ page }) => { + await page.goto('/many-promises') + + // Immediate group (0-20ms) + await expect(page.getByTestId('immediate-1')).toContainText('immediate-1', { + timeout: 5000, + }) + await expect(page.getByTestId('immediate-2')).toContainText('immediate-2', { + timeout: 5000, + }) + await expect(page.getByTestId('immediate-3')).toContainText('immediate-3', { + timeout: 5000, + }) + + // Fast group (50-125ms) + await expect(page.getByTestId('fast-1')).toContainText('fast-1', { + timeout: 5000, + }) + await expect(page.getByTestId('fast-2')).toContainText('fast-2', { + timeout: 5000, + }) + await expect(page.getByTestId('fast-3')).toContainText('fast-3', { + timeout: 5000, + }) + await expect(page.getByTestId('fast-4')).toContainText('fast-4', { + timeout: 5000, + }) + + // Medium group (150-250ms) + await expect(page.getByTestId('medium-1')).toContainText('medium-1', { + timeout: 5000, + }) + await expect(page.getByTestId('medium-2')).toContainText('medium-2', { + timeout: 5000, + }) + await expect(page.getByTestId('medium-3')).toContainText('medium-3', { + timeout: 5000, + }) + + // Slow group (300-500ms) + await expect(page.getByTestId('slow-1')).toContainText('slow-1', { + timeout: 5000, + }) + await expect(page.getByTestId('slow-2')).toContainText('slow-2', { + timeout: 5000, + }) + await expect(page.getByTestId('slow-3')).toContainText('slow-3', { + timeout: 5000, + }) + + // Very slow group (600-800ms) + await expect(page.getByTestId('very-slow-1')).toContainText('very-slow-1', { + timeout: 5000, + }) + await expect(page.getByTestId('very-slow-2')).toContainText('very-slow-2', { + timeout: 5000, + }) + }) + + testWithHydration('hydration works with many promises', async ({ page }) => { + await page.goto('/many-promises') + await page.waitForLoadState('networkidle') + + // Wait for all promises to resolve + await expect(page.getByTestId('very-slow-2')).toBeVisible({ timeout: 5000 }) + }) + + test('client-side navigation works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Many Promises' }).click() + await expect(page).toHaveURL('/many-promises') + + // All promises should eventually resolve + await expect(page.getByTestId('very-slow-2')).toBeVisible({ timeout: 5000 }) + }) +}) diff --git a/e2e/streaming-ssr-specs/nested-deferred.ts b/e2e/streaming-ssr-specs/nested-deferred.ts new file mode 100644 index 0000000000..0146a23162 --- /dev/null +++ b/e2e/streaming-ssr-specs/nested-deferred.ts @@ -0,0 +1,52 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Nested deferred (multiple levels of deferred data)', () => { + test('all levels of deferred data eventually resolve', async ({ page }) => { + await page.goto('/nested-deferred') + + // All deferred values should eventually resolve. + await expect(page.getByTestId('plain-deferred')).toContainText( + 'Plain deferred resolved!', + { timeout: 5000 }, + ) + + await expect(page.getByTestId('level1-data')).toContainText('Level 1:', { + timeout: 5000, + }) + + await expect(page.getByTestId('level2-data')).toContainText('Level 2:', { + timeout: 5000, + }) + + await expect(page.getByTestId('level3-data')).toContainText('Level 3:', { + timeout: 5000, + }) + }) + + testWithHydration( + 'hydration works with nested deferred', + async ({ page }) => { + await page.goto('/nested-deferred') + await page.waitForLoadState('networkidle') + + // Wait for all data + await expect(page.getByTestId('level3-data')).toBeVisible({ + timeout: 10000, + }) + }, + ) + + test('client-side navigation works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Nested Deferred' }).first().click() + await expect(page).toHaveURL('/nested-deferred') + + // All levels should eventually render + await expect(page.getByTestId('level3-data')).toBeVisible({ + timeout: 10000, + }) + }) +}) diff --git a/e2e/streaming-ssr-specs/preview-streaming.ts b/e2e/streaming-ssr-specs/preview-streaming.ts new file mode 100644 index 0000000000..5087dff730 --- /dev/null +++ b/e2e/streaming-ssr-specs/preview-streaming.ts @@ -0,0 +1,13 @@ +import { + expectDeferredRouteResponseOrder, + test, +} from '../streaming-ssr-assertions' + +test.skip( + process.env.MODE !== 'preview', + 'Only runs against vite preview: pnpm test:e2e:preview', +) + +test('vite preview preserves deferred HTML order', async ({ baseURL }) => { + await expectDeferredRouteResponseOrder(baseURL) +}) diff --git a/e2e/streaming-ssr-specs/query-heavy.ts b/e2e/streaming-ssr-specs/query-heavy.ts new file mode 100644 index 0000000000..b33a64f366 --- /dev/null +++ b/e2e/streaming-ssr-specs/query-heavy.ts @@ -0,0 +1,142 @@ +import { + expect, + expectQueryHeavyRouteStreamOrder, + test, + testWithHydration, +} from '../streaming-ssr-assertions' + +test.describe('Query heavy route (9 queries)', () => { + test('emits the complete router stream before document closes', async ({ + baseURL, + }) => { + await expectQueryHeavyRouteStreamOrder(baseURL) + }) + + test('all queries resolve with server data', async ({ page }) => { + await page.goto('/query-heavy') + + // Sync queries should show server source + await expect(page.getByTestId('sync-query-1')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('sync-query-2')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('sync-query-3')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + + // Fast async queries should show server source + await expect(page.getByTestId('fast-async-query-1')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('fast-async-query-2')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('fast-async-query-3')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + + // Slow async queries should show server source + await expect(page.getByTestId('slow-async-query-1')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('slow-async-query-2')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + await expect(page.getByTestId('slow-async-query-3')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + }) + + test('sync queries have correct values', async ({ page }) => { + await page.goto('/query-heavy') + + await expect(page.getByTestId('sync-query-1')).toContainText('sync-value-1') + await expect(page.getByTestId('sync-query-2')).toContainText('sync-value-2') + await expect(page.getByTestId('sync-query-3')).toContainText('sync-value-3') + }) + + test('async queries have correct values', async ({ page }) => { + await page.goto('/query-heavy') + + await expect(page.getByTestId('fast-async-query-1')).toContainText( + 'fast-async-1', + { timeout: 5000 }, + ) + await expect(page.getByTestId('fast-async-query-2')).toContainText( + 'fast-async-2', + { timeout: 5000 }, + ) + await expect(page.getByTestId('fast-async-query-3')).toContainText( + 'fast-async-3', + { timeout: 5000 }, + ) + + await expect(page.getByTestId('slow-async-query-1')).toContainText( + 'slow-async-1', + { timeout: 5000 }, + ) + await expect(page.getByTestId('slow-async-query-2')).toContainText( + 'slow-async-2', + { timeout: 5000 }, + ) + await expect(page.getByTestId('slow-async-query-3')).toContainText( + 'slow-async-3', + { timeout: 5000 }, + ) + }) + + testWithHydration('hydration works with many queries', async ({ page }) => { + await page.goto('/query-heavy') + await page.waitForLoadState('networkidle') + + // Wait for all queries to resolve + await expect(page.getByTestId('slow-async-query-3')).toBeVisible({ + timeout: 5000, + }) + }) + + test('client-side navigation works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Query Heavy' }).click() + await expect(page).toHaveURL('/query-heavy') + + // All queries should eventually resolve (on client) + await expect(page.getByTestId('slow-async-query-3')).toBeVisible({ + timeout: 5000, + }) + }) + + test('server query data hydrates without client refetch', async ({ + page, + }) => { + // If hydration missed the server data, these queries would re-execute on + // the client and show "client" as their source. + await page.goto('/query-heavy') + + // Wait for all queries + await expect(page.getByTestId('slow-async-query-3')).toBeVisible({ + timeout: 5000, + }) + + // Verify that all server results hydrated without a client refetch. + const serverSourceCount = await page + .locator('[data-testid*="query-"]') + .filter({ hasText: 'source: server' }) + .count() + expect(serverSourceCount).toBe(9) + }) +}) diff --git a/e2e/streaming-ssr-specs/slow-render.ts b/e2e/streaming-ssr-specs/slow-render.ts new file mode 100644 index 0000000000..117559701e --- /dev/null +++ b/e2e/streaming-ssr-specs/slow-render.ts @@ -0,0 +1,71 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +test.describe('Slow render (render takes longer than serialization)', () => { + test('all data eventually renders with server source', async ({ page }) => { + await page.goto('/slow-render') + await page.waitForLoadState('networkidle') + + // Quick data should be available with server source + await expect(page.getByTestId('quick-data')).toContainText('Quick:') + await expect(page.getByTestId('quick-source')).toContainText( + 'Quick data source: server', + ) + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + + // Deferred data should resolve with server source + await expect(page.getByTestId('deferred-resolved')).toContainText( + 'Deferred resolved!', + { timeout: 5000 }, + ) + await expect(page.getByTestId('deferred-resolved')).toContainText( + 'source: server', + { timeout: 5000 }, + ) + + // Slow components should have rendered + await expect(page.getByTestId('slow-component-1')).toBeVisible() + await expect(page.getByTestId('slow-component-2')).toBeVisible() + await expect(page.getByTestId('slow-component-3')).toBeVisible() + }) + + testWithHydration('hydration works after slow render', async ({ page }) => { + await page.goto('/slow-render') + await page.waitForLoadState('networkidle') + + // Wait for content and verify server source + await expect(page.getByTestId('slow-component-1')).toBeVisible() + await expect(page.getByTestId('loader-source')).toContainText( + 'Loader source: server', + ) + }) + + test('client-side navigation works', async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Slow Render' }).first().click() + await expect(page).toHaveURL('/slow-render') + + await expect(page.getByTestId('quick-data')).toBeVisible({ timeout: 10000 }) + }) + + test('all data sources are server', async ({ page }) => { + await page.goto('/slow-render') + await page.waitForLoadState('networkidle') + + // Wait for deferred content + await expect(page.getByTestId('deferred-resolved')).toBeVisible({ + timeout: 5000, + }) + + // Verify all sources are server + await expect(page.getByTestId('quick-source')).toContainText('server') + await expect(page.getByTestId('loader-source')).toContainText('server') + await expect(page.getByTestId('deferred-resolved')).toContainText( + 'source: server', + ) + }) +}) diff --git a/e2e/streaming-ssr-specs/stream.ts b/e2e/streaming-ssr-specs/stream.ts new file mode 100644 index 0000000000..ee61f170de --- /dev/null +++ b/e2e/streaming-ssr-specs/stream.ts @@ -0,0 +1,55 @@ +import { expect, test, testWithHydration } from '../streaming-ssr-assertions' + +const expectedStreamChunks = [ + 'chunk-0', + 'chunk-1', + 'chunk-2', + 'chunk-3', + 'chunk-4', +] + +test.describe('ReadableStream deserialization', () => { + testWithHydration('promise data deserializes correctly', async ({ page }) => { + await page.goto('/stream') + + await expect(page.getByTestId('promise-data')).toContainText( + 'promise-resolved', + { timeout: 5000 }, + ) + }) + + testWithHydration( + 'stream chunks deserialize in source order', + async ({ page }) => { + await page.goto('/stream') + + await expect(page.getByTestId('stream-complete')).toBeVisible({ + timeout: 10000, + }) + + const chunks = page + .getByTestId('stream-data') + .locator('[data-testid^="stream-chunk-"]') + await expect(chunks).toHaveText(expectedStreamChunks) + + // This browser assertion covers deserialization and source order. The + // raw `/deferred` assertion covers server-response and router ordering. + }, + ) + + testWithHydration( + 'client-side navigation to stream route works', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + + // Navigate via nav link + await page.getByRole('link', { name: 'Stream' }).first().click() + await expect(page).toHaveURL('/stream') + + await expect(page.getByTestId('stream-complete')).toBeVisible({ + timeout: 10000, + }) + }, + ) +}) diff --git a/e2e/streaming-ssr-specs/sync-only.ts b/e2e/streaming-ssr-specs/sync-only.ts new file mode 100644 index 0000000000..9850265109 --- /dev/null +++ b/e2e/streaming-ssr-specs/sync-only.ts @@ -0,0 +1,80 @@ +import { + expect, + expectRouterHydrationMarkers, + test, + testWithHydration, +} from '../streaming-ssr-assertions' + +/** + * Tests for synchronous serialization - no deferred data, no streaming. + * This is the most common case where all loader data is immediately available. + * The hydration scripts should be included in the initial HTML response. + */ + +test('Sync-only route renders with loader data', async ({ page }) => { + await page.goto('/sync-only') + + // Verify the page content is rendered + await expect(page.getByTestId('sync-title')).toContainText( + 'Synchronous Serialization Test', + ) + await expect(page.getByTestId('sync-message')).toContainText( + 'Hello from sync loader!', + ) + + // Verify loader data items are rendered + await expect(page.getByTestId('sync-item-item-1')).toBeVisible() + await expect(page.getByTestId('sync-item-item-2')).toBeVisible() + await expect(page.getByTestId('sync-item-item-3')).toBeVisible() + + // Verify the loader ran during SSR. + await expect(page.getByTestId('sync-source')).toContainText('Source: server') +}) + +testWithHydration('Sync-only route hydrates correctly', async ({ page }) => { + await page.goto('/sync-only') + + // Verify client-side navigation works (proves hydration succeeded) + await page.getByRole('navigation').getByRole('link', { name: 'Home' }).click() + await expect(page.getByTestId('index-title')).toBeVisible() + + // Navigate back to sync-only via client-side navigation (use nav link to be specific) + await page + .getByRole('navigation') + .getByRole('link', { name: 'Sync Only' }) + .click() + await expect(page.getByTestId('sync-title')).toBeVisible() +}) + +test('Sync-only route has bootstrap scripts in initial HTML', async ({ + page, +}) => { + // Intercept the response to check the raw HTML + let responseHtml = '' + await page.route('/sync-only', async (route) => { + const response = await route.fetch() + responseHtml = await response.text() + await route.fulfill({ response }) + }) + + await page.goto('/sync-only') + + // Wait for page to load + await expect(page.getByTestId('sync-title')).toBeVisible() + + // Bootstrap, end record, and the boundary rendered by . + expectRouterHydrationMarkers(responseHtml) +}) + +test('Navigating to sync-only from home page', async ({ page }) => { + await page.goto('/') + + await page.getByTestId('link-sync-only').click() + + await expect(page.getByTestId('sync-title')).toContainText( + 'Synchronous Serialization Test', + ) + await expect(page.getByTestId('sync-message')).toContainText( + 'Hello from sync loader!', + ) +}) diff --git a/e2e/vue-router/basepath-file-based/package.json b/e2e/vue-router/basepath-file-based/package.json index 0ed990a8ff..3af9176e83 100644 --- a/e2e/vue-router/basepath-file-based/package.json +++ b/e2e/vue-router/basepath-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -28,6 +28,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basepath-file-based/playwright.config.ts b/e2e/vue-router/basepath-file-based/playwright.config.ts index 6069bbe59f..4eead86444 100644 --- a/e2e/vue-router/basepath-file-based/playwright.config.ts +++ b/e2e/vue-router/basepath-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basepath-file-based/tests/setup/global.setup.ts b/e2e/vue-router/basepath-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basepath-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basepath-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/basepath-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basepath-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/package.json b/e2e/vue-router/basic-esbuild-file-based/package.json index e27d749899..a51cf9149c 100644 --- a/e2e/vue-router/basic-esbuild-file-based/package.json +++ b/e2e/vue-router/basic-esbuild-file-based/package.json @@ -7,14 +7,14 @@ "build": "node src/esbuild.run.js build && vue-tsc --noEmit", "preview": "node src/esbuild.run.js preview", "start": "pnpm dev", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/router-plugin": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "postcss": "^8.5.1", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.16", "zod": "^4.4.3" }, @@ -27,8 +27,9 @@ "esbuild": "^0.27.4", "esbuild-plugin-vue3": "^0.5.1", "eslint-plugin-vue": "^9.33.0", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vue-eslint-parser": "^9.4.3", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-esbuild-file-based/playwright.config.ts b/e2e/vue-router/basic-esbuild-file-based/playwright.config.ts index 836ea41bd8..9d9c8d49a3 100644 --- a/e2e/vue-router/basic-esbuild-file-based/playwright.config.ts +++ b/e2e/vue-router/basic-esbuild-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-esbuild-file-based/src/esbuild.config.js b/e2e/vue-router/basic-esbuild-file-based/src/esbuild.config.js index c4aba8798e..16f6fbca44 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/esbuild.config.js +++ b/e2e/vue-router/basic-esbuild-file-based/src/esbuild.config.js @@ -9,7 +9,6 @@ export default { }), tanstackRouter({ target: 'vue', - autoCodeSplitting: true, }), ], } diff --git a/e2e/vue-router/basic-esbuild-file-based/src/esbuild.run.js b/e2e/vue-router/basic-esbuild-file-based/src/esbuild.run.js index 19e882c1a9..0ab294f2bf 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/esbuild.run.js +++ b/e2e/vue-router/basic-esbuild-file-based/src/esbuild.run.js @@ -1,8 +1,7 @@ -import * as esbuild from 'esbuild' import http from 'node:http' -import { createReadStream } from 'node:fs' -import { promises as fs } from 'node:fs' +import { createReadStream, promises as fs } from 'node:fs' import path from 'node:path' +import * as esbuild from 'esbuild' import esbuildConfig from './esbuild.config.js' const args = process.argv.slice(2) @@ -18,7 +17,7 @@ function getPort() { const fromArg = getArgValue('--port') const fromEnv = process.env.VITE_SERVER_PORT const port = Number(fromArg ?? fromEnv ?? 5601) - if (!Number.isFinite(port) || port <= 0) { + if (!Number.isFinite(port) || port < 0) { throw new Error(`Invalid port: ${String(fromArg ?? fromEnv)}`) } return port @@ -138,7 +137,7 @@ function startStaticServer({ port }) { return new Promise((resolve) => { server.listen(port, () => { - console.log(`http://localhost:${port}`) + console.log(`E2E app: http://localhost:${server.address().port}`) resolve(server) }) }) diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/(another-group)/onlyrouteinside.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/(another-group)/onlyrouteinside.tsx index 727c1b4d94..8869cefc01 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/(another-group)/onlyrouteinside.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/(another-group)/onlyrouteinside.tsx @@ -1,27 +1,32 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const OnlyRouteInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ + from: '/(another-group)/onlyrouteinside', + }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(another-group)/onlyrouteinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: OnlyRouteInsideComponent, }) const routeApi = getRouteApi('/(another-group)/onlyrouteinside') - -function OnlyRouteInsideComponent() { - const searchViaHook = useSearch({ from: '/(another-group)/onlyrouteinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/_layout.insidelayout.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/_layout.insidelayout.tsx index 4b239f3ef4..f2998803fd 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/_layout.insidelayout.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/_layout.insidelayout.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const InsideLayoutComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/_layout/insidelayout')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideLayoutComponent, }) const routeApi = getRouteApi('/(group)/_layout/insidelayout') - -function InsideLayoutComponent() { - const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/inside.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/inside.tsx index f12ca517d3..20e0d5afdb 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/inside.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/inside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const InsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideComponent, }) const routeApi = getRouteApi('/(group)/inside') - -function InsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/lazyinside.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/lazyinside.tsx index 05b34eb201..a46da658d6 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/lazyinside.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/lazyinside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const LazyInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/lazyinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: LazyInsideComponent, }) const routeApi = getRouteApi('/(group)/lazyinside') - -function LazyInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/subfolder/inside.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/subfolder/inside.tsx index 317c766186..715d2cc972 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/subfolder/inside.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/(group)/subfolder/inside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const SubfolderInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/subfolder/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: SubfolderInsideComponent, }) const routeApi = getRouteApi('/(group)/subfolder/inside') - -function SubfolderInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/__root.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/__root.tsx index 59c9e6fa48..62c4af3aa4 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/__root.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/__root.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { HeadContent, Link, @@ -10,95 +11,97 @@ import { import { TanStackRouterDevtools } from '@tanstack/vue-router-devtools' import NotFoundComponent from '../components/NotFoundComponent.vue' +const RootComponent = defineComponent({ + setup() { + const router = useRouter() + const canGoBack = useCanGoBack() + // test useRouterState doesn't crash client side navigation + const _state = useRouterState() + + return () => ( + <> + +
+ + + Home + + + Posts + + + Layout + + + Only Route Inside Group + + + Inside Group + + + Inside Subfolder Inside Group + + + Inside Group Inside Layout + + + Lazy Inside Group + + + unicode path + + + This Route Does Not Exist + +
+
+ + + + ) + }, +}) + export const Route = createRootRoute({ component: RootComponent, notFoundComponent: NotFoundComponent, }) - -function RootComponent() { - const router = useRouter() - const canGoBack = useCanGoBack() - // test useRouterState doesn't crash client side navigation - const _state = useRouterState() - - return ( - <> - -
- - - Home - - - Posts - - - Layout - - - Only Route Inside Group - - - Inside Group - - - Inside Subfolder Inside Group - - - Inside Group Inside Layout - - - Lazy Inside Group - - - unicode path - - - This Route Does Not Exist - -
-
- - - - ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.$postId.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.$postId.tsx index 15d17387c8..54ae789c8e 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.$postId.tsx @@ -1,24 +1,27 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import PostErrorComponent from '../components/PostErrorComponent.vue' import { fetchPost } from '../posts' import type { PostType } from '../posts' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

+ {(post.value as PostType).title} +

+
{(post.value as PostType).body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), component: PostComponent, errorComponent: PostErrorComponent, notFoundComponent: () =>

Post not found

, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

- {(post.value as PostType).title} -

-
{(post.value as PostType).body}
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.tsx index ae580dfc02..e0afd27b4c 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts.tsx @@ -1,7 +1,38 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../posts' import type { PostType } from '../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...(posts.value as Array), + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ head: () => ({ meta: [ @@ -13,31 +44,3 @@ export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...(posts.value as Array), - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts_.$postId.edit.tsx b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts_.$postId.edit.tsx index 57963c6b64..22979c93c9 100644 --- a/e2e/vue-router/basic-esbuild-file-based/src/routes/posts_.$postId.edit.tsx +++ b/e2e/vue-router/basic-esbuild-file-based/src/routes/posts_.$postId.edit.tsx @@ -1,23 +1,28 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useParams } from '@tanstack/vue-router' +const PostEditComponent = defineComponent({ + setup() { + const paramsViaApi = api.useParams() + const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) + const paramsViaRouteHook = api.useParams() + + return () => ( +
+
{paramsViaHook.value.postId}
+
+ {paramsViaRouteHook.value.postId} +
+
+ {paramsViaApi.value.postId} +
+
+ ) + }, +}) + export const Route = createFileRoute('/posts_/$postId/edit')({ component: PostEditComponent, }) const api = getRouteApi('/posts_/$postId/edit') - -function PostEditComponent() { - const paramsViaApi = api.useParams() - const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) - const paramsViaRouteHook = api.useParams() - - return ( -
-
{paramsViaHook.value.postId}
-
- {paramsViaRouteHook.value.postId} -
-
{paramsViaApi.value.postId}
-
- ) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/tests/app.spec.ts b/e2e/vue-router/basic-esbuild-file-based/tests/app.spec.ts index 543746d64d..7380859e7b 100644 --- a/e2e/vue-router/basic-esbuild-file-based/tests/app.spec.ts +++ b/e2e/vue-router/basic-esbuild-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' test.beforeEach(async ({ page }) => { diff --git a/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.setup.ts b/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-esbuild-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-file-based-jsx/package.json b/e2e/vue-router/basic-file-based-jsx/package.json index e4d20d72e9..9ab7f21e82 100644 --- a/e2e/vue-router/basic-file-based-jsx/package.json +++ b/e2e/vue-router/basic-file-based-jsx/package.json @@ -8,14 +8,14 @@ "build": "vite build && vue-tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/router-plugin": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16", "zod": "^4.4.3" @@ -32,6 +32,6 @@ "typescript": "~5.8.3", "vite": "^8.0.14", "vue-eslint-parser": "^9.4.3", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-file-based-jsx/playwright.config.ts b/e2e/vue-router/basic-file-based-jsx/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic-file-based-jsx/playwright.config.ts +++ b/e2e/vue-router/basic-file-based-jsx/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-file-based-jsx/src/posts.tsx b/e2e/vue-router/basic-file-based-jsx/src/posts.tsx index 1b4c92b41d..f7a1941605 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/posts.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/basic-file-based-jsx/src/routeTree.gen.ts b/e2e/vue-router/basic-file-based-jsx/src/routeTree.gen.ts index 3922025c82..5922c5f7b1 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routeTree.gen.ts +++ b/e2e/vue-router/basic-file-based-jsx/src/routeTree.gen.ts @@ -364,7 +364,7 @@ declare module '@tanstack/vue-router' { '/(group)/_layout': { id: '/(group)/_layout' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupLayoutRouteImport parentRoute: typeof rootRouteImport } diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx index 727c1b4d94..8869cefc01 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx @@ -1,27 +1,32 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const OnlyRouteInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ + from: '/(another-group)/onlyrouteinside', + }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(another-group)/onlyrouteinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: OnlyRouteInsideComponent, }) const routeApi = getRouteApi('/(another-group)/onlyrouteinside') - -function OnlyRouteInsideComponent() { - const searchViaHook = useSearch({ from: '/(another-group)/onlyrouteinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx index 4b239f3ef4..f2998803fd 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const InsideLayoutComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/_layout/insidelayout')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideLayoutComponent, }) const routeApi = getRouteApi('/(group)/_layout/insidelayout') - -function InsideLayoutComponent() { - const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/inside.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/inside.tsx index f12ca517d3..20e0d5afdb 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/inside.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/inside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const InsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideComponent, }) const routeApi = getRouteApi('/(group)/inside') - -function InsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx index 05b34eb201..a46da658d6 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const LazyInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/lazyinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: LazyInsideComponent, }) const routeApi = getRouteApi('/(group)/lazyinside') - -function LazyInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx index 317c766186..715d2cc972 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx @@ -1,27 +1,30 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' import { z } from 'zod' +const SubfolderInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/subfolder/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: SubfolderInsideComponent, }) const routeApi = getRouteApi('/(group)/subfolder/inside') - -function SubfolderInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/__root.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/__root.tsx index 59c9e6fa48..62c4af3aa4 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/__root.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/__root.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { HeadContent, Link, @@ -10,95 +11,97 @@ import { import { TanStackRouterDevtools } from '@tanstack/vue-router-devtools' import NotFoundComponent from '../components/NotFoundComponent.vue' +const RootComponent = defineComponent({ + setup() { + const router = useRouter() + const canGoBack = useCanGoBack() + // test useRouterState doesn't crash client side navigation + const _state = useRouterState() + + return () => ( + <> + +
+ + + Home + + + Posts + + + Layout + + + Only Route Inside Group + + + Inside Group + + + Inside Subfolder Inside Group + + + Inside Group Inside Layout + + + Lazy Inside Group + + + unicode path + + + This Route Does Not Exist + +
+
+ + + + ) + }, +}) + export const Route = createRootRoute({ component: RootComponent, notFoundComponent: NotFoundComponent, }) - -function RootComponent() { - const router = useRouter() - const canGoBack = useCanGoBack() - // test useRouterState doesn't crash client side navigation - const _state = useRouterState() - - return ( - <> - -
- - - Home - - - Posts - - - Layout - - - Only Route Inside Group - - - Inside Group - - - Inside Subfolder Inside Group - - - Inside Group Inside Layout - - - Lazy Inside Group - - - unicode path - - - This Route Does Not Exist - -
-
- - - - ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/posts.$postId.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/posts.$postId.tsx index 15d17387c8..54ae789c8e 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/posts.$postId.tsx @@ -1,24 +1,27 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import PostErrorComponent from '../components/PostErrorComponent.vue' import { fetchPost } from '../posts' import type { PostType } from '../posts' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

+ {(post.value as PostType).title} +

+
{(post.value as PostType).body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), component: PostComponent, errorComponent: PostErrorComponent, notFoundComponent: () =>

Post not found

, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

- {(post.value as PostType).title} -

-
{(post.value as PostType).body}
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/posts.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/posts.tsx index ae580dfc02..e0afd27b4c 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/posts.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/posts.tsx @@ -1,7 +1,38 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../posts' import type { PostType } from '../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...(posts.value as Array), + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ head: () => ({ meta: [ @@ -13,31 +44,3 @@ export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...(posts.value as Array), - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx b/e2e/vue-router/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx index 57963c6b64..22979c93c9 100644 --- a/e2e/vue-router/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx +++ b/e2e/vue-router/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx @@ -1,23 +1,28 @@ +import { defineComponent } from 'vue' import { createFileRoute, getRouteApi, useParams } from '@tanstack/vue-router' +const PostEditComponent = defineComponent({ + setup() { + const paramsViaApi = api.useParams() + const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) + const paramsViaRouteHook = api.useParams() + + return () => ( +
+
{paramsViaHook.value.postId}
+
+ {paramsViaRouteHook.value.postId} +
+
+ {paramsViaApi.value.postId} +
+
+ ) + }, +}) + export const Route = createFileRoute('/posts_/$postId/edit')({ component: PostEditComponent, }) const api = getRouteApi('/posts_/$postId/edit') - -function PostEditComponent() { - const paramsViaApi = api.useParams() - const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) - const paramsViaRouteHook = api.useParams() - - return ( -
-
{paramsViaHook.value.postId}
-
- {paramsViaRouteHook.value.postId} -
-
{paramsViaApi.value.postId}
-
- ) -} diff --git a/e2e/vue-router/basic-file-based-jsx/tests/app.spec.ts b/e2e/vue-router/basic-file-based-jsx/tests/app.spec.ts index 543746d64d..7380859e7b 100644 --- a/e2e/vue-router/basic-file-based-jsx/tests/app.spec.ts +++ b/e2e/vue-router/basic-file-based-jsx/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' test.beforeEach(async ({ page }) => { diff --git a/e2e/vue-router/basic-file-based-jsx/tests/setup/global.setup.ts b/e2e/vue-router/basic-file-based-jsx/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-file-based-jsx/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-file-based-jsx/tests/setup/global.teardown.ts b/e2e/vue-router/basic-file-based-jsx/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-file-based-jsx/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-file-based-sfc/package.json b/e2e/vue-router/basic-file-based-sfc/package.json index 0f1934b9a9..e6ffa156f9 100644 --- a/e2e/vue-router/basic-file-based-sfc/package.json +++ b/e2e/vue-router/basic-file-based-sfc/package.json @@ -8,14 +8,14 @@ "build": "vite build && vue-tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/router-plugin": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16", "zod": "^4.4.3" @@ -27,6 +27,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-file-based-sfc/playwright.config.ts b/e2e/vue-router/basic-file-based-sfc/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic-file-based-sfc/playwright.config.ts +++ b/e2e/vue-router/basic-file-based-sfc/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-file-based-sfc/src/posts.ts b/e2e/vue-router/basic-file-based-sfc/src/posts.ts index 1b4c92b41d..f7a1941605 100644 --- a/e2e/vue-router/basic-file-based-sfc/src/posts.ts +++ b/e2e/vue-router/basic-file-based-sfc/src/posts.ts @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/basic-file-based-sfc/src/routeTree.gen.ts b/e2e/vue-router/basic-file-based-sfc/src/routeTree.gen.ts index 09d62b0706..0bfdddab3d 100644 --- a/e2e/vue-router/basic-file-based-sfc/src/routeTree.gen.ts +++ b/e2e/vue-router/basic-file-based-sfc/src/routeTree.gen.ts @@ -454,7 +454,7 @@ declare module '@tanstack/vue-router' { '/(group)/_layout': { id: '/(group)/_layout' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupLayoutRouteImport parentRoute: typeof rootRouteImport } diff --git a/e2e/vue-router/basic-file-based-sfc/tests/app.spec.ts b/e2e/vue-router/basic-file-based-sfc/tests/app.spec.ts index 543746d64d..7380859e7b 100644 --- a/e2e/vue-router/basic-file-based-sfc/tests/app.spec.ts +++ b/e2e/vue-router/basic-file-based-sfc/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import type { Page } from '@playwright/test' test.beforeEach(async ({ page }) => { diff --git a/e2e/vue-router/basic-file-based-sfc/tests/setup/global.setup.ts b/e2e/vue-router/basic-file-based-sfc/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-file-based-sfc/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-file-based-sfc/tests/setup/global.teardown.ts b/e2e/vue-router/basic-file-based-sfc/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-file-based-sfc/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-scroll-restoration/package.json b/e2e/vue-router/basic-scroll-restoration/package.json index 86c91c62ca..f4616a5651 100644 --- a/e2e/vue-router/basic-scroll-restoration/package.json +++ b/e2e/vue-router/basic-scroll-restoration/package.json @@ -8,14 +8,14 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-virtual": "^3.13.0", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.16", "tailwindcss": "^4.2.2" }, @@ -25,7 +25,7 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "vite": "^8.0.14", - "vue-tsc": "^3.1.5", + "vue-tsc": "^3.3.8", "typescript": "~5.9.0" } } diff --git a/e2e/vue-router/basic-scroll-restoration/playwright.config.ts b/e2e/vue-router/basic-scroll-restoration/playwright.config.ts index 0c5cee43e4..6a684ac89e 100644 --- a/e2e/vue-router/basic-scroll-restoration/playwright.config.ts +++ b/e2e/vue-router/basic-scroll-restoration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-virtual-file-based/package.json b/e2e/vue-router/basic-virtual-file-based/package.json index 3a341e0e7d..3701c2254c 100644 --- a/e2e/vue-router/basic-virtual-file-based/package.json +++ b/e2e/vue-router/basic-virtual-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -29,6 +29,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-virtual-file-based/playwright.config.ts b/e2e/vue-router/basic-virtual-file-based/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic-virtual-file-based/playwright.config.ts +++ b/e2e/vue-router/basic-virtual-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-virtual-file-based/src/posts.tsx b/e2e/vue-router/basic-virtual-file-based/src/posts.tsx index 8576a3799a..5f5463a668 100644 --- a/e2e/vue-router/basic-virtual-file-based/src/posts.tsx +++ b/e2e/vue-router/basic-virtual-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx b/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx index b4c91d3e85..aa5387a4d8 100644 --- a/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx +++ b/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -6,6 +7,19 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value?.title}

+
{post.value?.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent as any, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ }, component: PostComponent, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value?.title}

-
{post.value?.body}
-
- ) -} diff --git a/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx b/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx index 265faaf650..2a4e8deddd 100644 --- a/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx +++ b/e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx @@ -1,39 +1,42 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts b/e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts +++ b/e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts b/e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/package.json b/e2e/vue-router/basic-virtual-named-export-config-file-based/package.json index 08815d8265..d3a69ed573 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/package.json +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -18,7 +18,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -29,6 +29,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts b/e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx index 8576a3799a..5f5463a668 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx index b4c91d3e85..aa5387a4d8 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -6,6 +7,19 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value?.title}

+
{post.value?.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent as any, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ }, component: PostComponent, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value?.title}

-
{post.value?.body}
-
- ) -} diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx index 265faaf650..2a4e8deddd 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx @@ -1,39 +1,42 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts b/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts +++ b/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts b/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-vue-query-file-based/package.json b/e2e/vue-router/basic-vue-query-file-based/package.json index 2cd6d23ba0..3b4422d8d8 100644 --- a/e2e/vue-router/basic-vue-query-file-based/package.json +++ b/e2e/vue-router/basic-vue-query-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && vue-tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16", "zod": "^4.4.3" @@ -29,6 +29,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-vue-query-file-based/playwright.config.ts b/e2e/vue-router/basic-vue-query-file-based/playwright.config.ts index 6e7c123f74..fbda9bd451 100644 --- a/e2e/vue-router/basic-vue-query-file-based/playwright.config.ts +++ b/e2e/vue-router/basic-vue-query-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -17,17 +12,15 @@ export default defineConfig({ workers: 1, reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-vue-query-file-based/src/posts.tsx b/e2e/vue-router/basic-vue-query-file-based/src/posts.tsx index 1becc2c242..1f6cb8e308 100644 --- a/e2e/vue-router/basic-vue-query-file-based/src/posts.tsx +++ b/e2e/vue-router/basic-vue-query-file-based/src/posts.tsx @@ -8,11 +8,7 @@ export type PostType = { export class PostNotFoundError extends Error {} -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.$postId.tsx b/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.$postId.tsx index 72109fc891..e8b66ddf5d 100644 --- a/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.$postId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { ErrorComponent, useRouter } from '@tanstack/vue-router' import { useQuery } from '@tanstack/vue-query' @@ -5,6 +6,21 @@ import { PostNotFoundError } from '../posts' import { postQueryOptions } from '../postQueryOptions' import type { ErrorComponentProps } from '@tanstack/vue-router' +const PostComponent = defineComponent({ + setup() { + const params = Route.useParams() + useQuery(() => postQueryOptions(params.value.postId)) + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: ({ context: { queryClient }, params: { postId } }) => { return queryClient.ensureQueryData(postQueryOptions(postId)) @@ -32,16 +48,3 @@ export function PostErrorComponent({ error }: ErrorComponentProps) {
) } - -function PostComponent() { - const postId = Route.useParams().value.postId - useQuery(postQueryOptions(postId)) - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.tsx b/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.tsx index f9e20f99d6..e1c35d59ad 100644 --- a/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.tsx +++ b/e2e/vue-router/basic-vue-query-file-based/src/routes/posts.tsx @@ -1,42 +1,45 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { useQuery } from '@tanstack/vue-query' import { postsQueryOptions } from '../postsQueryOptions' +const PostsComponent = defineComponent({ + setup() { + useQuery(postsQueryOptions) + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: ({ context: { queryClient } }) => queryClient.ensureQueryData(postsQueryOptions), component: PostsComponent, }) - -function PostsComponent() { - useQuery(postsQueryOptions) - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/basic-vue-query-file-based/tests/app.spec.ts b/e2e/vue-router/basic-vue-query-file-based/tests/app.spec.ts index d80e8dada5..2b42d6d589 100644 --- a/e2e/vue-router/basic-vue-query-file-based/tests/app.spec.ts +++ b/e2e/vue-router/basic-vue-query-file-based/tests/app.spec.ts @@ -1,24 +1,23 @@ -import { expect, test } from '@playwright/test' -import { getDummyServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') }) -test('GetPosts', async () => { - const port = await getDummyServerPort(packageJson.name) - const res = await fetch(`http://localhost:${port}/posts`) - - expect(res.status).toBe(200) - - const posts = await res.json() - +test('GetPosts with networking disabled', async ({ page, context }) => { + await page.goto('about:blank') + await context.setOffline(true) + const { status, posts, post } = await page.evaluate(async () => { + const response = await fetch('https://jsonplaceholder.typicode.com/posts') + const posts = await response.json() + const post = await fetch( + 'https://jsonplaceholder.typicode.com/posts/1', + ).then((r) => r.json()) + return { status: response.status, posts, post } + }) + expect(status).toBe(200) expect(posts.length).toBeGreaterThan(0) - - const postRes = await fetch(`http://localhost:${port}/posts/1`) - expect(postRes.status).toBe(200) - const post = await postRes.json() expect(post).toEqual(posts[0]) }) diff --git a/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.setup.ts b/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-vue-query-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-vue-query-file-based/tsconfig.json b/e2e/vue-router/basic-vue-query-file-based/tsconfig.json index 123a2f4122..28889522fc 100644 --- a/e2e/vue-router/basic-vue-query-file-based/tsconfig.json +++ b/e2e/vue-router/basic-vue-query-file-based/tsconfig.json @@ -10,7 +10,7 @@ "skipLibCheck": true, "noEmit": true, "resolveJsonModule": true, - "types": ["vite/client"] + "types": ["vite/client", "node"] }, "include": ["src", "tests"], "exclude": ["node_modules", "dist"] diff --git a/e2e/vue-router/basic-vue-query/package.json b/e2e/vue-router/basic-vue-query/package.json index 288d96018d..68f1a8c9ea 100644 --- a/e2e/vue-router/basic-vue-query/package.json +++ b/e2e/vue-router/basic-vue-query/package.json @@ -8,7 +8,7 @@ "build": "vite build && vue-tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -16,7 +16,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -27,6 +27,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic-vue-query/playwright.config.ts b/e2e/vue-router/basic-vue-query/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic-vue-query/playwright.config.ts +++ b/e2e/vue-router/basic-vue-query/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic-vue-query/src/main.tsx b/e2e/vue-router/basic-vue-query/src/main.tsx index 4f862a9b31..3235f26ce3 100644 --- a/e2e/vue-router/basic-vue-query/src/main.tsx +++ b/e2e/vue-router/basic-vue-query/src/main.tsx @@ -1,4 +1,4 @@ -import { createApp } from 'vue' +import { createApp, defineComponent } from 'vue' import { ErrorComponent, Link, @@ -108,6 +108,21 @@ function PostsIndexRouteComponent() { return
Select a post.
} +const PostRouteComponent = defineComponent({ + setup() { + const params = postRoute.useParams() + useQuery(() => postQueryOptions(params.value.postId)) + const post = postRoute.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + const postRoute = createRoute({ getParentRoute: () => postsRoute, path: '$postId', @@ -137,19 +152,6 @@ function PostErrorComponent({ error }: ErrorComponentProps) { ) } -function PostRouteComponent() { - const postId = postRoute.useParams().value.postId - useQuery(postQueryOptions(postId)) - const post = postRoute.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} - const layoutRoute = createRoute({ getParentRoute: () => rootRoute, id: '_layout', diff --git a/e2e/vue-router/basic-vue-query/src/posts.lazy.tsx b/e2e/vue-router/basic-vue-query/src/posts.lazy.tsx index eb844bc68d..d42d3d49dc 100644 --- a/e2e/vue-router/basic-vue-query/src/posts.lazy.tsx +++ b/e2e/vue-router/basic-vue-query/src/posts.lazy.tsx @@ -1,39 +1,42 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createLazyRoute } from '@tanstack/vue-router' import { useQuery } from '@tanstack/vue-query' import { postsQueryOptions } from './posts' +const PostsComponent = defineComponent({ + setup() { + const postsQuery = useQuery(postsQueryOptions) + const posts = postsQuery.data + + return () => ( +
+
    + {[ + ...((posts.value ?? []) as Array<{ id: string; title: string }>), + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+ +
+ ) + }, +}) + export const Route = createLazyRoute('/posts')({ component: PostsComponent, }) - -function PostsComponent() { - const postsQuery = useQuery(postsQueryOptions) - const posts = postsQuery.data - - return ( -
-
    - {[ - ...((posts.value ?? []) as Array<{ id: string; title: string }>), - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
- -
- ) -} diff --git a/e2e/vue-router/basic-vue-query/src/posts.ts b/e2e/vue-router/basic-vue-query/src/posts.ts index 18f8a9f93f..69e1814af5 100644 --- a/e2e/vue-router/basic-vue-query/src/posts.ts +++ b/e2e/vue-router/basic-vue-query/src/posts.ts @@ -9,11 +9,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/vue-router/basic-vue-query/tests/app.spec.ts b/e2e/vue-router/basic-vue-query/tests/app.spec.ts index 3e5a69ccaa..fbf093cd51 100644 --- a/e2e/vue-router/basic-vue-query/tests/app.spec.ts +++ b/e2e/vue-router/basic-vue-query/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/basic-vue-query/tests/setup/global.setup.ts b/e2e/vue-router/basic-vue-query/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic-vue-query/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic-vue-query/tests/setup/global.teardown.ts b/e2e/vue-router/basic-vue-query/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic-vue-query/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic/package.json b/e2e/vue-router/basic/package.json index ce95750e12..1b57dae772 100644 --- a/e2e/vue-router/basic/package.json +++ b/e2e/vue-router/basic/package.json @@ -8,13 +8,13 @@ "build": "vite build && vue-tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -24,6 +24,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/basic/playwright.config.ts b/e2e/vue-router/basic/playwright.config.ts index 836ea41bd8..4eead86444 100644 --- a/e2e/vue-router/basic/playwright.config.ts +++ b/e2e/vue-router/basic/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/basic/src/main.tsx b/e2e/vue-router/basic/src/main.tsx index 3e5ac6f1e0..c2293018fc 100644 --- a/e2e/vue-router/basic/src/main.tsx +++ b/e2e/vue-router/basic/src/main.tsx @@ -1,4 +1,4 @@ -import { createApp } from 'vue' +import { createApp, defineComponent } from 'vue' import { ErrorComponent, Link, @@ -133,6 +133,20 @@ function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = postRoute.useLoaderData() + + return () => ( +
+

{post.value.title}

+
+
{post.value.body}
+
+ ) + }, +}) + const postRoute = createRoute({ getParentRoute: () => postsRoute, path: '$postId', @@ -141,18 +155,6 @@ const postRoute = createRoute({ component: PostComponent, }) -function PostComponent() { - const post = postRoute.useLoaderData() - - return ( -
-

{post.value.title}

-
-
{post.value.body}
-
- ) -} - const layoutRoute = createRoute({ getParentRoute: () => rootRoute, id: '_layout', @@ -315,14 +317,30 @@ const paramsPsNamedIndexRoute = createRoute({ }, }) +const ParamsNamedFoo = defineComponent({ + setup() { + const p = paramsPsNamedFooRoute.useParams() + return () => ( +
+

ParamsNamedFoo

+
{JSON.stringify(p.value)}
+
+ ) + }, +}) + const paramsPsNamedFooRoute = createRoute({ getParentRoute: () => paramsPsNamedRoute, path: '/$foo', - component: function ParamsNamedFoo() { - const p = paramsPsNamedFooRoute.useParams() - return ( + component: ParamsNamedFoo, +}) + +const ParamsNamedFooMarkdown = defineComponent({ + setup() { + const p = paramsPsNamedFooPrefixRoute.useParams() + return () => (
-

ParamsNamedFoo

+

ParamsNamedFooPrefix

{JSON.stringify(p.value)}
) @@ -332,11 +350,15 @@ const paramsPsNamedFooRoute = createRoute({ const paramsPsNamedFooPrefixRoute = createRoute({ getParentRoute: () => paramsPsNamedRoute, path: '/prefix{$foo}', - component: function ParamsNamedFooMarkdown() { - const p = paramsPsNamedFooPrefixRoute.useParams() - return ( + component: ParamsNamedFooMarkdown, +}) + +const ParamsNamedFooSuffix = defineComponent({ + setup() { + const p = paramsPsNamedFooSuffixRoute.useParams() + return () => (
-

ParamsNamedFooPrefix

+

ParamsNamedFooSuffix

{JSON.stringify(p.value)}
) @@ -346,15 +368,7 @@ const paramsPsNamedFooPrefixRoute = createRoute({ const paramsPsNamedFooSuffixRoute = createRoute({ getParentRoute: () => paramsPsNamedRoute, path: '/{$foo}suffix', - component: function ParamsNamedFooSuffix() { - const p = paramsPsNamedFooSuffixRoute.useParams() - return ( -
-

ParamsNamedFooSuffix

-
{JSON.stringify(p.value)}
-
- ) - }, + component: ParamsNamedFooSuffix, }) const paramsPsWildcardRoute = createRoute({ @@ -370,14 +384,30 @@ const paramsPsWildcardIndexRoute = createRoute({ }, }) +const ParamsWildcardSplat = defineComponent({ + setup() { + const p = paramsPsWildcardSplatRoute.useParams() + return () => ( +
+

ParamsWildcardSplat

+
{JSON.stringify(p.value)}
+
+ ) + }, +}) + const paramsPsWildcardSplatRoute = createRoute({ getParentRoute: () => paramsPsWildcardRoute, path: '$', - component: function ParamsWildcardSplat() { - const p = paramsPsWildcardSplatRoute.useParams() - return ( + component: ParamsWildcardSplat, +}) + +const ParamsWildcardSplatPrefix = defineComponent({ + setup() { + const p = paramsPsWildcardSplatPrefixRoute.useParams() + return () => (
-

ParamsWildcardSplat

+

ParamsWildcardSplatPrefix

{JSON.stringify(p.value)}
) @@ -387,11 +417,15 @@ const paramsPsWildcardSplatRoute = createRoute({ const paramsPsWildcardSplatPrefixRoute = createRoute({ getParentRoute: () => paramsPsWildcardRoute, path: 'prefix{$}', - component: function ParamsWildcardSplatPrefix() { - const p = paramsPsWildcardSplatPrefixRoute.useParams() - return ( + component: ParamsWildcardSplatPrefix, +}) + +const ParamsWildcardSplatSuffix = defineComponent({ + setup() { + const p = paramsPsWildcardSplatSuffixRoute.useParams() + return () => (
-

ParamsWildcardSplatPrefix

+

ParamsWildcardSplatSuffix

{JSON.stringify(p.value)}
) @@ -401,15 +435,7 @@ const paramsPsWildcardSplatPrefixRoute = createRoute({ const paramsPsWildcardSplatSuffixRoute = createRoute({ getParentRoute: () => paramsPsWildcardRoute, path: '{$}suffix', - component: function ParamsWildcardSplatSuffix() { - const p = paramsPsWildcardSplatSuffixRoute.useParams() - return ( -
-

ParamsWildcardSplatSuffix

-
{JSON.stringify(p.value)}
-
- ) - }, + component: ParamsWildcardSplatSuffix, }) const routeTree = rootRoute.addChildren([ diff --git a/e2e/vue-router/basic/src/posts.lazy.tsx b/e2e/vue-router/basic/src/posts.lazy.tsx index b2df740010..a236404d84 100644 --- a/e2e/vue-router/basic/src/posts.lazy.tsx +++ b/e2e/vue-router/basic/src/posts.lazy.tsx @@ -1,36 +1,39 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createLazyRoute } from '@tanstack/vue-router' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+ +
+ ) + }, +}) + export const Route = createLazyRoute('/posts')({ component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
- -
- ) -} diff --git a/e2e/vue-router/basic/src/posts.ts b/e2e/vue-router/basic/src/posts.ts index e859645746..f72d16fee3 100644 --- a/e2e/vue-router/basic/src/posts.ts +++ b/e2e/vue-router/basic/src/posts.ts @@ -8,11 +8,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/vue-router/basic/tests/app.spec.ts b/e2e/vue-router/basic/tests/app.spec.ts index ec0e24d8a4..9c0a6b6901 100644 --- a/e2e/vue-router/basic/tests/app.spec.ts +++ b/e2e/vue-router/basic/tests/app.spec.ts @@ -1,8 +1,7 @@ -import { expect, test } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from '../package.json' with { type: 'json' } +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/basic/tests/params.spec.ts b/e2e/vue-router/basic/tests/params.spec.ts index ac18f39864..f673138047 100644 --- a/e2e/vue-router/basic/tests/params.spec.ts +++ b/e2e/vue-router/basic/tests/params.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.describe('params operations + prefix/suffix', () => { test.beforeEach(async ({ page }) => { diff --git a/e2e/vue-router/basic/tests/setup/global.setup.ts b/e2e/vue-router/basic/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/basic/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/basic/tests/setup/global.teardown.ts b/e2e/vue-router/basic/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/basic/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/generator-cli-only/package.json b/e2e/vue-router/generator-cli-only/package.json index 410a14b742..f9324643ac 100644 --- a/e2e/vue-router/generator-cli-only/package.json +++ b/e2e/vue-router/generator-cli-only/package.json @@ -8,14 +8,14 @@ "build": "tsr generate && vite build && tsc --noEmit", "preview": "vite preview", "start": "tsr generate && vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/router-cli": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.16", "tailwindcss": "^4.2.2" }, @@ -26,6 +26,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/generator-cli-only/playwright.config.ts b/e2e/vue-router/generator-cli-only/playwright.config.ts index c9d9a76ae7..4eead86444 100644 --- a/e2e/vue-router/generator-cli-only/playwright.config.ts +++ b/e2e/vue-router/generator-cli-only/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/generator-cli-only/src/posts.ts b/e2e/vue-router/generator-cli-only/src/posts.ts index e859645746..f72d16fee3 100644 --- a/e2e/vue-router/generator-cli-only/src/posts.ts +++ b/e2e/vue-router/generator-cli-only/src/posts.ts @@ -8,11 +8,7 @@ type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx b/e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx index f4f1b04f88..bb2d728afd 100644 --- a/e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx @@ -1,7 +1,21 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ export function PostErrorComponent({ error }: ErrorComponentProps) { return } - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx b/e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx index eaaa35fd5c..518bdc3d70 100644 --- a/e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx +++ b/e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx @@ -1,39 +1,42 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../posts' +const PostsLayoutComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsLayoutComponent, }) - -function PostsLayoutComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/generator-cli-only/tests/app.spec.ts b/e2e/vue-router/generator-cli-only/tests/app.spec.ts index 5a83a314f2..ced5ac9310 100644 --- a/e2e/vue-router/generator-cli-only/tests/app.spec.ts +++ b/e2e/vue-router/generator-cli-only/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/generator-cli-only/tests/setup/global.setup.ts b/e2e/vue-router/generator-cli-only/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/generator-cli-only/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts b/e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/js-only-file-based/package.json b/e2e/vue-router/js-only-file-based/package.json index d7f062038e..cda098978c 100644 --- a/e2e/vue-router/js-only-file-based/package.json +++ b/e2e/vue-router/js-only-file-based/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, diff --git a/e2e/vue-router/js-only-file-based/playwright.config.ts b/e2e/vue-router/js-only-file-based/playwright.config.ts index 4f93bc1413..0925936d55 100644 --- a/e2e/vue-router/js-only-file-based/playwright.config.ts +++ b/e2e/vue-router/js-only-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -18,18 +13,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/js-only-file-based/src/posts.js b/e2e/vue-router/js-only-file-based/src/posts.js index 979e5e381c..36c1c281f6 100644 --- a/e2e/vue-router/js-only-file-based/src/posts.js +++ b/e2e/vue-router/js-only-file-based/src/posts.js @@ -2,11 +2,7 @@ import axios from 'redaxios' export class NotFoundError extends Error {} -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPosts = async () => { console.info('Fetching posts...') diff --git a/e2e/vue-router/js-only-file-based/src/routes/posts.$postId.jsx b/e2e/vue-router/js-only-file-based/src/routes/posts.$postId.jsx index b769e23862..05599a6780 100644 --- a/e2e/vue-router/js-only-file-based/src/routes/posts.$postId.jsx +++ b/e2e/vue-router/js-only-file-based/src/routes/posts.$postId.jsx @@ -1,8 +1,22 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { ErrorComponent } from '@tanstack/vue-router' import { fetchPost } from '../posts' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent, @@ -15,14 +29,3 @@ export const Route = createFileRoute('/posts/$postId')({ export function PostErrorComponent({ error }) { return } - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/js-only-file-based/src/routes/posts.route.jsx b/e2e/vue-router/js-only-file-based/src/routes/posts.route.jsx index c1fef7213d..5925dbed54 100644 --- a/e2e/vue-router/js-only-file-based/src/routes/posts.route.jsx +++ b/e2e/vue-router/js-only-file-based/src/routes/posts.route.jsx @@ -1,41 +1,44 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { Link, Outlet } from '@tanstack/vue-router' import { fetchPosts } from '../posts' +const PostsLayoutComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsLayoutComponent, }) - -function PostsLayoutComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/js-only-file-based/tests/app.spec.ts b/e2e/vue-router/js-only-file-based/tests/app.spec.ts index 5a83a314f2..ced5ac9310 100644 --- a/e2e/vue-router/js-only-file-based/tests/app.spec.ts +++ b/e2e/vue-router/js-only-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/js-only-file-based/tests/setup/global.setup.ts b/e2e/vue-router/js-only-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/js-only-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/js-only-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/js-only-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/js-only-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/rspack-basic-file-based/package.json b/e2e/vue-router/rspack-basic-file-based/package.json index ba0ae7efde..93439f7d5b 100644 --- a/e2e/vue-router/rspack-basic-file-based/package.json +++ b/e2e/vue-router/rspack-basic-file-based/package.json @@ -7,17 +7,17 @@ "build": "rsbuild build && tsc --noEmit", "preview": "rsbuild preview", "start": "rsbuild preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.16" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-babel": "^1.1.2", "@rsbuild/plugin-vue": "^1.2.7", "@rsbuild/plugin-vue-jsx": "^2.0.0", @@ -27,7 +27,8 @@ "@tanstack/virtual-file-routes": "workspace:^", "postcss": "^8.5.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", - "vue-tsc": "^3.1.5" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/rspack-basic-file-based/playwright.config.ts b/e2e/vue-router/rspack-basic-file-based/playwright.config.ts index 5f20415459..4eead86444 100644 --- a/e2e/vue-router/rspack-basic-file-based/playwright.config.ts +++ b/e2e/vue-router/rspack-basic-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `PUBLIC_NODE_ENV="test" PUBLIC_EXTERNAL_PORT=${EXTERNAL_PORT} PUBLIC_SERVER_PORT=${PORT} pnpm build && PUBLIC_NODE_ENV="test" PUBLIC_EXTERNAL_PORT=${EXTERNAL_PORT} PUBLIC_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/rspack-basic-file-based/rsbuild.config.ts b/e2e/vue-router/rspack-basic-file-based/rsbuild.config.ts index d5e4b7456c..c91449b6c3 100644 --- a/e2e/vue-router/rspack-basic-file-based/rsbuild.config.ts +++ b/e2e/vue-router/rspack-basic-file-based/rsbuild.config.ts @@ -12,19 +12,6 @@ export default defineConfig({ pluginVue(), pluginVueJsx(), ], - source: { - define: { - // Rsbuild only defines `import.meta.env.PUBLIC_*` when the env var exists. - // When it doesn't, rspack can transform `import.meta.env` to `void 0`, which - // makes `import.meta.env.PUBLIC_*` crash at runtime. - 'import.meta.env.PUBLIC_NODE_ENV': JSON.stringify( - process.env.PUBLIC_NODE_ENV ?? '', - ), - 'import.meta.env.PUBLIC_EXTERNAL_PORT': JSON.stringify( - process.env.PUBLIC_EXTERNAL_PORT ?? '', - ), - }, - }, tools: { rspack: { plugins: [tanstackRouter({ target: 'vue', autoCodeSplitting: true })], diff --git a/e2e/vue-router/rspack-basic-file-based/src/posts.tsx b/e2e/vue-router/rspack-basic-file-based/src/posts.tsx index 0b557a0f65..5f5463a668 100644 --- a/e2e/vue-router/rspack-basic-file-based/src/posts.tsx +++ b/e2e/vue-router/rspack-basic-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.PUBLIC_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.PUBLIC_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/rspack-basic-file-based/src/routes/posts.$postId.tsx b/e2e/vue-router/rspack-basic-file-based/src/routes/posts.$postId.tsx index e271c139f5..a86ea0762f 100644 --- a/e2e/vue-router/rspack-basic-file-based/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/rspack-basic-file-based/src/routes/posts.$postId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -6,6 +7,19 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ }, component: PostComponent, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/rspack-basic-file-based/src/routes/posts.tsx b/e2e/vue-router/rspack-basic-file-based/src/routes/posts.tsx index 653918c370..90744370ff 100644 --- a/e2e/vue-router/rspack-basic-file-based/src/routes/posts.tsx +++ b/e2e/vue-router/rspack-basic-file-based/src/routes/posts.tsx @@ -1,40 +1,43 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/rspack-basic-file-based/tests/app.spec.ts b/e2e/vue-router/rspack-basic-file-based/tests/app.spec.ts index 10beff655f..d230263bfe 100644 --- a/e2e/vue-router/rspack-basic-file-based/tests/app.spec.ts +++ b/e2e/vue-router/rspack-basic-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/rspack-basic-file-based/tests/setup/global.setup.ts b/e2e/vue-router/rspack-basic-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/rspack-basic-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/rspack-basic-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/rspack-basic-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/rspack-basic-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json index 9b55dcc6f9..536435a09e 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json @@ -7,17 +7,17 @@ "build": "rsbuild build && tsc --noEmit", "preview": "rsbuild preview", "start": "rsbuild preview", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.16" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-babel": "^1.1.2", "@rsbuild/plugin-vue": "^1.2.7", "@rsbuild/plugin-vue-jsx": "^2.0.0", @@ -27,7 +27,8 @@ "@tanstack/virtual-file-routes": "workspace:^", "postcss": "^8.5.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", - "vue-tsc": "^3.1.5" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts index bf3adc082c..1c1d021f2f 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -17,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `PUBLIC_NODE_ENV="test" PUBLIC_EXTERNAL_PORT=${EXTERNAL_PORT} PUBLIC_SERVER_PORT=${PORT} pnpm build && PUBLIC_SERVER_PORT=${PORT} pnpm start --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm start --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/rsbuild.config.ts b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/rsbuild.config.ts index b09f6ccda8..e5c7e8b77e 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/rsbuild.config.ts +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/rsbuild.config.ts @@ -12,19 +12,6 @@ export default defineConfig({ pluginVue(), pluginVueJsx(), ], - source: { - define: { - // Rsbuild only defines `import.meta.env.PUBLIC_*` when the env var exists. - // When it doesn't, rspack can transform `import.meta.env` to `void 0`, which - // makes `import.meta.env.PUBLIC_*` crash at runtime. - 'import.meta.env.PUBLIC_NODE_ENV': JSON.stringify( - process.env.PUBLIC_NODE_ENV ?? '', - ), - 'import.meta.env.PUBLIC_EXTERNAL_PORT': JSON.stringify( - process.env.PUBLIC_EXTERNAL_PORT ?? '', - ), - }, - }, tools: { rspack: { plugins: [ diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx index 0b557a0f65..5f5463a668 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.PUBLIC_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.PUBLIC_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx index cb1924e993..5e3fe4d130 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -6,6 +7,19 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent as any, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ }, component: PostComponent, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx index 265faaf650..2a4e8deddd 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx @@ -1,39 +1,42 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
- -
- ) -} diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts index 10beff655f..d230263bfe 100644 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts +++ b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts b/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/package.json b/e2e/vue-router/scroll-restoration-sandbox-vite/package.json index ebcea6fb39..d071ee546a 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/package.json +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/package.json @@ -11,14 +11,14 @@ "start": "vite", "test:e2e:browser": "VITE_APP_HISTORY=browser playwright test --config=playwright.browser.config.ts --project=chromium", "test:e2e:hash": "VITE_APP_HISTORY=hash playwright test --config=playwright.hash.config.ts --project=chromium", - "test:e2e": "rm -rf port*.txt; pnpm run test:e2e:browser && pnpm run test:e2e:hash" + "test:e2e": "pnpm run test:e2e:browser && pnpm run test:e2e:hash" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/router-plugin": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16", "zod": "^4.4.3" @@ -30,6 +30,16 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/dist-hash" + ] + } + } } } diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts b/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts index 9d7691f0fd..e2681daea5 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.browser.config.ts @@ -1,15 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, - resolveRuntimeSuffix, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort( - packageJson.name + `-${resolveRuntimeSuffix('browser')}`, -) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=browser pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=browser pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `VITE_APP_HISTORY=browser pnpm build && VITE_APP_HISTORY=browser pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts b/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts index 80a340cef4..445616b9bd 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/playwright.hash.config.ts @@ -1,15 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, - resolveRuntimeSuffix, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort( - packageJson.name + `-${resolveRuntimeSuffix('hash')}`, -) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,18 +12,15 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=hash vite build --outDir dist-hash && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} VITE_APP_HISTORY=hash pnpm preview --port ${PORT} --outDir dist-hash`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `VITE_APP_HISTORY=hash vite build --outDir dist-hash && VITE_APP_HISTORY=hash pnpm preview --port ${PORT} --outDir dist-hash`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/src/posts.tsx b/e2e/vue-router/scroll-restoration-sandbox-vite/src/posts.tsx index c6cba486ab..bc56dff904 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/src/posts.tsx +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/src/posts.tsx @@ -12,11 +12,7 @@ export type PostType = { export class PostNotFoundError extends Error {} -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/app.spec.ts b/e2e/vue-router/scroll-restoration-sandbox-vite/tests/app.spec.ts index 5f226c6db3..067f0341c4 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/app.spec.ts +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' import { toRuntimePath } from '@tanstack/router-e2e-utils' test('Smoke - Renders home', async ({ page }) => { diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts b/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts b/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/scroll-restoration-sandbox-vite/tsconfig.json b/e2e/vue-router/scroll-restoration-sandbox-vite/tsconfig.json index 3e5b04987f..b47cca9589 100644 --- a/e2e/vue-router/scroll-restoration-sandbox-vite/tsconfig.json +++ b/e2e/vue-router/scroll-restoration-sandbox-vite/tsconfig.json @@ -12,5 +12,5 @@ "allowJs": true, "types": ["vite/client", "node"] }, - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist", "dist-hash"] } diff --git a/e2e/vue-router/sentry-integration/package.json b/e2e/vue-router/sentry-integration/package.json index 897331f1b8..045ddd99be 100644 --- a/e2e/vue-router/sentry-integration/package.json +++ b/e2e/vue-router/sentry-integration/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@sentry/vue": "^10.32.0", @@ -17,7 +17,7 @@ "@tailwindcss/vite": "^4.2.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -27,6 +27,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/sentry-integration/playwright.config.ts b/e2e/vue-router/sentry-integration/playwright.config.ts index 0c5cee43e4..6a684ac89e 100644 --- a/e2e/vue-router/sentry-integration/playwright.config.ts +++ b/e2e/vue-router/sentry-integration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/view-transitions/package.json b/e2e/vue-router/view-transitions/package.json index 82f88dbe64..21a0f1d8a0 100644 --- a/e2e/vue-router/view-transitions/package.json +++ b/e2e/vue-router/view-transitions/package.json @@ -8,7 +8,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "vite", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tailwindcss/vite": "^4.2.2", @@ -17,7 +17,7 @@ "@tanstack/vue-query-devtools": "^6.1.2", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwindcss": "^4.2.2", "vue": "^3.5.16" }, @@ -28,6 +28,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-router/view-transitions/playwright.config.ts b/e2e/vue-router/view-transitions/playwright.config.ts index c5de6b5611..4eead86444 100644 --- a/e2e/vue-router/view-transitions/playwright.config.ts +++ b/e2e/vue-router/view-transitions/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -22,13 +17,10 @@ export default defineConfig({ baseURL, }, - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - webServer: { - command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && pnpm preview --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-router/view-transitions/src/routes/posts.$postId.tsx b/e2e/vue-router/view-transitions/src/routes/posts.$postId.tsx index e271c139f5..a86ea0762f 100644 --- a/e2e/vue-router/view-transitions/src/routes/posts.$postId.tsx +++ b/e2e/vue-router/view-transitions/src/routes/posts.$postId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -6,6 +7,19 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent, @@ -14,14 +28,3 @@ export const Route = createFileRoute('/posts/$postId')({ }, component: PostComponent, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-router/view-transitions/src/routes/posts.route.tsx b/e2e/vue-router/view-transitions/src/routes/posts.route.tsx index 01d90b7ad6..6802b073f6 100644 --- a/e2e/vue-router/view-transitions/src/routes/posts.route.tsx +++ b/e2e/vue-router/view-transitions/src/routes/posts.route.tsx @@ -1,43 +1,46 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../posts' +const PostsLayoutComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+
+
+ +
+
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsLayoutComponent, }) - -function PostsLayoutComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
-
-
- -
-
- ) -} diff --git a/e2e/vue-router/view-transitions/tests/app.spec.ts b/e2e/vue-router/view-transitions/tests/app.spec.ts index 472bd6ed0b..6c1ccf1a6e 100644 --- a/e2e/vue-router/view-transitions/tests/app.spec.ts +++ b/e2e/vue-router/view-transitions/tests/app.spec.ts @@ -1,4 +1,4 @@ -import { test } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-router/view-transitions/tests/setup/global.setup.ts b/e2e/vue-router/view-transitions/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-router/view-transitions/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/view-transitions/tests/setup/global.teardown.ts b/e2e/vue-router/view-transitions/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-router/view-transitions/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-router/view-transitions/tests/view-transitions.spec.ts b/e2e/vue-router/view-transitions/tests/view-transitions.spec.ts index 31d8b12b04..e62662a1d2 100644 --- a/e2e/vue-router/view-transitions/tests/view-transitions.spec.ts +++ b/e2e/vue-router/view-transitions/tests/view-transitions.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.addInitScript(() => { diff --git a/e2e/vue-start/basic-auth/package.json b/e2e/vue-start/basic-auth/package.json index 25de0c6b80..7f6fb798da 100644 --- a/e2e/vue-start/basic-auth/package.json +++ b/e2e/vue-start/basic-auth/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", "prisma-generate": "prisma generate", - "test:e2e": "rm -rf port*.txt; mkdir -p .tmp; rm -f .tmp/dev.db .tmp/dev.db-journal .tmp/dev.db-wal .tmp/dev.db-shm; export DATABASE_URL=file:./.tmp/dev.db; pnpm run prisma-generate && pnpm exec prisma migrate deploy && playwright test --project=chromium" + "test:e2e": "mkdir -p .tmp; rm -f .tmp/dev.db .tmp/dev.db-journal .tmp/dev.db-wal .tmp/dev.db-shm; export DATABASE_URL=file:./.tmp/dev.db; pnpm run prisma-generate && pnpm exec prisma migrate deploy && playwright test --project=chromium" }, "dependencies": { "@libsql/client": "^0.15.15", @@ -19,7 +19,8 @@ "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-start": "workspace:^", - "redaxios": "^0.5.1", + "iron-session": "^9.0.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25" }, @@ -32,9 +33,21 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "dotenv": "^17.2.3", "prisma": "^7.0.0", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/.tmp", + "{projectRoot}/src/prisma-generated" + ] + } + } } } diff --git a/e2e/vue-start/basic-auth/playwright.config.ts b/e2e/vue-start/basic-auth/playwright.config.ts index 18b8905468..82678ac00b 100644 --- a/e2e/vue-start/basic-auth/playwright.config.ts +++ b/e2e/vue-start/basic-auth/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx index 02caf56456..0687372ae0 100644 --- a/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/basic-auth/src/routes/__root.tsx b/e2e/vue-start/basic-auth/src/routes/__root.tsx index 89802cfd2f..e5b6f6778f 100644 --- a/e2e/vue-start/basic-auth/src/routes/__root.tsx +++ b/e2e/vue-start/basic-auth/src/routes/__root.tsx @@ -1,4 +1,5 @@ /// +import { defineComponent } from 'vue' import { Body, HeadContent, @@ -15,21 +16,69 @@ import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js' import { NotFound } from '~/components/NotFound.js' import appCss from '~/styles/app.css?url' import { seo } from '~/utils/seo.js' -import { useAppSession } from '~/utils/session.js' +import { getAppSession } from '~/utils/session.js' const fetchUser = createServerFn({ method: 'GET' }).handler(async () => { // We need to auth on the server so we have access to secure cookies - const session = await useAppSession() + const session = await getAppSession() - if (!session.data.userEmail) { + if (!session.userEmail) { return null } return { - email: session.data.userEmail, + email: session.userEmail, } }) +const RootShell = defineComponent({ + setup(_, { slots }) { + const routeContext = Route.useRouteContext() + return () => ( + + + + + +
+ + Home + {' '} + + Posts + +
+ {routeContext.value.user ? ( + <> + {routeContext.value.user.email} + Logout + + ) : ( + Login + )} +
+
+
+ {slots.default?.()} + + + + + ) + }, +}) + export const Route = createRootRoute({ beforeLoad: async () => { const user = await fetchUser() @@ -81,50 +130,3 @@ export const Route = createRootRoute({ notFoundComponent: () => , component: () => , }) - -function RootShell(_: unknown, { slots }: { slots: any }) { - const routeContext = Route.useRouteContext() - - return ( - - - - - -
- - Home - {' '} - - Posts - -
- {routeContext.value.user ? ( - <> - {routeContext.value.user.email} - Logout - - ) : ( - Login - )} -
-
-
- {slots.default?.()} - - - - - ) -} diff --git a/e2e/vue-start/basic-auth/src/routes/_authed.tsx b/e2e/vue-start/basic-auth/src/routes/_authed.tsx index 153efc39eb..606de3e487 100644 --- a/e2e/vue-start/basic-auth/src/routes/_authed.tsx +++ b/e2e/vue-start/basic-auth/src/routes/_authed.tsx @@ -3,7 +3,7 @@ import { createServerFn } from '@tanstack/vue-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { Login } from '~/components/Login' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const loginFn = createServerFn({ method: 'POST', @@ -37,12 +37,11 @@ export const loginFn = createServerFn({ } // Create a session - const session = await useAppSession() + const session = await getAppSession() // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + session.userEmail = user.email + await session.save() }) export const Route = createFileRoute('/_authed')({ @@ -52,7 +51,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return } diff --git a/e2e/vue-start/basic-auth/src/routes/_authed/posts.$postId.tsx b/e2e/vue-start/basic-auth/src/routes/_authed/posts.$postId.tsx index da0c26f27f..45d6bbab0d 100644 --- a/e2e/vue-start/basic-auth/src/routes/_authed/posts.$postId.tsx +++ b/e2e/vue-start/basic-auth/src/routes/_authed/posts.$postId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -8,6 +9,18 @@ export function PostErrorComponent({ error }: ErrorComponentProps) { return } +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/_authed/posts/$postId')({ loader: ({ params: { postId } }) => fetchPost({ data: postId }), errorComponent: PostErrorComponent, @@ -16,14 +29,3 @@ export const Route = createFileRoute('/_authed/posts/$postId')({ return Post not found }, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-start/basic-auth/src/routes/_authed/posts.tsx b/e2e/vue-start/basic-auth/src/routes/_authed/posts.tsx index cfac133b51..6b8b54c666 100644 --- a/e2e/vue-start/basic-auth/src/routes/_authed/posts.tsx +++ b/e2e/vue-start/basic-auth/src/routes/_authed/posts.tsx @@ -1,36 +1,38 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '~/utils/posts.js' -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) export const Route = createFileRoute('/_authed/posts')({ loader: () => fetchPosts(), diff --git a/e2e/vue-start/basic-auth/src/routes/logout.tsx b/e2e/vue-start/basic-auth/src/routes/logout.tsx index f1d7b58e29..8372b33608 100644 --- a/e2e/vue-start/basic-auth/src/routes/logout.tsx +++ b/e2e/vue-start/basic-auth/src/routes/logout.tsx @@ -1,12 +1,12 @@ import { redirect, createFileRoute } from '@tanstack/vue-router' import { createServerFn } from '@tanstack/vue-start' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' const logoutFn = createServerFn({ method: 'POST' }).handler(async () => { - const session = await useAppSession() + const session = await getAppSession() - session.clear() + session.destroy() throw redirect({ href: '/', diff --git a/e2e/vue-start/basic-auth/src/routes/signup.tsx b/e2e/vue-start/basic-auth/src/routes/signup.tsx index eade8363e6..5f37f109c7 100644 --- a/e2e/vue-start/basic-auth/src/routes/signup.tsx +++ b/e2e/vue-start/basic-auth/src/routes/signup.tsx @@ -5,7 +5,7 @@ import { defineComponent } from 'vue' import { hashPassword, prismaClient } from '~/utils/prisma' import { useMutation } from '~/hooks/useMutation' import { Auth } from '~/components/Auth' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const signupFn = createServerFn({ method: 'POST', @@ -25,7 +25,7 @@ export const signupFn = createServerFn({ const password = await hashPassword(payload.password) // Create a session - const session = await useAppSession() + const session = await getAppSession() if (found) { if (found.password !== password) { @@ -37,9 +37,8 @@ export const signupFn = createServerFn({ } // Store the user's email in the session - await session.update({ - userEmail: found.email, - }) + session.userEmail = found.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ @@ -56,9 +55,8 @@ export const signupFn = createServerFn({ }) // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + session.userEmail = user.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ diff --git a/e2e/vue-start/basic-auth/src/utils/session.ts b/e2e/vue-start/basic-auth/src/utils/session.ts index 7cf2a41792..7d078225a0 100644 --- a/e2e/vue-start/basic-auth/src/utils/session.ts +++ b/e2e/vue-start/basic-auth/src/utils/session.ts @@ -1,13 +1,25 @@ -// src/services/session.server.ts -import { useSession } from '@tanstack/vue-start/server' +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/vue-start/server' import type { User } from '~/prisma-generated/client' type SessionUser = { userEmail: User['email'] } -export function useAppSession() { - return useSession({ - password: 'ChangeThisBeforeShippingToProdOrYouWillBeFired', - }) +export function getAppSession() { + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'test-auth-session', + // This fixture only runs locally with test credentials. + password: 'local-e2e-only-session-password-at-least-32-characters', + ttl: 60 * 60, + cookieOptions: { + httpOnly: true, + secure: false, + sameSite: 'lax', + path: '/', + }, + }, + ) } diff --git a/e2e/vue-start/basic-cloudflare/package.json b/e2e/vue-start/basic-cloudflare/package.json index 05b2158c0e..5ab77db8fc 100644 --- a/e2e/vue-start/basic-cloudflare/package.json +++ b/e2e/vue-start/basic-cloudflare/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "cf-typegen": "wrangler types", "postinstall": "WRANGLER_LOG=warn npm run --silent cf-typegen", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -25,10 +25,21 @@ "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "wrangler": "^4.74.0" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/.wrangler/deploy" + ] + } + } } } diff --git a/e2e/vue-start/basic-cloudflare/playwright.config.ts b/e2e/vue-start/basic-cloudflare/playwright.config.ts index a545dff891..0925936d55 100644 --- a/e2e/vue-start/basic-cloudflare/playwright.config.ts +++ b/e2e/vue-start/basic-cloudflare/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -14,9 +13,6 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, @@ -24,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && pnpm preview --port ${PORT}`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx index 02caf56456..0687372ae0 100644 --- a/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/basic-cloudflare/src/routes/index.tsx b/e2e/vue-start/basic-cloudflare/src/routes/index.tsx index 1c708a7ec6..d3a020c7ad 100644 --- a/e2e/vue-start/basic-cloudflare/src/routes/index.tsx +++ b/e2e/vue-start/basic-cloudflare/src/routes/index.tsx @@ -1,7 +1,21 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { createServerFn } from '@tanstack/vue-start' import { env } from 'cloudflare:workers' +const Home = defineComponent({ + setup() { + const data = Route.useLoaderData() + return () => ( +
+

Welcome Home!!!

+

{data.value.message}

+

{data.value.myVar}

+
+ ) + }, +}) + export const Route = createFileRoute('/')({ loader: () => getData(), component: Home, @@ -13,15 +27,3 @@ const getData = createServerFn().handler(() => { myVar: env.MY_VAR, } }) - -function Home() { - const data = Route.useLoaderData() - - return ( -
-

Welcome Home!!!

-

{data.value.message}

-

{data.value.myVar}

-
- ) -} diff --git a/e2e/vue-start/basic-cloudflare/src/routes/static.tsx b/e2e/vue-start/basic-cloudflare/src/routes/static.tsx index 7b0f9fd232..14d0c06294 100644 --- a/e2e/vue-start/basic-cloudflare/src/routes/static.tsx +++ b/e2e/vue-start/basic-cloudflare/src/routes/static.tsx @@ -1,7 +1,20 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { createServerFn } from '@tanstack/vue-start' import { env } from 'cloudflare:workers' +const StaticPage = defineComponent({ + setup() { + const data = Route.useLoaderData() + return () => ( +
+

Static Page

+

The value is {data.value.myVar}

+
+ ) + }, +}) + export const Route = createFileRoute('/static')({ loader: () => getData(), component: StaticPage, @@ -12,14 +25,3 @@ const getData = createServerFn().handler(() => { myVar: env.MY_VAR, } }) - -function StaticPage() { - const data = Route.useLoaderData() - - return ( -
-

Static Page

-

The value is {data.value.myVar}

-
- ) -} diff --git a/e2e/vue-start/basic-cloudflare/tests/setup/global.setup.ts b/e2e/vue-start/basic-cloudflare/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-start/basic-cloudflare/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/basic-cloudflare/tests/setup/global.teardown.ts b/e2e/vue-start/basic-cloudflare/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/basic-cloudflare/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/basic-tsr-config/package.json b/e2e/vue-start/basic-tsr-config/package.json index 93c3b272fa..828dce5b2a 100644 --- a/e2e/vue-start/basic-tsr-config/package.json +++ b/e2e/vue-start/basic-tsr-config/package.json @@ -8,7 +8,7 @@ "dev:e2e": "vite dev", "build": "rimraf ./count.txt && vite build && tsc --noEmit", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -19,10 +19,12 @@ "devDependencies": { "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "vite": "^8.0.14" + "vite": "^8.0.14", + "rimraf": "catalog:" } } diff --git a/e2e/vue-start/basic-tsr-config/playwright.config.ts b/e2e/vue-start/basic-tsr-config/playwright.config.ts index f6dd61ba6c..e6b92ce385 100644 --- a/e2e/vue-start/basic-tsr-config/playwright.config.ts +++ b/e2e/vue-start/basic-tsr-config/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/basic-tsr-config/src/app/routes/index.tsx b/e2e/vue-start/basic-tsr-config/src/app/routes/index.tsx index 3f4de50817..b4b520e8af 100644 --- a/e2e/vue-start/basic-tsr-config/src/app/routes/index.tsx +++ b/e2e/vue-start/basic-tsr-config/src/app/routes/index.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import * as fs from 'node:fs' import { createFileRoute, useRouter } from '@tanstack/vue-router' import { createServerFn } from '@tanstack/vue-start' @@ -17,25 +18,26 @@ const updateCount = createServerFn({ method: 'POST' }) const count = await getCount() await fs.promises.writeFile(filePath, `${count + data}`) }) +const Home = defineComponent({ + setup() { + const router = useRouter() + const state = Route.useLoaderData() + return () => ( + + ) + }, +}) + export const Route = createFileRoute('/')({ component: Home, loader: async () => await getCount(), }) - -function Home() { - const router = useRouter() - const state = Route.useLoaderData() - - return ( - - ) -} diff --git a/e2e/vue-start/basic-vue-query/package.json b/e2e/vue-start/basic-vue-query/package.json index 6b1335d8bd..ab9589376d 100644 --- a/e2e/vue-start/basic-vue-query/package.json +++ b/e2e/vue-start/basic-vue-query/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-query": "^5.92.1", @@ -18,7 +18,7 @@ "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-router-ssr-query": "workspace:^", "@tanstack/vue-start": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -30,9 +30,10 @@ "@types/node": "^22.10.2", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/basic-vue-query/playwright.config.ts b/e2e/vue-start/basic-vue-query/playwright.config.ts index 84636ab0f9..0618b7272a 100644 --- a/e2e/vue-start/basic-vue-query/playwright.config.ts +++ b/e2e/vue-start/basic-vue-query/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` @@ -16,18 +11,18 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/vue-start/basic-vue-query/src/routes/api.users.ts b/e2e/vue-start/basic-vue-query/src/routes/api.users.ts index cab4cafc3f..f9330a87db 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/api.users.ts +++ b/e2e/vue-start/basic-vue-query/src/routes/api.users.ts @@ -2,11 +2,7 @@ import { createFileRoute } from '@tanstack/vue-router' import axios from 'redaxios' import type { User } from '../utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users')({ server: { diff --git a/e2e/vue-start/basic-vue-query/src/routes/api/users.$id.ts b/e2e/vue-start/basic-vue-query/src/routes/api/users.$id.ts index 4cc4b33a0b..d138746730 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/api/users.$id.ts +++ b/e2e/vue-start/basic-vue-query/src/routes/api/users.$id.ts @@ -2,11 +2,7 @@ import { createFileRoute } from '@tanstack/vue-router' import axios from 'redaxios' import type { User } from '../../utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users/$id')({ server: { diff --git a/e2e/vue-start/basic-vue-query/src/routes/posts.$postId.tsx b/e2e/vue-start/basic-vue-query/src/routes/posts.$postId.tsx index 27baf4bd5f..fd8deaf291 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/posts.$postId.tsx +++ b/e2e/vue-start/basic-vue-query/src/routes/posts.$postId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { useQuery } from '@tanstack/vue-query' import { ErrorComponent, @@ -11,27 +12,30 @@ export function PostErrorComponent(props: ErrorComponentProps) { return } -function PostComponent() { - const params = Route.useParams() - const postQuery = useQuery(() => postQueryOptions(params.value.postId)) - - return ( -
-

{postQuery.data.value?.title}

-
{postQuery.data.value?.body}
- - Deep View - -
- ) -} +const PostComponent = defineComponent({ + setup() { + const params = Route.useParams() + const postQuery = useQuery(() => postQueryOptions(params.value.postId)) + return () => ( +
+

+ {postQuery.data.value?.title} +

+
{postQuery.data.value?.body}
+ + Deep View + +
+ ) + }, +}) export const Route = createFileRoute('/posts/$postId')({ loader: async ({ context, params }) => { diff --git a/e2e/vue-start/basic-vue-query/src/routes/posts_.$postId.deep.tsx b/e2e/vue-start/basic-vue-query/src/routes/posts_.$postId.deep.tsx index 38e7429f6e..211b3ca4b1 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/posts_.$postId.deep.tsx +++ b/e2e/vue-start/basic-vue-query/src/routes/posts_.$postId.deep.tsx @@ -1,22 +1,26 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { useQuery } from '@tanstack/vue-query' import { postQueryOptions } from '../utils/posts' import { PostErrorComponent } from './posts.$postId' -function PostDeepComponent() { - const params = Route.useParams() - const postQuery = useQuery(() => postQueryOptions(params.value.postId)) - - return ( -
- - ← All Posts - -

{postQuery.data.value?.title}

-
{postQuery.data.value?.body}
-
- ) -} +const PostDeepComponent = defineComponent({ + setup() { + const params = Route.useParams() + const postQuery = useQuery(() => postQueryOptions(params.value.postId)) + return () => ( +
+ + ← All Posts + +

+ {postQuery.data.value?.title} +

+
{postQuery.data.value?.body}
+
+ ) + }, +}) export const Route = createFileRoute('/posts_/$postId/deep')({ loader: async ({ params: { postId }, context }) => { diff --git a/e2e/vue-start/basic-vue-query/src/routes/suspense-transition.tsx b/e2e/vue-start/basic-vue-query/src/routes/suspense-transition.tsx index 6d12790dc9..f5004aa21d 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/suspense-transition.tsx +++ b/e2e/vue-start/basic-vue-query/src/routes/suspense-transition.tsx @@ -1,6 +1,6 @@ import { queryOptions, useQuery } from '@tanstack/vue-query' import { Link, createFileRoute } from '@tanstack/vue-router' -import { ref, watchEffect } from 'vue' +import { defineComponent, ref, watchEffect } from 'vue' const doubleQueryOptions = (n: number) => queryOptions({ @@ -19,6 +19,37 @@ export const Route = createFileRoute('/suspense-transition')({ ssr: false, // Disable SSR to avoid suspense issues during initial load }) +const Result = defineComponent({ + setup() { + const search = Route.useSearch() + const doubleQuery = useQuery(() => doubleQueryOptions(search.value.n)) + const displayedN = ref(search.value.n) + const displayedDouble = ref(undefined) + watchEffect(() => { + if (doubleQuery.data.value !== undefined) { + displayedN.value = search.value.n + displayedDouble.value = doubleQuery.data.value + } + }) + return () => ( +
+
+ Loading... +
+
+
+ n: {displayedN.value} +
+
+ double:{' '} + {displayedDouble.value} +
+
+
+ ) + }, +}) + function SuspenseTransitionComponent() { return (
@@ -39,34 +70,3 @@ function SuspenseTransitionComponent() {
) } - -function Result() { - const search = Route.useSearch() - const doubleQuery = useQuery(() => doubleQueryOptions(search.value.n)) - const displayedN = ref(search.value.n) - const displayedDouble = ref(undefined) - - watchEffect(() => { - if (doubleQuery.data.value !== undefined) { - displayedN.value = search.value.n - displayedDouble.value = doubleQuery.data.value - } - }) - - return ( -
-
- Loading... -
-
-
- n: {displayedN.value} -
-
- double:{' '} - {displayedDouble.value} -
-
-
- ) -} diff --git a/e2e/vue-start/basic-vue-query/src/routes/transition/count/query.tsx b/e2e/vue-start/basic-vue-query/src/routes/transition/count/query.tsx index 2ab0562203..32b1943c71 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/transition/count/query.tsx +++ b/e2e/vue-start/basic-vue-query/src/routes/transition/count/query.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { queryOptions, useQuery } from '@tanstack/vue-query' import { z } from 'zod' @@ -16,6 +17,32 @@ const doubleQueryOptions = (n: number) => placeholderData: (oldData) => oldData, }) +const TransitionPage = defineComponent({ + setup() { + const search = Route.useSearch() + const doubleQuery = useQuery(() => doubleQueryOptions(search.value.n)) + return () => ( +
+ ({ n: s.n + 1 })} + > + Increase + + +
+
n: {doubleQuery.data.value?.n}
+
+ double: {doubleQuery.data.value?.double} +
+
+
+ ) + }, +}) + export const Route = createFileRoute('/transition/count/query')({ validateSearch: searchSchema, loader: ({ context: { queryClient }, location }) => { @@ -24,28 +51,3 @@ export const Route = createFileRoute('/transition/count/query')({ }, component: TransitionPage, }) - -function TransitionPage() { - const search = Route.useSearch() - const doubleQuery = useQuery(() => doubleQueryOptions(search.value.n)) - - return ( -
- ({ n: s.n + 1 })} - > - Increase - - -
-
n: {doubleQuery.data.value?.n}
-
- double: {doubleQuery.data.value?.double} -
-
-
- ) -} diff --git a/e2e/vue-start/basic-vue-query/src/routes/users.$userId.tsx b/e2e/vue-start/basic-vue-query/src/routes/users.$userId.tsx index 91376b9498..bf1b75861e 100644 --- a/e2e/vue-start/basic-vue-query/src/routes/users.$userId.tsx +++ b/e2e/vue-start/basic-vue-query/src/routes/users.$userId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { useQuery } from '@tanstack/vue-query' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' @@ -5,19 +6,20 @@ import type { ErrorComponentProps } from '@tanstack/vue-router' import { NotFound } from '~/components/NotFound' import { userQueryOptions } from '~/utils/users' -function UserComponent() { - const params = Route.useParams() - const userQuery = useQuery(() => userQueryOptions(params.value.userId)) - - return ( -
-

- {userQuery.data.value?.name ?? 'loading...'} -

-
{userQuery.data.value?.email ?? ''}
-
- ) -} +const UserComponent = defineComponent({ + setup() { + const params = Route.useParams() + const userQuery = useQuery(() => userQueryOptions(params.value.userId)) + return () => ( +
+

+ {userQuery.data.value?.name ?? 'loading...'} +

+
{userQuery.data.value?.email ?? ''}
+
+ ) + }, +}) export const Route = createFileRoute('/users/$userId')({ loader: async ({ context, params: { userId } }) => { diff --git a/e2e/vue-start/basic-vue-query/src/utils/posts.tsx b/e2e/vue-start/basic-vue-query/src/utils/posts.tsx index b0a0b8f60d..c6b5e70a0b 100644 --- a/e2e/vue-start/basic-vue-query/src/utils/posts.tsx +++ b/e2e/vue-start/basic-vue-query/src/utils/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const postsQueryOptions = () => queryOptions({ diff --git a/e2e/vue-start/basic-vue-query/src/utils/users.tsx b/e2e/vue-start/basic-vue-query/src/utils/users.tsx index 29bf08c315..fe7a902fa2 100644 --- a/e2e/vue-start/basic-vue-query/src/utils/users.tsx +++ b/e2e/vue-start/basic-vue-query/src/utils/users.tsx @@ -1,4 +1,6 @@ import { queryOptions } from '@tanstack/vue-query' +import { createIsomorphicFn } from '@tanstack/vue-start' +import { getRequestUrl } from '@tanstack/vue-start/server' import axios from 'redaxios' export type User = { @@ -7,17 +9,16 @@ export type User = { email: string } -const PORT = - import.meta.env.VITE_SERVER_PORT || process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` +const getOrigin = createIsomorphicFn() + .server(() => getRequestUrl().origin) + .client(() => window.location.origin) export const usersQueryOptions = () => queryOptions({ queryKey: ['users'], queryFn: () => axios - .get>(DEPLOY_URL + '/api/users') + .get>(getOrigin() + '/api/users') .then((r) => r.data) .catch(() => { throw new Error('Failed to fetch users') @@ -29,7 +30,7 @@ export const userQueryOptions = (id: string) => queryKey: ['users', id], queryFn: () => axios - .get(DEPLOY_URL + '/api/users/' + id) + .get(getOrigin() + '/api/users/' + id) .then((r) => r.data) .catch(() => { throw new Error('Failed to fetch user') diff --git a/e2e/vue-start/basic-vue-query/tests/app.spec.ts b/e2e/vue-start/basic-vue-query/tests/app.spec.ts index ab2469f68d..4ce5c20ef7 100644 --- a/e2e/vue-start/basic-vue-query/tests/app.spec.ts +++ b/e2e/vue-start/basic-vue-query/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test('Navigating to post', async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-start/basic-vue-query/tests/setup/global.setup.ts b/e2e/vue-start/basic-vue-query/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-start/basic-vue-query/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/basic-vue-query/tests/setup/global.teardown.ts b/e2e/vue-start/basic-vue-query/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/basic-vue-query/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/basic-vue-query/tests/transition.spec.ts b/e2e/vue-start/basic-vue-query/tests/transition.spec.ts index 2c28fc72a2..a0f3bf0964 100644 --- a/e2e/vue-start/basic-vue-query/tests/transition.spec.ts +++ b/e2e/vue-start/basic-vue-query/tests/transition.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test('transitions/count/query should keep old values visible during navigation', async ({ page, diff --git a/e2e/vue-start/basic/package.json b/e2e/vue-start/basic/package.json index dacbcc2154..2ff8329543 100644 --- a/e2e/vue-start/basic/package.json +++ b/e2e/vue-start/basic/package.json @@ -6,12 +6,12 @@ "scripts": { "dev": "vite dev --port 3000", "dev:e2e": "vite dev", - "build": "vite build && tsc --noEmit", + "build": "pnpm build:vite", "preview": "vite preview", "start": "node server.js", - "test:e2e:startDummyServer": "node -e 'import(\"./tests/setup/global.setup.ts\").then(m => m.default())' & node -e 'import(\"./tests/setup/waitForDummyServer.ts\").then(m => m.default())'", - "test:e2e:stopDummyServer": "node -e 'import(\"./tests/setup/global.teardown.ts\").then(m => m.default())'", - "test:e2e:local": "playwright test --project=chromium" + "test:e2e:local": "playwright test --project=chromium", + "build:vite": "vite build && tsc --noEmit", + "build:rsbuild": "rsbuild build && tsc --noEmit" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -20,17 +20,17 @@ "express": "^5.2.1", "http-proxy-middleware": "^3.0.5", "js-cookie": "^3.0.5", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.16", "zod": "^4.4.3" }, "devDependencies": { "@playwright/test": "^1.61.0", - "@rsbuild/core": "^2.0.11", - "@rsbuild/plugin-babel": "^1.0.5", - "@rsbuild/plugin-vue": "^1.2.2", - "@rsbuild/plugin-vue-jsx": "^1.1.1", + "@rsbuild/core": "^2.3.1", + "@rsbuild/plugin-babel": "^1.1.2", + "@rsbuild/plugin-vue": "^1.2.7", + "@rsbuild/plugin-vue-jsx": "^2.0.0", "@tailwindcss/postcss": "^4.2.2", "@tailwindcss/vite": "^4.2.2", "@tanstack/router-e2e-utils": "workspace:^", @@ -39,9 +39,10 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { @@ -58,7 +59,10 @@ }, { "toolchain": "vite", - "mode": "prerender" + "mode": "prerender", + "env": { + "NODE_OPTIONS": "--import=@tanstack/router-e2e-utils/mock-api" + } }, { "toolchain": "vite", diff --git a/e2e/vue-start/basic/playwright.config.ts b/e2e/vue-start/basic/playwright.config.ts index 6924134cd1..9322874f3a 100644 --- a/e2e/vue-start/basic/playwright.config.ts +++ b/e2e/vue-start/basic/playwright.config.ts @@ -1,59 +1,37 @@ -import fs from 'node:fs' import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const mode = process.env.MODE ?? 'ssr' -const e2ePortKey = process.env.E2E_PORT_KEY ?? packageJson.name + const distDir = process.env.E2E_DIST_DIR ?? 'dist' -if (process.env.TEST_WORKER_INDEX === undefined) { - for (const portFile of [ - `port-${e2ePortKey}.txt`, - `port-${e2ePortKey}_start.txt`, - `port-${e2ePortKey}-external.txt`, - ]) { - fs.rmSync(portFile, { force: true }) - } -} - -const PORT = await getTestServerPort(e2ePortKey) -const START_PORT = await getTestServerPort(`${e2ePortKey}_start`) -const EXTERNAL_PORT = await getDummyServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` const commandByMode = mode === 'preview' - ? `pnpm run test:e2e:startDummyServer && pnpm preview --outDir ${distDir} --port ${PORT}` - : `pnpm run test:e2e:startDummyServer && pnpm start` + ? `pnpm preview --host 0.0.0.0 --outDir ${distDir} --port ${PORT}` + : `pnpm start` export default defineConfig({ testDir: './tests', workers: 1, reporter: [['line']], - globalTeardown: './tests/setup/global.teardown.ts', - use: { baseURL, }, webServer: { command: commandByMode, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, MODE: mode, - VITE_NODE_ENV: 'test', - VITE_EXTERNAL_PORT: String(EXTERNAL_PORT), - VITE_SERVER_PORT: String(PORT), - START_PORT: String(START_PORT), + START_PORT: '0', PORT: String(PORT), E2E_DIST_DIR: distDir, - E2E_PORT_KEY: e2ePortKey, }, }, diff --git a/e2e/vue-start/basic/rsbuild.config.ts b/e2e/vue-start/basic/rsbuild.config.ts index 93af798c3c..aad3a76e73 100644 --- a/e2e/vue-start/basic/rsbuild.config.ts +++ b/e2e/vue-start/basic/rsbuild.config.ts @@ -16,11 +16,6 @@ export default defineConfig({ pluginVueJsx(), tanstackStart(), ], - performance: { - chunkSplit: { - strategy: 'split-by-experience', - }, - }, source: { define: { __TSR_PRERENDER__: JSON.stringify(isPrerender), diff --git a/e2e/vue-start/basic/server.js b/e2e/vue-start/basic/server.js index 69c1e4ca91..3e1ddab400 100644 --- a/e2e/vue-start/basic/server.js +++ b/e2e/vue-start/basic/server.js @@ -1,12 +1,12 @@ -import { toNodeHandler } from 'srvx/node' import fs from 'node:fs' import path from 'node:path' +import { toNodeHandler } from 'srvx/node' import express from 'express' import { createProxyMiddleware } from 'http-proxy-middleware' -const port = process.env.PORT || 3000 +const port = Number(process.env.PORT ?? 3000) -const startPort = process.env.START_PORT || 3001 +const startPort = Number(process.env.START_PORT ?? 0) const isSpaMode = process.env.MODE === 'spa' const isPrerender = process.env.MODE === 'prerender' @@ -49,13 +49,13 @@ export async function createStartServer() { return { app } } -export async function createSpaServer() { +export async function createSpaServer(backendPort) { const app = express() app.use( '/api', createProxyMiddleware({ - target: `http://localhost:${startPort}/api`, // Replace with your target server's URL + target: `http://localhost:${backendPort}/api`, // Replace with your target server's URL changeOrigin: false, // Needed for virtual hosted sites, }), ) @@ -63,7 +63,7 @@ export async function createSpaServer() { app.use( '/_serverFn', createProxyMiddleware({ - target: `http://localhost:${startPort}/_serverFn`, // Replace with your target server's URL + target: `http://localhost:${backendPort}/_serverFn`, // Replace with your target server's URL changeOrigin: false, // Needed for virtual hosted sites, }), ) @@ -71,31 +71,28 @@ export async function createSpaServer() { app.use(express.static(distClientDir)) app.get('/{*splat}', (req, res) => { - res.sendFile(path.resolve(distClientDir, 'index.html')) + res.sendFile('index.html', { root: distClientDir }) }) return { app } } -if (isSpaMode) { - createSpaServer().then(async ({ app }) => - app.listen(port, (error) => { - if (error) throw error - console.info(`Client Server: http://localhost:${port}`) - }), - ) - - createStartServer().then(async ({ app }) => - app.listen(startPort, (error) => { - if (error) throw error - console.info(`Start Server: http://localhost:${startPort}`) - }), - ) -} else { - createStartServer().then(async ({ app }) => - app.listen(port, (error) => { - if (error) throw error - console.info(`Start Server: http://localhost:${port}`) - }), - ) -} +// Bind the backend first so the SPA proxy receives the port actually held by it. +const { app: startApp } = await createStartServer() +const backend = startApp.listen(isSpaMode ? startPort : port, async (error) => { + if (error) { + throw error + } + const backendPort = backend.address().port + if (isSpaMode) { + const { app } = await createSpaServer(backendPort) + const frontend = app.listen(port, (frontendError) => { + if (frontendError) { + throw frontendError + } + console.info(`E2E app: http://localhost:${frontend.address().port}`) + }) + } else { + console.info(`E2E app: http://localhost:${backendPort}`) + } +}) diff --git a/e2e/vue-start/basic/src/routes/__root.tsx b/e2e/vue-start/basic/src/routes/__root.tsx index 843ec05893..9da2c581fe 100644 --- a/e2e/vue-start/basic/src/routes/__root.tsx +++ b/e2e/vue-start/basic/src/routes/__root.tsx @@ -1,4 +1,5 @@ /// +import { defineComponent } from 'vue' import { Body, ClientOnly, @@ -16,6 +17,119 @@ import { NotFound } from '~/components/NotFound' import '~/styles/app.css' import { seo } from '~/utils/seo' +const RootComponent = defineComponent({ + setup() { + const routerState = useRouterState({ + select: (state) => ({ isLoading: state.isLoading, status: state.status }), + }) + return () => ( + + + + + +
+ + Home + {' '} + + Posts + {' '} + + Users + {' '} + + Layout + {' '} + + Scripts + {' '} + + Inline Scripts + {' '} + + Deferred + {' '} + + redirect + {' '} + + Raw Stream + {' '} + + This Route Does Not Exist + +
+ + + + +
This is an inline styled div
+ + + + + ) + }, +}) + export const Route = createRootRoute({ head: () => ({ meta: [ @@ -62,119 +176,11 @@ export const Route = createRootRoute({ }, ], }), - errorComponent: (props) =>

{props.error.stack}

, + errorComponent: (props) => ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ), notFoundComponent: () => , component: RootComponent, }) - -function RootComponent() { - const routerState = useRouterState({ - select: (state) => ({ isLoading: state.isLoading, status: state.status }), - }) - - return ( - - - - - -
- - Home - {' '} - - Posts - {' '} - - Users - {' '} - - Layout - {' '} - - Scripts - {' '} - - Inline Scripts - {' '} - - Deferred - {' '} - - redirect - {' '} - - Raw Stream - {' '} - - This Route Does Not Exist - -
- - - - -
This is an inline styled div
- - - - - ) -} diff --git a/e2e/vue-start/basic/src/routes/api/users.$userId.ts b/e2e/vue-start/basic/src/routes/api/users.$userId.ts index 50b9ca995a..24938d51c2 100644 --- a/e2e/vue-start/basic/src/routes/api/users.$userId.ts +++ b/e2e/vue-start/basic/src/routes/api/users.$userId.ts @@ -1,19 +1,15 @@ import { createFileRoute } from '@tanstack/vue-router' import type { User } from '~/utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} - export const Route = createFileRoute('/api/users/$userId')({ server: { handlers: { GET: async ({ params, request }) => { console.info(`Fetching users by id=${params.userId}... @`, request.url) try { - const res = await fetch(`${queryURL}/users/${params.userId}`) + const res = await fetch( + `https://jsonplaceholder.typicode.com/users/${params.userId}`, + ) if (!res.ok) { throw new Error('Failed to fetch user') } diff --git a/e2e/vue-start/basic/src/routes/api/users.ts b/e2e/vue-start/basic/src/routes/api/users.ts index 97989b93ca..c6045977b8 100644 --- a/e2e/vue-start/basic/src/routes/api/users.ts +++ b/e2e/vue-start/basic/src/routes/api/users.ts @@ -38,19 +38,13 @@ const testMiddleware = createMiddleware() return result }) -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} - export const Route = createFileRoute('/api/users')({ server: { middleware: [testMiddleware, userLoggerMiddleware, testParentMiddleware], handlers: { GET: async ({ request }) => { console.info('Fetching users... @', request.url) - const res = await fetch(`${queryURL}/users`) + const res = await fetch('https://jsonplaceholder.typicode.com/users') if (!res.ok) { throw new Error('Failed to fetch users') } diff --git a/e2e/vue-start/basic/src/routes/not-found/index.tsx b/e2e/vue-start/basic/src/routes/not-found/index.tsx index 9f7e3b4b33..ecd12d1dad 100644 --- a/e2e/vue-start/basic/src/routes/not-found/index.tsx +++ b/e2e/vue-start/basic/src/routes/not-found/index.tsx @@ -1,9 +1,10 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' -export const Route = createFileRoute('/not-found/')({ - component: () => { +const RouteComponent = defineComponent({ + setup() { const preload = Route.useSearch({ select: (s) => s.preload }) - return ( + return () => (
( +
+
+ {loaderData.value.parentLoaderData} +
+
+ ) + }, +}) + export const Route = createFileRoute('/not-found/parent-boundary')({ loader: () => ({ parentLoaderData: 'ready', @@ -15,15 +29,3 @@ function RouteComponent() {
) } - -function ParentBoundaryNotFoundComponent() { - const loaderData = Route.useLoaderData() - - return ( -
-
- {loaderData.value.parentLoaderData} -
-
- ) -} diff --git a/e2e/vue-start/basic/src/routes/posts.$postId.tsx b/e2e/vue-start/basic/src/routes/posts.$postId.tsx index 4d71080d64..edda7f0017 100644 --- a/e2e/vue-start/basic/src/routes/posts.$postId.tsx +++ b/e2e/vue-start/basic/src/routes/posts.$postId.tsx @@ -1,9 +1,32 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '~/utils/posts' import { NotFound } from '~/components/NotFound' import { PostErrorComponent } from '~/components/PostErrorComponent' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+

{post.value.title}

+
{post.value.body}
+ + Deep View + +
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost({ data: postId }), errorComponent: PostErrorComponent, @@ -12,24 +35,3 @@ export const Route = createFileRoute('/posts/$postId')({ return Post not found }, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
- - Deep View - -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/posts.tsx b/e2e/vue-start/basic/src/routes/posts.tsx index 1a9d58a31d..64d4754f2f 100644 --- a/e2e/vue-start/basic/src/routes/posts.tsx +++ b/e2e/vue-start/basic/src/routes/posts.tsx @@ -1,7 +1,36 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '~/utils/posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + return () => ( +
+
    + {posts.value.map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ head: () => ({ meta: [ @@ -13,30 +42,3 @@ export const Route = createFileRoute('/posts')({ loader: async () => fetchPosts(), component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {posts.value.map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/posts_.$postId.deep.tsx b/e2e/vue-start/basic/src/routes/posts_.$postId.deep.tsx index a52c6f32f7..f77ae7d3ab 100644 --- a/e2e/vue-start/basic/src/routes/posts_.$postId.deep.tsx +++ b/e2e/vue-start/basic/src/routes/posts_.$postId.deep.tsx @@ -1,24 +1,26 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { PostErrorComponent } from '~/components/PostErrorComponent' import { fetchPost } from '~/utils/posts' +const PostDeepComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+ + ← All Posts + +

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts_/$postId/deep')({ loader: async ({ params: { postId } }) => fetchPost({ data: postId }), errorComponent: PostErrorComponent, component: PostDeepComponent, }) - -function PostDeepComponent() { - const post = Route.useLoaderData() - - return ( -
- - ← All Posts - -

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-start/basic/src/routes/redirect/$target/index.tsx b/e2e/vue-start/basic/src/routes/redirect/$target/index.tsx index a8c3c75b1f..e39bda5bcf 100644 --- a/e2e/vue-start/basic/src/routes/redirect/$target/index.tsx +++ b/e2e/vue-start/basic/src/routes/redirect/$target/index.tsx @@ -1,9 +1,10 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' -export const Route = createFileRoute('/redirect/$target/')({ - component: () => { +const RouteComponent = defineComponent({ + setup() { const preload = Route.useSearch({ select: (s) => s.preload }) - return ( + return () => (
{ +const RouteComponent = defineComponent({ + setup() { const params = Route.useParams() - return ( + return () => (

redirect test with server functions (target {params.value.target}) @@ -87,3 +88,7 @@ export const Route = createFileRoute('/redirect/$target/serverFn/')({ ) }, }) + +export const Route = createFileRoute('/redirect/$target/serverFn/')({ + component: RouteComponent, +}) diff --git a/e2e/vue-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx b/e2e/vue-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx index 399e8ac995..093a591636 100644 --- a/e2e/vue-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx +++ b/e2e/vue-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx @@ -1,13 +1,12 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { RedirectOnClick } from '~/components/RedirectOnClick' -export const Route = createFileRoute( - '/redirect/$target/serverFn/via-useServerFn', -)({ - component: () => { +const RouteComponent = defineComponent({ + setup() { const params = Route.useParams() const search = Route.useSearch() - return ( + return () => ( ( + <> +
{search.value.default}
+
{context.value.hello}
+ + ) + }, +}) + export const Route = createFileRoute('/search-params/default')({ validateSearch: z.object({ default: z.string().default('d1'), @@ -15,14 +29,5 @@ export const Route = createFileRoute('/search-params/default')({ throw new Error('Context hello is not "world"') } }, - component: () => { - const search = Route.useSearch() - const context = Route.useRouteContext() - return ( - <> -
{search.value.default}
-
{context.value.hello}
- - ) - }, + component: RouteComponent, }) diff --git a/e2e/vue-start/basic/src/routes/search-params/loader-throws-redirect.tsx b/e2e/vue-start/basic/src/routes/search-params/loader-throws-redirect.tsx index 14b137abc6..ccd1276387 100644 --- a/e2e/vue-start/basic/src/routes/search-params/loader-throws-redirect.tsx +++ b/e2e/vue-start/basic/src/routes/search-params/loader-throws-redirect.tsx @@ -1,6 +1,19 @@ +import { defineComponent } from 'vue' import { redirect, createFileRoute } from '@tanstack/vue-router' import { z } from 'zod' +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + return () => ( +
+

SearchParams

+
{search.value.step}
+
+ ) + }, +}) + export const Route = createFileRoute('/search-params/loader-throws-redirect')({ validateSearch: z.object({ step: z.enum(['a', 'b', 'c']).optional(), @@ -14,13 +27,5 @@ export const Route = createFileRoute('/search-params/loader-throws-redirect')({ }) } }, - component: () => { - const search = Route.useSearch() - return ( -
-

SearchParams

-
{search.value.step}
-
- ) - }, + component: RouteComponent, }) diff --git a/e2e/vue-start/basic/src/routes/specialChars/$param.tsx b/e2e/vue-start/basic/src/routes/specialChars/$param.tsx index de3cba0a97..ec315ede1f 100644 --- a/e2e/vue-start/basic/src/routes/specialChars/$param.tsx +++ b/e2e/vue-start/basic/src/routes/specialChars/$param.tsx @@ -1,15 +1,18 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const RouteComponent = defineComponent({ + setup() { + const params = Route.useParams() + return () => ( +
+ Hello "/specialChars/$param":{' '} + {params.value.param} +
+ ) + }, +}) + export const Route = createFileRoute('/specialChars/$param')({ component: RouteComponent, }) - -function RouteComponent() { - const params = Route.useParams() - return ( -
- Hello "/specialChars/$param":{' '} - {params.value.param} -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/specialChars/malformed/$param.tsx b/e2e/vue-start/basic/src/routes/specialChars/malformed/$param.tsx index 7160964549..2b19e7e36e 100644 --- a/e2e/vue-start/basic/src/routes/specialChars/malformed/$param.tsx +++ b/e2e/vue-start/basic/src/routes/specialChars/malformed/$param.tsx @@ -1,15 +1,20 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const RouteComponent = defineComponent({ + setup() { + const params = Route.useParams() + return () => ( +
+ Hello "/specialChars/malformed/$param":{' '} + + {params.value.param} + +
+ ) + }, +}) + export const Route = createFileRoute('/specialChars/malformed/$param')({ component: RouteComponent, }) - -function RouteComponent() { - const params = Route.useParams() - return ( -
- Hello "/specialChars/malformed/$param":{' '} - {params.value.param} -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/specialChars/malformed/search.tsx b/e2e/vue-start/basic/src/routes/specialChars/malformed/search.tsx index 2438604954..8d6ad5b1dd 100644 --- a/e2e/vue-start/basic/src/routes/specialChars/malformed/search.tsx +++ b/e2e/vue-start/basic/src/routes/specialChars/malformed/search.tsx @@ -1,22 +1,24 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import z from 'zod' +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + return () => ( +
+ Hello "/specialChars/malformed/search"! + + {search.value.searchParam} + +
+ ) + }, +}) + export const Route = createFileRoute('/specialChars/malformed/search')({ validateSearch: z.object({ searchParam: z.string(), }), component: RouteComponent, }) - -function RouteComponent() { - const search = Route.useSearch() - - return ( -
- Hello "/specialChars/malformed/search"! - - {search.value.searchParam} - -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/specialChars/search.tsx b/e2e/vue-start/basic/src/routes/specialChars/search.tsx index 5ba858e747..b4e022639d 100644 --- a/e2e/vue-start/basic/src/routes/specialChars/search.tsx +++ b/e2e/vue-start/basic/src/routes/specialChars/search.tsx @@ -1,22 +1,24 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import z from 'zod' +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + return () => ( +
+ Hello "/specialChars/search"! + + {search.value.searchParam} + +
+ ) + }, +}) + export const Route = createFileRoute('/specialChars/search')({ validateSearch: z.object({ searchParam: z.string(), }), component: RouteComponent, }) - -function RouteComponent() { - const search = Route.useSearch() - - return ( -
- Hello "/specialChars/search"! - - {search.value.searchParam} - -
- ) -} diff --git a/e2e/vue-start/basic/src/routes/users.$userId.tsx b/e2e/vue-start/basic/src/routes/users.$userId.tsx index 420b7e4a50..76340cf9fb 100644 --- a/e2e/vue-start/basic/src/routes/users.$userId.tsx +++ b/e2e/vue-start/basic/src/routes/users.$userId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import axios from 'redaxios' @@ -6,6 +7,18 @@ import type { User } from '~/utils/users' import { NotFound } from '~/components/NotFound' import { UserErrorComponent } from '~/components/UserErrorComponent' +const UserComponent = defineComponent({ + setup() { + const user = Route.useLoaderData() + return () => ( +
+

{user.value.name}

+
{user.value.email}
+
+ ) + }, +}) + export const Route = createFileRoute('/users/$userId')({ loader: async ({ params: { userId } }) => { const router = await getRouterInstance() @@ -22,14 +35,3 @@ export const Route = createFileRoute('/users/$userId')({ return User not found }, }) - -function UserComponent() { - const user = Route.useLoaderData() - - return ( -
-

{user.value.name}

-
{user.value.email}
-
- ) -} diff --git a/e2e/vue-start/basic/src/routes/users.tsx b/e2e/vue-start/basic/src/routes/users.tsx index 1e0b297dd2..3d8ef31598 100644 --- a/e2e/vue-start/basic/src/routes/users.tsx +++ b/e2e/vue-start/basic/src/routes/users.tsx @@ -1,9 +1,41 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { getRouterInstance } from '@tanstack/vue-start' import axios from 'redaxios' import type { User } from '~/utils/users' +const UsersComponent = defineComponent({ + setup() { + const users = Route.useLoaderData() + return () => ( +
+
    + {[ + ...users.value, + { id: 'i-do-not-exist', name: 'Non-existent User', email: '' }, + ].map((user) => ( +
  • + +
    {user.name}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/users')({ loader: async () => { const router = await getRouterInstance() @@ -16,33 +48,3 @@ export const Route = createFileRoute('/users')({ }, component: UsersComponent, }) - -function UsersComponent() { - const users = Route.useLoaderData() - - return ( -
-
    - {[ - ...users.value, - { id: 'i-do-not-exist', name: 'Non-existent User', email: '' }, - ].map((user) => ( -
  • - -
    {user.name}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-start/basic/src/utils/posts.tsx b/e2e/vue-start/basic/src/utils/posts.tsx index 66cb298f83..d8e2dc7450 100644 --- a/e2e/vue-start/basic/src/utils/posts.tsx +++ b/e2e/vue-start/basic/src/utils/posts.tsx @@ -8,18 +8,12 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} - export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) .handler(async ({ data: postId }) => { console.info(`Fetching post with id ${postId}...`) const post = await axios - .get(`${queryURL}/posts/${postId}`) + .get(`https://jsonplaceholder.typicode.com/posts/${postId}`) .then((r) => r.data) .catch((err) => { console.error(err) @@ -36,7 +30,7 @@ export const fetchPosts = createServerFn({ method: 'GET' }).handler( async () => { console.info('Fetching posts...') return axios - .get>(`${queryURL}/posts`) + .get>('https://jsonplaceholder.typicode.com/posts') .then((r) => r.data.slice(0, 10)) }, ) diff --git a/e2e/vue-start/basic/src/utils/users.tsx b/e2e/vue-start/basic/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/vue-start/basic/src/utils/users.tsx +++ b/e2e/vue-start/basic/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/vue-start/basic/src/vite-env.d.ts b/e2e/vue-start/basic/src/vite-env.d.ts index e8259b1e33..4da6234c8a 100644 --- a/e2e/vue-start/basic/src/vite-env.d.ts +++ b/e2e/vue-start/basic/src/vite-env.d.ts @@ -2,7 +2,6 @@ interface ImportMetaEnv { readonly VITE_NODE_ENV: string - readonly VITE_EXTERNAL_PORT: string readonly VITE_SERVER_PORT: string } diff --git a/e2e/vue-start/basic/tests/fixture-api.spec.ts b/e2e/vue-start/basic/tests/fixture-api.spec.ts new file mode 100644 index 0000000000..6c9b26dc4c --- /dev/null +++ b/e2e/vue-start/basic/tests/fixture-api.spec.ts @@ -0,0 +1,11 @@ +import { expect, test } from '@playwright/test' + +test('server API receives canned users without a fixture listener', async ({ + request, +}) => { + const response = await request.get('/api/users') + expect(response.ok()).toBe(true) + const users = await response.json() + expect(users).toHaveLength(10) + expect(users[0]).toMatchObject({ id: 1, name: 'Leanne Graham' }) +}) diff --git a/e2e/vue-start/basic/tests/redirect.spec.ts b/e2e/vue-start/basic/tests/redirect.spec.ts index 2f6354aa81..8e6ceba5b9 100644 --- a/e2e/vue-start/basic/tests/redirect.spec.ts +++ b/e2e/vue-start/basic/tests/redirect.spec.ts @@ -1,19 +1,14 @@ import queryString from 'node:querystring' -import { expect, type Page } from '@playwright/test' +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' import combinateImport from 'combinate' -import { - getDummyServerPort, - getTestServerPort, - test, -} from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from './utils/getE2EPortKey.ts' +import type { Page } from '@playwright/test' // somehow playwright does not correctly import default exports const combinate = (combinateImport as any).default as typeof combinateImport -const e2ePortKey = getE2EPortKey() -const PORT = await getTestServerPort(e2ePortKey) -const EXTERNAL_HOST_PORT = await getDummyServerPort(e2ePortKey) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const EXTERNAL_ORIGIN = `http://127.0.0.1:${PORT}` const POSTS_URL = `http://localhost:${PORT}/posts` async function waitForRouterIdle(page: Page) { @@ -106,7 +101,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, }) if (scenario === 'navigate') { @@ -119,7 +114,7 @@ test.describe('redirects', () => { await page.goto(`/redirect/external/via-${thrower}?${q}`) } - const url = `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) @@ -140,7 +135,7 @@ test.describe('redirects', () => { }) => { let fullPageLoad = false const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, reloadDocument, }) @@ -159,10 +154,7 @@ test.describe('redirects', () => { await page.goto(`/redirect/${target}/serverFn/via-${thrower}?${q}`) } - const url = - target === 'internal' - ? POSTS_URL - : `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = target === 'internal' ? POSTS_URL : `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) if (target === 'internal' && scenario === 'navigate') { @@ -184,7 +176,7 @@ test.describe('redirects', () => { page, }) => { const q = queryString.stringify({ - externalHost: `http://localhost:${EXTERNAL_HOST_PORT}/`, + externalHost: `${EXTERNAL_ORIGIN}/`, reloadDocument, }) @@ -201,10 +193,7 @@ test.describe('redirects', () => { await button.click() - const url = - target === 'internal' - ? POSTS_URL - : `http://localhost:${EXTERNAL_HOST_PORT}/` + const url = target === 'internal' ? POSTS_URL : `${EXTERNAL_ORIGIN}/` await page.waitForURL(url) expect(page.url()).toBe(url) if (target === 'internal') { diff --git a/e2e/vue-start/basic/tests/setup/global.setup.ts b/e2e/vue-start/basic/tests/setup/global.setup.ts deleted file mode 100644 index cd38c35885..0000000000 --- a/e2e/vue-start/basic/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -export default async function setup() { - await e2eStartDummyServer(getE2EPortKey()) -} diff --git a/e2e/vue-start/basic/tests/setup/global.teardown.ts b/e2e/vue-start/basic/tests/setup/global.teardown.ts deleted file mode 100644 index 36e5c92858..0000000000 --- a/e2e/vue-start/basic/tests/setup/global.teardown.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -export default async function teardown() { - try { - await e2eStopDummyServer(getE2EPortKey()) - } catch {} -} diff --git a/e2e/vue-start/basic/tests/setup/waitForDummyServer.ts b/e2e/vue-start/basic/tests/setup/waitForDummyServer.ts deleted file mode 100644 index 88c18fd79e..0000000000 --- a/e2e/vue-start/basic/tests/setup/waitForDummyServer.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { getDummyServerPort } from '@tanstack/router-e2e-utils' -import { getE2EPortKey } from '../utils/getE2EPortKey.ts' - -const timeoutMs = 10_000 -const retryIntervalMs = 100 - -export default async function waitForDummyServer() { - const port = await getDummyServerPort(getE2EPortKey()) - const deadline = Date.now() + timeoutMs - - while (Date.now() < deadline) { - try { - const response = await fetch(`http://localhost:${port}/`) - - if (response.ok) { - return - } - } catch {} - - await new Promise((resolve) => setTimeout(resolve, retryIntervalMs)) - } - - throw new Error(`Timed out waiting for dummy server on port ${port}`) -} diff --git a/e2e/vue-start/basic/tests/utils/getE2EPortKey.ts b/e2e/vue-start/basic/tests/utils/getE2EPortKey.ts deleted file mode 100644 index 48be6a9027..0000000000 --- a/e2e/vue-start/basic/tests/utils/getE2EPortKey.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getPackageName } from './getPackageName.ts' - -export function getE2EPortKey() { - return process.env.E2E_PORT_KEY ?? getPackageName() -} diff --git a/e2e/vue-start/css-modules/package.json b/e2e/vue-start/css-modules/package.json index 7e28e9d5a8..3671774644 100644 --- a/e2e/vue-start/css-modules/package.json +++ b/e2e/vue-start/css-modules/package.json @@ -11,7 +11,7 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js", "test:e2e:dev": "MODE=dev playwright test --project=chromium", "test:e2e:prod": "playwright test --project=chromium", - "test:e2e": "rm -rf port*.txt; pnpm run test:e2e:dev" + "test:e2e": "pnpm run test:e2e:dev" }, "dependencies": { "@tanstack/vue-router": "workspace:*", @@ -24,8 +24,9 @@ "@types/node": "^22.10.2", "@vitejs/plugin-vue-jsx": "^5.1.5", "sass": "^1.97.2", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/css-modules/playwright.config.ts b/e2e/vue-start/css-modules/playwright.config.ts index 0b810d5372..a50ac5ae63 100644 --- a/e2e/vue-start/css-modules/playwright.config.ts +++ b/e2e/vue-start/css-modules/playwright.config.ts @@ -1,10 +1,9 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' const mode = process.env.MODE ?? 'prod' const isDev = mode === 'dev' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -13,16 +12,17 @@ export default defineConfig({ reporter: [['line']], globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', use: { baseURL, }, webServer: { - command: isDev ? `pnpm dev:e2e` : `pnpm build && PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: isDev + ? `pnpm dev:e2e --port 0` + : `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', env: { VITE_NODE_ENV: 'test', diff --git a/e2e/vue-start/css-modules/tests/setup/global.setup.ts b/e2e/vue-start/css-modules/tests/setup/global.setup.ts index 2d3a1db946..17be637f77 100644 --- a/e2e/vue-start/css-modules/tests/setup/global.setup.ts +++ b/e2e/vue-start/css-modules/tests/setup/global.setup.ts @@ -1,17 +1,9 @@ -import { - e2eStartDummyServer, - getTestServerPort, - preOptimizeDevServer, - waitForServer, -} from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' export default async function setup() { - await e2eStartDummyServer(packageJson.name) - if (process.env.MODE !== 'dev') return - const port = await getTestServerPort(packageJson.name) + const port = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${port}` await waitForServer(baseURL) diff --git a/e2e/vue-start/css-modules/tests/setup/global.teardown.ts b/e2e/vue-start/css-modules/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/css-modules/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/custom-basepath/express-server.ts b/e2e/vue-start/custom-basepath/express-server.ts index 1884c5eb5a..b9bf393466 100644 --- a/e2e/vue-start/custom-basepath/express-server.ts +++ b/e2e/vue-start/custom-basepath/express-server.ts @@ -1,5 +1,6 @@ import express from 'express' import { toNodeHandler } from 'srvx/node' +import type { AddressInfo } from 'node:net' import type { NodeHttp1Handler } from 'srvx' const DEVELOPMENT = process.env.NODE_ENV === 'development' @@ -40,7 +41,11 @@ if (DEVELOPMENT) { }) } -app.listen(PORT, (error) => { - if (error) throw error - console.log(`Server is running on http://localhost:${PORT}`) +const httpServer = app.listen(PORT, (error) => { + if (error) { + throw error + } + console.log( + `E2E app: http://localhost:${(httpServer.address() as AddressInfo).port}`, + ) }) diff --git a/e2e/vue-start/custom-basepath/package.json b/e2e/vue-start/custom-basepath/package.json index 3d0208de01..c1032ea88b 100644 --- a/e2e/vue-start/custom-basepath/package.json +++ b/e2e/vue-start/custom-basepath/package.json @@ -8,14 +8,14 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "tsx express-server.ts", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-start": "workspace:^", "express": "^5.2.1", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "vue": "^3.5.25" }, "devDependencies": { @@ -25,10 +25,11 @@ "@types/express": "^5.0.6", "@types/node": "^22.10.2", "cross-env": "^10.0.0", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", "tsx": "^4.20.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5" diff --git a/e2e/vue-start/custom-basepath/playwright.config.ts b/e2e/vue-start/custom-basepath/playwright.config.ts index 5095425f47..e113ce64ad 100644 --- a/e2e/vue-start/custom-basepath/playwright.config.ts +++ b/e2e/vue-start/custom-basepath/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}/custom/basepath` /** @@ -18,19 +13,19 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx index d06f4a948b..77c03c5afa 100644 --- a/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/custom-basepath/src/routes/__root.tsx b/e2e/vue-start/custom-basepath/src/routes/__root.tsx index 8bc947b03a..c6d1eb197c 100644 --- a/e2e/vue-start/custom-basepath/src/routes/__root.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/__root.tsx @@ -49,7 +49,11 @@ export const Route = createRootRoute({ { rel: 'icon', href: '/favicon.ico' }, ], }), - errorComponent: (props) =>

{props.error.stack}

, + errorComponent: (props) => ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ), notFoundComponent: () => , component: RootComponent, }) diff --git a/e2e/vue-start/custom-basepath/src/routes/api/users.$userId.ts b/e2e/vue-start/custom-basepath/src/routes/api/users.$userId.ts index 50b9ca995a..7e3f528d68 100644 --- a/e2e/vue-start/custom-basepath/src/routes/api/users.$userId.ts +++ b/e2e/vue-start/custom-basepath/src/routes/api/users.$userId.ts @@ -1,11 +1,7 @@ import { createFileRoute } from '@tanstack/vue-router' import type { User } from '~/utils/users' -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users/$userId')({ server: { diff --git a/e2e/vue-start/custom-basepath/src/routes/api/users.ts b/e2e/vue-start/custom-basepath/src/routes/api/users.ts index 97989b93ca..dfdb5cd844 100644 --- a/e2e/vue-start/custom-basepath/src/routes/api/users.ts +++ b/e2e/vue-start/custom-basepath/src/routes/api/users.ts @@ -38,11 +38,7 @@ const testMiddleware = createMiddleware() return result }) -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const Route = createFileRoute('/api/users')({ server: { diff --git a/e2e/vue-start/custom-basepath/src/routes/posts.$postId.tsx b/e2e/vue-start/custom-basepath/src/routes/posts.$postId.tsx index b4e5a8a6a2..599e0f046e 100644 --- a/e2e/vue-start/custom-basepath/src/routes/posts.$postId.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/posts.$postId.tsx @@ -1,9 +1,32 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '~/utils/posts' import { NotFound } from '~/components/NotFound' import { PostErrorComponent } from '~/components/PostErrorComponent' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+

{post.value.title}

+
{post.value.body}
+ + Deep View + +
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost({ data: postId }), errorComponent: PostErrorComponent, @@ -12,24 +35,3 @@ export const Route = createFileRoute('/posts/$postId')({ return Post not found }, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
- - Deep View - -
- ) -} diff --git a/e2e/vue-start/custom-basepath/src/routes/posts.tsx b/e2e/vue-start/custom-basepath/src/routes/posts.tsx index 1a9d58a31d..64d4754f2f 100644 --- a/e2e/vue-start/custom-basepath/src/routes/posts.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/posts.tsx @@ -1,7 +1,36 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '~/utils/posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + return () => ( +
+
    + {posts.value.map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ head: () => ({ meta: [ @@ -13,30 +42,3 @@ export const Route = createFileRoute('/posts')({ loader: async () => fetchPosts(), component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {posts.value.map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-start/custom-basepath/src/routes/posts_.$postId.deep.tsx b/e2e/vue-start/custom-basepath/src/routes/posts_.$postId.deep.tsx index a52c6f32f7..f77ae7d3ab 100644 --- a/e2e/vue-start/custom-basepath/src/routes/posts_.$postId.deep.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/posts_.$postId.deep.tsx @@ -1,24 +1,26 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { PostErrorComponent } from '~/components/PostErrorComponent' import { fetchPost } from '~/utils/posts' +const PostDeepComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+ + ← All Posts + +

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts_/$postId/deep')({ loader: async ({ params: { postId } }) => fetchPost({ data: postId }), errorComponent: PostErrorComponent, component: PostDeepComponent, }) - -function PostDeepComponent() { - const post = Route.useLoaderData() - - return ( -
- - ← All Posts - -

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-start/custom-basepath/src/routes/users.$userId.tsx b/e2e/vue-start/custom-basepath/src/routes/users.$userId.tsx index fb7fce5f4c..4effec0d5b 100644 --- a/e2e/vue-start/custom-basepath/src/routes/users.$userId.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/users.$userId.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import axios from 'redaxios' @@ -6,6 +7,18 @@ import { NotFound } from '~/components/NotFound' import { UserErrorComponent } from '~/components/UserErrorComponent' import { basepath } from '~/utils/basepath' +const UserComponent = defineComponent({ + setup() { + const user = Route.useLoaderData() + return () => ( +
+

{user.value.name}

+
{user.value.email}
+
+ ) + }, +}) + export const Route = createFileRoute('/users/$userId')({ loader: async ({ params: { userId } }) => { return await axios @@ -21,14 +34,3 @@ export const Route = createFileRoute('/users/$userId')({ return User not found }, }) - -function UserComponent() { - const user = Route.useLoaderData() - - return ( -
-

{user.value.name}

-
{user.value.email}
-
- ) -} diff --git a/e2e/vue-start/custom-basepath/src/routes/users.tsx b/e2e/vue-start/custom-basepath/src/routes/users.tsx index 1432e50451..fe926d0a44 100644 --- a/e2e/vue-start/custom-basepath/src/routes/users.tsx +++ b/e2e/vue-start/custom-basepath/src/routes/users.tsx @@ -1,8 +1,40 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import axios from 'redaxios' import type { User } from '~/utils/users' import { basepath } from '~/utils/basepath' +const UsersComponent = defineComponent({ + setup() { + const users = Route.useLoaderData() + return () => ( +
+
    + {[ + ...users.value, + { id: 'i-do-not-exist', name: 'Non-existent User', email: '' }, + ].map((user) => ( +
  • + +
    {user.name}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/users')({ loader: async () => { return await axios @@ -14,33 +46,3 @@ export const Route = createFileRoute('/users')({ }, component: UsersComponent, }) - -function UsersComponent() { - const users = Route.useLoaderData() - - return ( -
-
    - {[ - ...users.value, - { id: 'i-do-not-exist', name: 'Non-existent User', email: '' }, - ].map((user) => ( -
  • - -
    {user.name}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-start/custom-basepath/src/utils/posts.tsx b/e2e/vue-start/custom-basepath/src/utils/posts.tsx index 66cb298f83..11d80d08b5 100644 --- a/e2e/vue-start/custom-basepath/src/utils/posts.tsx +++ b/e2e/vue-start/custom-basepath/src/utils/posts.tsx @@ -8,11 +8,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) diff --git a/e2e/vue-start/custom-basepath/src/utils/users.tsx b/e2e/vue-start/custom-basepath/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/vue-start/custom-basepath/src/utils/users.tsx +++ b/e2e/vue-start/custom-basepath/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/vue-start/custom-basepath/tests/setup/global.setup.ts b/e2e/vue-start/custom-basepath/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-start/custom-basepath/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/custom-basepath/tests/setup/global.teardown.ts b/e2e/vue-start/custom-basepath/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/custom-basepath/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/dev-ssr-styles/.gitignore b/e2e/vue-start/dev-ssr-styles/.gitignore new file mode 100644 index 0000000000..950326609c --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/.gitignore @@ -0,0 +1,7 @@ +node_modules +dist +.routeTree.gen.ts +src/routeTree.gen.ts +test-results +playwright-report +port*.txt diff --git a/e2e/vue-start/dev-ssr-styles/package.json b/e2e/vue-start/dev-ssr-styles/package.json new file mode 100644 index 0000000000..0033a0a5cc --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/package.json @@ -0,0 +1,32 @@ +{ + "name": "tanstack-vue-start-e2e-dev-ssr-styles", + "private": true, + "sideEffects": false, + "type": "module", + "scripts": { + "dev": "vite dev --port 3000", + "dev:e2e": "vite dev --port 0", + "build": "vite build && tsc --noEmit", + "start": "pnpx srvx --prod -s ../client dist/server/server.js", + "test:e2e:dev": "MODE=dev playwright test --project=chromium", + "test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:dev:bundled-dev", + "test:e2e:dev:bundled-dev": "MODE=dev E2E_VITE_BUNDLED_DEV=true playwright test --project=chromium" + }, + "dependencies": { + "@tanstack/vue-router": "workspace:*", + "@tanstack/vue-start": "workspace:*", + "vue": "^3.5.16" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-core": "workspace:*", + "@tanstack/router-e2e-utils": "workspace:*", + "@types/node": "^22.10.2", + "@vitejs/plugin-vue": "^6.0.5", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "srvx": "^1.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14", + "@typescript/native": "npm:typescript@^7.0.2" + } +} diff --git a/e2e/vue-start/dev-ssr-styles/playwright.config.ts b/e2e/vue-start/dev-ssr-styles/playwright.config.ts new file mode 100644 index 0000000000..723cd32789 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/playwright.config.ts @@ -0,0 +1,28 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +export default defineConfig({ + testDir: './tests', + workers: 1, + reporter: [['line']], + globalSetup: './tests/setup/global.setup.ts', + use: { baseURL }, + webServer: { + command: 'pnpm dev:e2e', + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + env: { + VITE_NODE_ENV: 'test', + }, + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/vue-start/dev-ssr-styles/src/components/SfcStyledBox.vue b/e2e/vue-start/dev-ssr-styles/src/components/SfcStyledBox.vue new file mode 100644 index 0000000000..bd92215136 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/components/SfcStyledBox.vue @@ -0,0 +1,14 @@ + + + diff --git a/e2e/vue-start/dev-ssr-styles/src/router.tsx b/e2e/vue-start/dev-ssr-styles/src/router.tsx new file mode 100644 index 0000000000..c0d7f2b200 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/router.tsx @@ -0,0 +1,10 @@ +import { createRouter } from '@tanstack/vue-router' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + return createRouter({ + routeTree, + scrollRestoration: true, + defaultPreload: false, + }) +} diff --git a/e2e/vue-start/dev-ssr-styles/src/routes/__root.tsx b/e2e/vue-start/dev-ssr-styles/src/routes/__root.tsx new file mode 100644 index 0000000000..0dec479a07 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/routes/__root.tsx @@ -0,0 +1,27 @@ +import { + Body, + HeadContent, + Html, + Outlet, + Scripts, + createRootRoute, +} from '@tanstack/vue-router' +import '~/styles/app.css' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return ( + + + + + + + + + + ) +} diff --git a/e2e/vue-start/dev-ssr-styles/src/routes/index.tsx b/e2e/vue-start/dev-ssr-styles/src/routes/index.tsx new file mode 100644 index 0000000000..733bc1d559 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/routes/index.tsx @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/vue-router' +import SfcStyledBox from '../components/SfcStyledBox.vue' + +export const Route = createFileRoute('/')({ + component: Home, +}) + +function Home() { + return ( +
+

Vue Dev SSR Styles Test

+ +
+ ) +} diff --git a/e2e/vue-start/dev-ssr-styles/src/styles/app.css b/e2e/vue-start/dev-ssr-styles/src/styles/app.css new file mode 100644 index 0000000000..9a67f9b153 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/styles/app.css @@ -0,0 +1,5 @@ +body { + font-family: sans-serif; + margin: 0; + padding: 20px; +} diff --git a/e2e/vue-start/dev-ssr-styles/src/vue-shim.d.ts b/e2e/vue-start/dev-ssr-styles/src/vue-shim.d.ts new file mode 100644 index 0000000000..fe00a856b2 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/src/vue-shim.d.ts @@ -0,0 +1,6 @@ +declare module '*.vue' { + import type { DefineComponent } from 'vue' + + const component: DefineComponent + export default component +} diff --git a/e2e/vue-start/dev-ssr-styles/tests/app.spec.ts b/e2e/vue-start/dev-ssr-styles/tests/app.spec.ts new file mode 100644 index 0000000000..0e052441b7 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/tests/app.spec.ts @@ -0,0 +1,61 @@ +import { expect } from '@playwright/test' +import { DEV_STYLES_ATTR } from '@tanstack/router-core' +import { test } from '@tanstack/router-e2e-utils' + +const whitelistErrors = [ + 'Failed to load resource: net::ERR_NAME_NOT_RESOLVED', + 'Failed to load resource: the server responded with a status of 504', +] + +test.describe('dev SSR styles', () => { + test.use({ whitelistErrors }) + + test.describe('with JavaScript disabled', () => { + test.use({ javaScriptEnabled: false, whitelistErrors }) + + test('includes a Vue SFC style block during SSR', async ({ page }) => { + await page.goto('/') + + const element = page.getByTestId('styled-box') + await expect(element).toBeVisible() + await expect(element).toHaveCSS('background-color', 'rgb(126, 34, 206)') + + const href = await page + .locator(`link[${DEV_STYLES_ATTR}]`) + .getAttribute('href') + expect(href).toBeTruthy() + + const response = await page.request.get(new URL(href!, page.url()).href) + expect(response.ok()).toBeTruthy() + const css = await response.text() + expect(css).toContain('--vue-sfc-style-marker') + expect(css).toMatch( + /\/src\/components\/SfcStyledBox\.vue\?vue&type=style[^\n]*&lang\.css/, + ) + }) + }) + + test('keeps CSS output stable after client modules load', async ({ + page, + }) => { + const initialResponsePromise = page.waitForResponse((response) => + new URL(response.url()).pathname.endsWith('/@tanstack-start/styles.css'), + ) + await page.goto('/') + await expect(page.getByTestId('styled-box')).toBeVisible() + const initialResponse = await initialResponsePromise + expect(initialResponse.ok()).toBeTruthy() + const initialCss = await initialResponse.text() + + const reloadedResponsePromise = page.waitForResponse((response) => + new URL(response.url()).pathname.endsWith('/@tanstack-start/styles.css'), + ) + await page.reload() + await expect(page.getByTestId('styled-box')).toBeVisible() + const reloadedResponse = await reloadedResponsePromise + expect(reloadedResponse.ok()).toBeTruthy() + const reloadedCss = await reloadedResponse.text() + + expect(reloadedCss).toBe(initialCss) + }) +}) diff --git a/e2e/vue-start/dev-ssr-styles/tests/setup/global.setup.ts b/e2e/vue-start/dev-ssr-styles/tests/setup/global.setup.ts new file mode 100644 index 0000000000..b03b6485c8 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/tests/setup/global.setup.ts @@ -0,0 +1,15 @@ +import { preOptimizeDevServer, waitForServer } from '@tanstack/router-e2e-utils' + +export default async function setup() { + if (process.env.MODE !== 'dev') { + return + } + + const port = Number(process.env.E2E_APP_PORT ?? 0) + const baseURL = `http://localhost:${port}` + await waitForServer(baseURL) + await preOptimizeDevServer({ + baseURL, + readyTestId: 'home-heading', + }) +} diff --git a/e2e/vue-start/dev-ssr-styles/tsconfig.json b/e2e/vue-start/dev-ssr-styles/tsconfig.json new file mode 100644 index 0000000000..898ea214b1 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/tsconfig.json @@ -0,0 +1,23 @@ +{ + "include": ["**/*.ts", "**/*.tsx", "**/*.vue"], + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "vue", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "isolatedModules": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "target": "ES2022", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "~/*": ["./src/*"] + }, + "noEmit": true, + "types": ["vite/client"] + } +} diff --git a/e2e/vue-start/dev-ssr-styles/vite.config.ts b/e2e/vue-start/dev-ssr-styles/vite.config.ts new file mode 100644 index 0000000000..f8b7293af9 --- /dev/null +++ b/e2e/vue-start/dev-ssr-styles/vite.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/vue-start/plugin/vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + resolve: { tsconfigPaths: true }, + experimental: + process.env.E2E_VITE_BUNDLED_DEV === 'true' + ? { bundledDev: true } + : undefined, + server: { port: 3000 }, + plugins: [tanstackStart(), vue(), vueJsx()], +}) diff --git a/e2e/vue-start/query-integration/package.json b/e2e/vue-start/query-integration/package.json index 4cb22b48be..617ce4f430 100644 --- a/e2e/vue-start/query-integration/package.json +++ b/e2e/vue-start/query-integration/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-query": "^5.90.0", @@ -30,7 +30,8 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/query-integration/playwright.config.ts b/e2e/vue-start/query-integration/playwright.config.ts index 4d86a1dbe7..82678ac00b 100644 --- a/e2e/vue-start/query-integration/playwright.config.ts +++ b/e2e/vue-start/query-integration/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { derivePort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await derivePort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/query-integration/src/routes/loader-fetchQuery/$type.tsx b/e2e/vue-start/query-integration/src/routes/loader-fetchQuery/$type.tsx index 9e928feafe..38f1e209dc 100644 --- a/e2e/vue-start/query-integration/src/routes/loader-fetchQuery/$type.tsx +++ b/e2e/vue-start/query-integration/src/routes/loader-fetchQuery/$type.tsx @@ -1,8 +1,29 @@ +import { defineComponent } from 'vue' import { useQuery } from '@tanstack/vue-query' import { createFileRoute } from '@tanstack/vue-router' import z from 'zod' import { makeQueryOptions } from '~/queryOptions' +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + const query = useQuery(() => context.value.queryOptions) + return () => ( +
+
+ loader data:{' '} +
{loaderData.value ?? 'undefined'}
+
+
+ query data:{' '} +
{query.data.value ?? 'loading...'}
+
+
+ ) + }, +}) + export const Route = createFileRoute('/loader-fetchQuery/$type')({ component: RouteComponent, params: { @@ -24,21 +45,3 @@ export const Route = createFileRoute('/loader-fetchQuery/$type')({ }, ssr: 'data-only', }) - -function RouteComponent() { - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - const query = useQuery(context.value.queryOptions) - return ( -
-
- loader data:{' '} -
{loaderData.value ?? 'undefined'}
-
-
- query data:{' '} -
{query.data.value ?? 'loading...'}
-
-
- ) -} diff --git a/e2e/vue-start/scroll-restoration/package.json b/e2e/vue-start/scroll-restoration/package.json index cbc04f23ec..025b0225be 100644 --- a/e2e/vue-start/scroll-restoration/package.json +++ b/e2e/vue-start/scroll-restoration/package.json @@ -9,13 +9,13 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-start": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -28,9 +28,10 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/scroll-restoration/playwright.config.ts b/e2e/vue-start/scroll-restoration/playwright.config.ts index b0c365f8bd..1862174905 100644 --- a/e2e/vue-start/scroll-restoration/playwright.config.ts +++ b/e2e/vue-start/scroll-restoration/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -18,19 +13,19 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx index d06f4a948b..77c03c5afa 100644 --- a/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/scroll-restoration/src/routes/__root.tsx b/e2e/vue-start/scroll-restoration/src/routes/__root.tsx index a28ab59f79..cd8a558359 100644 --- a/e2e/vue-start/scroll-restoration/src/routes/__root.tsx +++ b/e2e/vue-start/scroll-restoration/src/routes/__root.tsx @@ -53,7 +53,11 @@ export const Route = createRootRoute({ ], }), errorComponent: (props) => { - return

{props.error.stack}

+ return ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ) }, notFoundComponent: () => , component: RootComponent, diff --git a/e2e/vue-start/scroll-restoration/src/utils/posts.tsx b/e2e/vue-start/scroll-restoration/src/utils/posts.tsx index e45ef52969..c4a2d0dcca 100644 --- a/e2e/vue-start/scroll-restoration/src/utils/posts.tsx +++ b/e2e/vue-start/scroll-restoration/src/utils/posts.tsx @@ -10,11 +10,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export class PostNotFoundError extends Error {} diff --git a/e2e/vue-start/scroll-restoration/src/utils/users.tsx b/e2e/vue-start/scroll-restoration/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/vue-start/scroll-restoration/src/utils/users.tsx +++ b/e2e/vue-start/scroll-restoration/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/vue-start/scroll-restoration/tests/scroll-restoration-lifecycle.spec.ts b/e2e/vue-start/scroll-restoration/tests/scroll-restoration-lifecycle.spec.ts new file mode 100644 index 0000000000..df75cba73c --- /dev/null +++ b/e2e/vue-start/scroll-restoration/tests/scroll-restoration-lifecycle.spec.ts @@ -0,0 +1,4 @@ +import { test } from '@tanstack/router-e2e-utils' +import { scrollRestorationLifecycleTests } from '../../../scroll-restoration-lifecycle' + +scrollRestorationLifecycleTests(test) diff --git a/e2e/vue-start/scroll-restoration/tests/setup/global.setup.ts b/e2e/vue-start/scroll-restoration/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-start/scroll-restoration/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/scroll-restoration/tests/setup/global.teardown.ts b/e2e/vue-start/scroll-restoration/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/scroll-restoration/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/selective-ssr/package.json b/e2e/vue-start/selective-ssr/package.json index 95c82b2511..b555a01c26 100644 --- a/e2e/vue-start/selective-ssr/package.json +++ b/e2e/vue-start/selective-ssr/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -22,10 +22,11 @@ "@tanstack/router-e2e-utils": "workspace:^", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", - "vue-tsc": "^3.1.8" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-start/selective-ssr/playwright.config.ts b/e2e/vue-start/selective-ssr/playwright.config.ts index badd6db0eb..630989e41f 100644 --- a/e2e/vue-start/selective-ssr/playwright.config.ts +++ b/e2e/vue-start/selective-ssr/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && NODE_ENV=production PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/selective-ssr/src/routes/__root.tsx b/e2e/vue-start/selective-ssr/src/routes/__root.tsx index a952abd4e0..9319a0982a 100644 --- a/e2e/vue-start/selective-ssr/src/routes/__root.tsx +++ b/e2e/vue-start/selective-ssr/src/routes/__root.tsx @@ -1,4 +1,5 @@ /// +import { defineComponent } from 'vue' import { Body, ClientOnly, @@ -14,6 +15,93 @@ import { z } from 'zod' import { ssrSchema } from '~/search' import appCss from '~/styles/app.css?url' +const RootDocument = defineComponent({ + setup(_, { slots }) { + const routerState = useRouterState({ + select: (state) => ({ + isLoading: state.isLoading, + status: state.status, + }), + }) + return () => ( + + + + + +
+

Selective SSR E2E Test

+ + Home + +
+
+ +
+ router isLoading:{' '} + + {routerState.value.isLoading ? 'true' : 'false'} + +
+
+ router status:{' '} + {routerState.value.status} +
+
+
+ {slots.default?.()} + + + + ) + }, +}) + +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => { + if ( + typeof window === 'undefined' && + search.value.root?.expected?.render === 'client-only' + ) { + const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` + console.error(error) + throw new Error(error) + } + return ( +
+

root

+
+ ssr: {JSON.stringify(search.value.root?.ssr ?? 'undefined')} +
+
+ expected data location execution:{' '} + + {search.value.root?.expected?.data} + +
+
+ loader: {loaderData.value.root} +
+
+ context: {context.value.root} +
+
+ +
+ ) + } + }, +}) + export const Route = createRootRoute({ head: () => ({ meta: [ @@ -74,84 +162,5 @@ export const Route = createRootRoute({ return { root: typeof window === 'undefined' ? 'server' : 'client' } }, shellComponent: RootDocument, - component: () => { - const search = Route.useSearch() - if ( - typeof window === 'undefined' && - search.value.root?.expected?.render === 'client-only' - ) { - const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` - console.error(error) - throw new Error(error) - } - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - return ( -
-

root

-
- ssr: {JSON.stringify(search.value.root?.ssr ?? 'undefined')} -
-
- expected data location execution:{' '} - - {search.value.root?.expected?.data} - -
-
- loader: {loaderData.value.root} -
-
- context: {context.value.root} -
-
- -
- ) - }, + component: RouteComponent, }) - -function RootDocument(_: unknown, { slots }: { slots: any }) { - const routerState = useRouterState({ - select: (state) => ({ - isLoading: state.isLoading, - status: state.status, - }), - }) - return ( - - - - - -
-

Selective SSR E2E Test

- - Home - -
-
- -
- router isLoading:{' '} - - {routerState.value.isLoading ? 'true' : 'false'} - -
-
- router status:{' '} - {routerState.value.status} -
-
-
- {slots.default?.()} - - - - ) -} diff --git a/e2e/vue-start/selective-ssr/src/routes/posts.$postId.tsx b/e2e/vue-start/selective-ssr/src/routes/posts.$postId.tsx index 4e7065cc48..522b5e9b8e 100644 --- a/e2e/vue-start/selective-ssr/src/routes/posts.$postId.tsx +++ b/e2e/vue-start/selective-ssr/src/routes/posts.$postId.tsx @@ -1,7 +1,47 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import z from 'zod' import { ssrSchema } from '~/search' +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => { + if ( + typeof window === 'undefined' && + search.value.postId?.expected?.render === 'client-only' + ) { + const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` + console.error(error) + throw new Error(error) + } + return ( +
+

postId

+
+ ssr:{' '} + {JSON.stringify(search.value.postId?.ssr ?? 'undefined')} +
+
+ expected data location execution:{' '} + + {search.value.postId?.expected?.data} + +
+
+ loader: {loaderData.value.postId} +
+
+ context: {context.value.postId} +
+
+ ) + } + }, +}) + export const Route = createFileRoute('/posts/$postId')({ validateSearch: z.object({ postId: ssrSchema }), ssr: ({ search }) => { @@ -46,37 +86,5 @@ export const Route = createFileRoute('/posts/$postId')({ } return { postId: typeof window === 'undefined' ? 'server' : 'client' } }, - component: () => { - const search = Route.useSearch() - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - if ( - typeof window === 'undefined' && - search.value.postId?.expected?.render === 'client-only' - ) { - const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` - console.error(error) - throw new Error(error) - } - return ( -
-

postId

-
- ssr: {JSON.stringify(search.value.postId?.ssr ?? 'undefined')} -
-
- expected data location execution:{' '} - - {search.value.postId?.expected?.data} - -
-
- loader: {loaderData.value.postId} -
-
- context: {context.value.postId} -
-
- ) - }, + component: RouteComponent, }) diff --git a/e2e/vue-start/selective-ssr/src/routes/posts.tsx b/e2e/vue-start/selective-ssr/src/routes/posts.tsx index 6c4e490dde..514628b229 100644 --- a/e2e/vue-start/selective-ssr/src/routes/posts.tsx +++ b/e2e/vue-start/selective-ssr/src/routes/posts.tsx @@ -1,7 +1,48 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import z from 'zod' import { ssrSchema } from '~/search' +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => { + if ( + typeof window === 'undefined' && + search.value.posts?.expected?.render === 'client-only' + ) { + const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` + console.error(error) + throw new Error(error) + } + return ( +
+

posts

+
+ ssr: {JSON.stringify(search.value.posts?.ssr ?? 'undefined')} +
+
+ expected data location execution:{' '} + + {search.value.posts?.expected?.data} + +
+
+ loader: {loaderData.value.posts} +
+
+ context: {context.value.posts} +
+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/posts')({ validateSearch: z.object({ posts: ssrSchema }), ssr: ({ search }) => { @@ -46,39 +87,5 @@ export const Route = createFileRoute('/posts')({ } return { posts: typeof window === 'undefined' ? 'server' : 'client' } }, - component: () => { - const search = Route.useSearch() - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - if ( - typeof window === 'undefined' && - search.value.posts?.expected?.render === 'client-only' - ) { - const error = `Expected component for ${Route.id} to be executed on the client, but it is running on the server` - console.error(error) - throw new Error(error) - } - return ( -
-

posts

-
- ssr: {JSON.stringify(search.value.posts?.ssr ?? 'undefined')} -
-
- expected data location execution:{' '} - - {search.value.posts?.expected?.data} - -
-
- loader: {loaderData.value.posts} -
-
- context: {context.value.posts} -
-
- -
- ) - }, + component: RouteComponent, }) diff --git a/e2e/vue-start/serialization-adapters/package.json b/e2e/vue-start/serialization-adapters/package.json index d854c0bb7c..a056e21da3 100644 --- a/e2e/vue-start/serialization-adapters/package.json +++ b/e2e/vue-start/serialization-adapters/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -23,10 +23,11 @@ "@tanstack/router-e2e-utils": "workspace:^", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", - "vue-tsc": "^3.1.8" + "vue-tsc": "^3.3.8" } } diff --git a/e2e/vue-start/serialization-adapters/playwright.config.ts b/e2e/vue-start/serialization-adapters/playwright.config.ts index badd6db0eb..630989e41f 100644 --- a/e2e/vue-start/serialization-adapters/playwright.config.ts +++ b/e2e/vue-start/serialization-adapters/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && NODE_ENV=production PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/serialization-adapters/src/routes/__root.tsx b/e2e/vue-start/serialization-adapters/src/routes/__root.tsx index 96911d2500..3ea36c7d46 100644 --- a/e2e/vue-start/serialization-adapters/src/routes/__root.tsx +++ b/e2e/vue-start/serialization-adapters/src/routes/__root.tsx @@ -1,4 +1,5 @@ /// +import { defineComponent } from 'vue' import { Body, ClientOnly, @@ -12,6 +13,51 @@ import { import { TanStackRouterDevtoolsInProd } from '@tanstack/vue-router-devtools' import appCss from '~/styles/app.css?url' +const RootDocument = defineComponent({ + setup(_, { slots }) { + const routerState = useRouterState({ + select: (state) => ({ isLoading: state.isLoading, status: state.status }), + }) + return () => ( + + + + + +
+

Serialization Adapters E2E Test

+ + Home + +
+
+ +
+ router isLoading:{' '} + + {routerState.value.isLoading ? 'true' : 'false'} + +
+
+ router status:{' '} + {routerState.value.status} +
+
+
+ {slots.default?.()} + + + + + ) + }, +}) + export const Route = createRootRoute({ head: () => ({ meta: [ @@ -31,46 +77,3 @@ export const Route = createRootRoute({ shellComponent: RootDocument, notFoundComponent: (e) =>
404 - Not Found {JSON.stringify(e.data)}
, }) - -function RootDocument(_: unknown, { slots }: { slots: any }) { - const routerState = useRouterState({ - select: (state) => ({ isLoading: state.isLoading, status: state.status }), - }) - return ( - - - - - -
-

Serialization Adapters E2E Test

- - Home - -
-
- -
- router isLoading:{' '} - - {routerState.value.isLoading ? 'true' : 'false'} - -
-
- router status:{' '} - {routerState.value.status} -
-
-
- {slots.default?.()} - - - - - ) -} diff --git a/e2e/vue-start/serialization-adapters/src/routes/index.tsx b/e2e/vue-start/serialization-adapters/src/routes/index.tsx index 2d90e4b073..d6bacefdc0 100644 --- a/e2e/vue-start/serialization-adapters/src/routes/index.tsx +++ b/e2e/vue-start/serialization-adapters/src/routes/index.tsx @@ -2,7 +2,9 @@ import { Link, createFileRoute } from '@tanstack/vue-router' export const Route = createFileRoute('/')({ component: Home, - errorComponent: (e) =>
{e.error.message}
, + errorComponent: (e) => ( +
{e.error instanceof Error ? e.error.message : String(e.error)}
+ ), }) function Home() { diff --git a/e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx b/e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx index ecb35d0a55..e71906f03e 100644 --- a/e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx +++ b/e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx @@ -1,6 +1,47 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' import { RenderData, makeData } from '~/data' +const RouteComponent = defineComponent({ + setup() { + const context = Route.useRouteContext() + const loaderData = Route.useLoaderData() + return () => { + const localData = makeData() + const expectedHonkState = localData.car.singleInstance.honk() + const honkState = loaderData.value.car.singleInstance.honk() + return ( +
+

data-only

+
+ context: +
+
+ loader: +
+
+

honk

+
+ expected:{' '} +
+ {JSON.stringify(expectedHonkState)} +
+
+
+ actual:{' '} +
+ {JSON.stringify(honkState)} +
+
+
+
+ +
+ ) + } + }, +}) + export const Route = createFileRoute('/ssr/data-only')({ ssr: 'data-only', beforeLoad: () => { @@ -9,43 +50,6 @@ export const Route = createFileRoute('/ssr/data-only')({ loader: ({ context }) => { return context }, - component: () => { - const context = Route.useRouteContext() - const loaderData = Route.useLoaderData() - - const localData = makeData() - const expectedHonkState = localData.car.singleInstance.honk() - - const honkState = loaderData.value.car.singleInstance.honk() - - return ( -
-

data-only

-
- context: -
-
- loader: -
-
-

honk

-
- expected:{' '} -
- {JSON.stringify(expectedHonkState)} -
-
-
- actual:{' '} -
- {JSON.stringify(honkState)} -
-
-
-
- -
- ) - }, + component: RouteComponent, pendingComponent: () =>
posts Loading...
, }) diff --git a/e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx b/e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx index bbc240b96d..b4f7fd8f23 100644 --- a/e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx +++ b/e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx @@ -1,6 +1,14 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { RenderNestedData, makeNested } from '~/data' +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + return () => + }, +}) + export const Route = createFileRoute('/ssr/nested')({ beforeLoad: () => { return { nested: makeNested() } @@ -8,8 +16,5 @@ export const Route = createFileRoute('/ssr/nested')({ loader: ({ context }) => { return context }, - component: () => { - const loaderData = Route.useLoaderData() - return - }, + component: RouteComponent, }) diff --git a/e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx b/e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx index 4fce3271f8..f6056699af 100644 --- a/e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx +++ b/e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx @@ -1,7 +1,32 @@ import { Await, createFileRoute } from '@tanstack/vue-router' -import { Suspense } from 'vue' +import { defineComponent, Suspense } from 'vue' import { RenderData, makeData } from '~/data' +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + return () => ( +
+

Stream

+
{loaderData.value.someString}
+ + {{ + default: () => ( + ) => ( + + )} + /> + ), + fallback: () =>
Loading...
, + }} +
+
+ ) + }, +}) + export const Route = createFileRoute('/ssr/stream')({ loader: () => { const dataPromise = new Promise>((r) => @@ -13,29 +38,8 @@ export const Route = createFileRoute('/ssr/stream')({ } }, - errorComponent: (e) =>
{e.error.message}
, + errorComponent: (e) => ( +
{e.error instanceof Error ? e.error.message : String(e.error)}
+ ), component: RouteComponent, }) - -function RouteComponent() { - const loaderData = Route.useLoaderData() - return ( -
-

Stream

-
{loaderData.value.someString}
- - {{ - default: () => ( - ) => ( - - )} - /> - ), - fallback: () =>
Loading...
, - }} -
-
- ) -} diff --git a/e2e/vue-start/server-functions/package.json b/e2e/vue-start/server-functions/package.json index 5752c48b73..dd1a7a9c6b 100644 --- a/e2e/vue-start/server-functions/package.json +++ b/e2e/vue-start/server-functions/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-query": "^5.90.9", @@ -18,7 +18,7 @@ "@tanstack/vue-router-ssr-query": "workspace:^", "@tanstack/vue-start": "workspace:^", "js-cookie": "^3.0.5", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -32,9 +32,10 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/server-functions/playwright.config.ts b/e2e/vue-start/server-functions/playwright.config.ts index cb1da03b94..48e14683f4 100644 --- a/e2e/vue-start/server-functions/playwright.config.ts +++ b/e2e/vue-start/server-functions/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -export const PORT = await getTestServerPort(packageJson.name) +export const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx index d06f4a948b..77c03c5afa 100644 --- a/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/server-functions/src/routes/__root.tsx b/e2e/vue-start/server-functions/src/routes/__root.tsx index 342f7a79b3..a52b12deae 100644 --- a/e2e/vue-start/server-functions/src/routes/__root.tsx +++ b/e2e/vue-start/server-functions/src/routes/__root.tsx @@ -25,7 +25,11 @@ export const Route = createRootRoute({ links: [{ rel: 'stylesheet', href: appCss }], }), errorComponent: (props) => { - return

{props.error.stack}

+ return ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ) }, notFoundComponent: () => , component: RootComponent, diff --git a/e2e/vue-start/server-functions/src/routes/cookies/index.tsx b/e2e/vue-start/server-functions/src/routes/cookies/index.tsx index d7fef10223..90dddad0af 100644 --- a/e2e/vue-start/server-functions/src/routes/cookies/index.tsx +++ b/e2e/vue-start/server-functions/src/routes/cookies/index.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' import { z } from 'zod' @@ -5,21 +6,23 @@ const cookieSchema = z .object({ value: z.string().default(() => `CLIENT-${Date.now()}`) }) .prefault({}) .catch(() => ({ value: `CLIENT-${Date.now()}` })) +const RouteComponent = defineComponent({ + setup() { + const search = Route.useSearch() + return () => ( + + got to route that sets the cookies with {JSON.stringify(search.value)} + + ) + }, +}) + export const Route = createFileRoute('/cookies/')({ validateSearch: cookieSchema, component: RouteComponent, }) - -function RouteComponent() { - const search = Route.useSearch() - return ( - - got to route that sets the cookies with {JSON.stringify(search.value)} - - ) -} diff --git a/e2e/vue-start/server-functions/src/routes/formdata-redirect/index.tsx b/e2e/vue-start/server-functions/src/routes/formdata-redirect/index.tsx index 8b0c623b8c..8bfcc55ca3 100644 --- a/e2e/vue-start/server-functions/src/routes/formdata-redirect/index.tsx +++ b/e2e/vue-start/server-functions/src/routes/formdata-redirect/index.tsx @@ -1,7 +1,51 @@ +import { defineComponent } from 'vue' import { createFileRoute, redirect } from '@tanstack/vue-router' import { createServerFn, useServerFn } from '@tanstack/vue-start' import { z } from 'zod' +const SubmitPostFormDataFn = defineComponent({ + setup() { + const mode = Route.useSearch({ select: (search) => search.mode }) + const greetUserFn = useServerFn(greetUser) + return () => ( +
+

Submit POST FormData Fn Call

+
+ It should return redirect to /formdata-redirect/target/ + {testValues.name} and greet the user with their name: + +
+              {testValues.name}
+            
+
+
+
{ + if (mode.value === 'js') { + evt.preventDefault() + const data = new FormData(evt.currentTarget as HTMLFormElement) + await greetUserFn({ data }) + } + }} + > + + +
+
+ ) + }, +}) + export const Route = createFileRoute('/formdata-redirect/')({ component: SubmitPostFormDataFn, validateSearch: z.object({ @@ -31,44 +75,3 @@ export const greetUser = createServerFn({ method: 'POST' }) .handler(({ data: { name } }) => { throw redirect({ to: '/formdata-redirect/target/$name', params: { name } }) }) - -function SubmitPostFormDataFn() { - const mode = Route.useSearch({ select: (search) => search.mode }) - const greetUserFn = useServerFn(greetUser) - return ( -
-

Submit POST FormData Fn Call

-
- It should return redirect to /formdata-redirect/target/{testValues.name}{' '} - and greet the user with their name: - -
-            {testValues.name}
-          
-
-
-
{ - if (mode.value === 'js') { - evt.preventDefault() - const data = new FormData(evt.currentTarget as HTMLFormElement) - await greetUserFn({ data }) - } - }} - > - - -
-
- ) -} diff --git a/e2e/vue-start/server-functions/src/routes/formdata-redirect/target.$name.tsx b/e2e/vue-start/server-functions/src/routes/formdata-redirect/target.$name.tsx index 958aeaf617..099a8665bf 100644 --- a/e2e/vue-start/server-functions/src/routes/formdata-redirect/target.$name.tsx +++ b/e2e/vue-start/server-functions/src/routes/formdata-redirect/target.$name.tsx @@ -1,18 +1,21 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const RouteComponent = defineComponent({ + setup() { + const params = Route.useParams() + return () => ( +
+ Hello{' '} + + {params.value.name} + + ! +
+ ) + }, +}) + export const Route = createFileRoute('/formdata-redirect/target/$name')({ component: RouteComponent, }) - -function RouteComponent() { - const params = Route.useParams() - return ( -
- Hello{' '} - - {params.value.name} - - ! -
- ) -} diff --git a/e2e/vue-start/server-routes/package.json b/e2e/vue-start/server-routes/package.json index 4f9db26152..6a8e1babed 100644 --- a/e2e/vue-start/server-routes/package.json +++ b/e2e/vue-start/server-routes/package.json @@ -18,7 +18,7 @@ "@tanstack/vue-router-ssr-query": "workspace:^", "@tanstack/vue-start": "workspace:^", "js-cookie": "^3.0.5", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -32,9 +32,10 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/server-routes/playwright.config.ts b/e2e/vue-start/server-routes/playwright.config.ts index cb1da03b94..48e14683f4 100644 --- a/e2e/vue-start/server-routes/playwright.config.ts +++ b/e2e/vue-start/server-routes/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -export const PORT = await getTestServerPort(packageJson.name) +export const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx index d06f4a948b..77c03c5afa 100644 --- a/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/server-routes/src/routes/__root.tsx b/e2e/vue-start/server-routes/src/routes/__root.tsx index 999d80fff1..aa4b1f31fa 100644 --- a/e2e/vue-start/server-routes/src/routes/__root.tsx +++ b/e2e/vue-start/server-routes/src/routes/__root.tsx @@ -25,7 +25,11 @@ export const Route = createRootRoute({ links: [{ rel: 'stylesheet', href: appCss }], }), errorComponent: (props) => { - return

{props.error.stack}

+ return ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ) }, notFoundComponent: () => , component: RootComponent, diff --git a/e2e/vue-start/spa-mode/package.json b/e2e/vue-start/spa-mode/package.json index 1795d2d5c4..c4270cfccd 100644 --- a/e2e/vue-start/spa-mode/package.json +++ b/e2e/vue-start/spa-mode/package.json @@ -9,7 +9,7 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "npx serve dist/client", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", @@ -24,7 +24,8 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/spa-mode/playwright.config.ts b/e2e/vue-start/spa-mode/playwright.config.ts index badd6db0eb..630989e41f 100644 --- a/e2e/vue-start/spa-mode/playwright.config.ts +++ b/e2e/vue-start/spa-mode/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** * See https://playwright.dev/docs/test-configuration. @@ -20,8 +19,8 @@ export default defineConfig({ webServer: { command: `VITE_SERVER_PORT=${PORT} pnpm build && NODE_ENV=production PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/spa-mode/src/routes/__root.tsx b/e2e/vue-start/spa-mode/src/routes/__root.tsx index 1e38664739..45aee73c06 100644 --- a/e2e/vue-start/spa-mode/src/routes/__root.tsx +++ b/e2e/vue-start/spa-mode/src/routes/__root.tsx @@ -1,4 +1,5 @@ /// +import { defineComponent } from 'vue' import { Body, ClientOnly, @@ -13,6 +14,71 @@ import { import { TanStackRouterDevtools } from '@tanstack/vue-router-devtools' import appCss from '~/styles/app.css?url' +const RootDocument = defineComponent({ + setup(_, { slots }) { + const routerState = useRouterState({ + select: (state) => ({ isLoading: state.isLoading, status: state.status }), + }) + return () => ( + + + + + +
+

SPA Mode E2E Test

+ + Home + +
+
+ +
+ router isLoading:{' '} + + {routerState.value.isLoading ? 'true' : 'false'} + +
+
+ router status:{' '} + {routerState.value.status} +
+
+
+ {slots.default?.()} + + + + + ) + }, +}) + +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => ( +
+

root

+
+ loader: {loaderData.value.root} +
+
+ context: {context.value.root} +
+
+ +
+ ) + }, +}) + export const Route = createRootRoute({ head: () => ({ meta: [ @@ -44,65 +110,6 @@ export const Route = createRootRoute({ return { root: typeof window === 'undefined' ? 'server' : 'client' } }, shellComponent: RootDocument, - component: () => { - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - return ( -
-

root

-
- loader: {loaderData.value.root} -
-
- context: {context.value.root} -
-
- -
- ) - }, + component: RouteComponent, pendingComponent: () =>
__root Loading...
, }) - -function RootDocument(_: unknown, { slots }: { slots: any }) { - const routerState = useRouterState({ - select: (state) => ({ isLoading: state.isLoading, status: state.status }), - }) - return ( - - - - - -
-

SPA Mode E2E Test

- - Home - -
-
- -
- router isLoading:{' '} - - {routerState.value.isLoading ? 'true' : 'false'} - -
-
- router status:{' '} - {routerState.value.status} -
-
-
- {slots.default?.()} - - - - - ) -} diff --git a/e2e/vue-start/spa-mode/src/routes/posts.$postId.tsx b/e2e/vue-start/spa-mode/src/routes/posts.$postId.tsx index 6733ef7436..9c25cbad25 100644 --- a/e2e/vue-start/spa-mode/src/routes/posts.$postId.tsx +++ b/e2e/vue-start/spa-mode/src/routes/posts.$postId.tsx @@ -1,5 +1,24 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => ( +
+

postId

+
+ loader: {loaderData.value.postId} +
+
+ context: {context.value.postId} +
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ beforeLoad: () => { console.log( @@ -15,20 +34,6 @@ export const Route = createFileRoute('/posts/$postId')({ ) return { postId: typeof window === 'undefined' ? 'server' : 'client' } }, - component: () => { - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - return ( -
-

postId

-
- loader: {loaderData.value.postId} -
-
- context: {context.value.postId} -
-
- ) - }, + component: RouteComponent, pendingComponent: () =>
$postId Loading...
, }) diff --git a/e2e/vue-start/spa-mode/src/routes/posts.tsx b/e2e/vue-start/spa-mode/src/routes/posts.tsx index e69ae1ea86..44c536adc4 100644 --- a/e2e/vue-start/spa-mode/src/routes/posts.tsx +++ b/e2e/vue-start/spa-mode/src/routes/posts.tsx @@ -1,5 +1,26 @@ +import { defineComponent } from 'vue' import { Outlet, createFileRoute } from '@tanstack/vue-router' +const RouteComponent = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + const context = Route.useRouteContext() + return () => ( +
+

posts

+
+ loader: {loaderData.value.posts} +
+
+ context: {context.value.posts} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ beforeLoad: () => { console.log( @@ -16,22 +37,6 @@ export const Route = createFileRoute('/posts')({ return { posts: typeof window === 'undefined' ? 'server' : 'client' } }, - component: () => { - const loaderData = Route.useLoaderData() - const context = Route.useRouteContext() - return ( -
-

posts

-
- loader: {loaderData.value.posts} -
-
- context: {context.value.posts} -
-
- -
- ) - }, + component: RouteComponent, pendingComponent: () =>
posts Loading...
, }) diff --git a/e2e/vue-start/start-manifest/package.json b/e2e/vue-start/start-manifest/package.json index 358e8e0c04..ae682f7a9d 100644 --- a/e2e/vue-start/start-manifest/package.json +++ b/e2e/vue-start/start-manifest/package.json @@ -19,8 +19,9 @@ "@tanstack/router-e2e-utils": "workspace:^", "@types/node": "^22.10.2", "@vitejs/plugin-vue-jsx": "^5.1.5", - "srvx": "^0.11.9", - "typescript": "^6.0.2", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "nx": { diff --git a/e2e/vue-start/start-manifest/playwright.config.ts b/e2e/vue-start/start-manifest/playwright.config.ts index b9f835c16a..653e08253f 100644 --- a/e2e/vue-start/start-manifest/playwright.config.ts +++ b/e2e/vue-start/start-manifest/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` export default defineConfig({ @@ -16,8 +15,8 @@ export default defineConfig({ webServer: { command: `pnpm build && PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/start-manifest/tests/start-manifest.spec.ts b/e2e/vue-start/start-manifest/tests/start-manifest.spec.ts index 6c0f0d15ab..4d5bea0a33 100644 --- a/e2e/vue-start/start-manifest/tests/start-manifest.spec.ts +++ b/e2e/vue-start/start-manifest/tests/start-manifest.spec.ts @@ -372,24 +372,19 @@ test('shared widget CSS stays applied when navigating from static to lazy route' const widget = page.getByTestId('shared-widget') await expect(widget).toBeVisible() - expect(await getBackgroundColor('shared-widget', page)).toBe(SHARED_WIDGET_BG) - expect( - await widget.evaluate( - (element) => getComputedStyle(element).borderTopColor, - ), - ).toBe(SHARED_WIDGET_BORDER) + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) await expect(page.getByTestId('lazy-css-static-hydrated')).toBeVisible() await page.getByTestId('nav-/lazy-css-lazy').click() await page.waitForURL('**/lazy-css-lazy') + // Both routes render `shared-widget`: wait for the destination route before + // asserting on it, so the assertions cannot match the departing widget. await expect(page.getByTestId('lazy-css-lazy-heading')).toBeVisible() - await expect - .poll(() => getBackgroundColor('shared-widget', page), { - timeout: 5_000, - }) - .toBe(SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) }) test('shared widget CSS stays applied when navigating from lazy to static route', async ({ @@ -399,27 +394,19 @@ test('shared widget CSS stays applied when navigating from lazy to static route' await page.goto(buildUrl(baseURL!, '/lazy-css-lazy')) await expect(page.getByTestId('lazy-css-lazy-heading')).toBeVisible() - await expect - .poll(() => getBackgroundColor('shared-widget', page), { - timeout: 5_000, - }) - .toBe(SHARED_WIDGET_BG) + const widget = page.getByTestId('shared-widget') + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) await page.getByTestId('nav-/lazy-css-static').click() await page.waitForURL('**/lazy-css-static') + // The URL updates before the lazy route unmounts, and both routes render + // `shared-widget`: wait for a marker only the static route renders. + await expect(page.getByTestId('lazy-css-static-hydrated')).toBeVisible() - const widget = page.getByTestId('shared-widget') await expect(widget).toBeVisible() - await expect - .poll(() => getBackgroundColor('shared-widget', page), { - timeout: 5_000, - }) - .toBe(SHARED_WIDGET_BG) - expect( - await widget.evaluate( - (element) => getComputedStyle(element).borderTopColor, - ), - ).toBe(SHARED_WIDGET_BORDER) + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) }) test('shared widget CSS is applied on direct navigation to lazy route', async ({ @@ -431,17 +418,8 @@ test('shared widget CSS is applied on direct navigation to lazy route', async ({ const widget = page.getByTestId('shared-widget') await expect(widget).toBeVisible() - - await expect - .poll(() => getBackgroundColor('shared-widget', page), { - timeout: 5_000, - }) - .toBe(SHARED_WIDGET_BG) - expect( - await widget.evaluate( - (element) => getComputedStyle(element).borderTopColor, - ), - ).toBe(SHARED_WIDGET_BORDER) + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) }) test('shared widget CSS persists after navigating away from lazy and back', async ({ @@ -451,19 +429,21 @@ test('shared widget CSS persists after navigating away from lazy and back', asyn await page.goto(buildUrl(baseURL!, '/lazy-css-static')) await expect(page.getByTestId('lazy-css-static-hydrated')).toBeVisible() + const widget = page.getByTestId('shared-widget') + await page.getByTestId('nav-/lazy-css-lazy').click() await page.waitForURL('**/lazy-css-lazy') - await expect(page.getByTestId('shared-widget')).toBeVisible() + await expect(page.getByTestId('lazy-css-lazy-heading')).toBeVisible() + await expect(widget).toBeVisible() await page.getByTestId('nav-home').click() - await page.waitForURL(/\/([^/]*)(\/)?($|\?)/) + await page.waitForURL((url) => url.pathname === '/') + await expect(page.getByTestId('home-copy')).toBeVisible() await page.getByTestId('nav-/lazy-css-lazy').click() await page.waitForURL('**/lazy-css-lazy') + await expect(page.getByTestId('lazy-css-lazy-heading')).toBeVisible() - await expect - .poll(() => getBackgroundColor('shared-widget', page), { - timeout: 5_000, - }) - .toBe(SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('background-color', SHARED_WIDGET_BG) + await expect(widget).toHaveCSS('border-top-color', SHARED_WIDGET_BORDER) }) diff --git a/e2e/vue-start/streaming-ssr/package.json b/e2e/vue-start/streaming-ssr/package.json new file mode 100644 index 0000000000..382120860a --- /dev/null +++ b/e2e/vue-start/streaming-ssr/package.json @@ -0,0 +1,59 @@ +{ + "name": "tanstack-vue-start-e2e-streaming-ssr", + "private": true, + "sideEffects": false, + "type": "module", + "scripts": { + "dev": "vite dev --port 3000", + "dev:e2e": "vite dev", + "build": "vite build && tsc --noEmit", + "start": "pnpx srvx --prod -s ../client dist/server/server.js", + "preview": "vite preview", + "test:e2e": "playwright test --project=chromium", + "test:e2e:preview": "MODE=preview playwright test preview-streaming.spec.ts --project=chromium" + }, + "dependencies": { + "@tanstack/vue-query": "^5.90.0", + "@tanstack/vue-router": "workspace:^", + "@tanstack/vue-router-ssr-query": "workspace:^", + "@tanstack/vue-start": "workspace:^", + "vue": "^3.5.16" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-e2e-utils": "workspace:^", + "@types/node": "^22.10.2", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "srvx": "^1.0.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14" + }, + "nx": { + "targets": { + "build": { + "inputs": [ + "buildProduction", + "^buildProduction", + "dependentTaskOutputs", + "streamingSsrTests" + ] + }, + "test:e2e": { + "inputs": [ + "default", + "^production", + "dependentTaskOutputs", + "streamingSsrTests" + ] + }, + "test:e2e:preview": { + "inputs": [ + "default", + "^production", + "streamingSsrTests" + ] + } + } + } +} diff --git a/e2e/vue-start/streaming-ssr/playwright.config.ts b/e2e/vue-start/streaming-ssr/playwright.config.ts new file mode 100644 index 0000000000..c2f3b67a0c --- /dev/null +++ b/e2e/vue-start/streaming-ssr/playwright.config.ts @@ -0,0 +1,39 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const isPreview = process.env.MODE === 'preview' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` + +const ssrCommand = `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start` +const previewCommand = `VITE_SERVER_PORT=${PORT} pnpm build && pnpm preview --port ${PORT}` + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './tests', + workers: 1, + + reporter: [['line']], + + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL, + }, + + webServer: { + command: isPreview ? previewCommand : ssrCommand, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/vue-start/streaming-ssr/src/routeTree.gen.ts b/e2e/vue-start/streaming-ssr/src/routeTree.gen.ts new file mode 100644 index 0000000000..ac4c9ab156 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routeTree.gen.ts @@ -0,0 +1,282 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as ConcurrentRouteImport } from './routes/concurrent' +import { Route as DeferredRouteImport } from './routes/deferred' +import { Route as DeferredRejectionRouteImport } from './routes/deferred-rejection' +import { Route as FastSerialRouteImport } from './routes/fast-serial' +import { Route as ManyPromisesRouteImport } from './routes/many-promises' +import { Route as NestedDeferredRouteImport } from './routes/nested-deferred' +import { Route as QueryHeavyRouteImport } from './routes/query-heavy' +import { Route as SlowRenderRouteImport } from './routes/slow-render' +import { Route as StreamRouteImport } from './routes/stream' +import { Route as SyncOnlyRouteImport } from './routes/sync-only' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const ConcurrentRoute = ConcurrentRouteImport.update({ + id: '/concurrent', + path: '/concurrent', + getParentRoute: () => rootRouteImport, +} as any) +const DeferredRoute = DeferredRouteImport.update({ + id: '/deferred', + path: '/deferred', + getParentRoute: () => rootRouteImport, +} as any) +const DeferredRejectionRoute = DeferredRejectionRouteImport.update({ + id: '/deferred-rejection', + path: '/deferred-rejection', + getParentRoute: () => rootRouteImport, +} as any) +const FastSerialRoute = FastSerialRouteImport.update({ + id: '/fast-serial', + path: '/fast-serial', + getParentRoute: () => rootRouteImport, +} as any) +const ManyPromisesRoute = ManyPromisesRouteImport.update({ + id: '/many-promises', + path: '/many-promises', + getParentRoute: () => rootRouteImport, +} as any) +const NestedDeferredRoute = NestedDeferredRouteImport.update({ + id: '/nested-deferred', + path: '/nested-deferred', + getParentRoute: () => rootRouteImport, +} as any) +const QueryHeavyRoute = QueryHeavyRouteImport.update({ + id: '/query-heavy', + path: '/query-heavy', + getParentRoute: () => rootRouteImport, +} as any) +const SlowRenderRoute = SlowRenderRouteImport.update({ + id: '/slow-render', + path: '/slow-render', + getParentRoute: () => rootRouteImport, +} as any) +const StreamRoute = StreamRouteImport.update({ + id: '/stream', + path: '/stream', + getParentRoute: () => rootRouteImport, +} as any) +const SyncOnlyRoute = SyncOnlyRouteImport.update({ + id: '/sync-only', + path: '/sync-only', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/concurrent': typeof ConcurrentRoute + '/deferred': typeof DeferredRoute + '/deferred-rejection': typeof DeferredRejectionRoute + '/fast-serial': typeof FastSerialRoute + '/many-promises': typeof ManyPromisesRoute + '/nested-deferred': typeof NestedDeferredRoute + '/query-heavy': typeof QueryHeavyRoute + '/slow-render': typeof SlowRenderRoute + '/stream': typeof StreamRoute + '/sync-only': typeof SyncOnlyRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/concurrent': typeof ConcurrentRoute + '/deferred': typeof DeferredRoute + '/deferred-rejection': typeof DeferredRejectionRoute + '/fast-serial': typeof FastSerialRoute + '/many-promises': typeof ManyPromisesRoute + '/nested-deferred': typeof NestedDeferredRoute + '/query-heavy': typeof QueryHeavyRoute + '/slow-render': typeof SlowRenderRoute + '/stream': typeof StreamRoute + '/sync-only': typeof SyncOnlyRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/concurrent': typeof ConcurrentRoute + '/deferred': typeof DeferredRoute + '/deferred-rejection': typeof DeferredRejectionRoute + '/fast-serial': typeof FastSerialRoute + '/many-promises': typeof ManyPromisesRoute + '/nested-deferred': typeof NestedDeferredRoute + '/query-heavy': typeof QueryHeavyRoute + '/slow-render': typeof SlowRenderRoute + '/stream': typeof StreamRoute + '/sync-only': typeof SyncOnlyRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/' + | '/concurrent' + | '/deferred' + | '/deferred-rejection' + | '/fast-serial' + | '/many-promises' + | '/nested-deferred' + | '/query-heavy' + | '/slow-render' + | '/stream' + | '/sync-only' + fileRoutesByTo: FileRoutesByTo + to: + | '/' + | '/concurrent' + | '/deferred' + | '/deferred-rejection' + | '/fast-serial' + | '/many-promises' + | '/nested-deferred' + | '/query-heavy' + | '/slow-render' + | '/stream' + | '/sync-only' + id: + | '__root__' + | '/' + | '/concurrent' + | '/deferred' + | '/deferred-rejection' + | '/fast-serial' + | '/many-promises' + | '/nested-deferred' + | '/query-heavy' + | '/slow-render' + | '/stream' + | '/sync-only' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + ConcurrentRoute: typeof ConcurrentRoute + DeferredRoute: typeof DeferredRoute + DeferredRejectionRoute: typeof DeferredRejectionRoute + FastSerialRoute: typeof FastSerialRoute + ManyPromisesRoute: typeof ManyPromisesRoute + NestedDeferredRoute: typeof NestedDeferredRoute + QueryHeavyRoute: typeof QueryHeavyRoute + SlowRenderRoute: typeof SlowRenderRoute + StreamRoute: typeof StreamRoute + SyncOnlyRoute: typeof SyncOnlyRoute +} + +declare module '@tanstack/vue-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/concurrent': { + id: '/concurrent' + path: '/concurrent' + fullPath: '/concurrent' + preLoaderRoute: typeof ConcurrentRouteImport + parentRoute: typeof rootRouteImport + } + '/deferred': { + id: '/deferred' + path: '/deferred' + fullPath: '/deferred' + preLoaderRoute: typeof DeferredRouteImport + parentRoute: typeof rootRouteImport + } + '/deferred-rejection': { + id: '/deferred-rejection' + path: '/deferred-rejection' + fullPath: '/deferred-rejection' + preLoaderRoute: typeof DeferredRejectionRouteImport + parentRoute: typeof rootRouteImport + } + '/fast-serial': { + id: '/fast-serial' + path: '/fast-serial' + fullPath: '/fast-serial' + preLoaderRoute: typeof FastSerialRouteImport + parentRoute: typeof rootRouteImport + } + '/many-promises': { + id: '/many-promises' + path: '/many-promises' + fullPath: '/many-promises' + preLoaderRoute: typeof ManyPromisesRouteImport + parentRoute: typeof rootRouteImport + } + '/nested-deferred': { + id: '/nested-deferred' + path: '/nested-deferred' + fullPath: '/nested-deferred' + preLoaderRoute: typeof NestedDeferredRouteImport + parentRoute: typeof rootRouteImport + } + '/query-heavy': { + id: '/query-heavy' + path: '/query-heavy' + fullPath: '/query-heavy' + preLoaderRoute: typeof QueryHeavyRouteImport + parentRoute: typeof rootRouteImport + } + '/slow-render': { + id: '/slow-render' + path: '/slow-render' + fullPath: '/slow-render' + preLoaderRoute: typeof SlowRenderRouteImport + parentRoute: typeof rootRouteImport + } + '/stream': { + id: '/stream' + path: '/stream' + fullPath: '/stream' + preLoaderRoute: typeof StreamRouteImport + parentRoute: typeof rootRouteImport + } + '/sync-only': { + id: '/sync-only' + path: '/sync-only' + fullPath: '/sync-only' + preLoaderRoute: typeof SyncOnlyRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + ConcurrentRoute: ConcurrentRoute, + DeferredRoute: DeferredRoute, + DeferredRejectionRoute: DeferredRejectionRoute, + FastSerialRoute: FastSerialRoute, + ManyPromisesRoute: ManyPromisesRoute, + NestedDeferredRoute: NestedDeferredRoute, + QueryHeavyRoute: QueryHeavyRoute, + SlowRenderRoute: SlowRenderRoute, + StreamRoute: StreamRoute, + SyncOnlyRoute: SyncOnlyRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/vue-start' +declare module '@tanstack/vue-start' { + interface Register { + ssr: true + router: Awaited> + } +} diff --git a/e2e/vue-start/streaming-ssr/src/router.tsx b/e2e/vue-start/streaming-ssr/src/router.tsx new file mode 100644 index 0000000000..257eb8dac9 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/router.tsx @@ -0,0 +1,18 @@ +import { QueryClient } from '@tanstack/vue-query' +import { createRouter } from '@tanstack/vue-router' +import { setupRouterSsrQueryIntegration } from '@tanstack/vue-router-ssr-query' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + const queryClient = new QueryClient() + const router = createRouter({ + routeTree, + context: { queryClient }, + scrollRestoration: true, + }) + setupRouterSsrQueryIntegration({ + router, + queryClient, + }) + return router +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/__root.tsx b/e2e/vue-start/streaming-ssr/src/routes/__root.tsx new file mode 100644 index 0000000000..d3b3339720 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/__root.tsx @@ -0,0 +1,103 @@ +import { + Body, + HeadContent, + Html, + Link, + Outlet, + Scripts, + createRootRouteWithContext, +} from '@tanstack/vue-router' +import { defineComponent, ref } from 'vue' +import type { QueryClient } from '@tanstack/vue-query' + +export const Route = createRootRouteWithContext<{ + queryClient: QueryClient +}>()({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { title: 'Streaming SSR Tests' }, + ], + }), + component: RootComponent, +}) + +function RootComponent() { + return ( + + + + + + + + + + + + ) +} + +const HydrationCheck = defineComponent({ + setup() { + const status = ref<'pending' | 'hydrated'>('pending') + + return () => ( +
+ + + {status.value} + +
+ ) + }, +}) diff --git a/e2e/vue-start/streaming-ssr/src/routes/concurrent.tsx b/e2e/vue-start/streaming-ssr/src/routes/concurrent.tsx new file mode 100644 index 0000000000..5fed8ab517 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/concurrent.tsx @@ -0,0 +1,54 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { Suspense } from 'vue' +import { createConcurrentLoaderData } from '../../../../streaming-ssr-fixtures' + +export const Route = createFileRoute('/concurrent')({ + loader: async () => createConcurrentLoaderData(), + component: Concurrent, +}) + +function PromiseItem(props: { promise: Promise; testId: string }) { + return ( + + {{ + default: () => ( + ( +
{value}
+ )} + /> + ), + fallback: () => ( +
Loading...
+ ), + }} +
+ ) +} + +function Concurrent() { + const data = Route.useLoaderData() + + return ( +
+

Concurrent Resolution Test (15 promises in 3 batches)

+

Tests multiple promises resolving at the exact same instant.

+ + + + + + + + + + + + + + + +
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/deferred-rejection.tsx b/e2e/vue-start/streaming-ssr/src/routes/deferred-rejection.tsx new file mode 100644 index 0000000000..5018f9e07c --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/deferred-rejection.tsx @@ -0,0 +1,49 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { Suspense } from 'vue' +import { + deferredDataDelay, + deferredErrorMessage, +} from '../../../../streaming-ssr-fixtures' + +export const Route = createFileRoute('/deferred-rejection')({ + loader: async () => { + return { + deferredData: new Promise((_resolve, reject) => { + setTimeout(() => { + reject(new Error(deferredErrorMessage)) + }, deferredDataDelay) + }), + } + }, + errorComponent: ({ error }) => ( +
+ {error instanceof Error ? error.message : String(error)} +
+ ), + component: DeferredRejection, +}) + +function DeferredRejection() { + const data = Route.useLoaderData() + + return ( +
+

Deferred Rejection Test

+ + {{ + default: () => ( + ( +
{value}
+ )} + /> + ), + fallback: () => ( +
Loading deferred...
+ ), + }} +
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/deferred.tsx b/e2e/vue-start/streaming-ssr/src/routes/deferred.tsx new file mode 100644 index 0000000000..6a8affe1b4 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/deferred.tsx @@ -0,0 +1,100 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { createServerFn } from '@tanstack/vue-start' +import { Suspense } from 'vue' +import { + deferredDataDelay, + deferredDataMessage, + deferredImmediateName, + deferredServerDelay, + deferredSlowName, + delay, + makeDeferredMessage, + makeServerData, + sourceMarker, +} from '../../../../streaming-ssr-fixtures' + +const getImmediateData = createServerFn({ method: 'GET' }) + .validator((data: { name: string }) => data) + .handler(({ data }) => makeServerData(data.name)) + +const getSlowData = createServerFn({ method: 'GET' }) + .validator((data: { name: string; delay: number }) => data) + .handler(async ({ data }) => { + await delay(data.delay) + return makeServerData(data.name) + }) + +export const Route = createFileRoute('/deferred')({ + loader: async () => { + return { + deferredData: makeDeferredMessage(deferredDataMessage, deferredDataDelay), + deferredServerData: getSlowData({ + data: { name: deferredSlowName, delay: deferredServerDelay }, + }), + immediateData: await getImmediateData({ + data: { name: deferredImmediateName }, + }), + loaderSource: sourceMarker(), + } + }, + component: Deferred, +}) + +function Deferred() { + const data = Route.useLoaderData() + + return ( +
+

Deferred Data Test

+
+ Immediate: {data.value.immediateData.name} @{' '} + {data.value.immediateData.timestamp} +
+
+ Immediate source: {data.value.immediateData.source} +
+
+ Loader source: {data.value.loaderSource} +
+ + {{ + default: () => ( + ( +
+ {value.message} (source: {value.source}) +
+ )} + /> + ), + fallback: () => ( +
Loading deferred...
+ ), + }} +
+ + {{ + default: () => ( + ( +
+ Server: {value.name} @ {value.timestamp} (source:{' '} + {value.source}) +
+ )} + /> + ), + fallback: () => ( +
Loading server data...
+ ), + }} +
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/fast-serial.tsx b/e2e/vue-start/streaming-ssr/src/routes/fast-serial.tsx new file mode 100644 index 0000000000..ac004b041c --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/fast-serial.tsx @@ -0,0 +1,49 @@ +import { createFileRoute } from '@tanstack/vue-router' +import { createServerFn } from '@tanstack/vue-start' +import { + fastSerialStaticData, + makeFastSerialSmallData, + sourceMarker, +} from '../../../../streaming-ssr-fixtures' + +const getSmallData = createServerFn({ method: 'GET' }).handler(() => + makeFastSerialSmallData(), +) + +export const Route = createFileRoute('/fast-serial')({ + loader: async () => { + const data = await getSmallData() + return { + serverData: data, + staticData: fastSerialStaticData, + timestamp: Date.now(), + loaderSource: sourceMarker(), + } + }, + component: FastSerial, +}) + +function FastSerial() { + const data = Route.useLoaderData() + + return ( +
+

Fast Serialization Test

+

This route tests when serialization completes before render.

+
+ Server: {data.value.serverData.value} @{' '} + {data.value.serverData.timestamp} +
+
+ Server function source: {data.value.serverData.source} +
+
+ Loader source: {data.value.loaderSource} +
+
Static: {data.value.staticData}
+
+ Loader timestamp: {data.value.timestamp} +
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/index.tsx b/e2e/vue-start/streaming-ssr/src/routes/index.tsx new file mode 100644 index 0000000000..0350eb5d4a --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/index.tsx @@ -0,0 +1,58 @@ +import { Link, createFileRoute } from '@tanstack/vue-router' + +export const Route = createFileRoute('/')({ + component: Index, +}) + +function Index() { + return ( +
+

Streaming SSR Test Scenarios

+

This e2e project tests various SSR streaming scenarios:

+
    +
  • + + Sync Only + {' '} + - Tests synchronous serialization with no deferred/streaming data +
  • +
  • + + Deferred Data + {' '} + - Tests deferred promises resolving after initial render +
  • +
  • + + Deferred Rejection + {' '} + - Tests deferred promise rejections render through the error boundary +
  • +
  • + + ReadableStream + {' '} + - Tests streaming data via ReadableStream +
  • +
  • + + Fast Serialization + {' '} + - Tests when serialization completes before render finishes +
  • +
  • + + Slow Render + {' '} + - Tests when render takes longer than serialization +
  • +
  • + + Nested Deferred + {' '} + - Tests nested components with deferred data +
  • +
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/many-promises.tsx b/e2e/vue-start/streaming-ssr/src/routes/many-promises.tsx new file mode 100644 index 0000000000..4361696107 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/many-promises.tsx @@ -0,0 +1,94 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { Suspense } from 'vue' +import { createManyPromises } from '../../../../streaming-ssr-fixtures' + +export const Route = createFileRoute('/many-promises')({ + loader: async () => createManyPromises(), + component: ManyPromises, +}) + +function PromiseItem(props: { + promise: Promise + testId: string + label: string +}) { + return ( + + {{ + default: () => ( + ( +
+ {props.label}: {value} +
+ )} + /> + ), + fallback: () => ( +
+ Loading {props.label}... +
+ ), + }} +
+ ) +} + +function ManyPromises() { + const data = Route.useLoaderData() + + return ( +
+

Many Promises Test (15 deferred)

+

Tests streaming with many concurrent deferred promises.

+ + + + + + + + + + + + + + + +
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/nested-deferred.tsx b/e2e/vue-start/streaming-ssr/src/routes/nested-deferred.tsx new file mode 100644 index 0000000000..b24336ec40 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/nested-deferred.tsx @@ -0,0 +1,143 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { createServerFn } from '@tanstack/vue-start' +import { Suspense } from 'vue' +import { + delay, + makeDeferred, + makeLevelData, + nestedLevelDelays, + nestedPlainDelay, + nestedPlainMessage, +} from '../../../../streaming-ssr-fixtures' + +const getLevel1Data = createServerFn({ method: 'GET' }).handler(async () => { + await delay(nestedLevelDelays[0]) + return makeLevelData(1) +}) + +const getLevel2Data = createServerFn({ method: 'GET' }).handler(async () => { + await delay(nestedLevelDelays[1]) + return makeLevelData(2) +}) + +const getLevel3Data = createServerFn({ method: 'GET' }).handler(async () => { + await delay(nestedLevelDelays[2]) + return makeLevelData(3) +}) + +export const Route = createFileRoute('/nested-deferred')({ + loader: async () => { + return { + level1: getLevel1Data(), + level2: getLevel2Data(), + level3: getLevel3Data(), + plainDeferred: makeDeferred(nestedPlainMessage, nestedPlainDelay), + } + }, + component: NestedDeferred, +}) + +function Level2Content(props: { + level3: Promise<{ level: number; timestamp: number }> +}) { + return ( +
+ + {{ + default: () => ( + ( +
+ Level 3: {value.level} @ {value.timestamp} +
+ )} + /> + ), + fallback: () => ( +
Loading level 3...
+ ), + }} +
+
+ ) +} + +function Level1Content(props: { + level2: Promise<{ level: number; timestamp: number }> + level3: Promise<{ level: number; timestamp: number }> +}) { + return ( +
+ + {{ + default: () => ( + ( +
+ Level 2: {value.level} @ {value.timestamp} + +
+ )} + /> + ), + fallback: () => ( +
Loading level 2...
+ ), + }} +
+
+ ) +} + +function NestedDeferred() { + const data = Route.useLoaderData() + + return ( +
+

Nested Deferred Test

+

+ Tests multiple nested deferred promises resolving at different times. +

+ + {{ + default: () => ( + ( +
{value}
+ )} + /> + ), + fallback: () => ( +
Loading plain...
+ ), + }} +
+
+ + {{ + default: () => ( + ( +
+ Level 1: {value.level} @ {value.timestamp} + +
+ )} + /> + ), + fallback: () => ( +
Loading level 1...
+ ), + }} +
+
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/query-heavy.tsx b/e2e/vue-start/streaming-ssr/src/routes/query-heavy.tsx new file mode 100644 index 0000000000..b22154b78e --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/query-heavy.tsx @@ -0,0 +1,168 @@ +import { queryOptions, useQuery } from '@tanstack/vue-query' +import { createFileRoute } from '@tanstack/vue-router' +import { Suspense, defineComponent } from 'vue' +import type { PropType } from 'vue' + +import { + delay, + makeQueryData, + queryHeavyItems, +} from '../../../../streaming-ssr-fixtures' +import type { QueryData } from '../../../../streaming-ssr-fixtures' + +function makeQueryOptions(item: (typeof queryHeavyItems)[number]) { + return queryOptions({ + queryKey: ['streaming-ssr-query-heavy', item.type, item.id], + queryFn: async (): Promise => { + if (item.delayMs > 0) { + await delay(item.delayMs) + } + + return makeQueryData(item) + }, + staleTime: Infinity, + }) +} + +const syncQuery1 = makeQueryOptions(queryHeavyItems[0]) +const syncQuery2 = makeQueryOptions(queryHeavyItems[1]) +const syncQuery3 = makeQueryOptions(queryHeavyItems[2]) +const fastAsyncQuery1 = makeQueryOptions(queryHeavyItems[3]) +const fastAsyncQuery2 = makeQueryOptions(queryHeavyItems[4]) +const fastAsyncQuery3 = makeQueryOptions(queryHeavyItems[5]) +const slowAsyncQuery1 = makeQueryOptions(queryHeavyItems[6]) +const slowAsyncQuery2 = makeQueryOptions(queryHeavyItems[7]) +const slowAsyncQuery3 = makeQueryOptions(queryHeavyItems[8]) + +type QueryOptions = ReturnType + +const QueryDisplay = defineComponent({ + props: { + queryOpts: { + type: Object as PropType, + required: true, + }, + testId: { + type: String, + required: true, + }, + }, + async setup(props) { + const query = useQuery(props.queryOpts) + await query.suspense() + + return () => { + const data = query.data.value + + return ( +
+ {data?.value} (source: {data?.source}) +
+ ) + } + }, +}) + +function QuerySuspense(props: { + queryOpts: QueryOptions + testId: string + fallback: string +}) { + return ( + + {{ + default: () => ( + + ), + fallback: () => ( +
{props.fallback}
+ ), + }} +
+ ) +} + +const QueryHeavy = defineComponent({ + setup() { + return () => ( +
+

Query Heavy Test (9 useQuery calls)

+

Tests multiple useQuery with mixed sync/async queryFn.

+

+ All queries should show "source: server" if SSR streaming works + correctly. +

+ +
+
+

Sync Queries (immediate)

+ + + +
+ +
+

Fast Async Queries (50-100ms)

+ + + +
+ +
+

Slow Async Queries (200-400ms)

+ + + +
+
+
+ ) + }, +}) + +export const Route = createFileRoute('/query-heavy')({ + component: QueryHeavy, +}) diff --git a/e2e/vue-start/streaming-ssr/src/routes/slow-render.tsx b/e2e/vue-start/streaming-ssr/src/routes/slow-render.tsx new file mode 100644 index 0000000000..f897e03ff0 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/slow-render.tsx @@ -0,0 +1,77 @@ +import { Await, createFileRoute } from '@tanstack/vue-router' +import { createServerFn } from '@tanstack/vue-start' +import { Suspense } from 'vue' +import { + makeDeferredMessage, + makeServerData, + slowRenderComponents, + slowRenderDeferredDelay, + slowRenderDeferredMessage, + slowRenderQuickName, + sourceMarker, +} from '../../../../streaming-ssr-fixtures' + +const getQuickData = createServerFn({ method: 'GET' }).handler(() => + makeServerData(slowRenderQuickName), +) + +function SlowComponent(props: { data: string; index: number }) { + const startTime = Date.now() + while (Date.now() - startTime < 100) { + // Simulate slow render work. + } + return
{props.data}
+} + +export const Route = createFileRoute('/slow-render')({ + loader: async () => { + const quickData = await getQuickData() + return { + quickData, + deferredData: makeDeferredMessage( + slowRenderDeferredMessage, + slowRenderDeferredDelay, + ), + loaderSource: sourceMarker(), + } + }, + component: SlowRender, +}) + +function SlowRender() { + const data = Route.useLoaderData() + + return ( +
+

Slow Render Test

+

Tests when render takes longer than serialization.

+
+ Quick: {data.value.quickData.name} @ {data.value.quickData.timestamp} +
+
+ Quick data source: {data.value.quickData.source} +
+
+ Loader source: {data.value.loaderSource} +
+ + {{ + default: () => ( + ( +
+ {value.message} (source: {value.source}) +
+ )} + /> + ), + fallback: () =>
Loading...
, + }} +
+ {slowRenderComponents.map((data, index) => ( + + ))} +
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/src/routes/stream.tsx b/e2e/vue-start/streaming-ssr/src/routes/stream.tsx new file mode 100644 index 0000000000..31368bedfc --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/stream.tsx @@ -0,0 +1,171 @@ +import { Await, createFileRoute, useRouter } from '@tanstack/vue-router' +import { + Suspense, + defineComponent, + onMounted, + onUnmounted, + ref, + watch, +} from 'vue' +import { + createChunkStream, + createStreamPromise, +} from '../../../../streaming-ssr-fixtures' + +export const Route = createFileRoute('/stream')({ + component: () => , + loader() { + return { + promise: createStreamPromise(), + stream: createChunkStream(), + } + }, +}) + +const decoder = new TextDecoder('utf-8') + +const StreamRoute = defineComponent({ + setup() { + const data = Route.useLoaderData() + const router = useRouter() + const streamData = ref>([]) + const streamComplete = ref(false) + const streamReadCount = ref(0) + let reader: ReadableStreamDefaultReader | undefined + let mounted = false + let activeStream: ReadableStream | undefined + let reading = false + let readTimer: ReturnType | undefined + + function clearReadTimer() { + if (readTimer) { + clearTimeout(readTimer) + readTimer = undefined + } + } + + function scheduleRead(delay = 0) { + if (!mounted || reading) { + return + } + + clearReadTimer() + readTimer = setTimeout(() => { + readTimer = undefined + void readStream() + }, delay) + } + + async function readStream() { + const stream = data.value.stream + if (!mounted || reading || activeStream === stream) { + return + } + + if (stream.locked) { + scheduleRead(10) + return + } + + streamData.value = [] + streamComplete.value = false + + let activeReader: ReadableStreamDefaultReader | undefined + + try { + const currentReader = stream.getReader() + activeReader = currentReader + reader = currentReader + activeStream = stream + reading = true + streamReadCount.value++ + + let chunk + while (!(chunk = await currentReader.read()).done) { + let value = chunk.value + if (typeof value !== 'string') { + value = decoder.decode(value, { stream: !chunk.done }) + } + streamData.value = [...streamData.value, value] + } + streamComplete.value = true + } catch (e) { + const message = String(e) + if (e instanceof TypeError && message.includes('locked')) { + activeStream = undefined + scheduleRead(10) + } else if (!(e instanceof TypeError && message.includes('cancelled'))) { + console.error('Stream error:', e) + } + } finally { + activeReader?.releaseLock() + if (reader === activeReader) { + reader = undefined + } + reading = false + if (activeStream !== data.value.stream) { + scheduleRead() + } + } + } + + onMounted(() => { + mounted = true + scheduleRead() + }) + watch( + () => data.value.stream, + () => { + activeStream = undefined + scheduleRead() + }, + ) + onUnmounted(() => { + mounted = false + clearReadTimer() + reader?.cancel().catch(() => {}) + reader = undefined + }) + + return () => ( +
+

ReadableStream Test

+ + + {{ + default: () => ( + ( +
{value}
+ )} + /> + ), + fallback: () => ( +
Loading promise...
+ ), + }} +
+
+

Stream chunks:

+
+ {streamData.value.map((chunk, i) => ( +
{chunk}
+ ))} +
+ {streamComplete.value && ( +
Stream complete!
+ )} +
+
+ ) + }, +}) diff --git a/e2e/vue-start/streaming-ssr/src/routes/sync-only.tsx b/e2e/vue-start/streaming-ssr/src/routes/sync-only.tsx new file mode 100644 index 0000000000..bbad10839e --- /dev/null +++ b/e2e/vue-start/streaming-ssr/src/routes/sync-only.tsx @@ -0,0 +1,25 @@ +import { createFileRoute } from '@tanstack/vue-router' +import { makeSyncOnlyData } from '../../../../streaming-ssr-fixtures' + +export const Route = createFileRoute('/sync-only')({ + loader: async () => makeSyncOnlyData(), + component: SyncOnly, +}) + +function SyncOnly() { + const data = Route.useLoaderData() + + return ( +
+

Synchronous Serialization Test

+

{data.value.message}

+

Loaded at: {data.value.timestamp}

+

Source: {data.value.source}

+
    + {data.value.items.map((item: string) => ( +
  • {item}
  • + ))} +
+
+ ) +} diff --git a/e2e/vue-start/streaming-ssr/tests/client-navigation.spec.ts b/e2e/vue-start/streaming-ssr/tests/client-navigation.spec.ts new file mode 100644 index 0000000000..8b9b3a8dcc --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/client-navigation.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/client-navigation' diff --git a/e2e/vue-start/streaming-ssr/tests/concurrent.spec.ts b/e2e/vue-start/streaming-ssr/tests/concurrent.spec.ts new file mode 100644 index 0000000000..8625473a58 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/concurrent.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/concurrent' diff --git a/e2e/vue-start/streaming-ssr/tests/deferred-rejection.spec.ts b/e2e/vue-start/streaming-ssr/tests/deferred-rejection.spec.ts new file mode 100644 index 0000000000..355b5019bc --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/deferred-rejection.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/deferred-rejection' diff --git a/e2e/vue-start/streaming-ssr/tests/deferred.spec.ts b/e2e/vue-start/streaming-ssr/tests/deferred.spec.ts new file mode 100644 index 0000000000..3145897d7b --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/deferred.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/deferred' diff --git a/e2e/vue-start/streaming-ssr/tests/fast-serial.spec.ts b/e2e/vue-start/streaming-ssr/tests/fast-serial.spec.ts new file mode 100644 index 0000000000..95df0555e2 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/fast-serial.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/fast-serial' diff --git a/e2e/vue-start/streaming-ssr/tests/home.spec.ts b/e2e/vue-start/streaming-ssr/tests/home.spec.ts new file mode 100644 index 0000000000..5d49d34a56 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/home.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/home' diff --git a/e2e/vue-start/streaming-ssr/tests/many-promises.spec.ts b/e2e/vue-start/streaming-ssr/tests/many-promises.spec.ts new file mode 100644 index 0000000000..b747bd7d0a --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/many-promises.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/many-promises' diff --git a/e2e/vue-start/streaming-ssr/tests/nested-deferred.spec.ts b/e2e/vue-start/streaming-ssr/tests/nested-deferred.spec.ts new file mode 100644 index 0000000000..8df20a8a95 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/nested-deferred.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/nested-deferred' diff --git a/e2e/vue-start/streaming-ssr/tests/preview-streaming.spec.ts b/e2e/vue-start/streaming-ssr/tests/preview-streaming.spec.ts new file mode 100644 index 0000000000..34241cfbaa --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/preview-streaming.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/preview-streaming' diff --git a/e2e/vue-start/streaming-ssr/tests/query-heavy.spec.ts b/e2e/vue-start/streaming-ssr/tests/query-heavy.spec.ts new file mode 100644 index 0000000000..d15c092f6e --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/query-heavy.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/query-heavy' diff --git a/e2e/vue-start/streaming-ssr/tests/slow-render.spec.ts b/e2e/vue-start/streaming-ssr/tests/slow-render.spec.ts new file mode 100644 index 0000000000..0d5a87363f --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/slow-render.spec.ts @@ -0,0 +1 @@ +import '../../../streaming-ssr-specs/slow-render' diff --git a/e2e/vue-start/streaming-ssr/tests/stream.spec.ts b/e2e/vue-start/streaming-ssr/tests/stream.spec.ts new file mode 100644 index 0000000000..9dfc6820ad --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/stream.spec.ts @@ -0,0 +1,22 @@ +import { expect, testWithHydration } from '../../../streaming-ssr-assertions' +import '../../../streaming-ssr-specs/stream' + +testWithHydration( + 'reads a replacement stream after an active read', + async ({ page }) => { + await page.goto('/') + await page.waitForLoadState('networkidle') + await page.getByRole('link', { name: 'Stream' }).first().click() + await expect(page.getByTestId('stream-chunk-0')).toHaveText('chunk-0') + await expect(page.getByTestId('stream-complete')).toHaveCount(0) + + await page.getByTestId('refresh-stream').click() + + const streamData = page.getByTestId('stream-data') + await expect(streamData).toHaveAttribute('data-read-count', '2') + await expect(page.getByTestId('stream-complete')).toBeVisible() + await expect( + streamData.locator('[data-testid^="stream-chunk-"]'), + ).toHaveText(['chunk-0', 'chunk-1', 'chunk-2', 'chunk-3', 'chunk-4']) + }, +) diff --git a/e2e/vue-start/streaming-ssr/tests/sync-only.spec.ts b/e2e/vue-start/streaming-ssr/tests/sync-only.spec.ts new file mode 100644 index 0000000000..b25572f615 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tests/sync-only.spec.ts @@ -0,0 +1,7 @@ +import '../../../streaming-ssr-specs/sync-only' +import { expect, test } from '../../../streaming-ssr-assertions' + +test('Vue renders an unwrapped document root', async ({ request }) => { + const response = await request.get('/sync-only') + expect(await response.text()).toMatch(/^)/) +}) diff --git a/e2e/vue-start/streaming-ssr/tsconfig.json b/e2e/vue-start/streaming-ssr/tsconfig.json new file mode 100644 index 0000000000..390dad84c0 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/tsconfig.json @@ -0,0 +1,22 @@ +{ + "include": ["**/*.ts", "**/*.tsx"], + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "vue", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "isolatedModules": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "target": "ES2022", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "~/*": ["./src/*"] + }, + "noEmit": true + } +} diff --git a/e2e/vue-start/streaming-ssr/vite.config.ts b/e2e/vue-start/streaming-ssr/vite.config.ts new file mode 100644 index 0000000000..6519ec54c8 --- /dev/null +++ b/e2e/vue-start/streaming-ssr/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/vue-start/plugin/vite' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + server: { + port: 3000, + }, + plugins: [tanstackStart(), vueJsx()], +}) diff --git a/e2e/vue-start/virtual-routes/package.json b/e2e/vue-start/virtual-routes/package.json index 6c2011e1ea..90f09ce911 100644 --- a/e2e/vue-start/virtual-routes/package.json +++ b/e2e/vue-start/virtual-routes/package.json @@ -9,14 +9,14 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/virtual-file-routes": "workspace:^", "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-start": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -29,9 +29,10 @@ "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "combinate": "^1.1.11", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/virtual-routes/playwright.config.ts b/e2e/vue-start/virtual-routes/playwright.config.ts index b0c365f8bd..1862174905 100644 --- a/e2e/vue-start/virtual-routes/playwright.config.ts +++ b/e2e/vue-start/virtual-routes/playwright.config.ts @@ -1,12 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { - getDummyServerPort, - getTestServerPort, -} from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) -const EXTERNAL_PORT = await getDummyServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -18,19 +13,19 @@ export default defineConfig({ reporter: [['line']], - globalSetup: './tests/setup/global.setup.ts', - globalTeardown: './tests/setup/global.teardown.ts', - use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, }, webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + command: `pnpm build && PORT=${PORT} pnpm start`, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', + env: { + NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --import=@tanstack/router-e2e-utils/mock-api`, + }, }, projects: [ diff --git a/e2e/vue-start/virtual-routes/src/posts.tsx b/e2e/vue-start/virtual-routes/src/posts.tsx index 1b4c92b41d..f7a1941605 100644 --- a/e2e/vue-start/virtual-routes/src/posts.tsx +++ b/e2e/vue-start/virtual-routes/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/e2e/vue-start/virtual-routes/src/routes/posts/posts-detail.tsx b/e2e/vue-start/virtual-routes/src/routes/posts/posts-detail.tsx index 5086e3ad88..4bc3824f62 100644 --- a/e2e/vue-start/virtual-routes/src/routes/posts/posts-detail.tsx +++ b/e2e/vue-start/virtual-routes/src/routes/posts/posts-detail.tsx @@ -1,7 +1,20 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import { fetchPost } from '../../posts' import type { ErrorComponentProps } from '@tanstack/vue-router' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+

{post.value.title}

+
{post.value.body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), errorComponent: PostErrorComponent, @@ -14,14 +27,3 @@ export const Route = createFileRoute('/posts/$postId')({ function PostErrorComponent({ error }: ErrorComponentProps) { return } - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

{post.value.title}

-
{post.value.body}
-
- ) -} diff --git a/e2e/vue-start/virtual-routes/src/routes/posts/posts.tsx b/e2e/vue-start/virtual-routes/src/routes/posts/posts.tsx index f56d6550a6..dd380aa353 100644 --- a/e2e/vue-start/virtual-routes/src/routes/posts/posts.tsx +++ b/e2e/vue-start/virtual-routes/src/routes/posts/posts.tsx @@ -1,37 +1,39 @@ +import { defineComponent } from 'vue' import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' import { fetchPosts } from '../../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/e2e/vue-start/virtual-routes/src/utils/posts.tsx b/e2e/vue-start/virtual-routes/src/utils/posts.tsx index 66cb298f83..11d80d08b5 100644 --- a/e2e/vue-start/virtual-routes/src/utils/posts.tsx +++ b/e2e/vue-start/virtual-routes/src/utils/posts.tsx @@ -8,11 +8,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) diff --git a/e2e/vue-start/virtual-routes/src/utils/users.tsx b/e2e/vue-start/virtual-routes/src/utils/users.tsx index 46be4b1580..7ba645b383 100644 --- a/e2e/vue-start/virtual-routes/src/utils/users.tsx +++ b/e2e/vue-start/virtual-routes/src/utils/users.tsx @@ -3,7 +3,3 @@ export type User = { name: string email: string } - -const PORT = process.env.VITE_SERVER_PORT || 3000 - -export const DEPLOY_URL = `http://localhost:${PORT}` diff --git a/e2e/vue-start/virtual-routes/tests/app.spec.ts b/e2e/vue-start/virtual-routes/tests/app.spec.ts index 3182febfa0..e9db98e3f3 100644 --- a/e2e/vue-start/virtual-routes/tests/app.spec.ts +++ b/e2e/vue-start/virtual-routes/tests/app.spec.ts @@ -1,4 +1,5 @@ -import { expect, test } from '@playwright/test' +import { expect } from '@playwright/test' +import { apiTest as test } from '@tanstack/router-e2e-utils' test.beforeEach(async ({ page }) => { await page.goto('/') diff --git a/e2e/vue-start/virtual-routes/tests/setup/global.setup.ts b/e2e/vue-start/virtual-routes/tests/setup/global.setup.ts deleted file mode 100644 index 3593d10ab9..0000000000 --- a/e2e/vue-start/virtual-routes/tests/setup/global.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStartDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function setup() { - await e2eStartDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/virtual-routes/tests/setup/global.teardown.ts b/e2e/vue-start/virtual-routes/tests/setup/global.teardown.ts deleted file mode 100644 index 62fd79911c..0000000000 --- a/e2e/vue-start/virtual-routes/tests/setup/global.teardown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { e2eStopDummyServer } from '@tanstack/router-e2e-utils' -import packageJson from '../../package.json' with { type: 'json' } - -export default async function teardown() { - await e2eStopDummyServer(packageJson.name) -} diff --git a/e2e/vue-start/website/package.json b/e2e/vue-start/website/package.json index bfbb042de5..6c30b1500f 100644 --- a/e2e/vue-start/website/package.json +++ b/e2e/vue-start/website/package.json @@ -9,13 +9,13 @@ "build": "vite build && tsc --noEmit", "preview": "vite preview", "start": "pnpx srvx --prod -s ../client dist/server/server.js", - "test:e2e": "rm -rf port*.txt; playwright test --project=chromium" + "test:e2e": "playwright test --project=chromium" }, "dependencies": { "@tanstack/vue-router": "workspace:^", "@tanstack/vue-router-devtools": "workspace:^", "@tanstack/vue-start": "workspace:^", - "redaxios": "^0.5.1", + "redaxios": "catalog:", "tailwind-merge": "^3.6.0", "vue": "^3.5.25", "zod": "^4.4.3" @@ -27,9 +27,10 @@ "@types/node": "^22.10.2", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/e2e/vue-start/website/playwright.config.ts b/e2e/vue-start/website/playwright.config.ts index f6dd61ba6c..e6b92ce385 100644 --- a/e2e/vue-start/website/playwright.config.ts +++ b/e2e/vue-start/website/playwright.config.ts @@ -1,8 +1,7 @@ import { defineConfig, devices } from '@playwright/test' -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const PORT = await getTestServerPort(packageJson.name) +const PORT = Number(process.env.E2E_APP_PORT ?? 0) const baseURL = `http://localhost:${PORT}` /** @@ -21,8 +20,8 @@ export default defineConfig({ webServer: { command: `pnpm build && VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`, - url: baseURL, - reuseExistingServer: !process.env.CI, + wait: appServerReady, + reuseExistingServer: false, stdout: 'pipe', }, diff --git a/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx index d06f4a948b..77c03c5afa 100644 --- a/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx @@ -1,3 +1,5 @@ +import { defineComponent } from 'vue' +import type { PropType } from 'vue' import { ErrorComponent, Link, @@ -6,46 +8,54 @@ import { } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useLocation({ - select: (location) => location.pathname === '/', - }) - - console.error(error) - - return ( -
- -
- - {isRoot.value ? ( - - Home - - ) : ( - { - e.preventDefault() - window.history.back() - }} - > - Go Back - - )} -
-
- ) -} +export const DefaultCatchBoundary = defineComponent({ + props: { + error: { + type: Object as PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + return () => { + console.error(props.error) + return ( +
+ +
+ + {isRoot.value ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) + } + }, +}) diff --git a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx index f56c911b88..1d9173f200 100644 --- a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx +++ b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx @@ -1,9 +1,27 @@ +import { defineComponent } from 'vue' import { ErrorComponent, createFileRoute } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' import { NotFound } from '~/components/NotFound' import { getDocument } from '~/server/document' import { capitalize, seo } from '~/utils/seo' +const Page = defineComponent({ + setup() { + const post = Route.useLoaderData() + return () => ( +
+

+ {post.value.title} +

+
{post.value.content}
+
+ ) + }, +}) + export const Route = createFileRoute( '/$project/$version/docs/framework/$framework/$', )({ @@ -26,19 +44,3 @@ export const Route = createFileRoute( function PostErrorComponent({ error }: ErrorComponentProps) { return } - -function Page() { - const post = Route.useLoaderData() - - return ( -
-

- {post.value.title} -

-
{post.value.content}
-
- ) -} diff --git a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx index 97f8fdd49a..1ca9e97cbe 100644 --- a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx +++ b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx @@ -1,7 +1,24 @@ +import { defineComponent } from 'vue' import { createFileRoute } from '@tanstack/vue-router' import { NotFound } from '~/components/NotFound' import { capitalize, seo } from '~/utils/seo' +const Page = defineComponent({ + setup() { + const params = Route.useParams() + return () => ( +
+

+ {params.value._splat} example +

+
+ ) + }, +}) + export const Route = createFileRoute( '/$project/$version/docs/framework/$framework/examples/$', )({ @@ -15,18 +32,3 @@ export const Route = createFileRoute( return Example not found }, }) - -function Page() { - const params = Route.useParams() - - return ( -
-

- {params.value._splat} example -

-
- ) -} diff --git a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.tsx b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.tsx index 1b422b2ea0..e1c57491aa 100644 --- a/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.tsx +++ b/e2e/vue-start/website/src/routes/$project.$version.docs.framework.$framework.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Link, Outlet, @@ -7,6 +8,108 @@ import { import { getDocumentHeads } from '~/server/document' import { getProject } from '~/server/projects' +const Page = defineComponent({ + setup() { + const project = Route.useLoaderData({ select: (s) => s.library }) + const documents = Route.useLoaderData({ select: (s) => s.documents }) + const pathname = useLocation({ select: (s) => s.pathname }) + return () => ( +
+ +
+

+ {pathname.value} +

+ +
+
+ ) + }, +}) + export const Route = createFileRoute( '/$project/$version/docs/framework/$framework', )({ @@ -20,104 +123,3 @@ export const Route = createFileRoute( }, component: Page, }) - -function Page() { - const project = Route.useLoaderData({ select: (s) => s.library }) - const documents = Route.useLoaderData({ select: (s) => s.documents }) - const pathname = useLocation({ select: (s) => s.pathname }) - - return ( -
- -
-

- {pathname.value} -

- -
-
- ) -} diff --git a/e2e/vue-start/website/src/routes/__root.tsx b/e2e/vue-start/website/src/routes/__root.tsx index 64228c166e..744cac4b11 100644 --- a/e2e/vue-start/website/src/routes/__root.tsx +++ b/e2e/vue-start/website/src/routes/__root.tsx @@ -51,7 +51,11 @@ export const Route = createRootRoute({ ], }), errorComponent: (props) => { - return

{props.error.stack}

+ return ( +

+ {props.error instanceof Error ? props.error.stack : String(props.error)} +

+ ) }, notFoundComponent: () => , component: RootComponent, diff --git a/e2e/vue-start/website/src/routes/_library.$project.$version.index.tsx b/e2e/vue-start/website/src/routes/_library.$project.$version.index.tsx index ed8e4d0bb4..d6c9b00671 100644 --- a/e2e/vue-start/website/src/routes/_library.$project.$version.index.tsx +++ b/e2e/vue-start/website/src/routes/_library.$project.$version.index.tsx @@ -1,23 +1,31 @@ +import { defineComponent } from 'vue' import { Link, createFileRoute } from '@tanstack/vue-router' +const Page = defineComponent({ + setup() { + const params = Route.useParams() + return () => ( +
+

+ {params.value.project} landing page +

+

+ version: {params.value.version} +

+

+ + Get started with our documentation. + +

+
+ ) + }, +}) + export const Route = createFileRoute('/_library/$project/$version/')({ component: Page, }) - -function Page() { - const params = Route.useParams() - - return ( -
-

- {params.value.project} landing page -

-

version: {params.value.version}

-

- - Get started with our documentation. - -

-
- ) -} diff --git a/e2e/vue-start/website/src/routes/_library.tsx b/e2e/vue-start/website/src/routes/_library.tsx index fcbeaa35d0..b52198950d 100644 --- a/e2e/vue-start/website/src/routes/_library.tsx +++ b/e2e/vue-start/website/src/routes/_library.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { Link, Outlet, @@ -6,6 +7,53 @@ import { } from '@tanstack/vue-router' import { getProjects } from '~/server/projects' +const Layout = defineComponent({ + setup() { + const loaderData = Route.useLoaderData() + const pathname = useLocation({ select: (s) => s.pathname }) + return () => ( +
+ +
+

+ {pathname.value} +

+ +
+
+ ) + }, +}) + export const Route = createFileRoute('/_library')({ loader: async () => { const projects = await getProjects() @@ -15,48 +63,3 @@ export const Route = createFileRoute('/_library')({ }, component: Layout, }) - -function Layout() { - const loaderData = Route.useLoaderData() - const pathname = useLocation({ select: (s) => s.pathname }) - return ( -
- -
-

- {pathname.value} -

- -
-
- ) -} diff --git a/examples/AGENTS.md b/examples/AGENTS.md new file mode 100644 index 0000000000..eb47fbd925 --- /dev/null +++ b/examples/AGENTS.md @@ -0,0 +1,4 @@ +# Examples + +- Versioned dependencies on this repository's packages resolve locally through `pnpm-workspace.yaml` overrides. Keep published version ranges in example manifests; do not replace them with `workspace:*` as a linking fix. +- Root `pnpm dev` watches package builds. To run an example app, use its own `dev` script after building its workspace dependencies. diff --git a/examples/react/authenticated-routes-firebase/package.json b/examples/react/authenticated-routes-firebase/package.json index b1b0b0fd54..1efa172047 100644 --- a/examples/react/authenticated-routes-firebase/package.json +++ b/examples/react/authenticated-routes-firebase/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "firebase": "^11.4.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -25,7 +25,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/authenticated-routes/package.json b/examples/react/authenticated-routes/package.json index c32706b8ad..6af48f1d34 100644 --- a/examples/react/authenticated-routes/package.json +++ b/examples/react/authenticated-routes/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-default-search-params/package.json b/examples/react/basic-default-search-params/package.json index d3062bbb11..96c68fecd4 100644 --- a/examples/react/basic-default-search-params/package.json +++ b/examples/react/basic-default-search-params/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-devtools-panel/package.json b/examples/react/basic-devtools-panel/package.json index 3147d73064..ccae95d73f 100644 --- a/examples/react/basic-devtools-panel/package.json +++ b/examples/react/basic-devtools-panel/package.json @@ -10,9 +10,10 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.67.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -22,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-file-based/package.json b/examples/react/basic-file-based/package.json index 2e335dd749..9c3cacada1 100644 --- a/examples/react/basic-file-based/package.json +++ b/examples/react/basic-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-non-nested-devtools/package.json b/examples/react/basic-non-nested-devtools/package.json index 7ace128a31..32e856ebcf 100644 --- a/examples/react/basic-non-nested-devtools/package.json +++ b/examples/react/basic-non-nested-devtools/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -21,7 +21,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-react-query-file-based/package.json b/examples/react/basic-react-query-file-based/package.json index 762c842956..d01a02872e 100644 --- a/examples/react/basic-react-query-file-based/package.json +++ b/examples/react/basic-react-query-file-based/package.json @@ -10,11 +10,11 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -25,7 +25,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-react-query/package.json b/examples/react/basic-react-query/package.json index 160c426dc1..edab96afac 100644 --- a/examples/react/basic-react-query/package.json +++ b/examples/react/basic-react-query/package.json @@ -10,10 +10,10 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-ssr-file-based/package.json b/examples/react/basic-ssr-file-based/package.json index 2ec67334f6..3222c33e19 100644 --- a/examples/react/basic-ssr-file-based/package.json +++ b/examples/react/basic-ssr-file-based/package.json @@ -11,8 +11,8 @@ "debug": "node --inspect-brk server" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "compression": "^1.8.0", "express": "^5.2.1", "get-port": "^7.1.0", @@ -21,12 +21,13 @@ "react-dom": "^19.0.0" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router-devtools": "^1.167.3", "@types/express": "^5.0.6", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.1", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-ssr-streaming-file-based/package.json b/examples/react/basic-ssr-streaming-file-based/package.json index 1c138ed636..c3c87c8d88 100644 --- a/examples/react/basic-ssr-streaming-file-based/package.json +++ b/examples/react/basic-ssr-streaming-file-based/package.json @@ -11,8 +11,8 @@ "debug": "node --inspect-brk server" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "compression": "^1.8.0", "express": "^5.2.1", "get-port": "^7.1.0", @@ -21,12 +21,13 @@ "react-dom": "^19.0.0" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router-devtools": "^1.167.3", "@types/express": "^5.0.6", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.1", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-virtual-file-based/package.json b/examples/react/basic-virtual-file-based/package.json index 5e8e43e9af..84d326435c 100644 --- a/examples/react/basic-virtual-file-based/package.json +++ b/examples/react/basic-virtual-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/virtual-file-routes": "^1.162.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -24,7 +24,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic-virtual-inside-file-based/package.json b/examples/react/basic-virtual-inside-file-based/package.json index d53491b801..c04cb6012e 100644 --- a/examples/react/basic-virtual-inside-file-based/package.json +++ b/examples/react/basic-virtual-inside-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/virtual-file-routes": "^1.162.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -24,7 +24,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/basic/package.json b/examples/react/basic/package.json index f380281baa..2c09a3dfdf 100644 --- a/examples/react/basic/package.json +++ b/examples/react/basic/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -21,7 +21,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/deferred-data/package.json b/examples/react/deferred-data/package.json index c1ca6ba2e1..99afb661ee 100644 --- a/examples/react/deferred-data/package.json +++ b/examples/react/deferred-data/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -22,7 +22,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/i18n-paraglide/package.json b/examples/react/i18n-paraglide/package.json index 81565f3543..88140e8911 100644 --- a/examples/react/i18n-paraglide/package.json +++ b/examples/react/i18n-paraglide/package.json @@ -11,8 +11,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.1.1", "react-dom": "^19.1.1", "tailwindcss": "^4.2.2" @@ -22,8 +22,20 @@ "@types/react": "^19.1.13", "@types/react-dom": "^19.1.9", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@inlang/paraglide-js": "^2.4.0" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/examples/react/kitchen-sink-file-based/package.json b/examples/react/kitchen-sink-file-based/package.json index 3437d8efdf..e02defb3ce 100644 --- a/examples/react/kitchen-sink-file-based/package.json +++ b/examples/react/kitchen-sink-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "immer": "^10.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -24,7 +24,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/kitchen-sink-react-query-file-based/package.json b/examples/react/kitchen-sink-react-query-file-based/package.json index d10164584b..e3dd032ac2 100644 --- a/examples/react/kitchen-sink-react-query-file-based/package.json +++ b/examples/react/kitchen-sink-react-query-file-based/package.json @@ -10,11 +10,11 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "immer": "^10.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -26,7 +26,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/kitchen-sink-react-query/package.json b/examples/react/kitchen-sink-react-query/package.json index c03d144726..14d0dc8e86 100644 --- a/examples/react/kitchen-sink-react-query/package.json +++ b/examples/react/kitchen-sink-react-query/package.json @@ -10,10 +10,10 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "immer": "^10.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -25,7 +25,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/kitchen-sink/package.json b/examples/react/kitchen-sink/package.json index ebba4eb683..f738efc37e 100644 --- a/examples/react/kitchen-sink/package.json +++ b/examples/react/kitchen-sink/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "immer": "^10.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/large-file-based/package.json b/examples/react/large-file-based/package.json index 10fc569856..23d469d120 100644 --- a/examples/react/large-file-based/package.json +++ b/examples/react/large-file-based/package.json @@ -12,10 +12,10 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -26,7 +26,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/location-masking/package.json b/examples/react/location-masking/package.json index a43f090245..fe005c0d2f 100644 --- a/examples/react/location-masking/package.json +++ b/examples/react/location-masking/package.json @@ -11,9 +11,9 @@ "dependencies": { "@radix-ui/react-dialog": "^1.1.6", "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/navigation-blocking/package.json b/examples/react/navigation-blocking/package.json index ebb1b4d3b1..a7677dfd51 100644 --- a/examples/react/navigation-blocking/package.json +++ b/examples/react/navigation-blocking/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -22,7 +22,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/quickstart-esbuild-file-based/esbuild.config.js b/examples/react/quickstart-esbuild-file-based/esbuild.config.js index fb7950d1fa..2f83a79984 100644 --- a/examples/react/quickstart-esbuild-file-based/esbuild.config.js +++ b/examples/react/quickstart-esbuild-file-based/esbuild.config.js @@ -7,5 +7,5 @@ export default { bundle: true, format: 'esm', target: ['esnext'], - plugins: [tanstackRouter({ target: 'react', autoCodeSplitting: true })], + plugins: [tanstackRouter({ target: 'react' })], } diff --git a/examples/react/quickstart-esbuild-file-based/package.json b/examples/react/quickstart-esbuild-file-based/package.json index 7ce6a0d7c2..d855694fec 100644 --- a/examples/react/quickstart-esbuild-file-based/package.json +++ b/examples/react/quickstart-esbuild-file-based/package.json @@ -9,9 +9,9 @@ "start": "dev" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", diff --git a/examples/react/quickstart-file-based/package.json b/examples/react/quickstart-file-based/package.json index bc66af46cc..976ec838d1 100644 --- a/examples/react/quickstart-file-based/package.json +++ b/examples/react/quickstart-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/quickstart-rspack-file-based/package.json b/examples/react/quickstart-rspack-file-based/package.json index 263dda63d3..824998f428 100644 --- a/examples/react/quickstart-rspack-file-based/package.json +++ b/examples/react/quickstart-rspack-file-based/package.json @@ -9,19 +9,20 @@ }, "dependencies": { "@tailwindcss/postcss": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "postcss": "^8.5.1", "react": "^19.0.0", "react-dom": "^19.0.0", "tailwindcss": "^4.2.2" }, "devDependencies": { - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "typescript": "^6.0.2" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" } } diff --git a/examples/react/quickstart-webpack-file-based/package.json b/examples/react/quickstart-webpack-file-based/package.json index ce712ac9f3..baa14b89dd 100644 --- a/examples/react/quickstart-webpack-file-based/package.json +++ b/examples/react/quickstart-webpack-file-based/package.json @@ -7,20 +7,21 @@ "build": "webpack build && tsc --noEmit" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0" }, "devDependencies": { "@swc/core": "^1.15.33", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "html-webpack-plugin": "^5.6.3", "react-refresh": "^0.18.0", "swc-loader": "^0.2.6", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "webpack": "^5.97.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.2.4" diff --git a/examples/react/quickstart/package.json b/examples/react/quickstart/package.json index 983e3a00f6..b6db476ea8 100644 --- a/examples/react/quickstart/package.json +++ b/examples/react/quickstart/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "react": "^19.0.0", "react-dom": "^19.0.0", "tailwindcss": "^4.2.2" @@ -20,7 +20,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/router-monorepo-react-query/package.json b/examples/react/router-monorepo-react-query/package.json index 2a9e2a606c..b158eeda56 100644 --- a/examples/react/router-monorepo-react-query/package.json +++ b/examples/react/router-monorepo-react-query/package.json @@ -10,11 +10,11 @@ "dev": "pnpm post-query build && pnpm router build && pnpm post-feature build && pnpm app dev" }, "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1" @@ -23,7 +23,8 @@ "@types/node": "^22.10.2", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "@vitejs/plugin-react": "^6.0.1", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" diff --git a/examples/react/router-monorepo-react-query/packages/app/package.json b/examples/react/router-monorepo-react-query/packages/app/package.json index f4d7f184f8..f0994165c2 100644 --- a/examples/react/router-monorepo-react-query/packages/app/package.json +++ b/examples/react/router-monorepo-react-query/packages/app/package.json @@ -11,17 +11,18 @@ "dependencies": { "@router-mono-react-query/post-feature": "workspace:*", "@router-mono-react-query/router": "workspace:*", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "react": "^19.0.0", "react-dom": "^19.0.0" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router-devtools": "^1.167.3", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4", "@tailwindcss/vite": "^4.2.2" @@ -32,6 +33,12 @@ "dependsOn": [ "^build" ] + }, + "build": { + "inputs": [ + "...", + "{workspaceRoot}/examples/react/router-monorepo-react-query/.gitignore" + ] } } } diff --git a/examples/react/router-monorepo-react-query/packages/app/tsconfig.json b/examples/react/router-monorepo-react-query/packages/app/tsconfig.json index ce3a7d2339..196cb055a9 100644 --- a/examples/react/router-monorepo-react-query/packages/app/tsconfig.json +++ b/examples/react/router-monorepo-react-query/packages/app/tsconfig.json @@ -8,5 +8,6 @@ "module": "ESNext", "lib": ["DOM", "DOM.Iterable", "ES2022"], "skipLibCheck": true - } + }, + "exclude": ["node_modules", "dist"] } diff --git a/examples/react/router-monorepo-react-query/packages/post-feature/package.json b/examples/react/router-monorepo-react-query/packages/post-feature/package.json index 9618fe3814..7f5e186ab0 100644 --- a/examples/react/router-monorepo-react-query/packages/post-feature/package.json +++ b/examples/react/router-monorepo-react-query/packages/post-feature/package.json @@ -8,7 +8,7 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@router-mono-react-query/post-query": "workspace:*", "@router-mono-react-query/router": "workspace:*", "react": "^19.0.0", @@ -18,7 +18,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/router-monorepo-react-query/packages/post-query/package.json b/examples/react/router-monorepo-react-query/packages/post-query/package.json index 98833ff2dd..98a06051be 100644 --- a/examples/react/router-monorepo-react-query/packages/post-query/package.json +++ b/examples/react/router-monorepo-react-query/packages/post-query/package.json @@ -8,13 +8,14 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "redaxios": "^0.5.1", "zod": "^4.4.3" }, "devDependencies": { "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/router-monorepo-react-query/packages/router/package.json b/examples/react/router-monorepo-react-query/packages/router/package.json index 88f21fec59..1397db14b5 100644 --- a/examples/react/router-monorepo-react-query/packages/router/package.json +++ b/examples/react/router-monorepo-react-query/packages/router/package.json @@ -9,10 +9,10 @@ "types": "./dist/index.d.ts", "dependencies": { "@router-mono-react-query/post-query": "workspace:*", - "@tanstack/history": "^1.162.0", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/history": "^1.162.5", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -22,7 +22,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/router-monorepo-simple-lazy/package.json b/examples/react/router-monorepo-simple-lazy/package.json index a2144b4439..e044d86681 100644 --- a/examples/react/router-monorepo-simple-lazy/package.json +++ b/examples/react/router-monorepo-simple-lazy/package.json @@ -8,9 +8,9 @@ "dev": "pnpm router build && pnpm post-feature build && pnpm app dev" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1" @@ -20,7 +20,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" }, diff --git a/examples/react/router-monorepo-simple-lazy/packages/app/package.json b/examples/react/router-monorepo-simple-lazy/packages/app/package.json index a729b79fc9..cfc7a94942 100644 --- a/examples/react/router-monorepo-simple-lazy/packages/app/package.json +++ b/examples/react/router-monorepo-simple-lazy/packages/app/package.json @@ -15,12 +15,13 @@ "react-dom": "^19.0.0" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router-devtools": "^1.167.3", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4", "@tailwindcss/vite": "^4.2.2" @@ -31,6 +32,12 @@ "dependsOn": [ "^build" ] + }, + "build": { + "inputs": [ + "...", + "{workspaceRoot}/examples/react/router-monorepo-simple-lazy/.gitignore" + ] } } } diff --git a/examples/react/router-monorepo-simple-lazy/packages/app/tsconfig.json b/examples/react/router-monorepo-simple-lazy/packages/app/tsconfig.json index ce3a7d2339..196cb055a9 100644 --- a/examples/react/router-monorepo-simple-lazy/packages/app/tsconfig.json +++ b/examples/react/router-monorepo-simple-lazy/packages/app/tsconfig.json @@ -8,5 +8,6 @@ "module": "ESNext", "lib": ["DOM", "DOM.Iterable", "ES2022"], "skipLibCheck": true - } + }, + "exclude": ["node_modules", "dist"] } diff --git a/examples/react/router-monorepo-simple-lazy/packages/post-feature/package.json b/examples/react/router-monorepo-simple-lazy/packages/post-feature/package.json index d2bd3c4cdf..65738d6025 100644 --- a/examples/react/router-monorepo-simple-lazy/packages/post-feature/package.json +++ b/examples/react/router-monorepo-simple-lazy/packages/post-feature/package.json @@ -16,7 +16,7 @@ } }, "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@router-mono-simple-lazy/router": "workspace:*", "react": "^19.0.0", "react-dom": "^19.0.0" @@ -25,7 +25,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/router-monorepo-simple-lazy/packages/router/package.json b/examples/react/router-monorepo-simple-lazy/packages/router/package.json index 67cfed8cd6..afd4702b5d 100644 --- a/examples/react/router-monorepo-simple-lazy/packages/router/package.json +++ b/examples/react/router-monorepo-simple-lazy/packages/router/package.json @@ -8,9 +8,9 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/history": "^1.162.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/history": "^1.162.5", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -20,7 +20,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/router-monorepo-simple/package.json b/examples/react/router-monorepo-simple/package.json index 95b01f06a5..800d948c81 100644 --- a/examples/react/router-monorepo-simple/package.json +++ b/examples/react/router-monorepo-simple/package.json @@ -8,9 +8,9 @@ "dev": "pnpm router build && pnpm post-feature build && pnpm app dev" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1" @@ -20,7 +20,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" }, diff --git a/examples/react/router-monorepo-simple/packages/app/package.json b/examples/react/router-monorepo-simple/packages/app/package.json index 3e2b86f6db..a06431ef86 100644 --- a/examples/react/router-monorepo-simple/packages/app/package.json +++ b/examples/react/router-monorepo-simple/packages/app/package.json @@ -15,12 +15,13 @@ "react-dom": "^19.0.0" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router-devtools": "^1.167.3", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4", "@tailwindcss/vite": "^4.2.2" @@ -31,6 +32,12 @@ "dependsOn": [ "^build" ] + }, + "build": { + "inputs": [ + "...", + "{workspaceRoot}/examples/react/router-monorepo-simple/.gitignore" + ] } } } diff --git a/examples/react/router-monorepo-simple/packages/app/tsconfig.json b/examples/react/router-monorepo-simple/packages/app/tsconfig.json index ce3a7d2339..196cb055a9 100644 --- a/examples/react/router-monorepo-simple/packages/app/tsconfig.json +++ b/examples/react/router-monorepo-simple/packages/app/tsconfig.json @@ -8,5 +8,6 @@ "module": "ESNext", "lib": ["DOM", "DOM.Iterable", "ES2022"], "skipLibCheck": true - } + }, + "exclude": ["node_modules", "dist"] } diff --git a/examples/react/router-monorepo-simple/packages/post-feature/package.json b/examples/react/router-monorepo-simple/packages/post-feature/package.json index 9bdf4683c2..885aa6bbed 100644 --- a/examples/react/router-monorepo-simple/packages/post-feature/package.json +++ b/examples/react/router-monorepo-simple/packages/post-feature/package.json @@ -16,7 +16,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/router-monorepo-simple/packages/router/package.json b/examples/react/router-monorepo-simple/packages/router/package.json index 015d01de61..391b72e610 100644 --- a/examples/react/router-monorepo-simple/packages/router/package.json +++ b/examples/react/router-monorepo-simple/packages/router/package.json @@ -8,9 +8,9 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/history": "^1.162.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/history": "^1.162.5", + "@tanstack/react-router": "^1.170.46", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -20,7 +20,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/react/scroll-restoration/package.json b/examples/react/scroll-restoration/package.json index caf8329f07..704ff13838 100644 --- a/examples/react/scroll-restoration/package.json +++ b/examples/react/scroll-restoration/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "@tanstack/react-virtual": "^3.13.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -21,7 +21,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/search-validator-adapters/package.json b/examples/react/search-validator-adapters/package.json index 251d39d596..35e041e825 100644 --- a/examples/react/search-validator-adapters/package.json +++ b/examples/react/search-validator-adapters/package.json @@ -12,10 +12,10 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/arktype-adapter": "^1.167.0", - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/valibot-adapter": "^1.167.0", "@tanstack/zod-adapter": "^1.167.0", "arktype": "^2.1.7", @@ -26,12 +26,15 @@ "zod": "^3.24.2" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.2.0", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", - "vite": "^8.0.14" + "@typescript/native": "npm:typescript@^7.0.2", + "jsdom": "^27.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14", + "vitest": "^5.0.4" } } diff --git a/examples/react/search-validator-adapters/tests/arktype.test.tsx b/examples/react/search-validator-adapters/tests/arktype.test.tsx index 1c3a1baf76..776cc8369e 100644 --- a/examples/react/search-validator-adapters/tests/arktype.test.tsx +++ b/examples/react/search-validator-adapters/tests/arktype.test.tsx @@ -8,7 +8,6 @@ import { createRouter, } from '@tanstack/react-router' -import '@testing-library/jest-dom/vitest' import { type } from 'arktype' test('can navigate to the route', async () => { diff --git a/examples/react/search-validator-adapters/tests/jest-dom.setup.ts b/examples/react/search-validator-adapters/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/examples/react/search-validator-adapters/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/examples/react/search-validator-adapters/tests/valibot.test.tsx b/examples/react/search-validator-adapters/tests/valibot.test.tsx index 3680d2302c..d3e18db414 100644 --- a/examples/react/search-validator-adapters/tests/valibot.test.tsx +++ b/examples/react/search-validator-adapters/tests/valibot.test.tsx @@ -8,7 +8,6 @@ import { createRouter, } from '@tanstack/react-router' import * as v from 'valibot' -import '@testing-library/jest-dom/vitest' test('can navigate to the route', async () => { const rootRoute = createRootRoute() diff --git a/examples/react/search-validator-adapters/vite.config.ts b/examples/react/search-validator-adapters/vite.config.ts index 5b41e6e26b..e4b93f5cc3 100644 --- a/examples/react/search-validator-adapters/vite.config.ts +++ b/examples/react/search-validator-adapters/vite.config.ts @@ -11,6 +11,7 @@ export default defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, + setupFiles: ['./tests/jest-dom.setup.ts'], }, plugins: [ tailwindcss(), diff --git a/examples/react/start-bare/package.json b/examples/react/start-bare/package.json index 5a3d43e3c7..4ab9aff272 100644 --- a/examples/react/start-bare/package.json +++ b/examples/react/start-bare/package.json @@ -10,9 +10,9 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "zod": "^4.4.3" @@ -22,7 +22,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-bare/src/router.tsx b/examples/react/start-bare/src/router.tsx index a464233af9..6f82cbf378 100644 --- a/examples/react/start-bare/src/router.tsx +++ b/examples/react/start-bare/src/router.tsx @@ -5,7 +5,9 @@ export function getRouter() { const router = createRouter({ routeTree, defaultPreload: 'intent', - defaultErrorComponent: (err) =>

{err.error.stack}

, + defaultErrorComponent: (err) => ( +

{err.error instanceof Error ? err.error.stack : String(err.error)}

+ ), defaultNotFoundComponent: () =>

not found

, scrollRestoration: true, }) diff --git a/examples/react/start-basic-auth/README.md b/examples/react/start-basic-auth/README.md index 4e5ee29b40..7f1b093ba5 100644 --- a/examples/react/start-basic-auth/README.md +++ b/examples/react/start-basic-auth/README.md @@ -39,3 +39,13 @@ This example demonstrates: - Protected routes - Login/logout functionality - Redirect after authentication + +## Session configuration + +This example uses [iron-session](https://github.com/vvo/iron-session) through Start's `getCookie` and `setCookie` helpers. Set `SESSION_PASSWORD` to a random secret of at least 32 characters before starting the app, for example: + +```sh +export SESSION_PASSWORD="$(openssl rand -base64 32)" +``` + +Keep the same secret across instances and deployments that must read the same sessions. The cookie requires HTTPS in production. Each handler reads its own session, then awaits `session.save()` before redirecting or returning. diff --git a/examples/react/start-basic-auth/package.json b/examples/react/start-basic-auth/package.json index e98871304e..9ab89bdac9 100644 --- a/examples/react/start-basic-auth/package.json +++ b/examples/react/start-basic-auth/package.json @@ -14,9 +14,10 @@ "@libsql/client": "^0.15.15", "@prisma/adapter-libsql": "^7.0.0", "@prisma/client": "^7.0.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", + "iron-session": "^9.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -31,7 +32,8 @@ "dotenv": "^17.2.3", "prisma": "^7.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-basic-auth/src/routes/__root.tsx b/examples/react/start-basic-auth/src/routes/__root.tsx index 5728345fcf..3367c62f27 100644 --- a/examples/react/start-basic-auth/src/routes/__root.tsx +++ b/examples/react/start-basic-auth/src/routes/__root.tsx @@ -13,18 +13,18 @@ import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js' import { NotFound } from '~/components/NotFound.js' import appCss from '~/styles/app.css?url' import { seo } from '~/utils/seo.js' -import { useAppSession } from '~/utils/session.js' +import { getAppSession } from '~/utils/session.js' const fetchUser = createServerFn({ method: 'GET' }).handler(async () => { // We need to auth on the server so we have access to secure cookies - const session = await useAppSession() + const session = await getAppSession() - if (!session.data.userEmail) { + if (!session.userEmail) { return null } return { - email: session.data.userEmail, + email: session.userEmail, } }) diff --git a/examples/react/start-basic-auth/src/routes/_authed.tsx b/examples/react/start-basic-auth/src/routes/_authed.tsx index 3944e590f9..0b5c6f9047 100644 --- a/examples/react/start-basic-auth/src/routes/_authed.tsx +++ b/examples/react/start-basic-auth/src/routes/_authed.tsx @@ -2,7 +2,7 @@ import { createFileRoute } from '@tanstack/react-router' import { createServerFn } from '@tanstack/react-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { Login } from '~/components/Login' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const loginFn = createServerFn({ method: 'POST' }) .validator((d: { email: string; password: string }) => d) @@ -33,13 +33,10 @@ export const loginFn = createServerFn({ method: 'POST' }) } } - // Create a session - const session = await useAppSession() - // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + const session = await getAppSession() + session.userEmail = user.email + await session.save() }) export const Route = createFileRoute('/_authed')({ @@ -49,7 +46,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return } diff --git a/examples/react/start-basic-auth/src/routes/logout.tsx b/examples/react/start-basic-auth/src/routes/logout.tsx index 28f3c9f8fe..73cdaf1600 100644 --- a/examples/react/start-basic-auth/src/routes/logout.tsx +++ b/examples/react/start-basic-auth/src/routes/logout.tsx @@ -1,11 +1,10 @@ import { redirect, createFileRoute } from '@tanstack/react-router' import { createServerFn } from '@tanstack/react-start' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' const logoutFn = createServerFn().handler(async () => { - const session = await useAppSession() - - session.clear() + const session = await getAppSession() + session.destroy() throw redirect({ href: '/', diff --git a/examples/react/start-basic-auth/src/routes/signup.tsx b/examples/react/start-basic-auth/src/routes/signup.tsx index 247a94c03c..4dc8e350ac 100644 --- a/examples/react/start-basic-auth/src/routes/signup.tsx +++ b/examples/react/start-basic-auth/src/routes/signup.tsx @@ -3,7 +3,7 @@ import { createServerFn, useServerFn } from '@tanstack/react-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { useMutation } from '~/hooks/useMutation' import { Auth } from '~/components/Auth' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const signupFn = createServerFn({ method: 'POST' }) .validator( @@ -20,9 +20,6 @@ export const signupFn = createServerFn({ method: 'POST' }) // Encrypt the password using Sha256 into plaintext const password = await hashPassword(data.password) - // Create a session - const session = await useAppSession() - if (found) { if (found.password !== password) { return { @@ -33,9 +30,9 @@ export const signupFn = createServerFn({ method: 'POST' }) } // Store the user's email in the session - await session.update({ - userEmail: found.email, - }) + const session = await getAppSession() + session.userEmail = found.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ @@ -52,9 +49,9 @@ export const signupFn = createServerFn({ method: 'POST' }) }) // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + const session = await getAppSession() + session.userEmail = user.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ diff --git a/examples/react/start-basic-auth/src/utils/session.ts b/examples/react/start-basic-auth/src/utils/session.ts index c38bac1e48..7df7bc4da2 100644 --- a/examples/react/start-basic-auth/src/utils/session.ts +++ b/examples/react/start-basic-auth/src/utils/session.ts @@ -1,13 +1,29 @@ -// src/services/session.server.ts -import { useSession } from '@tanstack/react-start/server' +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/react-start/server' import type { User } from '@prisma/client' type SessionUser = { userEmail: User['email'] } -export function useAppSession() { - return useSession({ - password: 'ChangeThisBeforeShippingToProdOrYouWillBeFired', - }) +export function getAppSession() { + const password = process.env.SESSION_PASSWORD + if (!password || password.length < 32) { + throw new Error('Set SESSION_PASSWORD to at least 32 characters') + } + + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'app-session', + password, + ttl: 7 * 24 * 60 * 60, + cookieOptions: { + httpOnly: true, + sameSite: 'lax', + secure: process.env.NODE_ENV === 'production', + path: '/', + }, + }, + ) } diff --git a/examples/react/start-basic-authjs/package.json b/examples/react/start-basic-authjs/package.json index 2d150d2a13..e9fa789ea6 100644 --- a/examples/react/start-basic-authjs/package.json +++ b/examples/react/start-basic-authjs/package.json @@ -11,9 +11,9 @@ }, "dependencies": { "@auth/core": "^0.41.1", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "start-authjs": "^1.0.0", @@ -26,7 +26,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-basic-cloudflare/package.json b/examples/react/start-basic-cloudflare/package.json index 664f449996..2108922446 100644 --- a/examples/react/start-basic-cloudflare/package.json +++ b/examples/react/start-basic-cloudflare/package.json @@ -12,9 +12,9 @@ "postinstall": "WRANGLER_LOG=warn npm run --silent cf-typegen" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0" }, @@ -26,7 +26,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "wrangler": "^4.74.0" } diff --git a/examples/react/start-basic-react-query/README.md b/examples/react/start-basic-react-query/README.md index 77c61c2504..70cc728ae4 100644 --- a/examples/react/start-basic-react-query/README.md +++ b/examples/react/start-basic-react-query/README.md @@ -38,5 +38,18 @@ This example demonstrates how to use TanStack Query with TanStack Start for: - Server-side data fetching - Client-side caching and synchronization -- Optimistic updates -- Automatic refetching +- Confirmed server mutations followed by query invalidation +- Explicit freshness and automatic refetching + +## SSR and mutation checks + +Read the [Start + TanStack Query guide](https://tanstack.com/start/latest/docs/framework/react/guide/tanstack-query). The `/preferences` page stores a harmless display name in a cookie, so its tests need no account or external API. This cookie is not authentication. The other post/user examples use JSONPlaceholder. + +```sh +pnpm exec playwright install chromium +pnpm test:e2e +pnpm build +QUERY_EXAMPLE_PRODUCTION=1 pnpm test:e2e +``` + +The tests check concurrent SSR request isolation, no duplicate hydration read, one refetch after mutation invalidation, and persistence on reload. Query data is fresh for 30 seconds by default in this example; choose a window appropriate for your application. diff --git a/examples/react/start-basic-react-query/package.json b/examples/react/start-basic-react-query/package.json index 51006733fb..9d819d4390 100644 --- a/examples/react/start-basic-react-query/package.json +++ b/examples/react/start-basic-react-query/package.json @@ -7,15 +7,16 @@ "dev": "vite dev", "build": "vite build && tsc --noEmit", "preview": "vite preview", - "start": "pnpx srvx --prod -s ../client dist/server/server.js" + "start": "pnpx srvx --prod -s ../client dist/server/server.js", + "test:e2e": "playwright test" }, "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-router-ssr-query": "^1.167.1", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-router-ssr-query": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -28,7 +29,9 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", - "vite": "^8.0.14" + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14", + "@playwright/test": "^1.61.0" } } diff --git a/examples/react/start-basic-react-query/playwright.config.ts b/examples/react/start-basic-react-query/playwright.config.ts new file mode 100644 index 0000000000..298a1133e9 --- /dev/null +++ b/examples/react/start-basic-react-query/playwright.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from '@playwright/test' + +export default defineConfig({ + testDir: './tests', + use: { baseURL: 'http://localhost:3110', browserName: 'chromium' }, + webServer: { + command: + process.env.QUERY_EXAMPLE_PRODUCTION === '1' + ? 'PORT=3110 pnpm start' + : 'pnpm dev --port 3110', + url: 'http://localhost:3110/preferences', + timeout: 120_000, + }, +}) diff --git a/examples/react/start-basic-react-query/src/routeTree.gen.ts b/examples/react/start-basic-react-query/src/routeTree.gen.ts index e010af19fe..0c7a90d4a1 100644 --- a/examples/react/start-basic-react-query/src/routeTree.gen.ts +++ b/examples/react/start-basic-react-query/src/routeTree.gen.ts @@ -13,6 +13,7 @@ import { Route as IndexRouteImport } from './routes/index' import { Route as PathlessLayoutRouteImport } from './routes/_pathlessLayout' import { Route as DeferredRouteImport } from './routes/deferred' import { Route as PostsRouteRouteImport } from './routes/posts.route' +import { Route as PreferencesRouteImport } from './routes/preferences' import { Route as RedirectRouteImport } from './routes/redirect' import { Route as UsersRouteRouteImport } from './routes/users.route' import { Route as PathlessLayoutNestedLayoutRouteImport } from './routes/_pathlessLayout/_nested-layout' @@ -45,6 +46,11 @@ const PostsRouteRoute = PostsRouteRouteImport.update({ path: '/posts', getParentRoute: () => rootRouteImport, } as any) +const PreferencesRoute = PreferencesRouteImport.update({ + id: '/preferences', + path: '/preferences', + getParentRoute: () => rootRouteImport, +} as any) const RedirectRoute = RedirectRouteImport.update({ id: '/redirect', path: '/redirect', @@ -113,6 +119,7 @@ export interface FileRoutesByFullPath { '/posts': typeof PostsRouteRouteWithChildren '/users': typeof UsersRouteRouteWithChildren '/deferred': typeof DeferredRoute + '/preferences': typeof PreferencesRoute '/redirect': typeof RedirectRoute '/api/users': typeof ApiUsersRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute @@ -127,6 +134,7 @@ export interface FileRoutesByFullPath { export interface FileRoutesByTo { '/': typeof IndexRoute '/deferred': typeof DeferredRoute + '/preferences': typeof PreferencesRoute '/redirect': typeof RedirectRoute '/api/users': typeof ApiUsersRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute @@ -145,6 +153,7 @@ export interface FileRoutesById { '/users': typeof UsersRouteRouteWithChildren '/_pathlessLayout': typeof PathlessLayoutRouteWithChildren '/deferred': typeof DeferredRoute + '/preferences': typeof PreferencesRoute '/redirect': typeof RedirectRoute '/_pathlessLayout/_nested-layout': typeof PathlessLayoutNestedLayoutRouteWithChildren '/api/users': typeof ApiUsersRouteWithChildren @@ -164,6 +173,7 @@ export interface FileRouteTypes { | '/posts' | '/users' | '/deferred' + | '/preferences' | '/redirect' | '/api/users' | '/posts/$postId' @@ -178,6 +188,7 @@ export interface FileRouteTypes { to: | '/' | '/deferred' + | '/preferences' | '/redirect' | '/api/users' | '/posts/$postId' @@ -195,6 +206,7 @@ export interface FileRouteTypes { | '/users' | '/_pathlessLayout' | '/deferred' + | '/preferences' | '/redirect' | '/_pathlessLayout/_nested-layout' | '/api/users' @@ -214,6 +226,7 @@ export interface RootRouteChildren { UsersRouteRoute: typeof UsersRouteRouteWithChildren PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren DeferredRoute: typeof DeferredRoute + PreferencesRoute: typeof PreferencesRoute RedirectRoute: typeof RedirectRoute ApiUsersRoute: typeof ApiUsersRouteWithChildren PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute @@ -249,6 +262,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof PostsRouteRouteImport parentRoute: typeof rootRouteImport } + '/preferences': { + id: '/preferences' + path: '/preferences' + fullPath: '/preferences' + preLoaderRoute: typeof PreferencesRouteImport + parentRoute: typeof rootRouteImport + } '/redirect': { id: '/redirect' path: '/redirect' @@ -412,6 +432,7 @@ const rootRouteChildren: RootRouteChildren = { UsersRouteRoute: UsersRouteRouteWithChildren, PathlessLayoutRoute: PathlessLayoutRouteWithChildren, DeferredRoute: DeferredRoute, + PreferencesRoute: PreferencesRoute, RedirectRoute: RedirectRoute, ApiUsersRoute: ApiUsersRouteWithChildren, PostsPostIdDeepRoute: PostsPostIdDeepRoute, @@ -421,10 +442,11 @@ export const routeTree = rootRouteImport ._addFileTypes() import type { getRouter } from './router.tsx' -import type { createStart } from '@tanstack/react-start' +import type { startInstance } from './start.ts' declare module '@tanstack/react-start' { interface Register { ssr: true router: Awaited> + config: Awaited> } } diff --git a/examples/react/start-basic-react-query/src/router.tsx b/examples/react/start-basic-react-query/src/router.tsx index 314b29edd0..345055c116 100644 --- a/examples/react/start-basic-react-query/src/router.tsx +++ b/examples/react/start-basic-react-query/src/router.tsx @@ -6,12 +6,15 @@ import { DefaultCatchBoundary } from './components/DefaultCatchBoundary' import { NotFound } from './components/NotFound' export function getRouter() { - const queryClient = new QueryClient() + const queryClient = new QueryClient({ + defaultOptions: { queries: { staleTime: 30_000 } }, + }) const router = createRouter({ routeTree, context: { queryClient }, defaultPreload: 'intent', + defaultPreloadStaleTime: 0, defaultErrorComponent: DefaultCatchBoundary, defaultNotFoundComponent: () => , }) diff --git a/examples/react/start-basic-react-query/src/routes/__root.tsx b/examples/react/start-basic-react-query/src/routes/__root.tsx index bc278f8036..71c19b2c6f 100644 --- a/examples/react/start-basic-react-query/src/routes/__root.tsx +++ b/examples/react/start-basic-react-query/src/routes/__root.tsx @@ -83,6 +83,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
+ Preferences { + await context.queryClient.query(readerNameOptions) + }, + headers: () => ({ 'Cache-Control': 'private, no-store' }), + head: () => ({ meta: [{ title: 'Reader preferences' }] }), + component: Preferences, +}) + +function Preferences() { + const { data: name } = useSuspenseQuery(readerNameOptions) + const queryClient = useQueryClient() + const save = useServerFn(saveReaderName) + const hydrated = useHydrated() + const mutation = useMutation({ + mutationFn: (name: string) => save({ data: name }), + onSuccess: () => + queryClient.invalidateQueries({ queryKey: readerNameOptions.queryKey }), + }) + + return ( +
+

Reader preferences

+

Hello, {name}

+
{ + event.preventDefault() + const value = new FormData(event.currentTarget).get('name') + if (typeof value === 'string') { + mutation.mutate(value) + } + }} + > +
+ + +
+ {mutation.isError ? ( +

Could not save your name. Try again.

+ ) : null} +
+
+ ) +} diff --git a/examples/react/start-basic-react-query/src/start.ts b/examples/react/start-basic-react-query/src/start.ts new file mode 100644 index 0000000000..5fb1e247fb --- /dev/null +++ b/examples/react/start-basic-react-query/src/start.ts @@ -0,0 +1,9 @@ +import { createCsrfMiddleware, createStart } from '@tanstack/react-start' + +export const startInstance = createStart(() => ({ + requestMiddleware: [ + createCsrfMiddleware({ + filter: (ctx) => ctx.handlerType === 'serverFn', + }), + ], +})) diff --git a/examples/react/start-basic-react-query/src/utils/preferences.ts b/examples/react/start-basic-react-query/src/utils/preferences.ts new file mode 100644 index 0000000000..74c33e5848 --- /dev/null +++ b/examples/react/start-basic-react-query/src/utils/preferences.ts @@ -0,0 +1,34 @@ +import { queryOptions } from '@tanstack/react-query' +import { createServerFn } from '@tanstack/react-start' +import { + getCookie, + setCookie, + setResponseHeader, +} from '@tanstack/react-start/server' + +export const getReaderName = createServerFn({ method: 'GET' }).handler(() => { + setResponseHeader('Cache-Control', 'private, no-store') + return getCookie('reader-name') || 'Guest' +}) + +export const saveReaderName = createServerFn({ method: 'POST' }) + .validator((name: string) => { + if (typeof name !== 'string' || !name.trim() || name.length > 40) { + throw new Error('Enter a name between 1 and 40 characters') + } + return name.trim() + }) + .handler(({ data }) => { + setResponseHeader('Cache-Control', 'private, no-store') + setCookie('reader-name', data, { + httpOnly: true, + sameSite: 'lax', + secure: process.env.NODE_ENV === 'production', + path: '/', + }) + }) + +export const readerNameOptions = queryOptions({ + queryKey: ['reader-name'], + queryFn: () => getReaderName(), +}) diff --git a/examples/react/start-basic-react-query/tests/preferences.spec.ts b/examples/react/start-basic-react-query/tests/preferences.spec.ts new file mode 100644 index 0000000000..309c402798 --- /dev/null +++ b/examples/react/start-basic-react-query/tests/preferences.spec.ts @@ -0,0 +1,67 @@ +import { expect, test } from '@playwright/test' + +test('concurrent SSR requests keep the same query key isolated by request', async ({ + request, +}) => { + const names = ['Lucia', 'Omar', 'Maya', 'Felix'] + const responses = await Promise.all( + names.map((name) => + request.get('/preferences', { + headers: { Cookie: `reader-name=${name}` }, + }), + ), + ) + for (const [index, response] of responses.entries()) { + expect(response.status()).toBe(200) + expect(response.headers()['cache-control']).toContain('no-store') + const html = await response.text() + expect(html).toContain(names[index]) + for (const other of names.filter((_, otherIndex) => otherIndex !== index)) { + expect(html).not.toContain(other) + } + } +}) + +test('hydration reuses SSR data and mutation invalidation refetches once', async ({ + page, +}) => { + const reads: string[] = [] + page.on('request', (request) => { + if ( + request.method() === 'GET' && + new URL(request.url()).pathname.startsWith('/_serverFn/') + ) { + reads.push(request.url()) + } + }) + await page.goto('/preferences') + await expect(page.getByTestId('reader-name')).toHaveText('Hello, Guest') + await expect(page.getByLabel('Display name')).toBeEnabled() + await page.waitForLoadState('networkidle') + expect(reads).toHaveLength(0) + + await page.getByLabel('Display name').fill('Ada') + const mutation = page.waitForRequest((request) => request.method() === 'POST') + await page.getByRole('button', { name: 'Save name' }).click() + await expect(page.getByTestId('reader-name')).toHaveText('Hello, Ada') + await expect(page.getByRole('button', { name: 'Save name' })).toBeEnabled() + await page.waitForLoadState('networkidle') + expect(reads).toHaveLength(1) + + const savedRequest = await mutation + const headers = await savedRequest.allHeaders() + delete headers['content-length'] + headers.origin = 'https://untrusted.example' + headers['sec-fetch-site'] = 'cross-site' + const denied = await page.request.post(savedRequest.url(), { + headers, + data: savedRequest.postData() ?? '', + }) + expect(denied.status()).toBe(403) + + await page.reload() + await expect(page.getByTestId('reader-name')).toHaveText('Hello, Ada') + await expect(page.getByLabel('Display name')).toBeEnabled() + await page.waitForLoadState('networkidle') + expect(reads).toHaveLength(1) +}) diff --git a/examples/react/start-basic-rsbuild/.devcontainer/devcontainer.json b/examples/react/start-basic-rsbuild/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..e5dafce188 --- /dev/null +++ b/examples/react/start-basic-rsbuild/.devcontainer/devcontainer.json @@ -0,0 +1,3 @@ +{ + "image": "mcr.microsoft.com/devcontainers/typescript-node:24" +} diff --git a/examples/react/start-basic-rsbuild/.gitignore b/examples/react/start-basic-rsbuild/.gitignore new file mode 100644 index 0000000000..1f189d9bc0 --- /dev/null +++ b/examples/react/start-basic-rsbuild/.gitignore @@ -0,0 +1,19 @@ +node_modules +package-lock.json +yarn.lock + +.DS_Store +.cache +.env +.vercel +dist +/build/ +/api/ +/server/build +/public/build# Sentry Config File +.env.sentry-build-plugin +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +.tanstack diff --git a/examples/react/start-basic-rsbuild/.prettierignore b/examples/react/start-basic-rsbuild/.prettierignore new file mode 100644 index 0000000000..2be5eaa6ec --- /dev/null +++ b/examples/react/start-basic-rsbuild/.prettierignore @@ -0,0 +1,4 @@ +**/build +**/public +pnpm-lock.yaml +routeTree.gen.ts \ No newline at end of file diff --git a/examples/react/start-basic-rsbuild/.vscode/settings.json b/examples/react/start-basic-rsbuild/.vscode/settings.json new file mode 100644 index 0000000000..00b5278e58 --- /dev/null +++ b/examples/react/start-basic-rsbuild/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "files.watcherExclude": { + "**/routeTree.gen.ts": true + }, + "search.exclude": { + "**/routeTree.gen.ts": true + }, + "files.readonlyInclude": { + "**/routeTree.gen.ts": true + } +} diff --git a/examples/react/start-basic-rsbuild/README.md b/examples/react/start-basic-rsbuild/README.md new file mode 100644 index 0000000000..64117c915b --- /dev/null +++ b/examples/react/start-basic-rsbuild/README.md @@ -0,0 +1,36 @@ +# TanStack Start - Basic Rsbuild Example + +This is the basic TanStack Start Rsbuild example, demonstrating the fundamentals of building applications with TanStack Router and TanStack Start. + +- [TanStack Router Docs](https://tanstack.com/router) + +It's deployed automagically with Netlify! + +- [Netlify](https://netlify.com/) + +## Start a new project based on this example + +To start a new project based on this example, run: + +```sh +npx gitpick TanStack/router/tree/main/examples/react/start-basic-rsbuild start-basic-rsbuild +``` + +## Getting Started + +From your terminal: + +```sh +pnpm install +pnpm dev +``` + +This starts your app in development mode, rebuilding assets on file changes. + +## Build + +To build the app for production: + +```sh +pnpm build +``` diff --git a/examples/react/start-basic-rsbuild/package.json b/examples/react/start-basic-rsbuild/package.json new file mode 100644 index 0000000000..bea4ba26ef --- /dev/null +++ b/examples/react/start-basic-rsbuild/package.json @@ -0,0 +1,33 @@ +{ + "name": "tanstack-start-example-basic-rsbuild", + "private": true, + "sideEffects": false, + "type": "module", + "scripts": { + "dev": "rsbuild dev --port 3000", + "build": "rsbuild build && tsc --noEmit", + "preview": "rsbuild preview", + "start": "srvx --prod -s ../client dist/server/index.js" + }, + "dependencies": { + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", + "react": "^19.2.3", + "react-dom": "^19.2.3", + "tailwind-merge": "^3.6.0", + "zod": "^4.4.3" + }, + "devDependencies": { + "@rsbuild/core": "^2.3.1", + "@rsbuild/plugin-react": "^2.0.0", + "@rsbuild/plugin-tailwindcss": "^2.0.3", + "@types/node": "25.0.9", + "@types/react": "^19.2.8", + "@types/react-dom": "^19.2.3", + "srvx": "^1.0.0", + "tailwindcss": "^4.2.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" + } +} diff --git a/examples/react/start-basic-rsbuild/public/android-chrome-192x192.png b/examples/react/start-basic-rsbuild/public/android-chrome-192x192.png new file mode 100644 index 0000000000..09c8324f8c Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/android-chrome-192x192.png differ diff --git a/examples/react/start-basic-rsbuild/public/android-chrome-512x512.png b/examples/react/start-basic-rsbuild/public/android-chrome-512x512.png new file mode 100644 index 0000000000..11d626ea3d Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/android-chrome-512x512.png differ diff --git a/examples/react/start-basic-rsbuild/public/apple-touch-icon.png b/examples/react/start-basic-rsbuild/public/apple-touch-icon.png new file mode 100644 index 0000000000..5a9423cc02 Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/apple-touch-icon.png differ diff --git a/examples/react/start-basic-rsbuild/public/favicon-16x16.png b/examples/react/start-basic-rsbuild/public/favicon-16x16.png new file mode 100644 index 0000000000..e3389b0044 Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/favicon-16x16.png differ diff --git a/examples/react/start-basic-rsbuild/public/favicon-32x32.png b/examples/react/start-basic-rsbuild/public/favicon-32x32.png new file mode 100644 index 0000000000..900c77d444 Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/favicon-32x32.png differ diff --git a/examples/react/start-basic-rsbuild/public/favicon.ico b/examples/react/start-basic-rsbuild/public/favicon.ico new file mode 100644 index 0000000000..1a1751676f Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/favicon.ico differ diff --git a/examples/react/start-basic-rsbuild/public/favicon.png b/examples/react/start-basic-rsbuild/public/favicon.png new file mode 100644 index 0000000000..1e77bc0609 Binary files /dev/null and b/examples/react/start-basic-rsbuild/public/favicon.png differ diff --git a/examples/react/start-basic-rsbuild/public/site.webmanifest b/examples/react/start-basic-rsbuild/public/site.webmanifest new file mode 100644 index 0000000000..fa99de77db --- /dev/null +++ b/examples/react/start-basic-rsbuild/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/examples/react/start-basic-rsbuild/rsbuild.config.ts b/examples/react/start-basic-rsbuild/rsbuild.config.ts new file mode 100644 index 0000000000..3705696818 --- /dev/null +++ b/examples/react/start-basic-rsbuild/rsbuild.config.ts @@ -0,0 +1,17 @@ +import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' +import { pluginTailwindcss } from '@rsbuild/plugin-tailwindcss' + +export default defineConfig({ + server: { + port: 3000, + }, + plugins: [ + pluginTailwindcss(), + pluginReact(), + tanstackStart({ + srcDirectory: 'src', + }), + ], +}) diff --git a/examples/react/start-basic-rsbuild/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-rsbuild/src/components/DefaultCatchBoundary.tsx new file mode 100644 index 0000000000..4a22649ed4 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/components/DefaultCatchBoundary.tsx @@ -0,0 +1,51 @@ +import { + ErrorComponent, + Link, + useLocation, + useRouter, +} from '@tanstack/react-router' +import type { ErrorComponentProps } from '@tanstack/react-router' + +export function DefaultCatchBoundary({ error }: ErrorComponentProps) { + const router = useRouter() + const isRoot = useLocation({ + select: (location) => location.pathname === '/', + }) + + console.error('DefaultCatchBoundary Error:', error) + + return ( +
+ +
+ + {isRoot ? ( + + Home + + ) : ( + { + e.preventDefault() + window.history.back() + }} + > + Go Back + + )} +
+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/components/NotFound.tsx b/examples/react/start-basic-rsbuild/src/components/NotFound.tsx new file mode 100644 index 0000000000..fd4e75befe --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/components/NotFound.tsx @@ -0,0 +1,25 @@ +import { Link } from '@tanstack/react-router' + +export function NotFound({ children }: { children?: any }) { + return ( +
+
+ {children ||

The page you are looking for does not exist.

} +
+

+ + + Start Over + +

+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/components/PostError.tsx b/examples/react/start-basic-rsbuild/src/components/PostError.tsx new file mode 100644 index 0000000000..271f2d1de1 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/components/PostError.tsx @@ -0,0 +1,6 @@ +import { ErrorComponent } from '@tanstack/react-router' +import type { ErrorComponentProps } from '@tanstack/react-router' + +export function PostErrorComponent({ error }: ErrorComponentProps) { + return +} diff --git a/examples/react/start-basic-rsbuild/src/components/UserError.tsx b/examples/react/start-basic-rsbuild/src/components/UserError.tsx new file mode 100644 index 0000000000..af5d0c6f16 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/components/UserError.tsx @@ -0,0 +1,6 @@ +import { ErrorComponent } from '@tanstack/react-router' +import type { ErrorComponentProps } from '@tanstack/react-router' + +export function UserErrorComponent({ error }: ErrorComponentProps) { + return +} diff --git a/examples/react/start-basic-rsbuild/src/env.d.ts b/examples/react/start-basic-rsbuild/src/env.d.ts new file mode 100644 index 0000000000..b0ac762b09 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/react/start-basic-rsbuild/src/routeTree.gen.ts b/examples/react/start-basic-rsbuild/src/routeTree.gen.ts new file mode 100644 index 0000000000..57b849492d --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routeTree.gen.ts @@ -0,0 +1,447 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as PathlessLayoutRouteImport } from './routes/_pathlessLayout' +import { Route as CustomScriptDotjsRouteImport } from './routes/customScript[.]js' +import { Route as DeferredRouteImport } from './routes/deferred' +import { Route as PostsRouteImport } from './routes/posts' +import { Route as RedirectRouteImport } from './routes/redirect' +import { Route as UsersRouteImport } from './routes/users' +import { Route as PathlessLayoutNestedLayoutRouteImport } from './routes/_pathlessLayout/_nested-layout' +import { Route as ApiUsersRouteImport } from './routes/api/users' +import { Route as PostsIndexRouteImport } from './routes/posts.index' +import { Route as PostsPostIdRouteImport } from './routes/posts.$postId' +import { Route as UsersIndexRouteImport } from './routes/users.index' +import { Route as UsersUserIdRouteImport } from './routes/users.$userId' +import { Route as PathlessLayoutNestedLayoutRouteARouteImport } from './routes/_pathlessLayout/_nested-layout/route-a' +import { Route as PathlessLayoutNestedLayoutRouteBRouteImport } from './routes/_pathlessLayout/_nested-layout/route-b' +import { Route as ApiUsersUserIdRouteImport } from './routes/api/users.$userId' +import { Route as PostsPostIdDeepRouteImport } from './routes/posts_.$postId.deep' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const PathlessLayoutRoute = PathlessLayoutRouteImport.update({ + id: '/_pathlessLayout', + getParentRoute: () => rootRouteImport, +} as any) +const CustomScriptDotjsRoute = CustomScriptDotjsRouteImport.update({ + id: '/customScript.js', + path: '/customScript.js', + getParentRoute: () => rootRouteImport, +} as any) +const DeferredRoute = DeferredRouteImport.update({ + id: '/deferred', + path: '/deferred', + getParentRoute: () => rootRouteImport, +} as any) +const PostsRoute = PostsRouteImport.update({ + id: '/posts', + path: '/posts', + getParentRoute: () => rootRouteImport, +} as any) +const RedirectRoute = RedirectRouteImport.update({ + id: '/redirect', + path: '/redirect', + getParentRoute: () => rootRouteImport, +} as any) +const UsersRoute = UsersRouteImport.update({ + id: '/users', + path: '/users', + getParentRoute: () => rootRouteImport, +} as any) +const PathlessLayoutNestedLayoutRoute = + PathlessLayoutNestedLayoutRouteImport.update({ + id: '/_nested-layout', + getParentRoute: () => PathlessLayoutRoute, + } as any) +const ApiUsersRoute = ApiUsersRouteImport.update({ + id: '/api/users', + path: '/api/users', + getParentRoute: () => rootRouteImport, +} as any) +const PostsIndexRoute = PostsIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => PostsRoute, +} as any) +const PostsPostIdRoute = PostsPostIdRouteImport.update({ + id: '/$postId', + path: '/$postId', + getParentRoute: () => PostsRoute, +} as any) +const UsersIndexRoute = UsersIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => UsersRoute, +} as any) +const UsersUserIdRoute = UsersUserIdRouteImport.update({ + id: '/$userId', + path: '/$userId', + getParentRoute: () => UsersRoute, +} as any) +const PathlessLayoutNestedLayoutRouteARoute = + PathlessLayoutNestedLayoutRouteARouteImport.update({ + id: '/route-a', + path: '/route-a', + getParentRoute: () => PathlessLayoutNestedLayoutRoute, + } as any) +const PathlessLayoutNestedLayoutRouteBRoute = + PathlessLayoutNestedLayoutRouteBRouteImport.update({ + id: '/route-b', + path: '/route-b', + getParentRoute: () => PathlessLayoutNestedLayoutRoute, + } as any) +const ApiUsersUserIdRoute = ApiUsersUserIdRouteImport.update({ + id: '/$userId', + path: '/$userId', + getParentRoute: () => ApiUsersRoute, +} as any) +const PostsPostIdDeepRoute = PostsPostIdDeepRouteImport.update({ + id: '/posts_/$postId/deep', + path: '/posts/$postId/deep', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/customScript.js': typeof CustomScriptDotjsRoute + '/deferred': typeof DeferredRoute + '/posts': typeof PostsRouteWithChildren + '/redirect': typeof RedirectRoute + '/users': typeof UsersRouteWithChildren + '/api/users': typeof ApiUsersRouteWithChildren + '/posts/$postId': typeof PostsPostIdRoute + '/users/$userId': typeof UsersUserIdRoute + '/posts/': typeof PostsIndexRoute + '/users/': typeof UsersIndexRoute + '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute + '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute + '/api/users/$userId': typeof ApiUsersUserIdRoute + '/posts/$postId/deep': typeof PostsPostIdDeepRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/customScript.js': typeof CustomScriptDotjsRoute + '/deferred': typeof DeferredRoute + '/redirect': typeof RedirectRoute + '/api/users': typeof ApiUsersRouteWithChildren + '/posts/$postId': typeof PostsPostIdRoute + '/users/$userId': typeof UsersUserIdRoute + '/posts': typeof PostsIndexRoute + '/users': typeof UsersIndexRoute + '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute + '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute + '/api/users/$userId': typeof ApiUsersUserIdRoute + '/posts/$postId/deep': typeof PostsPostIdDeepRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/_pathlessLayout': typeof PathlessLayoutRouteWithChildren + '/customScript.js': typeof CustomScriptDotjsRoute + '/deferred': typeof DeferredRoute + '/posts': typeof PostsRouteWithChildren + '/redirect': typeof RedirectRoute + '/users': typeof UsersRouteWithChildren + '/_pathlessLayout/_nested-layout': typeof PathlessLayoutNestedLayoutRouteWithChildren + '/api/users': typeof ApiUsersRouteWithChildren + '/posts/$postId': typeof PostsPostIdRoute + '/users/$userId': typeof UsersUserIdRoute + '/posts/': typeof PostsIndexRoute + '/users/': typeof UsersIndexRoute + '/_pathlessLayout/_nested-layout/route-a': typeof PathlessLayoutNestedLayoutRouteARoute + '/_pathlessLayout/_nested-layout/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute + '/api/users/$userId': typeof ApiUsersUserIdRoute + '/posts_/$postId/deep': typeof PostsPostIdDeepRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/' + | '/customScript.js' + | '/deferred' + | '/posts' + | '/redirect' + | '/users' + | '/api/users' + | '/posts/$postId' + | '/users/$userId' + | '/posts/' + | '/users/' + | '/route-a' + | '/route-b' + | '/api/users/$userId' + | '/posts/$postId/deep' + fileRoutesByTo: FileRoutesByTo + to: + | '/' + | '/customScript.js' + | '/deferred' + | '/redirect' + | '/api/users' + | '/posts/$postId' + | '/users/$userId' + | '/posts' + | '/users' + | '/route-a' + | '/route-b' + | '/api/users/$userId' + | '/posts/$postId/deep' + id: + | '__root__' + | '/' + | '/_pathlessLayout' + | '/customScript.js' + | '/deferred' + | '/posts' + | '/redirect' + | '/users' + | '/_pathlessLayout/_nested-layout' + | '/api/users' + | '/posts/$postId' + | '/users/$userId' + | '/posts/' + | '/users/' + | '/_pathlessLayout/_nested-layout/route-a' + | '/_pathlessLayout/_nested-layout/route-b' + | '/api/users/$userId' + | '/posts_/$postId/deep' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren + CustomScriptDotjsRoute: typeof CustomScriptDotjsRoute + DeferredRoute: typeof DeferredRoute + PostsRoute: typeof PostsRouteWithChildren + RedirectRoute: typeof RedirectRoute + UsersRoute: typeof UsersRouteWithChildren + ApiUsersRoute: typeof ApiUsersRouteWithChildren + PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/_pathlessLayout': { + id: '/_pathlessLayout' + path: '' + fullPath: '/' + preLoaderRoute: typeof PathlessLayoutRouteImport + parentRoute: typeof rootRouteImport + } + '/customScript.js': { + id: '/customScript.js' + path: '/customScript.js' + fullPath: '/customScript.js' + preLoaderRoute: typeof CustomScriptDotjsRouteImport + parentRoute: typeof rootRouteImport + } + '/deferred': { + id: '/deferred' + path: '/deferred' + fullPath: '/deferred' + preLoaderRoute: typeof DeferredRouteImport + parentRoute: typeof rootRouteImport + } + '/posts': { + id: '/posts' + path: '/posts' + fullPath: '/posts' + preLoaderRoute: typeof PostsRouteImport + parentRoute: typeof rootRouteImport + } + '/redirect': { + id: '/redirect' + path: '/redirect' + fullPath: '/redirect' + preLoaderRoute: typeof RedirectRouteImport + parentRoute: typeof rootRouteImport + } + '/users': { + id: '/users' + path: '/users' + fullPath: '/users' + preLoaderRoute: typeof UsersRouteImport + parentRoute: typeof rootRouteImport + } + '/_pathlessLayout/_nested-layout': { + id: '/_pathlessLayout/_nested-layout' + path: '' + fullPath: '/' + preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteImport + parentRoute: typeof PathlessLayoutRoute + } + '/api/users': { + id: '/api/users' + path: '/api/users' + fullPath: '/api/users' + preLoaderRoute: typeof ApiUsersRouteImport + parentRoute: typeof rootRouteImport + } + '/posts/': { + id: '/posts/' + path: '/' + fullPath: '/posts/' + preLoaderRoute: typeof PostsIndexRouteImport + parentRoute: typeof PostsRoute + } + '/posts/$postId': { + id: '/posts/$postId' + path: '/$postId' + fullPath: '/posts/$postId' + preLoaderRoute: typeof PostsPostIdRouteImport + parentRoute: typeof PostsRoute + } + '/users/': { + id: '/users/' + path: '/' + fullPath: '/users/' + preLoaderRoute: typeof UsersIndexRouteImport + parentRoute: typeof UsersRoute + } + '/users/$userId': { + id: '/users/$userId' + path: '/$userId' + fullPath: '/users/$userId' + preLoaderRoute: typeof UsersUserIdRouteImport + parentRoute: typeof UsersRoute + } + '/_pathlessLayout/_nested-layout/route-a': { + id: '/_pathlessLayout/_nested-layout/route-a' + path: '/route-a' + fullPath: '/route-a' + preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteARouteImport + parentRoute: typeof PathlessLayoutNestedLayoutRoute + } + '/_pathlessLayout/_nested-layout/route-b': { + id: '/_pathlessLayout/_nested-layout/route-b' + path: '/route-b' + fullPath: '/route-b' + preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteBRouteImport + parentRoute: typeof PathlessLayoutNestedLayoutRoute + } + '/api/users/$userId': { + id: '/api/users/$userId' + path: '/$userId' + fullPath: '/api/users/$userId' + preLoaderRoute: typeof ApiUsersUserIdRouteImport + parentRoute: typeof ApiUsersRoute + } + '/posts_/$postId/deep': { + id: '/posts_/$postId/deep' + path: '/posts/$postId/deep' + fullPath: '/posts/$postId/deep' + preLoaderRoute: typeof PostsPostIdDeepRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +interface PathlessLayoutNestedLayoutRouteChildren { + PathlessLayoutNestedLayoutRouteARoute: typeof PathlessLayoutNestedLayoutRouteARoute + PathlessLayoutNestedLayoutRouteBRoute: typeof PathlessLayoutNestedLayoutRouteBRoute +} + +const PathlessLayoutNestedLayoutRouteChildren: PathlessLayoutNestedLayoutRouteChildren = + { + PathlessLayoutNestedLayoutRouteARoute: + PathlessLayoutNestedLayoutRouteARoute, + PathlessLayoutNestedLayoutRouteBRoute: + PathlessLayoutNestedLayoutRouteBRoute, + } + +const PathlessLayoutNestedLayoutRouteWithChildren = + PathlessLayoutNestedLayoutRoute._addFileChildren( + PathlessLayoutNestedLayoutRouteChildren, + ) + +interface PathlessLayoutRouteChildren { + PathlessLayoutNestedLayoutRoute: typeof PathlessLayoutNestedLayoutRouteWithChildren +} + +const PathlessLayoutRouteChildren: PathlessLayoutRouteChildren = { + PathlessLayoutNestedLayoutRoute: PathlessLayoutNestedLayoutRouteWithChildren, +} + +const PathlessLayoutRouteWithChildren = PathlessLayoutRoute._addFileChildren( + PathlessLayoutRouteChildren, +) + +interface PostsRouteChildren { + PostsPostIdRoute: typeof PostsPostIdRoute + PostsIndexRoute: typeof PostsIndexRoute +} + +const PostsRouteChildren: PostsRouteChildren = { + PostsPostIdRoute: PostsPostIdRoute, + PostsIndexRoute: PostsIndexRoute, +} + +const PostsRouteWithChildren = PostsRoute._addFileChildren(PostsRouteChildren) + +interface UsersRouteChildren { + UsersUserIdRoute: typeof UsersUserIdRoute + UsersIndexRoute: typeof UsersIndexRoute +} + +const UsersRouteChildren: UsersRouteChildren = { + UsersUserIdRoute: UsersUserIdRoute, + UsersIndexRoute: UsersIndexRoute, +} + +const UsersRouteWithChildren = UsersRoute._addFileChildren(UsersRouteChildren) + +interface ApiUsersRouteChildren { + ApiUsersUserIdRoute: typeof ApiUsersUserIdRoute +} + +const ApiUsersRouteChildren: ApiUsersRouteChildren = { + ApiUsersUserIdRoute: ApiUsersUserIdRoute, +} + +const ApiUsersRouteWithChildren = ApiUsersRoute._addFileChildren( + ApiUsersRouteChildren, +) + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + PathlessLayoutRoute: PathlessLayoutRouteWithChildren, + CustomScriptDotjsRoute: CustomScriptDotjsRoute, + DeferredRoute: DeferredRoute, + PostsRoute: PostsRouteWithChildren, + RedirectRoute: RedirectRoute, + UsersRoute: UsersRouteWithChildren, + ApiUsersRoute: ApiUsersRouteWithChildren, + PostsPostIdDeepRoute: PostsPostIdDeepRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + } +} diff --git a/examples/react/start-basic-rsbuild/src/router.tsx b/examples/react/start-basic-rsbuild/src/router.tsx new file mode 100644 index 0000000000..f380f73be7 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/router.tsx @@ -0,0 +1,15 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +import { DefaultCatchBoundary } from './components/DefaultCatchBoundary' +import { NotFound } from './components/NotFound' + +export function getRouter() { + const router = createRouter({ + routeTree, + defaultPreload: 'intent', + defaultErrorComponent: DefaultCatchBoundary, + defaultNotFoundComponent: () => , + scrollRestoration: true, + }) + return router +} diff --git a/examples/react/start-basic-rsbuild/src/routes/__root.tsx b/examples/react/start-basic-rsbuild/src/routes/__root.tsx new file mode 100644 index 0000000000..6d4aed1fe0 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/__root.tsx @@ -0,0 +1,130 @@ +import { + HeadContent, + Link, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import { TanStackRouterDevtools } from '@tanstack/react-router-devtools' +import * as React from 'react' +import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary' +import { NotFound } from '~/components/NotFound' +import appCss from '~/styles/app.css?url' +import { seo } from '~/utils/seo' + +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { + charSet: 'utf-8', + }, + { + name: 'viewport', + content: 'width=device-width, initial-scale=1', + }, + ...seo({ + title: + 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework', + description: `TanStack Start is a type-safe, client-first, full-stack React framework. `, + }), + ], + links: [ + { rel: 'stylesheet', href: appCss }, + { + rel: 'apple-touch-icon', + sizes: '180x180', + href: '/apple-touch-icon.png', + }, + { + rel: 'icon', + type: 'image/png', + sizes: '32x32', + href: '/favicon-32x32.png', + }, + { + rel: 'icon', + type: 'image/png', + sizes: '16x16', + href: '/favicon-16x16.png', + }, + { rel: 'manifest', href: '/site.webmanifest', color: '#fffff' }, + { rel: 'icon', href: '/favicon.ico' }, + ], + scripts: [ + { + src: '/customScript.js', + type: 'text/javascript', + }, + ], + }), + errorComponent: DefaultCatchBoundary, + notFoundComponent: () => , + shellComponent: RootDocument, +}) + +function RootDocument({ children }: { children: React.ReactNode }) { + return ( + + + + + +
+ + Home + {' '} + + Posts + {' '} + + Users + {' '} + + Pathless Layout + {' '} + + Deferred + {' '} + + This Route Does Not Exist + +
+
+ {children} + + + + + ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout.tsx b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout.tsx new file mode 100644 index 0000000000..c3b12442b8 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/_pathlessLayout')({ + component: LayoutComponent, +}) + +function LayoutComponent() { + return ( +
+
I'm a layout
+
+ +
+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout.tsx b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout.tsx new file mode 100644 index 0000000000..9a48b73a46 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout.tsx @@ -0,0 +1,34 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/_pathlessLayout/_nested-layout')({ + component: LayoutComponent, +}) + +function LayoutComponent() { + return ( +
+
I'm a nested layout
+
+ + Go to route A + + + Go to route B + +
+
+ +
+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-a.tsx b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-a.tsx new file mode 100644 index 0000000000..426a8fe486 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-a.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-a')( + { + component: LayoutAComponent, + }, +) + +function LayoutAComponent() { + return
I'm A!
+} diff --git a/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-b.tsx b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-b.tsx new file mode 100644 index 0000000000..20facf2daf --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/_pathlessLayout/_nested-layout/route-b.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-b')( + { + component: LayoutBComponent, + }, +) + +function LayoutBComponent() { + return
I'm B!
+} diff --git a/examples/react/start-basic-rsbuild/src/routes/api/users.$userId.ts b/examples/react/start-basic-rsbuild/src/routes/api/users.$userId.ts new file mode 100644 index 0000000000..ee34d7a189 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/api/users.$userId.ts @@ -0,0 +1,31 @@ +import { createFileRoute } from '@tanstack/react-router' +import type { User } from '~/utils/users' + +export const Route = createFileRoute('/api/users/$userId')({ + server: { + handlers: { + GET: async ({ params, request }) => { + console.info(`Fetching users by id=${params.userId}... @`, request.url) + try { + const res = await fetch( + 'https://jsonplaceholder.typicode.com/users/' + params.userId, + ) + if (!res.ok) { + throw new Error('Failed to fetch user') + } + + const user = (await res.json()) as User + + return Response.json({ + id: user.id, + name: user.name, + email: user.email, + }) + } catch (e) { + console.error(e) + return Response.json({ error: 'User not found' }, { status: 404 }) + } + }, + }, + }, +}) diff --git a/examples/react/start-basic-rsbuild/src/routes/api/users.ts b/examples/react/start-basic-rsbuild/src/routes/api/users.ts new file mode 100644 index 0000000000..4cecd01852 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/api/users.ts @@ -0,0 +1,63 @@ +import { createFileRoute } from '@tanstack/react-router' +import { getRequestHeaders } from '@tanstack/react-start/server' +import { createMiddleware } from '@tanstack/react-start' +import type { User } from '~/utils/users' + +const userLoggerMiddleware = createMiddleware().server(async ({ next }) => { + console.info('In: /users') + console.info('Request Headers:', getRequestHeaders()) + const result = await next() + result.response.headers.set('x-users', 'true') + console.info('Out: /users') + return result +}) + +const testParentMiddleware = createMiddleware().server(async ({ next }) => { + console.info('In: testParentMiddleware') + const result = await next() + result.response.headers.set('x-test-parent', 'true') + console.info('Out: testParentMiddleware') + return result +}) + +const testMiddleware = createMiddleware() + .middleware([testParentMiddleware]) + .server(async ({ next }) => { + console.info('In: testMiddleware') + const result = await next() + result.response.headers.set('x-test', 'true') + + // if (Math.random() > 0.5) { + // throw new Response(null, { + // status: 302, + // headers: { Location: 'https://www.google.com' }, + // }) + // } + + console.info('Out: testMiddleware') + return result + }) + +export const Route = createFileRoute('/api/users')({ + server: { + middleware: [testMiddleware, userLoggerMiddleware], + handlers: { + GET: async ({ request }) => { + console.info('GET /api/users @', request.url) + console.info('Fetching users... @', request.url) + const res = await fetch('https://jsonplaceholder.typicode.com/users') + if (!res.ok) { + throw new Error('Failed to fetch users') + } + + const data = (await res.json()) as Array + + const list = data.slice(0, 10) + + return Response.json( + list.map((u) => ({ id: u.id, name: u.name, email: u.email })), + ) + }, + }, + }, +}) diff --git a/examples/react/start-basic-rsbuild/src/routes/customScript[.]js.ts b/examples/react/start-basic-rsbuild/src/routes/customScript[.]js.ts new file mode 100644 index 0000000000..811471ac15 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/customScript[.]js.ts @@ -0,0 +1,15 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/customScript.js')({ + server: { + handlers: { + GET: () => { + return new Response('console.log("Hello from customScript.js!")', { + headers: { + 'Content-Type': 'application/javascript', + }, + }) + }, + }, + }, +}) diff --git a/examples/react/start-basic-rsbuild/src/routes/deferred.tsx b/examples/react/start-basic-rsbuild/src/routes/deferred.tsx new file mode 100644 index 0000000000..f3e09d1d4e --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/deferred.tsx @@ -0,0 +1,62 @@ +import { Await, createFileRoute } from '@tanstack/react-router' +import { createServerFn } from '@tanstack/react-start' +import { Suspense, useState } from 'react' + +const personServerFn = createServerFn({ method: 'GET' }) + .validator((d: string) => d) + .handler(({ data: name }) => { + return { name, randomNumber: Math.floor(Math.random() * 100) } + }) + +const slowServerFn = createServerFn({ method: 'GET' }) + .validator((d: string) => d) + .handler(async ({ data: name }) => { + await new Promise((r) => setTimeout(r, 1000)) + return { name, randomNumber: Math.floor(Math.random() * 100) } + }) + +export const Route = createFileRoute('/deferred')({ + loader: async () => { + return { + deferredStuff: new Promise((r) => + setTimeout(() => r('Hello deferred!'), 2000), + ), + deferredPerson: slowServerFn({ data: 'Tanner Linsley' }), + person: await personServerFn({ data: 'John Doe' }), + } + }, + component: Deferred, +}) + +function Deferred() { + const [count, setCount] = useState(0) + const { deferredStuff, deferredPerson, person } = Route.useLoaderData() + + return ( +
+
+ {person.name} - {person.randomNumber} +
+ Loading person...
}> + ( +
+ {data.name} - {data.randomNumber} +
+ )} + /> + + Loading stuff...
}> +

{data}

} + /> + +
Count: {count}
+
+ +
+

+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/index.tsx b/examples/react/start-basic-rsbuild/src/routes/index.tsx new file mode 100644 index 0000000000..09a907cb18 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/index.tsx @@ -0,0 +1,13 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: Home, +}) + +function Home() { + return ( +
+

Welcome Home!!!

+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/posts.$postId.tsx b/examples/react/start-basic-rsbuild/src/routes/posts.$postId.tsx new file mode 100644 index 0000000000..65905bf8c4 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/posts.$postId.tsx @@ -0,0 +1,34 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import { fetchPost } from '../utils/posts' +import { NotFound } from '~/components/NotFound' +import { PostErrorComponent } from '~/components/PostError' + +export const Route = createFileRoute('/posts/$postId')({ + loader: ({ params: { postId } }) => fetchPost({ data: postId }), + errorComponent: PostErrorComponent, + component: PostComponent, + notFoundComponent: () => { + return Post not found + }, +}) + +function PostComponent() { + const post = Route.useLoaderData() + + return ( +
+

{post.title}

+
{post.body}
+ + Deep View + +
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/posts.index.tsx b/examples/react/start-basic-rsbuild/src/routes/posts.index.tsx new file mode 100644 index 0000000000..5b5f08f95b --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/posts.index.tsx @@ -0,0 +1,9 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/posts/')({ + component: PostsIndexComponent, +}) + +function PostsIndexComponent() { + return
Select a post.
+} diff --git a/examples/react/start-basic-rsbuild/src/routes/posts.tsx b/examples/react/start-basic-rsbuild/src/routes/posts.tsx new file mode 100644 index 0000000000..9b9162be7c --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/posts.tsx @@ -0,0 +1,38 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' +import { fetchPosts } from '../utils/posts' + +export const Route = createFileRoute('/posts')({ + loader: async () => fetchPosts(), + component: PostsComponent, +}) + +function PostsComponent() { + const posts = Route.useLoaderData() + + return ( +
+
    + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }].map( + (post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + }, + )} +
+
+ +
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/posts_.$postId.deep.tsx b/examples/react/start-basic-rsbuild/src/routes/posts_.$postId.deep.tsx new file mode 100644 index 0000000000..29e6c39b5a --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/posts_.$postId.deep.tsx @@ -0,0 +1,29 @@ +import { Link, createFileRoute } from '@tanstack/react-router' +import { fetchPost } from '../utils/posts' +import { PostErrorComponent } from '~/components/PostError' + +export const Route = createFileRoute('/posts_/$postId/deep')({ + loader: async ({ params: { postId } }) => + fetchPost({ + data: postId, + }), + errorComponent: PostErrorComponent, + component: PostDeepComponent, +}) + +function PostDeepComponent() { + const post = Route.useLoaderData() + + return ( +
+ + ← All Posts + +

{post.title}

+
{post.body}
+
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/redirect.tsx b/examples/react/start-basic-rsbuild/src/routes/redirect.tsx new file mode 100644 index 0000000000..ea34b6e420 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/redirect.tsx @@ -0,0 +1,9 @@ +import { createFileRoute, redirect } from '@tanstack/react-router' + +export const Route = createFileRoute('/redirect')({ + beforeLoad: () => { + throw redirect({ + to: '/posts', + }) + }, +}) diff --git a/examples/react/start-basic-rsbuild/src/routes/users.$userId.tsx b/examples/react/start-basic-rsbuild/src/routes/users.$userId.tsx new file mode 100644 index 0000000000..4e4d470075 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/users.$userId.tsx @@ -0,0 +1,45 @@ +import { createFileRoute } from '@tanstack/react-router' +import { NotFound } from '../components/NotFound' +import { UserErrorComponent } from '../components/UserError' +import type { User } from '../utils/users' + +export const Route = createFileRoute('/users/$userId')({ + loader: async ({ params: { userId } }) => { + try { + const res = await fetch('/api/users/' + userId) + if (!res.ok) { + throw new Error('Unexpected status code') + } + + const data = await res.json() + + return data as User + } catch { + throw new Error('Failed to fetch user') + } + }, + errorComponent: UserErrorComponent, + component: UserComponent, + notFoundComponent: () => { + return User not found + }, +}) + +function UserComponent() { + const user = Route.useLoaderData() + + return ( +
+

{user.name}

+
{user.email}
+ +
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/users.index.tsx b/examples/react/start-basic-rsbuild/src/routes/users.index.tsx new file mode 100644 index 0000000000..27d136987e --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/users.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/users/')({ + component: UsersIndexComponent, +}) + +function UsersIndexComponent() { + return ( +
+ Select a user or{' '} + + view as JSON + +
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/routes/users.tsx b/examples/react/start-basic-rsbuild/src/routes/users.tsx new file mode 100644 index 0000000000..64ca3ce156 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/routes/users.tsx @@ -0,0 +1,49 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' +import type { User } from '../utils/users' + +export const Route = createFileRoute('/users')({ + loader: async () => { + const res = await fetch('/api/users') + + if (!res.ok) { + throw new Error('Unexpected status code') + } + + const data = await res.json() + + return data as Array + }, + component: UsersComponent, +}) + +function UsersComponent() { + const users = Route.useLoaderData() + + return ( +
+
    + {[ + ...users, + { id: 'i-do-not-exist', name: 'Non-existent User', email: '' }, + ].map((user) => { + return ( +
  • + +
    {user.name}
    + +
  • + ) + })} +
+
+ +
+ ) +} diff --git a/examples/react/start-basic-rsbuild/src/styles/app.css b/examples/react/start-basic-rsbuild/src/styles/app.css new file mode 100644 index 0000000000..37c1f5a6e2 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/styles/app.css @@ -0,0 +1,30 @@ +@import 'tailwindcss' source('../'); + +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentcolor); + } +} + +@layer base { + html { + color-scheme: light dark; + } + + * { + @apply border-gray-200 dark:border-gray-800; + } + + html, + body { + @apply text-gray-900 bg-gray-50 dark:bg-gray-950 dark:text-gray-200; + } + + .using-mouse * { + outline: none !important; + } +} diff --git a/examples/react/start-basic-rsbuild/src/utils/loggingMiddleware.tsx b/examples/react/start-basic-rsbuild/src/utils/loggingMiddleware.tsx new file mode 100644 index 0000000000..3ea9a06439 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/utils/loggingMiddleware.tsx @@ -0,0 +1,41 @@ +import { createMiddleware } from '@tanstack/react-start' + +const preLogMiddleware = createMiddleware({ type: 'function' }) + .client(async (ctx) => { + const clientTime = new Date() + + return ctx.next({ + context: { + clientTime, + }, + sendContext: { + clientTime, + }, + }) + }) + .server(async (ctx) => { + const serverTime = new Date() + + return ctx.next({ + sendContext: { + serverTime, + durationToServer: + serverTime.getTime() - ctx.context.clientTime.getTime(), + }, + }) + }) + +export const logMiddleware = createMiddleware({ type: 'function' }) + .middleware([preLogMiddleware]) + .client(async (ctx) => { + const res = await ctx.next() + + const now = new Date() + console.log('Client Req/Res:', { + duration: now.getTime() - res.context.clientTime.getTime(), + durationToServer: res.context.durationToServer, + durationFromServer: now.getTime() - res.context.serverTime.getTime(), + }) + + return res + }) diff --git a/examples/react/start-basic-rsbuild/src/utils/posts.tsx b/examples/react/start-basic-rsbuild/src/utils/posts.tsx new file mode 100644 index 0000000000..ea7dd0a721 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/utils/posts.tsx @@ -0,0 +1,40 @@ +import { notFound } from '@tanstack/react-router' +import { createServerFn } from '@tanstack/react-start' + +export type PostType = { + id: number + title: string + body: string +} + +export const fetchPost = createServerFn({ method: 'POST' }) + .validator((d: string) => d) + .handler(async ({ data }) => { + console.info(`Fetching post with id ${data}...`) + const res = await fetch( + `https://jsonplaceholder.typicode.com/posts/${data}`, + ) + if (!res.ok) { + if (res.status === 404) { + throw notFound() + } + + throw new Error('Failed to fetch post') + } + + const post = await res.json() + + return post as PostType + }) + +export const fetchPosts = createServerFn().handler(async () => { + console.info('Fetching posts...') + const res = await fetch('https://jsonplaceholder.typicode.com/posts') + if (!res.ok) { + throw new Error('Failed to fetch posts') + } + + const posts = await res.json() + + return (posts as Array).slice(0, 10) +}) diff --git a/examples/react/start-basic-rsbuild/src/utils/seo.ts b/examples/react/start-basic-rsbuild/src/utils/seo.ts new file mode 100644 index 0000000000..d18ad84b74 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/utils/seo.ts @@ -0,0 +1,33 @@ +export const seo = ({ + title, + description, + keywords, + image, +}: { + title: string + description?: string + image?: string + keywords?: string +}) => { + const tags = [ + { title }, + { name: 'description', content: description }, + { name: 'keywords', content: keywords }, + { name: 'twitter:title', content: title }, + { name: 'twitter:description', content: description }, + { name: 'twitter:creator', content: '@tannerlinsley' }, + { name: 'twitter:site', content: '@tannerlinsley' }, + { name: 'og:type', content: 'website' }, + { name: 'og:title', content: title }, + { name: 'og:description', content: description }, + ...(image + ? [ + { name: 'twitter:image', content: image }, + { name: 'twitter:card', content: 'summary_large_image' }, + { name: 'og:image', content: image }, + ] + : []), + ] + + return tags +} diff --git a/examples/react/start-basic-rsbuild/src/utils/users.tsx b/examples/react/start-basic-rsbuild/src/utils/users.tsx new file mode 100644 index 0000000000..7ba645b383 --- /dev/null +++ b/examples/react/start-basic-rsbuild/src/utils/users.tsx @@ -0,0 +1,5 @@ +export type User = { + id: number + name: string + email: string +} diff --git a/examples/react/start-basic-rsbuild/tsconfig.json b/examples/react/start-basic-rsbuild/tsconfig.json new file mode 100644 index 0000000000..cc479423a1 --- /dev/null +++ b/examples/react/start-basic-rsbuild/tsconfig.json @@ -0,0 +1,21 @@ +{ + "include": ["**/*.ts", "**/*.tsx", "**/*.d.ts"], + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["DOM", "DOM.Iterable", "ES2024"], + "isolatedModules": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "target": "ES2024", + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "~/*": ["./src/*"] + }, + "noEmit": true + } +} diff --git a/examples/react/start-basic-static/package.json b/examples/react/start-basic-static/package.json index 9bb5be6c25..58d573ca36 100644 --- a/examples/react/start-basic-static/package.json +++ b/examples/react/start-basic-static/package.json @@ -10,10 +10,10 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", - "@tanstack/start-static-server-functions": "^1.167.19", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", + "@tanstack/start-static-server-functions": "^1.167.44", "@vitejs/plugin-react": "^6.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -26,7 +26,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-basic/package.json b/examples/react/start-basic/package.json index 86d047a7cf..46df8e4650 100644 --- a/examples/react/start-basic/package.json +++ b/examples/react/start-basic/package.json @@ -10,9 +10,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "tailwind-merge": "^3.6.0", @@ -24,9 +24,10 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "nitro": "^3.0.260311-beta", + "nitro": "^3.0.260903-beta", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-bun/package.json b/examples/react/start-bun/package.json index c2463684e4..24f7113912 100644 --- a/examples/react/start-bun/package.json +++ b/examples/react/start-bun/package.json @@ -15,11 +15,11 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/react-devtools": "^0.7.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-router-ssr-query": "^1.167.1", - "@tanstack/react-start": "^1.168.32", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-router-ssr-query": "^1.167.3", + "@tanstack/react-start": "^1.169.6", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.1.1", "react-dom": "^19.1.1", "tailwindcss": "^4.2.2" @@ -35,9 +35,10 @@ "@vitejs/plugin-react": "^6.0.1", "jsdom": "^27.0.0", "prettier": "^3.6.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", - "vitest": "^4.1.4", + "vitest": "^5.0.4", "web-vitals": "^5.1.0" } } diff --git a/examples/react/start-clerk-basic/package.json b/examples/react/start-clerk-basic/package.json index 3b55631b43..022300e159 100644 --- a/examples/react/start-clerk-basic/package.json +++ b/examples/react/start-clerk-basic/package.json @@ -11,14 +11,14 @@ }, "dependencies": { "@clerk/tanstack-react-start": "^0.27.14", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "@vitejs/plugin-react": "^6.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", - "srvx": "^0.11.9", + "srvx": "^1.0.0", "tailwind-merge": "^3.6.0" }, "devDependencies": { @@ -27,7 +27,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-clerk-basic/src/routes/_authed.tsx b/examples/react/start-clerk-basic/src/routes/_authed.tsx index 1a97917c12..04f8196894 100644 --- a/examples/react/start-clerk-basic/src/routes/_authed.tsx +++ b/examples/react/start-clerk-basic/src/routes/_authed.tsx @@ -8,7 +8,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return (
diff --git a/examples/react/start-convex-trellaux/package.json b/examples/react/start-convex-trellaux/package.json index 1292a1ab84..3452f910d0 100644 --- a/examples/react/start-convex-trellaux/package.json +++ b/examples/react/start-convex-trellaux/package.json @@ -13,12 +13,12 @@ }, "dependencies": { "@convex-dev/react-query": "0.0.0-alpha.8", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-router-ssr-query": "^1.167.1", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-router-ssr-query": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "concurrently": "^8.2.2", "convex": "^1.19.0", "ky": "^1.7.4", @@ -37,7 +37,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-counter/package.json b/examples/react/start-counter/package.json index 4e47d36b1d..8f4673143e 100644 --- a/examples/react/start-counter/package.json +++ b/examples/react/start-counter/package.json @@ -10,9 +10,9 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0" }, @@ -21,7 +21,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-i18n-paraglide/package.json b/examples/react/start-i18n-paraglide/package.json index f4df4b1c73..074f714d5c 100644 --- a/examples/react/start-i18n-paraglide/package.json +++ b/examples/react/start-i18n-paraglide/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tanstack/react-devtools": "^0.7.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.1.1", "react-dom": "^19.1.1" }, @@ -21,10 +21,22 @@ "@types/react": "^19.1.13", "@types/react-dom": "^19.1.9", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@tailwindcss/vite": "^4.2.2", "tailwindcss": "^4.2.2", "@inlang/paraglide-js": "^2.4.0" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/examples/react/start-large/package.json b/examples/react/start-large/package.json index 3a074bcdc9..f9f86b81d1 100644 --- a/examples/react/start-large/package.json +++ b/examples/react/start-large/package.json @@ -12,10 +12,10 @@ "test:types": "tsc --extendedDiagnostics" }, "dependencies": { - "@tanstack/react-query": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-query": "^5.102.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -29,7 +29,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" }, "keywords": [], diff --git a/examples/react/start-material-ui/package.json b/examples/react/start-material-ui/package.json index ffc392e847..1647e95f20 100644 --- a/examples/react/start-material-ui/package.json +++ b/examples/react/start-material-ui/package.json @@ -15,9 +15,9 @@ "@emotion/styled": "11.14.0", "@fontsource-variable/roboto": "5.2.5", "@mui/material": "6.4.7", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "zod": "^4.4.3" @@ -27,7 +27,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-material-ui/src/router.tsx b/examples/react/start-material-ui/src/router.tsx index a464233af9..6f82cbf378 100644 --- a/examples/react/start-material-ui/src/router.tsx +++ b/examples/react/start-material-ui/src/router.tsx @@ -5,7 +5,9 @@ export function getRouter() { const router = createRouter({ routeTree, defaultPreload: 'intent', - defaultErrorComponent: (err) =>

{err.error.stack}

, + defaultErrorComponent: (err) => ( +

{err.error instanceof Error ? err.error.stack : String(err.error)}

+ ), defaultNotFoundComponent: () =>

not found

, scrollRestoration: true, }) diff --git a/examples/react/start-nativescript/.gitignore b/examples/react/start-nativescript/.gitignore deleted file mode 100644 index 8f5cecc7e2..0000000000 --- a/examples/react/start-nativescript/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# NativeScript -.ns-vite-build/ -hooks/ -platforms/ diff --git a/examples/react/start-nativescript/App_Resources/Android/app.gradle b/examples/react/start-nativescript/App_Resources/Android/app.gradle deleted file mode 100644 index d48019790b..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/app.gradle +++ /dev/null @@ -1,25 +0,0 @@ -// You can add your native dependencies here -dependencies { -// implementation 'androidx.multidex:multidex:2.0.1' -} - -android { - compileSdkVersion 35 - buildToolsVersion "35" - // ndkVersion "" - - defaultConfig { - minSdkVersion 24 - targetSdkVersion 35 - - // Version Information - versionCode 1 - versionName "1.0.0" - - generatedDensities = [] - } - - aaptOptions { - additionalParameters "--no-version-vectors" - } -} diff --git a/examples/react/start-nativescript/App_Resources/Android/before-plugins.gradle b/examples/react/start-nativescript/App_Resources/Android/before-plugins.gradle deleted file mode 100644 index 9faffb8114..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/before-plugins.gradle +++ /dev/null @@ -1,15 +0,0 @@ -// this configurations is loaded before building plugins, as well as before building -// the app - this is where you can apply global settings and overrides - -project.ext { - // androidXAppCompat = "1.4.1" - // androidXExifInterface = "1.3.3" - // androidXFragment = "1.4.1" - // androidXMaterial = "1.5.0" - // androidXMultidex = "2.0.1" - // androidXTransition = "1.4.1" - // androidXViewPager = "1.0.0" - - // useKotlin = true - // kotlinVersion = "1.6.0" -} diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/AndroidManifest.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/AndroidManifest.xml deleted file mode 100644 index 7af126eccc..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/background.png deleted file mode 100644 index bbefbf42a4..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/logo.png deleted file mode 100644 index e788deb314..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-hdpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/background.png deleted file mode 100644 index f6a08eea59..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/logo.png deleted file mode 100644 index e4cac1adb9..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-ldpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/background.png deleted file mode 100644 index 0c90f0f799..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/logo.png deleted file mode 100644 index ce3c3a4b4f..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-mdpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml deleted file mode 100644 index ada77f92ce..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/background.png deleted file mode 100644 index 3541570c1c..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png deleted file mode 100644 index 88267df023..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png deleted file mode 100644 index abb0fc7047..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png deleted file mode 100644 index 55800c9ab9..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png deleted file mode 100644 index 108977520c..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png deleted file mode 100644 index 0703f90f43..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index fd826a314f..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 7353dbd1fd..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 69948d224f..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 90a58cd717..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 70a2a0d041..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 1ee5a94136..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 66e9d4bb26..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/colors.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/colors.xml deleted file mode 100644 index da5ca2fe96..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/colors.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/styles.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/styles.xml deleted file mode 100644 index 04d8a065df..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml deleted file mode 100644 index e3c3e148ca..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/colors.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/colors.xml deleted file mode 100644 index ea02632534..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/colors.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - #F5F5F5 - - - #757575 - - - #65ADF1 - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fdf..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/styles.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/styles.xml deleted file mode 100644 index 4f91b610a1..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/values/styles.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/examples/react/start-nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml b/examples/react/start-nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml deleted file mode 100644 index e9b6aa1508..0000000000 --- a/examples/react/start-nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - 10.0.2.2 - localhost - - diff --git a/examples/react/start-nativescript/App_Resources/LICENSE b/examples/react/start-nativescript/App_Resources/LICENSE deleted file mode 100644 index 216f6d024b..0000000000 --- a/examples/react/start-nativescript/App_Resources/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of such Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) 2015-2019 Progress Software Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/examples/react/start-nativescript/App_Resources/NOTICE b/examples/react/start-nativescript/App_Resources/NOTICE deleted file mode 100644 index 78faff35c0..0000000000 --- a/examples/react/start-nativescript/App_Resources/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -The App_Resources directory is derived from @nativescript/template-blank -version 9.0.0, maintained by the NativeScript team: - -https://github.com/NativeScript/nativescript-app-templates - -The files have been modified for the TanStack NativeScript scaffold. The -original resources are licensed under the Apache License 2.0 included in this -directory. diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 6d19987b31..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images": [ - { - "size": "20x20", - "idiom": "iphone", - "filename": "icon-20@2x.png", - "scale": "2x" - }, - { - "size": "20x20", - "idiom": "iphone", - "filename": "icon-20@3x.png", - "scale": "3x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29.png", - "scale": "1x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29@2x.png", - "scale": "2x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29@3x.png", - "scale": "3x" - }, - { - "size": "40x40", - "idiom": "iphone", - "filename": "icon-40@2x.png", - "scale": "2x" - }, - { - "size": "40x40", - "idiom": "iphone", - "filename": "icon-40@3x.png", - "scale": "3x" - }, - { - "size": "60x60", - "idiom": "iphone", - "filename": "icon-60@2x.png", - "scale": "2x" - }, - { - "size": "60x60", - "idiom": "iphone", - "filename": "icon-60@3x.png", - "scale": "3x" - }, - { - "size": "20x20", - "idiom": "ipad", - "filename": "icon-20.png", - "scale": "1x" - }, - { - "size": "20x20", - "idiom": "ipad", - "filename": "icon-20@2x.png", - "scale": "2x" - }, - { - "size": "29x29", - "idiom": "ipad", - "filename": "icon-29.png", - "scale": "1x" - }, - { - "size": "29x29", - "idiom": "ipad", - "filename": "icon-29@2x.png", - "scale": "2x" - }, - { - "size": "40x40", - "idiom": "ipad", - "filename": "icon-40.png", - "scale": "1x" - }, - { - "size": "40x40", - "idiom": "ipad", - "filename": "icon-40@2x.png", - "scale": "2x" - }, - { - "size": "76x76", - "idiom": "ipad", - "filename": "icon-76.png", - "scale": "1x" - }, - { - "size": "76x76", - "idiom": "ipad", - "filename": "icon-76@2x.png", - "scale": "2x" - }, - { - "size": "83.5x83.5", - "idiom": "ipad", - "filename": "icon-83.5@2x.png", - "scale": "2x" - }, - { - "size": "1024x1024", - "idiom": "ios-marketing", - "filename": "icon-1024.png", - "scale": "1x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png deleted file mode 100644 index b46c8bb2f7..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png deleted file mode 100644 index d73288a7f4..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png deleted file mode 100644 index c8d24cdc75..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png deleted file mode 100644 index 1b00c84854..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png deleted file mode 100644 index 72a164103c..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png deleted file mode 100644 index 05ab752b86..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png deleted file mode 100644 index ee72082583..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png deleted file mode 100644 index 2859288b88..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png deleted file mode 100644 index 88824fa7ca..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png deleted file mode 100644 index 02a930cc79..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png deleted file mode 100644 index d7b077f1b6..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png deleted file mode 100644 index 2f872dd4e6..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png deleted file mode 100644 index 7fb23a706a..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png deleted file mode 100644 index cb04c367d0..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png deleted file mode 100644 index e882226b2d..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/Contents.json b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/Contents.json deleted file mode 100644 index 97a8662ebd..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json deleted file mode 100644 index 9180be41d0..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill.png", - "scale": "1x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill@2x.png", - "scale": "2x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill@3x.png", - "scale": "3x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png deleted file mode 100644 index cb35cfae14..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png deleted file mode 100644 index 6eefb9a762..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png deleted file mode 100644 index 0ef5102069..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json deleted file mode 100644 index 7a03e93a60..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "filename": "LaunchScreen-Center.png", - "scale": "1x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-Center@2x.png", - "scale": "2x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-Center@3x.png", - "scale": "3x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png deleted file mode 100644 index 280c30e083..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png deleted file mode 100644 index f984b9e44d..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png b/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png deleted file mode 100644 index 95d86f3f76..0000000000 Binary files a/examples/react/start-nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png and /dev/null differ diff --git a/examples/react/start-nativescript/App_Resources/iOS/Info.plist b/examples/react/start-nativescript/App_Resources/iOS/Info.plist deleted file mode 100644 index 43cd6b1f2b..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsLocalNetworking - - - UILaunchStoryboardName - LaunchScreen - UIRequiresFullScreen - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/react/start-nativescript/App_Resources/iOS/LaunchScreen.storyboard b/examples/react/start-nativescript/App_Resources/iOS/LaunchScreen.storyboard deleted file mode 100644 index c4e5a3f394..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/LaunchScreen.storyboard +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/react/start-nativescript/App_Resources/iOS/build.xcconfig b/examples/react/start-nativescript/App_Resources/iOS/build.xcconfig deleted file mode 100644 index eb70be2dfb..0000000000 --- a/examples/react/start-nativescript/App_Resources/iOS/build.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// You can add custom settings here -// for example you can uncomment the following line to force distribution code signing -// CODE_SIGN_IDENTITY = iPhone Distribution -// To build for device with XCode you need to specify your development team. -// DEVELOPMENT_TEAM = YOUR_TEAM_ID; -ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; -IPHONEOS_DEPLOYMENT_TARGET = 16.0; diff --git a/examples/react/start-nativescript/README.md b/examples/react/start-nativescript/README.md deleted file mode 100644 index 405f88cfb0..0000000000 --- a/examples/react/start-nativescript/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# TanStack Start + NativeScript - -This example uses one generated route tree for a TanStack Start web app and a -NativeScript React app. Route definitions, params, search validation, loaders, -and server functions are shared. Web and NativeScript screen modules are paired -with the `*-native.tsx` convention. - -```sh -pnpm dev -pnpm native:ios -pnpm native:android -``` - -The native commands start the Start development server and the NativeScript -debug build together. Production native builds run in release mode and must set -`TSS_SERVER_FN_BASE` to the absolute HTTPS server-function endpoint. Android -release builds also require NativeScript's four `--key-store-*` signing -arguments. - -NativeScript renders native `Frame`, `Page`, `ActionBar`, and layout views. It is -not a WebView. iOS interactive swipe-back is provided by the native `Page` -navigation stack. Each retained page renders from its own Router state snapshot, -so its header, search params, loader data, and nested matches remain available -during the gesture. - -The web root route is replaced only in the native bundle. Imports such as -`screens/HomeScreen` resolve to `HomeScreen-native.tsx`, while route and server -modules stay shared. This is the intended migration boundary: DOM and CSS are -not translated into NativeScript controls. - -The stable NativeScript Vite 2 integration currently requires Vite 7. This -example pins Vite 7.3.6 while the rest of the monorepo can use Vite 8. diff --git a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.pbxproj b/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.pbxproj deleted file mode 100644 index 19088daf5e..0000000000 --- a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.pbxproj +++ /dev/null @@ -1,282 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 77; - objects = { - -/* Begin PBXBuildFile section */ - D51F55A524E256DA84BA0435 /* NativeScriptRouterUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A25C0F66A59067CD9CCCD00D /* NativeScriptRouterUITests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - A25C0F66A59067CD9CCCD00D /* NativeScriptRouterUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeScriptRouterUITests.swift; sourceTree = ""; }; - FC0E1B77E45370C9FADC8179 /* NativeScriptRouterUITests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = NativeScriptRouterUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXGroup section */ - 81B58CE263FE91560E017FC4 /* Tests */ = { - isa = PBXGroup; - children = ( - A25C0F66A59067CD9CCCD00D /* NativeScriptRouterUITests.swift */, - ); - path = Tests; - sourceTree = ""; - }; - BF6698EA9F941A55CE2EF4A4 /* Products */ = { - isa = PBXGroup; - children = ( - FC0E1B77E45370C9FADC8179 /* NativeScriptRouterUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - DB0C582CFC7FEE5FEE655578 = { - isa = PBXGroup; - children = ( - 81B58CE263FE91560E017FC4 /* Tests */, - BF6698EA9F941A55CE2EF4A4 /* Products */, - ); - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 90BCEAE87E341FEABF0B22D5 /* NativeScriptRouterUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = FA09C17EF770BFEA45112ADD /* Build configuration list for PBXNativeTarget "NativeScriptRouterUITests" */; - buildPhases = ( - A4423865CC869612DB1AD187 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = NativeScriptRouterUITests; - packageProductDependencies = ( - ); - productName = NativeScriptRouterUITests; - productReference = FC0E1B77E45370C9FADC8179 /* NativeScriptRouterUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 13B47769A581BCDFB2EAD205 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; - TargetAttributes = { - }; - }; - buildConfigurationList = 0BDA3F0B9CABF7E9AB9C183C /* Build configuration list for PBXProject "NativeScriptRouterUITests" */; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = DB0C582CFC7FEE5FEE655578; - minimizedProjectReferenceProxies = 1; - preferredProjectObjectVersion = 77; - productRefGroup = BF6698EA9F941A55CE2EF4A4 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 90BCEAE87E341FEABF0B22D5 /* NativeScriptRouterUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - A4423865CC869612DB1AD187 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D51F55A524E256DA84BA0435 /* NativeScriptRouterUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 495903DB40BCDB92FD228A00 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 18.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 4FB85D04C7B6C7BE8B89F185 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 18.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - D3F35B75540DBC96C94F605F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.tanstack.startnativescript.uitests; - SDKROOT = iphoneos; - SWIFT_VERSION = 6.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - FBA9B434CB28BDDF89AF3CE0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.tanstack.startnativescript.uitests; - SDKROOT = iphoneos; - SWIFT_VERSION = 6.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0BDA3F0B9CABF7E9AB9C183C /* Build configuration list for PBXProject "NativeScriptRouterUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4FB85D04C7B6C7BE8B89F185 /* Debug */, - 495903DB40BCDB92FD228A00 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - FA09C17EF770BFEA45112ADD /* Build configuration list for PBXNativeTarget "NativeScriptRouterUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D3F35B75540DBC96C94F605F /* Debug */, - FBA9B434CB28BDDF89AF3CE0 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = 13B47769A581BCDFB2EAD205 /* Project object */; -} diff --git a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a625..0000000000 --- a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/xcshareddata/xcschemes/NativeScriptRouterUITests.xcscheme b/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/xcshareddata/xcschemes/NativeScriptRouterUITests.xcscheme deleted file mode 100644 index 4aeb8f4f72..0000000000 --- a/examples/react/start-nativescript/e2e/ios/NativeScriptRouterUITests.xcodeproj/xcshareddata/xcschemes/NativeScriptRouterUITests.xcscheme +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/react/start-nativescript/e2e/ios/Tests/NativeScriptRouterUITests.swift b/examples/react/start-nativescript/e2e/ios/Tests/NativeScriptRouterUITests.swift deleted file mode 100644 index 0e440131dc..0000000000 --- a/examples/react/start-nativescript/e2e/ios/Tests/NativeScriptRouterUITests.swift +++ /dev/null @@ -1,106 +0,0 @@ -import XCTest - -@MainActor -final class NativeScriptRouterUITests: XCTestCase { - private let app = XCUIApplication(bundleIdentifier: "com.tanstack.startnativescript") - - override func setUpWithError() throws { - continueAfterFailure = false - app.launch() - } - - override func tearDownWithError() throws { - app.terminate() - } - - func testNativeStackAndInteractiveBackSwipe() { - assertVisible("TanStack Native") - assertVisible("This value came from a TanStack Start server function.", timeout: 20) - - tap("Open Router") - assertVisible("PATH PARAM + NATIVE STACK") - - tap("Search this topic") - assertVisible("SEARCH PARAMS + SERVER FUNCTION") - assertVisible("Results for “TanStack Router”") - - swipeBack() - assertVisible("PATH PARAM + NATIVE STACK") - - swipeBack() - assertVisible("ONE ROUTE TREE") - } - - func testSearchEntriesReuseTheNativeStack() { - assertVisible("TanStack Native") - - tap("Search native") - assertVisible("Results for “native”") - - tap("Search Router") - assertVisible("Results for “router”") - - tap("Search Start") - assertVisible("Results for “start”") - - tap("Search Router") - assertVisible("Results for “router”") - - swipeBack() - assertVisible("Results for “native”") - - swipeBack() - assertVisible("ONE ROUTE TREE") - } - - func testRouteBlockerControlsInteractiveBackSwipe() { - assertVisible("TanStack Native") - - tap("Open Router") - assertVisible("PATH PARAM + NATIVE STACK") - - tap("Protect back") - assertVisible("Back protected") - - swipeBack() - assertVisible("PATH PARAM + NATIVE STACK") - assertVisible("Back protected") - - tap("Allow back") - assertVisible("Protect back") - - swipeBack() - assertVisible("ONE ROUTE TREE") - } - - private func tap(_ label: String) { - let element = matchingLabel(label) - XCTAssertTrue(element.waitForExistence(timeout: 10), "Expected \(label) to be tappable") - element.tap() - } - - private func assertVisible(_ label: String, timeout: TimeInterval = 10) { - XCTAssertTrue( - matchingLabel(label).waitForExistence(timeout: timeout), - "Expected \(label) to be visible" - ) - } - - private func matchingLabel(_ label: String) -> XCUIElement { - app.descendants(matching: .any) - .matching(NSPredicate(format: "label == %@", label)) - .firstMatch - } - - private func swipeBack() { - let start = app.coordinate(withNormalizedOffset: CGVector(dx: 0.01, dy: 0.5)) - let end = app.coordinate(withNormalizedOffset: CGVector(dx: 0.9, dy: 0.5)) - - start.press( - forDuration: 0.05, - thenDragTo: end, - withVelocity: .fast, - thenHoldForDuration: 0 - ) - } -} diff --git a/examples/react/start-nativescript/e2e/ios/project.yml b/examples/react/start-nativescript/e2e/ios/project.yml deleted file mode 100644 index db727be1d8..0000000000 --- a/examples/react/start-nativescript/e2e/ios/project.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: NativeScriptRouterUITests - -options: - deploymentTarget: - iOS: '18.0' - -targets: - NativeScriptRouterUITests: - type: bundle.ui-testing - platform: iOS - sources: - - Tests - settings: - base: - GENERATE_INFOPLIST_FILE: YES - PRODUCT_BUNDLE_IDENTIFIER: com.tanstack.startnativescript.uitests - SWIFT_VERSION: '6.0' - -schemes: - NativeScriptRouterUITests: - build: - targets: - NativeScriptRouterUITests: test - test: - targets: - - NativeScriptRouterUITests diff --git a/examples/react/start-nativescript/e2e/run-android.mjs b/examples/react/start-nativescript/e2e/run-android.mjs deleted file mode 100644 index 54ae1d4bc4..0000000000 --- a/examples/react/start-nativescript/e2e/run-android.mjs +++ /dev/null @@ -1,554 +0,0 @@ -import { access, readFile, readdir } from 'node:fs/promises' -import { constants } from 'node:fs' -import { homedir } from 'node:os' -import { createServer } from 'node:net' -import { dirname, join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { spawn } from 'node:child_process' - -const exampleRoot = dirname(dirname(fileURLToPath(import.meta.url))) -const applicationId = 'com.tanstack.startnativescript' -const uiDumpPath = '/sdcard/tanstack-router-window.xml' - -let adb -let deviceId -let emulator -let nativeScript -let reversePort -let server - -function run(command, args, options = {}) { - const { - allowFailure = false, - capture = false, - env = process.env, - silent = false, - } = options - - return new Promise((resolve, reject) => { - const child = spawn(command, args, { - cwd: exampleRoot, - env, - stdio: capture - ? ['ignore', 'pipe', silent ? 'ignore' : 'inherit'] - : silent - ? 'ignore' - : 'inherit', - }) - let stdout = '' - - child.stdout?.on('data', (chunk) => { - stdout += chunk - }) - child.on('error', reject) - child.on('exit', (code, signal) => { - if (code === 0 || allowFailure) { - resolve(stdout) - return - } - - reject( - new Error( - `${command} exited with ${signal ? `signal ${signal}` : `code ${code}`}`, - ), - ) - }) - }) -} - -async function isExecutable(file) { - if (!file) { - return false - } - - try { - await access(file, constants.X_OK) - return true - } catch { - return false - } -} - -async function findCommand(name, candidates = []) { - for (const candidate of candidates) { - if (await isExecutable(candidate)) { - return candidate - } - } - - const resolved = ( - await run('/usr/bin/env', ['which', name], { - allowFailure: true, - capture: true, - silent: true, - }) - ).trim() - if (await isExecutable(resolved)) { - return resolved - } - - throw new Error(`Unable to find ${name}. Run \`ns setup android\` first.`) -} - -async function getAndroidTools() { - const sdkRoots = [ - process.env.ANDROID_HOME, - process.env.ANDROID_SDK_ROOT, - join(homedir(), 'Library', 'Android', 'sdk'), - '/opt/homebrew/share/android-commandlinetools', - '/usr/local/share/android-commandlinetools', - ].filter(Boolean) - - const adbCommand = await findCommand( - 'adb', - sdkRoots.map((root) => join(root, 'platform-tools', 'adb')), - ) - - return { - adb: adbCommand, - emulator: await findCommand( - 'emulator', - sdkRoots.map((root) => join(root, 'emulator', 'emulator')), - ), - sdkRoot: dirname(dirname(adbCommand)), - } -} - -async function getJavaHome() { - if (process.env.JAVA_HOME) { - return process.env.JAVA_HOME - } - - const javaHome = ( - await run('/usr/libexec/java_home', ['-v', '17'], { - allowFailure: true, - capture: true, - silent: true, - }) - ).trim() - if (javaHome) { - return javaHome - } - - const brewPrefix = ( - await run('brew', ['--prefix', 'openjdk@17'], { - allowFailure: true, - capture: true, - silent: true, - }) - ).trim() - const brewJavaHome = join( - brewPrefix, - 'libexec', - 'openjdk.jdk', - 'Contents', - 'Home', - ) - if (brewPrefix && (await isExecutable(join(brewJavaHome, 'bin', 'java')))) { - return brewJavaHome - } - - throw new Error('Unable to find JDK 17. Run `ns setup android` first.') -} - -function parseDevices(output) { - return output - .split('\n') - .slice(1) - .map((line) => line.trim().split(/\s+/)) - .filter(([, state]) => state === 'device') - .map(([id]) => id) -} - -async function listDevices() { - return parseDevices( - await run(adb, ['devices'], { capture: true, silent: true }), - ) -} - -async function waitForDevice(requestedId) { - const deadline = Date.now() + 180_000 - - while (Date.now() < deadline) { - const devices = await listDevices() - const selected = requestedId - ? devices.find((id) => id === requestedId) - : (devices.find((id) => id.startsWith('emulator-')) ?? devices[0]) - if (selected) { - const booted = ( - await run( - adb, - ['-s', selected, 'shell', 'getprop', 'sys.boot_completed'], - { - allowFailure: true, - capture: true, - silent: true, - }, - ) - ).trim() - if (booted === '1') { - return selected - } - } - - await new Promise((resolve) => setTimeout(resolve, 1_000)) - } - - throw new Error('Timed out waiting for an Android device to boot') -} - -async function getDevice(emulatorCommand) { - const requestedId = process.env.TSS_ANDROID_DEVICE_ID - const connected = await listDevices() - const selected = requestedId - ? connected.find((id) => id === requestedId) - : (connected.find((id) => id.startsWith('emulator-')) ?? connected[0]) - if (selected) { - return waitForDevice(selected) - } - - const avds = (await run(emulatorCommand, ['-list-avds'], { capture: true })) - .split('\n') - .map((name) => name.trim()) - .filter(Boolean) - const avd = process.env.TSS_ANDROID_AVD ?? avds[0] - if (!avd) { - throw new Error('No Android device or AVD is available') - } - - emulator = spawn( - emulatorCommand, - [ - '-avd', - avd, - '-no-window', - '-no-audio', - '-no-boot-anim', - '-gpu', - 'swiftshader_indirect', - ], - { cwd: exampleRoot, env: process.env, stdio: 'inherit' }, - ) - - return waitForDevice(requestedId) -} - -async function getFreePort() { - return new Promise((resolve, reject) => { - const socket = createServer() - socket.unref() - socket.on('error', reject) - socket.listen(0, '127.0.0.1', () => { - const address = socket.address() - if (!address || typeof address === 'string') { - reject(new Error('Unable to reserve a local port')) - return - } - - socket.close(() => resolve(address.port)) - }) - }) -} - -async function waitForServer(url) { - const deadline = Date.now() + 60_000 - - while (Date.now() < deadline) { - try { - const response = await fetch(url) - if (response.ok) { - return - } - } catch { - // The server is still starting. - } - - await new Promise((resolve) => setTimeout(resolve, 250)) - } - - throw new Error(`Timed out waiting for ${url}`) -} - -function decodeXml(value) { - return value - .replace(/&#x([\da-f]+);/gi, (_, hex) => - String.fromCodePoint(Number.parseInt(hex, 16)), - ) - .replace(/&#(\d+);/g, (_, decimal) => - String.fromCodePoint(Number.parseInt(decimal, 10)), - ) - .replaceAll('"', '"') - .replaceAll(''', "'") - .replaceAll('<', '<') - .replaceAll('>', '>') - .replaceAll('&', '&') -} - -function parseNodes(xml) { - return [...xml.matchAll(/]*)\/?\s*>/g)].map((nodeMatch) => { - const attributes = {} - for (const attribute of nodeMatch[1].matchAll(/([\w-]+)="([^"]*)"/g)) { - attributes[attribute[1]] = decodeXml(attribute[2]) - } - return attributes - }) -} - -async function dumpUi() { - await run(adb, ['-s', deviceId, 'shell', 'rm', '-f', uiDumpPath], { - allowFailure: true, - silent: true, - }) - await run(adb, ['-s', deviceId, 'shell', 'uiautomator', 'dump', uiDumpPath], { - allowFailure: true, - silent: true, - }) - return run(adb, ['-s', deviceId, 'shell', 'cat', uiDumpPath], { - allowFailure: true, - capture: true, - silent: true, - }) -} - -function matchingNode(nodes, label) { - return nodes.find( - (node) => node.text === label || node['content-desc'] === label, - ) -} - -async function waitForLabel(label, timeout = 20_000) { - const deadline = Date.now() + timeout - - while (Date.now() < deadline) { - if (nativeScript?.exitCode !== null) { - throw new Error( - `NativeScript exited before ${JSON.stringify(label)} appeared (code ${nativeScript.exitCode})`, - ) - } - - const node = matchingNode(parseNodes(await dumpUi()), label) - if (node) { - return node - } - - await new Promise((resolve) => setTimeout(resolve, 500)) - } - - throw new Error(`Timed out waiting for ${JSON.stringify(label)}`) -} - -async function tap(label) { - const node = await waitForLabel(label) - const bounds = node.bounds?.match(/^\[(\d+),(\d+)]\[(\d+),(\d+)]$/) - if (!bounds) { - throw new Error(`Unable to determine bounds for ${JSON.stringify(label)}`) - } - - const x = Math.round((Number(bounds[1]) + Number(bounds[3])) / 2) - const y = Math.round((Number(bounds[2]) + Number(bounds[4])) / 2) - await run(adb, ['-s', deviceId, 'shell', 'input', 'tap', `${x}`, `${y}`]) -} - -async function back() { - await run(adb, ['-s', deviceId, 'shell', 'input', 'keyevent', 'KEYCODE_BACK']) -} - -async function testNativeStack() { - await waitForLabel('TanStack Native', 180_000) - await waitForLabel( - 'This value came from a TanStack Start server function.', - 30_000, - ) - - await tap('Open Router') - await waitForLabel('PATH PARAM + NATIVE STACK') - await waitForLabel('Back') - - await tap('Search this topic') - await waitForLabel('SEARCH PARAMS + SERVER FUNCTION') - await waitForLabel('Results for “TanStack Router”') - await waitForLabel('Back') - - await tap('Back') - await waitForLabel('PATH PARAM + NATIVE STACK') - - await back() - await waitForLabel('ONE ROUTE TREE') -} - -async function assertNoBrowserElementWarnings() { - const logs = await run(adb, ['-s', deviceId, 'logcat', '-d', '-v', 'brief'], { - capture: true, - silent: true, - }) - - if (logs.includes("[UNDOM-NG] Element type 'link' is not registered.")) { - throw new Error('The native bundle initialized Vite browser preload links') - } -} - -async function assertNoBrowserPreloadCode() { - const buildDirectory = join(exampleRoot, '.ns-vite-build') - const modules = (await readdir(buildDirectory)).filter((file) => - file.endsWith('.mjs'), - ) - const affectedModules = [] - - for (const module of modules) { - const code = await readFile(join(buildDirectory, module), 'utf8') - if (/document\.createElement\((['"])link\1\)\.relList/.test(code)) { - affectedModules.push(module) - } - } - - if (affectedModules.length > 0) { - throw new Error( - `Native bundle contains Vite's browser preload probe: ${affectedModules.join(', ')}`, - ) - } -} - -async function testStackReuse() { - await tap('Search native') - await waitForLabel('Results for “native”') - - await tap('Search Router') - await waitForLabel('Results for “router”') - - await tap('Search Start') - await waitForLabel('Results for “start”') - - await tap('Search Router') - await waitForLabel('Results for “router”') - - await back() - await waitForLabel('Results for “native”') - - await back() - await waitForLabel('ONE ROUTE TREE') -} - -async function testRouteBlocker() { - await tap('Open Router') - await waitForLabel('PATH PARAM + NATIVE STACK') - - await tap('Protect back') - await waitForLabel('Back protected') - - await back() - await new Promise((resolve) => setTimeout(resolve, 500)) - await waitForLabel('PATH PARAM + NATIVE STACK') - await waitForLabel('Back protected') - - await tap('Allow back') - await waitForLabel('Protect back') - - await back() - await waitForLabel('ONE ROUTE TREE') -} - -function stopChild(child, signal) { - if (!child || child.killed || child.exitCode !== null) { - return - } - - child.kill(signal) -} - -function stopProcesses() { - stopChild(nativeScript, 'SIGINT') - stopChild(server, 'SIGTERM') - stopChild(emulator, 'SIGTERM') -} - -async function main() { - const tools = await getAndroidTools() - const javaHome = await getJavaHome() - adb = tools.adb - - await run(adb, ['start-server']) - deviceId = await getDevice(tools.emulator) - - const port = await getFreePort() - const origin = `http://127.0.0.1:${port}` - const serverHost = - process.env.TSS_ANDROID_SERVER_HOST ?? - (deviceId.startsWith('emulator-') ? '10.0.2.2' : '127.0.0.1') - const serverFunctionBase = `http://${serverHost}:${port}/_serverFn/` - const nativeEnvironment = { - ...process.env, - ANDROID_HOME: - process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT || tools.sdkRoot, - JAVA_HOME: javaHome, - TSS_NATIVE_PLATFORM: 'android', - TSS_SERVER_FN_BASE: serverFunctionBase, - } - - server = spawn( - 'pnpm', - [ - 'exec', - 'vite', - 'dev', - '--host', - '0.0.0.0', - '--port', - `${port}`, - '--strictPort', - ], - { cwd: exampleRoot, env: process.env, stdio: 'inherit' }, - ) - server.on('exit', (code) => { - if (code && code !== 0) { - process.exitCode = code - } - }) - - await waitForServer(origin) - if (serverHost === '127.0.0.1') { - await run(adb, ['-s', deviceId, 'reverse', `tcp:${port}`, `tcp:${port}`]) - reversePort = port - } - await run(adb, ['-s', deviceId, 'uninstall', applicationId], { - allowFailure: true, - silent: true, - }) - await run(adb, ['-s', deviceId, 'logcat', '-c'], { silent: true }) - - nativeScript = spawn( - 'pnpm', - ['exec', 'ns', 'debug', 'android', '--no-hmr', '--device', deviceId], - { cwd: exampleRoot, env: nativeEnvironment, stdio: 'inherit' }, - ) - - await testNativeStack() - await assertNoBrowserPreloadCode() - await testStackReuse() - await testRouteBlocker() - await assertNoBrowserElementWarnings() -} - -process.once('SIGINT', () => { - stopProcesses() - process.exit(130) -}) -process.once('SIGTERM', () => { - stopProcesses() - process.exit(143) -}) - -try { - await main() -} finally { - if (adb && deviceId && reversePort) { - await run( - adb, - ['-s', deviceId, 'reverse', '--remove', `tcp:${reversePort}`], - { - allowFailure: true, - silent: true, - }, - ) - } - stopProcesses() -} diff --git a/examples/react/start-nativescript/e2e/run-ios.mjs b/examples/react/start-nativescript/e2e/run-ios.mjs deleted file mode 100644 index ebc8d2b68a..0000000000 --- a/examples/react/start-nativescript/e2e/run-ios.mjs +++ /dev/null @@ -1,270 +0,0 @@ -import { readFile } from 'node:fs/promises' -import { createServer } from 'node:net' -import { dirname, join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { spawn } from 'node:child_process' - -const exampleRoot = dirname(dirname(fileURLToPath(import.meta.url))) -let server -let nativeScript - -function run(command, args, options = {}) { - const { - allowFailure = false, - capture = false, - env = process.env, - silent = false, - } = options - - return new Promise((resolve, reject) => { - const child = spawn(command, args, { - cwd: exampleRoot, - env, - stdio: capture - ? ['ignore', 'pipe', silent ? 'ignore' : 'inherit'] - : silent - ? 'ignore' - : 'inherit', - }) - let stdout = '' - - child.stdout?.on('data', (chunk) => { - stdout += chunk - }) - child.on('error', reject) - child.on('exit', (code, signal) => { - if (code === 0 || allowFailure) { - resolve(stdout) - return - } - - reject( - new Error( - `${command} exited with ${signal ? `signal ${signal}` : `code ${code}`}`, - ), - ) - }) - }) -} - -async function waitForNativeApp(simulatorId, serverFunctionBase) { - const deadline = Date.now() + 180_000 - - while (Date.now() < deadline) { - if (nativeScript.exitCode !== null) { - throw new Error( - `NativeScript exited before installing the app (code ${nativeScript.exitCode})`, - ) - } - - let bundle - try { - const appPath = ( - await run( - 'xcrun', - [ - 'simctl', - 'get_app_container', - simulatorId, - 'com.tanstack.startnativescript', - 'app', - ], - { capture: true, silent: true }, - ) - ).trim() - bundle = await readFile(join(appPath, 'app/bundle.mjs'), 'utf8') - } catch { - // NativeScript is still building or installing the app. - } - - if (bundle?.includes(serverFunctionBase)) { - if (/document\.createElement\((['"])link\1\)\.relList/.test(bundle)) { - throw new Error("Native bundle contains Vite's browser preload probe") - } - return - } - - await new Promise((resolve) => setTimeout(resolve, 500)) - } - - throw new Error('Timed out waiting for NativeScript to install the iOS app') -} - -async function getFreePort() { - return new Promise((resolve, reject) => { - const socket = createServer() - socket.unref() - socket.on('error', reject) - socket.listen(0, '127.0.0.1', () => { - const address = socket.address() - if (!address || typeof address === 'string') { - reject(new Error('Unable to reserve a local port')) - return - } - - socket.close(() => resolve(address.port)) - }) - }) -} - -async function waitForServer(url) { - const deadline = Date.now() + 60_000 - - while (Date.now() < deadline) { - try { - const response = await fetch(url) - if (response.ok) { - return - } - } catch { - // The server is still starting. - } - - await new Promise((resolve) => setTimeout(resolve, 250)) - } - - throw new Error(`Timed out waiting for ${url}`) -} - -function runtimeVersion(runtime) { - const match = runtime.match(/iOS-(\d+)-(\d+)/) - return match ? Number(match[1]) * 1_000 + Number(match[2]) : 0 -} - -async function getSimulator() { - const output = await run('xcrun', ['simctl', 'list', 'devices', '--json'], { - capture: true, - }) - const { devices } = JSON.parse(output) - const runtimes = Object.entries(devices) - .filter(([runtime]) => runtime.includes('.iOS-')) - .sort(([left], [right]) => runtimeVersion(right) - runtimeVersion(left)) - const allDevices = runtimes.flatMap(([, runtimeDevices]) => runtimeDevices) - const requestedId = process.env.TSS_IOS_SIMULATOR_ID - const requested = requestedId - ? allDevices.find((device) => device.udid === requestedId) - : undefined - const booted = allDevices.find( - (device) => - device.state === 'Booted' && - device.isAvailable !== false && - device.name.startsWith('iPhone'), - ) - const available = runtimes - .flatMap(([, runtimeDevices]) => runtimeDevices) - .find( - (device) => - device.isAvailable !== false && device.name.startsWith('iPhone'), - ) - const simulator = requested ?? booted ?? available - - if (!simulator) { - throw new Error('No available iPhone simulator was found') - } - - if (simulator.state !== 'Booted') { - await run('xcrun', ['simctl', 'boot', simulator.udid]) - } - await run('xcrun', ['simctl', 'bootstatus', simulator.udid, '-b']) - - return simulator -} - -function stopChild(child, signal) { - if (!child || child.killed || child.exitCode !== null) { - return - } - - child.kill(signal) -} - -function stopProcesses() { - stopChild(nativeScript, 'SIGINT') - stopChild(server, 'SIGTERM') -} - -async function main() { - const simulator = await getSimulator() - const port = await getFreePort() - const origin = `http://127.0.0.1:${port}` - const serverFunctionBase = `${origin}/_serverFn/` - - server = spawn( - 'pnpm', - [ - 'exec', - 'vite', - 'dev', - '--host', - '127.0.0.1', - '--port', - `${port}`, - '--strictPort', - ], - { - cwd: exampleRoot, - env: process.env, - stdio: 'inherit', - }, - ) - server.on('exit', (code) => { - if (code && code !== 0) { - process.exitCode = code - } - }) - - await waitForServer(origin) - await run( - 'xcrun', - ['simctl', 'uninstall', simulator.udid, 'com.tanstack.startnativescript'], - { allowFailure: true, silent: true }, - ) - nativeScript = spawn( - 'pnpm', - ['exec', 'ns', 'debug', 'ios', '--no-hmr', '--device', simulator.udid], - { - cwd: exampleRoot, - env: { - ...process.env, - TSS_SERVER_FN_BASE: serverFunctionBase, - }, - stdio: 'inherit', - }, - ) - await waitForNativeApp(simulator.udid, serverFunctionBase) - - await run( - 'xcodebuild', - [ - 'test', - '-project', - join('e2e', 'ios', 'NativeScriptRouterUITests.xcodeproj'), - '-scheme', - 'NativeScriptRouterUITests', - '-destination', - `platform=iOS Simulator,id=${simulator.udid}`, - '-quiet', - ], - { - env: { - ...process.env, - NSUnbufferedIO: 'YES', - }, - }, - ) -} - -process.once('SIGINT', () => { - stopProcesses() - process.exit(130) -}) -process.once('SIGTERM', () => { - stopProcesses() - process.exit(143) -}) - -try { - await main() -} finally { - stopProcesses() -} diff --git a/examples/react/start-nativescript/nativescript.config.ts b/examples/react/start-nativescript/nativescript.config.ts deleted file mode 100644 index 77d42307b3..0000000000 --- a/examples/react/start-nativescript/nativescript.config.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { NativeScriptConfig } from '@nativescript/core' - -export default { - id: 'com.tanstack.startnativescript', - appPath: 'src', - appResourcesPath: 'App_Resources', - bundler: 'vite', - bundlerConfigPath: 'vite.native.config.ts', - android: { - v8Flags: '--expose_gc', - markingMode: 'none', - }, - cli: { - packageManager: 'pnpm', - additionalPathsToClean: ['.ns-vite-build'], - }, -} satisfies NativeScriptConfig diff --git a/examples/react/start-nativescript/package.json b/examples/react/start-nativescript/package.json deleted file mode 100644 index ce37982ca3..0000000000 --- a/examples/react/start-nativescript/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "tanstack-start-example-nativescript", - "private": true, - "sideEffects": false, - "type": "module", - "main": "src/native/index.tsx", - "scripts": { - "dev": "vite dev --host 0.0.0.0", - "build": "vite build && tsc --noEmit", - "preview": "vite preview", - "native:ios": "concurrently --kill-others-on-fail --names start,ios \"vite dev --host 0.0.0.0\" \"wait-on http-get://127.0.0.1:3000 && cross-env TSS_SERVER_FN_BASE=http://127.0.0.1:3000/_serverFn/ ns debug ios --no-hmr\"", - "native:android": "concurrently --kill-others-on-fail --names start,android \"vite dev --host 0.0.0.0\" \"wait-on http-get://127.0.0.1:3000 && cross-env TSS_SERVER_FN_BASE=http://10.0.2.2:3000/_serverFn/ ns debug android --no-hmr\"", - "native:build:ios": "ns build ios --release --env.production", - "native:build:android": "ns build android --release --env.production", - "native:test:ios": "node e2e/run-ios.mjs", - "native:test:android": "node e2e/run-android.mjs" - }, - "dependencies": { - "@nativescript-community/react": "^19.0.0", - "@nativescript/core": "^9.0.20", - "@tanstack/react-nativescript-router": "^0.0.1", - "@tanstack/react-router": "^1.170.15", - "@tanstack/react-start": "^1.168.25", - "dominative": "^0.1.3", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-nativescript": "npm:@nativescript-community/react@^19.0.0", - "undom-ng": "^1.1.2" - }, - "devDependencies": { - "@nativescript/android": "^9.0.5", - "@nativescript/ios": "^9.0.3", - "@nativescript/types": "^9.0.0", - "@nativescript/vite": "2.0.3", - "@tanstack/router-cli": "^1.167.17", - "@types/node": "^22.5.4", - "@types/react": "^19.0.8", - "@types/react-dom": "^19.0.3", - "@vitejs/plugin-react": "^5.2.0", - "concurrently": "^9.2.1", - "cross-env": "^10.1.0", - "nativescript": "^9.0.6", - "nitro": "^3.0.260311-beta", - "typescript": "^6.0.2", - "vite": "^7.3.6", - "wait-on": "^9.0.3" - } -} diff --git a/examples/react/start-nativescript/src/native/index.tsx b/examples/react/start-nativescript/src/native/index.tsx deleted file mode 100644 index 6900c4fc1b..0000000000 --- a/examples/react/start-nativescript/src/native/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { startNativeScriptApp } from '@tanstack/react-nativescript-router' -import { configureNativeScriptStart } from '@tanstack/react-start/nativescript' -import { getRouter } from '../router' - -const router = getRouter() - -void startNativeScriptApp({ - router, - initialize: () => configureNativeScriptStart(), -}) diff --git a/examples/react/start-nativescript/src/native/jsx.d.ts b/examples/react/start-nativescript/src/native/jsx.d.ts deleted file mode 100644 index 9e5e08108a..0000000000 --- a/examples/react/start-nativescript/src/native/jsx.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import 'react' - -declare module 'react' { - namespace JSX { - interface IntrinsicElements { - actionbar: Record - actionitem: Record - contentview: Record - frame: Record - gridlayout: Record - navigationbutton: Record - page: Record - scrollview: Record - stacklayout: Record - } - } -} diff --git a/examples/react/start-nativescript/src/native/root-route.tsx b/examples/react/start-nativescript/src/native/root-route.tsx deleted file mode 100644 index 0558ee7c50..0000000000 --- a/examples/react/start-nativescript/src/native/root-route.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Outlet, createRootRoute } from '@tanstack/react-router' - -export const Route = createRootRoute({ - component: Outlet, -}) diff --git a/examples/react/start-nativescript/src/routes/__root.tsx b/examples/react/start-nativescript/src/routes/__root.tsx deleted file mode 100644 index 9ef3976c06..0000000000 --- a/examples/react/start-nativescript/src/routes/__root.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/// -import { - HeadContent, - Link, - Outlet, - Scripts, - createRootRoute, -} from '@tanstack/react-router' -import appCss from '~/styles/app.css?url' - -export const Route = createRootRoute({ - head: () => ({ - meta: [{ title: 'TanStack Start + NativeScript' }], - links: [{ rel: 'stylesheet', href: appCss }], - }), - component: RootComponent, -}) - -function RootComponent() { - return ( - - - - - -
- TanStack Native - -
-
- -
- - - - ) -} diff --git a/examples/react/start-nativescript/src/routes/index.tsx b/examples/react/start-nativescript/src/routes/index.tsx deleted file mode 100644 index 9d853aaaf8..0000000000 --- a/examples/react/start-nativescript/src/routes/index.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' -import { getWelcome } from '~/server/catalog' -import { HomeScreen } from '~/screens/HomeScreen' - -export const Route = createFileRoute('/')({ - loader: () => getWelcome(), - component: HomeRoute, - native: { - title: 'TanStack Native', - headerLargeTitle: true, - }, -}) - -function HomeRoute() { - return -} diff --git a/examples/react/start-nativescript/src/routes/items.$itemId.tsx b/examples/react/start-nativescript/src/routes/items.$itemId.tsx deleted file mode 100644 index 9e1db63ce6..0000000000 --- a/examples/react/start-nativescript/src/routes/items.$itemId.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { notFound } from '@tanstack/react-router' -import { createFileRoute, useBlocker } from '@tanstack/react-router' -import { useState } from 'react' -import { getCatalogItem } from '~/server/catalog' -import { ItemScreen } from '~/screens/ItemScreen' - -const itemIds = ['router', 'start'] as const -type ItemId = (typeof itemIds)[number] - -export const Route = createFileRoute('/items/$itemId')({ - loader: async ({ params }) => { - if (!itemIds.includes(params.itemId as ItemId)) { - throw notFound() - } - return getCatalogItem({ data: params.itemId as ItemId }) - }, - component: ItemRoute, - native: ({ params }) => ({ - title: params.itemId === 'start' ? 'TanStack Start' : 'TanStack Router', - }), -}) - -function ItemRoute() { - const [backProtected, setBackProtected] = useState(false) - useBlocker({ - disabled: !backProtected, - shouldBlockFn: () => true, - }) - - return ( - - ) -} diff --git a/examples/react/start-nativescript/src/routes/search.tsx b/examples/react/start-nativescript/src/routes/search.tsx deleted file mode 100644 index f5c8d43943..0000000000 --- a/examples/react/start-nativescript/src/routes/search.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' -import { searchCatalog } from '~/server/catalog' -import { SearchScreen } from '~/screens/SearchScreen' - -type SearchState = { - q: string -} - -export const Route = createFileRoute('/search')({ - validateSearch: (search): SearchState => ({ - q: typeof search.q === 'string' ? search.q : '', - }), - loaderDeps: ({ search }) => search, - loader: ({ deps }) => searchCatalog({ data: deps.q }), - component: SearchRoute, - native: { - title: 'Search', - }, -}) - -function SearchRoute() { - return ( - - ) -} diff --git a/examples/react/start-nativescript/src/screens/HomeScreen-native.tsx b/examples/react/start-nativescript/src/screens/HomeScreen-native.tsx deleted file mode 100644 index 7122e87c24..0000000000 --- a/examples/react/start-nativescript/src/screens/HomeScreen-native.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Link } from '@tanstack/react-router' -import type { WelcomeData } from './HomeScreen' - -export function HomeScreen({ welcome }: { welcome: WelcomeData }) { - return ( - - - - - - - - Open Router - - - Open Start - - - Search native - - - - ) -} diff --git a/examples/react/start-nativescript/src/screens/HomeScreen.tsx b/examples/react/start-nativescript/src/screens/HomeScreen.tsx deleted file mode 100644 index 1376dfa927..0000000000 --- a/examples/react/start-nativescript/src/screens/HomeScreen.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Link } from '@tanstack/react-router' - -export interface WelcomeData { - message: string - generatedAt: string -} - -export function HomeScreen({ welcome }: { welcome: WelcomeData }) { - return ( -
-

ONE ROUTE TREE

-

Web and real native navigation

-

{welcome.message}

-

Generated at {welcome.generatedAt}

-
- - Open Router - - - Open Start - -
-
- ) -} diff --git a/examples/react/start-nativescript/src/screens/ItemScreen-native.tsx b/examples/react/start-nativescript/src/screens/ItemScreen-native.tsx deleted file mode 100644 index f18c6c56e4..0000000000 --- a/examples/react/start-nativescript/src/screens/ItemScreen-native.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Link } from '@tanstack/react-router' -import type { ItemScreenProps } from './ItemScreen' -import type { ElementType } from 'react' - -const NativeButton = 'button' as ElementType<{ - text: string - onTap: () => void - style?: Record -}> - -export function ItemScreen({ - item, - backProtected, - onBackProtectedChange, -}: ItemScreenProps) { - return ( - - - - - {backProtected ? ( - - ) : null} - onBackProtectedChange(!backProtected)} - style={{ marginTop: 20 }} - /> - - Search this topic - - - ) -} diff --git a/examples/react/start-nativescript/src/screens/ItemScreen.tsx b/examples/react/start-nativescript/src/screens/ItemScreen.tsx deleted file mode 100644 index 70b7dc05c3..0000000000 --- a/examples/react/start-nativescript/src/screens/ItemScreen.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Link } from '@tanstack/react-router' -import type { CatalogResult } from './SearchScreen' - -export interface ItemScreenProps { - item: CatalogResult - backProtected: boolean - onBackProtectedChange: (protectedBack: boolean) => void -} - -export function ItemScreen({ - item, - backProtected, - onBackProtectedChange, -}: ItemScreenProps) { - return ( -
-

PATH PARAM + NATIVE STACK

-

{item.name}

-

{item.description}

- {backProtected ?

Back protected

: null} -
- - Search this topic - - -
-
- ) -} diff --git a/examples/react/start-nativescript/src/screens/SearchScreen-native.tsx b/examples/react/start-nativescript/src/screens/SearchScreen-native.tsx deleted file mode 100644 index 622e68c2f1..0000000000 --- a/examples/react/start-nativescript/src/screens/SearchScreen-native.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { Link } from '@tanstack/react-router' -import type { CatalogResult } from './SearchScreen' - -export function SearchScreen({ - query, - results, -}: { - query: string - results: Array -}) { - return ( - - - - - {results.map((result) => ( - - - - - ))} - - Search Router - - - Search Start - - - - ) -} diff --git a/examples/react/start-nativescript/src/screens/SearchScreen.tsx b/examples/react/start-nativescript/src/screens/SearchScreen.tsx deleted file mode 100644 index 2ffba087e0..0000000000 --- a/examples/react/start-nativescript/src/screens/SearchScreen.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Link } from '@tanstack/react-router' - -export interface CatalogResult { - name: string - description: string -} - -export function SearchScreen({ - query, - results, -}: { - query: string - results: Array -}) { - return ( -
-

SEARCH PARAMS + SERVER FUNCTION

-

Results for “{query}”

- {results.map((result) => ( -
-

{result.name}

-

{result.description}

-
- ))} -
- - Router - - - Start - -
-
- ) -} diff --git a/examples/react/start-nativescript/src/server/catalog.ts b/examples/react/start-nativescript/src/server/catalog.ts deleted file mode 100644 index 46a42c6c13..0000000000 --- a/examples/react/start-nativescript/src/server/catalog.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createServerFn } from '@tanstack/react-start' - -const catalog = { - router: { - name: 'TanStack Router', - description: 'Type-safe URL state shared by web and native clients.', - }, - start: { - name: 'TanStack Start', - description: 'Server functions compiled for both clients.', - }, -} as const - -export const getWelcome = createServerFn({ method: 'GET' }).handler(() => ({ - message: 'This value came from a TanStack Start server function.', - generatedAt: new Date().toISOString(), -})) - -export const searchCatalog = createServerFn({ method: 'GET' }) - .validator((query: string) => query) - .handler(({ data }) => { - const normalized = data.trim().toLowerCase() - return Object.values(catalog).filter((item) => - `${item.name} ${item.description}`.toLowerCase().includes(normalized), - ) - }) - -export const getCatalogItem = createServerFn({ method: 'GET' }) - .validator((id: keyof typeof catalog) => id) - .handler(({ data }) => catalog[data]) diff --git a/examples/react/start-nativescript/src/styles/app.css b/examples/react/start-nativescript/src/styles/app.css deleted file mode 100644 index bc7319de38..0000000000 --- a/examples/react/start-nativescript/src/styles/app.css +++ /dev/null @@ -1,73 +0,0 @@ -:root { - color: #172033; - background: #f5f7fb; - font-family: Inter, ui-sans-serif, system-ui, sans-serif; -} - -* { - box-sizing: border-box; -} - -body { - margin: 0; -} - -a { - color: #2563eb; - font-weight: 650; -} - -.site-header { - align-items: center; - border-bottom: 1px solid #dce2ec; - display: flex; - justify-content: space-between; - padding: 18px max(24px, calc((100vw - 920px) / 2)); -} - -.site-header nav { - display: flex; - gap: 18px; -} - -main { - margin: 0 auto; - max-width: 920px; - padding: 56px 24px; -} - -.panel { - background: white; - border: 1px solid #dce2ec; - border-radius: 8px; - padding: 40px; -} - -.eyebrow { - color: #2563eb; - font-size: 0.75rem; - font-weight: 800; -} - -h1 { - font-size: clamp(2rem, 6vw, 3.6rem); - letter-spacing: 0; - margin: 12px 0 20px; -} - -.muted { - color: #64748b; -} - -.actions { - display: flex; - flex-wrap: wrap; - gap: 16px; - margin-top: 28px; -} - -article { - border-top: 1px solid #dce2ec; - margin-top: 24px; - padding-top: 20px; -} diff --git a/examples/react/start-nativescript/vite.config.ts b/examples/react/start-nativescript/vite.config.ts deleted file mode 100644 index f4b06432c5..0000000000 --- a/examples/react/start-nativescript/vite.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { tanstackStart } from '@tanstack/react-start/plugin/vite' -import react from '@vitejs/plugin-react' -import { fileURLToPath } from 'node:url' -import { nitro } from 'nitro/vite' -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - port: 3000, - strictPort: true, - }, - resolve: { - alias: { - '~': fileURLToPath(new URL('./src', import.meta.url)), - }, - }, - plugins: [tanstackStart(), react(), nitro()], -}) diff --git a/examples/react/start-nativescript/vite.native.config.ts b/examples/react/start-nativescript/vite.native.config.ts deleted file mode 100644 index ca88dbf842..0000000000 --- a/examples/react/start-nativescript/vite.native.config.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { reactConfig } from '@nativescript/vite/react' -import { tanstackStartNativeScript } from '@tanstack/react-start/plugin/nativescript' -import { defineConfig, mergeConfig } from 'vite' - -function getServerFnBase(mode: string): string { - const configured = process.env.TSS_SERVER_FN_BASE - if (configured) { - return configured - } - if (mode === 'production') { - throw new Error( - 'Set TSS_SERVER_FN_BASE to the deployed absolute Start server-function URL before building the native app.', - ) - } - return process.env.TSS_NATIVE_PLATFORM === 'android' - ? 'http://10.0.2.2:3000/_serverFn/' - : 'http://127.0.0.1:3000/_serverFn/' -} - -export default defineConfig(({ mode }) => - mergeConfig(reactConfig({ mode }), { - resolve: { - preserveSymlinks: false, - }, - plugins: [ - tanstackStartNativeScript({ - serverFnBase: getServerFnBase(mode), - serverFnMode: mode === 'production' ? 'build' : 'dev', - nativeRootRoute: 'src/native/root-route.tsx', - }), - ], - }), -) diff --git a/examples/react/start-next-migration/.gitignore b/examples/react/start-next-migration/.gitignore new file mode 100644 index 0000000000..24e8148a7d --- /dev/null +++ b/examples/react/start-next-migration/.gitignore @@ -0,0 +1,13 @@ +node_modules +.next +.output +.nitro +.tanstack +test-results +playwright-report +.env +.env.local +*.tsbuildinfo +next-env.d.ts +next-app/AGENTS.md +next-app/CLAUDE.md diff --git a/examples/react/start-next-migration/README.md b/examples/react/start-next-migration/README.md new file mode 100644 index 0000000000..03bb53244e --- /dev/null +++ b/examples/react/start-next-migration/README.md @@ -0,0 +1,61 @@ +# Next.js to TanStack Start + +Two versions of the same small article site. `next-app/` uses the Next.js App Router; `src/` uses TanStack Start. They keep the public paths, article content, titles, descriptions, canonical URLs, search parameter, and permanent redirect. + +The private page saves one article in an encrypted session cookie. This keeps the example runnable without a database or an auth-provider account. It is a migration reference, not an authentication starter: the single demo account has no registration, password recovery, rate limiting, or account database. Do not deploy it as a public sign-in service. + +## Run + +Use Node 24 or newer and pnpm 12. From the repository root: + +```sh +pnpm install +pnpm nx run @tanstack/react-start:build +cd examples/react/start-next-migration +``` + +In each terminal that starts a server, set these variables. Generate your own secret and choose a demo password: + +```sh +export SESSION_PASSWORD="$(node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))")" +export DEMO_PASSWORD='choose-a-local-demo-password' +``` + +Run `pnpm dev:next` for Next.js at and `pnpm dev` in another terminal for Start at . Sign in as `reader@example.com` using the password you set. + +Both apps use iron-session, with different cookie names. Signing in to one does not sign you in to the other. Changing `SESSION_PASSWORD` invalidates that app's session. Saved state is tied to that session, not durable account storage. + +## Check the migration + +From this directory, with those ports free: + +```sh +pnpm exec playwright install chromium +pnpm test:e2e +pnpm build:next +pnpm build +MIGRATION_PRODUCTION=1 pnpm test:e2e +``` + +Playwright starts both dev servers with test-only credentials. The same tests run against each app and check server-rendered metadata, public paths, search, a 308 redirect, a missing article, sitemap membership, login errors, session persistence, private cache headers, saved-state mutation, and rejection of a captured mutation after sign-out. + +For a production-mode smoke check, keep the environment variables set and run `pnpm start:next` or `PORT=3101 pnpm start` after building. The cookie settings assume HTTPS in production. Deployment infrastructure, a shared database, real account security, and CDN behavior are outside this local fixture. + +## Compare + +| Next.js | TanStack Start | +| --------------------------------------------- | ------------------------------------------------------- | +| `next-app/app/page.tsx`, async `searchParams` | `src/routes/index.tsx`, `validateSearch` | +| `next-app/app/posts/[slug]/page.tsx` | `src/routes/posts.$slug.tsx` | +| `generateMetadata` | Route `head` using `loaderData` | +| `next-app/app/actions.ts` | `src/server/account.ts` | +| Server Action form and `revalidatePath` | `useServerFn`, local pending state, `router.invalidate` | +| `cookies()` with `iron-session` | `iron-session` with `getCookie` / `setCookie` | +| `next-app/next.config.ts` redirect | `src/routes/old-notes.tsx` redirect | +| `next-app/app/sitemap.ts` | `src/routes/sitemap[.]xml.ts` server route | + +The Next.js forms use Server Actions. The Start forms in this example handle client submit events and require JavaScript. For a no-JavaScript form, use a FormData-compatible server function URL or an explicit server-route POST implementation, including validation and CSRF protection. Replacing an Action with `createServerFn` does not preserve progressive enhancement automatically. + +The canonical origin is intentionally `https://field-notes.example` in both content modules, so local ports do not change the comparison. Replace it with your real public origin before adapting the example. + +The Start app enables `createCsrfMiddleware` for server-function requests in `src/start.ts`. The paired browser tests replay a mutation with an authenticated cookie jar and cross-site request metadata, then verify that it was rejected and the saved value did not change. Endpoint authorization is still checked independently after sign-out. diff --git a/examples/react/start-next-migration/next-app/account.ts b/examples/react/start-next-migration/next-app/account.ts new file mode 100644 index 0000000000..7073518994 --- /dev/null +++ b/examples/react/start-next-migration/next-app/account.ts @@ -0,0 +1,14 @@ +import { cookies } from 'next/headers' +import { getIronSession } from 'iron-session' +export async function getSession() { + const cookieStore = await cookies() + const password = process.env.SESSION_PASSWORD + if (!password || password.length < 32) { + throw new Error('Set SESSION_PASSWORD to at least 32 characters') + } + return getIronSession<{ email: string; saved: boolean }>(cookieStore, { + cookieName: 'next-migration-session', + password, + cookieOptions: { secure: process.env.NODE_ENV === 'production' }, + }) +} diff --git a/examples/react/start-next-migration/next-app/app/actions.ts b/examples/react/start-next-migration/next-app/app/actions.ts new file mode 100644 index 0000000000..325a4de176 --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/actions.ts @@ -0,0 +1,36 @@ +'use server' +import { redirect } from 'next/navigation' +import { revalidatePath } from 'next/cache' +import { getSession } from '../account' +export async function signIn(_state: { error: string }, form: FormData) { + if (!process.env.DEMO_PASSWORD) { + throw new Error('Set DEMO_PASSWORD before running the example') + } + const email = form.get('email'), + password = form.get('password') + if ( + email !== 'reader@example.com' || + password !== process.env.DEMO_PASSWORD + ) { + return { error: 'Invalid credentials' } + } + const session = await getSession() + session.email = email + session.saved = false + await session.save() + redirect('/saved') +} +export async function toggleSaved() { + const session = await getSession() + if (!session.email) { + throw new Error('Unauthorized') + } + session.saved = !session.saved + await session.save() + revalidatePath('/saved') +} +export async function signOut() { + const session = await getSession() + session.destroy() + redirect('/login') +} diff --git a/examples/react/start-next-migration/next-app/app/layout.tsx b/examples/react/start-next-migration/next-app/app/layout.tsx new file mode 100644 index 0000000000..2aafe653dd --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/layout.tsx @@ -0,0 +1,16 @@ +import Link from 'next/link' +import type { ReactNode } from 'react' +export default function Layout({ children }: { children: ReactNode }) { + return ( + + + + {children} + + + ) +} diff --git a/examples/react/start-next-migration/next-app/app/login/form.tsx b/examples/react/start-next-migration/next-app/app/login/form.tsx new file mode 100644 index 0000000000..41347eb65b --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/login/form.tsx @@ -0,0 +1,25 @@ +'use client' +import { useActionState } from 'react' +import { signIn } from '../actions' +export function LoginForm() { + const [state, action, pending] = useActionState(signIn, { error: '' }) + return ( +
+ + + +

{state.error}

+
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/login/page.tsx b/examples/react/start-next-migration/next-app/app/login/page.tsx new file mode 100644 index 0000000000..9cbb900629 --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/login/page.tsx @@ -0,0 +1,13 @@ +import { LoginForm } from './form' +export const metadata = { + title: 'Sign in | Field notes', + robots: { index: false }, +} +export default function Login() { + return ( +
+

Sign in

+ +
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/not-found.tsx b/examples/react/start-next-migration/next-app/app/not-found.tsx new file mode 100644 index 0000000000..5da341bf43 --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/not-found.tsx @@ -0,0 +1,9 @@ +import Link from 'next/link' +export default function NotFound() { + return ( +
+

Article not found

+ All articles +
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/page.tsx b/examples/react/start-next-migration/next-app/app/page.tsx new file mode 100644 index 0000000000..75653b8344 --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/page.tsx @@ -0,0 +1,37 @@ +import Link from 'next/link' +import { articles, siteUrl } from '../content' +export const metadata = { + title: 'Field notes', + description: + 'Notes on moving a web application without losing its public URLs.', + alternates: { canonical: siteUrl }, +} +export default async function Page({ + searchParams, +}: { + searchParams: Promise<{ q?: string | string[] }> +}) { + const search = await searchParams + const q = typeof search.q === 'string' ? search.q : '' + const visible = articles.filter((article) => + article.title.toLowerCase().includes(q.toLowerCase()), + ) + return ( +
+

Field notes

+
+ + +
+
    + {visible.map((article) => ( +
  • + {article.title} +
  • + ))} +
+
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/posts/[slug]/page.tsx b/examples/react/start-next-migration/next-app/app/posts/[slug]/page.tsx new file mode 100644 index 0000000000..36ed5b62da --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/posts/[slug]/page.tsx @@ -0,0 +1,36 @@ +import { notFound } from 'next/navigation' +import { articles, siteUrl } from '../../../content' +async function getArticle(params: Promise<{ slug: string }>) { + const { slug } = await params + const article = articles.find((item) => item.slug === slug) + if (!article) { + notFound() + } + return article +} +export async function generateMetadata({ + params, +}: { + params: Promise<{ slug: string }> +}) { + const article = await getArticle(params) + return { + title: article.title, + description: article.description, + openGraph: { title: article.title }, + alternates: { canonical: `${siteUrl}/posts/${article.slug}` }, + } +} +export default async function Page({ + params, +}: { + params: Promise<{ slug: string }> +}) { + const article = await getArticle(params) + return ( +
+

{article.title}

+

{article.body}

+
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/saved/page.tsx b/examples/react/start-next-migration/next-app/app/saved/page.tsx new file mode 100644 index 0000000000..5310dbc37e --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/saved/page.tsx @@ -0,0 +1,28 @@ +import { redirect } from 'next/navigation' +import { getSession } from '../../account' +import { signOut, toggleSaved } from '../actions' +export const metadata = { + title: 'Saved articles | Field notes', + robots: { index: false }, +} +export default async function Saved() { + const session = await getSession() + if (!session.email) { + redirect('/login') + } + return ( +
+

Saved articles

+

{session.email}

+

+ {session.saved ? 'Keeping your URLs is saved' : 'No saved articles'} +

+
+ +
+
+ +
+
+ ) +} diff --git a/examples/react/start-next-migration/next-app/app/sitemap.ts b/examples/react/start-next-migration/next-app/app/sitemap.ts new file mode 100644 index 0000000000..9859cffa17 --- /dev/null +++ b/examples/react/start-next-migration/next-app/app/sitemap.ts @@ -0,0 +1,7 @@ +import { articles, siteUrl } from '../content' +export default function sitemap() { + return [ + { url: siteUrl }, + ...articles.map((article) => ({ url: `${siteUrl}/posts/${article.slug}` })), + ] +} diff --git a/examples/react/start-next-migration/next-app/content.ts b/examples/react/start-next-migration/next-app/content.ts new file mode 100644 index 0000000000..2a9d15c1c0 --- /dev/null +++ b/examples/react/start-next-migration/next-app/content.ts @@ -0,0 +1,15 @@ +export const articles = [ + { + slug: 'keeping-your-urls', + title: 'Keeping your URLs', + description: 'Preserve public URLs when changing frameworks.', + body: 'A framework migration can keep the URLs your readers already use.', + }, + { + slug: 'checking-your-metadata', + title: 'Checking your metadata', + description: 'Compare rendered titles and canonical URLs before launch.', + body: 'Check the server response as well as the page after client navigation.', + }, +] +export const siteUrl = 'https://field-notes.example' diff --git a/examples/react/start-next-migration/next-app/next.config.ts b/examples/react/start-next-migration/next-app/next.config.ts new file mode 100644 index 0000000000..dc72c3ae72 --- /dev/null +++ b/examples/react/start-next-migration/next-app/next.config.ts @@ -0,0 +1,13 @@ +import type { NextConfig } from 'next' +const config: NextConfig = { + async redirects() { + return [ + { + source: '/old-notes', + destination: '/posts/keeping-your-urls', + permanent: true, + }, + ] + }, +} +export default config diff --git a/examples/react/start-next-migration/next-app/tsconfig.json b/examples/react/start-next-migration/next-app/tsconfig.json new file mode 100644 index 0000000000..8786ab9834 --- /dev/null +++ b/examples/react/start-next-migration/next-app/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "target": "ES2024", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "react-jsx", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ] + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts" + ], + "exclude": ["node_modules"] +} diff --git a/examples/react/start-next-migration/package.json b/examples/react/start-next-migration/package.json new file mode 100644 index 0000000000..0c2a2a9563 --- /dev/null +++ b/examples/react/start-next-migration/package.json @@ -0,0 +1,43 @@ +{ + "name": "tanstack-start-example-next-migration", + "private": true, + "type": "module", + "scripts": { + "dev": "vite dev --port 3101", + "dev:next": "next dev next-app --port 3100", + "build": "vite build && tsc --noEmit", + "build:next": "next build next-app", + "start": "node .output/server/index.mjs", + "start:next": "next start next-app --port 3100", + "test:e2e": "playwright test" + }, + "dependencies": { + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-start": "^1.169.6", + "iron-session": "^9.0.1", + "next": "16.3.4", + "react": "^19.2.3", + "react-dom": "^19.2.3" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@types/node": "^22.10.2", + "@types/react": "^19.2.8", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "nitro": "^3.0.260903-beta", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14" + }, + "nx": { + "targets": { + "test:e2e": { + "outputs": [ + "...", + "{projectRoot}/next-app/.next", + "{projectRoot}/next-app/next-env.d.ts" + ] + } + } + } +} diff --git a/examples/react/start-next-migration/playwright.config.ts b/examples/react/start-next-migration/playwright.config.ts new file mode 100644 index 0000000000..ce48715df4 --- /dev/null +++ b/examples/react/start-next-migration/playwright.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from '@playwright/test' + +const production = process.env.MIGRATION_PRODUCTION === '1' +const env = { + SESSION_PASSWORD: 'migration-reference-test-secret-at-least-32-characters', + DEMO_PASSWORD: 'migration-test-password', +} + +export default defineConfig({ + testDir: './tests', + use: { browserName: 'chromium' }, + projects: [ + { name: 'next', use: { baseURL: 'http://localhost:3100' } }, + { name: 'start', use: { baseURL: 'http://localhost:3101' } }, + ], + webServer: [ + { + command: production ? 'pnpm start:next' : 'pnpm dev:next', + url: 'http://localhost:3100', + env, + timeout: 120_000, + }, + { + command: production ? 'PORT=3101 pnpm start' : 'pnpm dev', + url: 'http://localhost:3101', + env, + timeout: 120_000, + }, + ], +}) diff --git a/examples/react/start-next-migration/src/content.ts b/examples/react/start-next-migration/src/content.ts new file mode 100644 index 0000000000..2a9d15c1c0 --- /dev/null +++ b/examples/react/start-next-migration/src/content.ts @@ -0,0 +1,15 @@ +export const articles = [ + { + slug: 'keeping-your-urls', + title: 'Keeping your URLs', + description: 'Preserve public URLs when changing frameworks.', + body: 'A framework migration can keep the URLs your readers already use.', + }, + { + slug: 'checking-your-metadata', + title: 'Checking your metadata', + description: 'Compare rendered titles and canonical URLs before launch.', + body: 'Check the server response as well as the page after client navigation.', + }, +] +export const siteUrl = 'https://field-notes.example' diff --git a/examples/react/start-next-migration/src/routeTree.gen.ts b/examples/react/start-next-migration/src/routeTree.gen.ts new file mode 100644 index 0000000000..15eeafce02 --- /dev/null +++ b/examples/react/start-next-migration/src/routeTree.gen.ts @@ -0,0 +1,167 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as LoginRouteImport } from './routes/login' +import { Route as OldNotesRouteImport } from './routes/old-notes' +import { Route as SavedRouteImport } from './routes/saved' +import { Route as SitemapDotxmlRouteImport } from './routes/sitemap[.]xml' +import { Route as PostsSlugRouteImport } from './routes/posts.$slug' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const LoginRoute = LoginRouteImport.update({ + id: '/login', + path: '/login', + getParentRoute: () => rootRouteImport, +} as any) +const OldNotesRoute = OldNotesRouteImport.update({ + id: '/old-notes', + path: '/old-notes', + getParentRoute: () => rootRouteImport, +} as any) +const SavedRoute = SavedRouteImport.update({ + id: '/saved', + path: '/saved', + getParentRoute: () => rootRouteImport, +} as any) +const SitemapDotxmlRoute = SitemapDotxmlRouteImport.update({ + id: '/sitemap.xml', + path: '/sitemap.xml', + getParentRoute: () => rootRouteImport, +} as any) +const PostsSlugRoute = PostsSlugRouteImport.update({ + id: '/posts/$slug', + path: '/posts/$slug', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/login': typeof LoginRoute + '/old-notes': typeof OldNotesRoute + '/saved': typeof SavedRoute + '/sitemap.xml': typeof SitemapDotxmlRoute + '/posts/$slug': typeof PostsSlugRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/login': typeof LoginRoute + '/old-notes': typeof OldNotesRoute + '/saved': typeof SavedRoute + '/sitemap.xml': typeof SitemapDotxmlRoute + '/posts/$slug': typeof PostsSlugRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/login': typeof LoginRoute + '/old-notes': typeof OldNotesRoute + '/saved': typeof SavedRoute + '/sitemap.xml': typeof SitemapDotxmlRoute + '/posts/$slug': typeof PostsSlugRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + '/' | '/login' | '/old-notes' | '/saved' | '/sitemap.xml' | '/posts/$slug' + fileRoutesByTo: FileRoutesByTo + to: '/' | '/login' | '/old-notes' | '/saved' | '/sitemap.xml' | '/posts/$slug' + id: + | '__root__' + | '/' + | '/login' + | '/old-notes' + | '/saved' + | '/sitemap.xml' + | '/posts/$slug' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + LoginRoute: typeof LoginRoute + OldNotesRoute: typeof OldNotesRoute + SavedRoute: typeof SavedRoute + SitemapDotxmlRoute: typeof SitemapDotxmlRoute + PostsSlugRoute: typeof PostsSlugRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/login': { + id: '/login' + path: '/login' + fullPath: '/login' + preLoaderRoute: typeof LoginRouteImport + parentRoute: typeof rootRouteImport + } + '/old-notes': { + id: '/old-notes' + path: '/old-notes' + fullPath: '/old-notes' + preLoaderRoute: typeof OldNotesRouteImport + parentRoute: typeof rootRouteImport + } + '/saved': { + id: '/saved' + path: '/saved' + fullPath: '/saved' + preLoaderRoute: typeof SavedRouteImport + parentRoute: typeof rootRouteImport + } + '/sitemap.xml': { + id: '/sitemap.xml' + path: '/sitemap.xml' + fullPath: '/sitemap.xml' + preLoaderRoute: typeof SitemapDotxmlRouteImport + parentRoute: typeof rootRouteImport + } + '/posts/$slug': { + id: '/posts/$slug' + path: '/posts/$slug' + fullPath: '/posts/$slug' + preLoaderRoute: typeof PostsSlugRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + LoginRoute: LoginRoute, + OldNotesRoute: OldNotesRoute, + SavedRoute: SavedRoute, + SitemapDotxmlRoute: SitemapDotxmlRoute, + PostsSlugRoute: PostsSlugRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { startInstance } from './start.ts' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + config: Awaited> + } +} diff --git a/examples/react/start-next-migration/src/router.tsx b/examples/react/start-next-migration/src/router.tsx new file mode 100644 index 0000000000..9711e610bf --- /dev/null +++ b/examples/react/start-next-migration/src/router.tsx @@ -0,0 +1,5 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +export function getRouter() { + return createRouter({ routeTree, scrollRestoration: true }) +} diff --git a/examples/react/start-next-migration/src/routes/__root.tsx b/examples/react/start-next-migration/src/routes/__root.tsx new file mode 100644 index 0000000000..a7eaa0168f --- /dev/null +++ b/examples/react/start-next-migration/src/routes/__root.tsx @@ -0,0 +1,46 @@ +import { + createRootRoute, + HeadContent, + Link, + Outlet, + Scripts, +} from '@tanstack/react-router' +import type { ReactNode } from 'react' +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + ], + }), + component: Outlet, + shellComponent: Document, + notFoundComponent: () => ( +
+

Article not found

+ + All articles + +
+ ), +}) +function Document({ children }: { children: ReactNode }) { + return ( + + + + + + + {children} + + + + ) +} diff --git a/examples/react/start-next-migration/src/routes/index.tsx b/examples/react/start-next-migration/src/routes/index.tsx new file mode 100644 index 0000000000..8778d9d01f --- /dev/null +++ b/examples/react/start-next-migration/src/routes/index.tsx @@ -0,0 +1,45 @@ +import { createFileRoute, Link } from '@tanstack/react-router' +import { articles, siteUrl } from '../content' +export const Route = createFileRoute('/')({ + validateSearch: (search) => ({ + q: typeof search.q === 'string' ? search.q : '', + }), + head: () => ({ + meta: [ + { title: 'Field notes' }, + { + name: 'description', + content: + 'Notes on moving a web application without losing its public URLs.', + }, + ], + links: [{ rel: 'canonical', href: siteUrl }], + }), + component: Articles, +}) +function Articles() { + const { q } = Route.useSearch() + const visible = articles.filter((article) => + article.title.toLowerCase().includes(q.toLowerCase()), + ) + return ( +
+

Field notes

+
+ + +
+
    + {visible.map((article) => ( +
  • + + {article.title} + +
  • + ))} +
+
+ ) +} diff --git a/examples/react/start-next-migration/src/routes/login.tsx b/examples/react/start-next-migration/src/routes/login.tsx new file mode 100644 index 0000000000..628261cc8e --- /dev/null +++ b/examples/react/start-next-migration/src/routes/login.tsx @@ -0,0 +1,70 @@ +import { createFileRoute, useHydrated, useRouter } from '@tanstack/react-router' +import { useServerFn } from '@tanstack/react-start' +import { useState } from 'react' +import { signIn } from '../server/account' +export const Route = createFileRoute('/login')({ + head: () => ({ + meta: [ + { title: 'Sign in | Field notes' }, + { name: 'robots', content: 'noindex' }, + ], + }), + component: Login, +}) +function Login() { + const hydrated = useHydrated() + const login = useServerFn(signIn) + const router = useRouter() + const [error, setError] = useState('') + const [pending, setPending] = useState(false) + return ( +
+

Sign in

+
{ + event.preventDefault() + const form = new FormData(event.currentTarget) + const email = form.get('email'), + password = form.get('password') + if (typeof email !== 'string' || typeof password !== 'string') { + return + } + setPending(true) + setError('') + try { + const result = await login({ data: { email, password } }) + if (result.error) { + setError(result.error) + return + } + await router.invalidate() + await router.navigate({ to: '/saved' }) + } catch { + setError('Sign-in failed. Try again.') + } finally { + setPending(false) + } + }} + > +
+ + + +
+

{error}

+
+
+ ) +} diff --git a/examples/react/start-next-migration/src/routes/old-notes.tsx b/examples/react/start-next-migration/src/routes/old-notes.tsx new file mode 100644 index 0000000000..1fb5ce846b --- /dev/null +++ b/examples/react/start-next-migration/src/routes/old-notes.tsx @@ -0,0 +1,10 @@ +import { createFileRoute, redirect } from '@tanstack/react-router' +export const Route = createFileRoute('/old-notes')({ + beforeLoad: () => { + throw redirect({ + to: '/posts/$slug', + params: { slug: 'keeping-your-urls' }, + statusCode: 308, + }) + }, +}) diff --git a/examples/react/start-next-migration/src/routes/posts.$slug.tsx b/examples/react/start-next-migration/src/routes/posts.$slug.tsx new file mode 100644 index 0000000000..1998717393 --- /dev/null +++ b/examples/react/start-next-migration/src/routes/posts.$slug.tsx @@ -0,0 +1,34 @@ +import { createFileRoute, notFound } from '@tanstack/react-router' +import { articles, siteUrl } from '../content' +export const Route = createFileRoute('/posts/$slug')({ + loader: ({ params }) => { + const article = articles.find((item) => item.slug === params.slug) + if (!article) { + throw notFound() + } + return article + }, + head: ({ loaderData }) => + loaderData + ? { + meta: [ + { title: loaderData.title }, + { name: 'description', content: loaderData.description }, + { property: 'og:title', content: loaderData.title }, + ], + links: [ + { rel: 'canonical', href: `${siteUrl}/posts/${loaderData.slug}` }, + ], + } + : {}, + component: Article, +}) +function Article() { + const article = Route.useLoaderData() + return ( +
+

{article.title}

+

{article.body}

+
+ ) +} diff --git a/examples/react/start-next-migration/src/routes/saved.tsx b/examples/react/start-next-migration/src/routes/saved.tsx new file mode 100644 index 0000000000..2f526eb7b5 --- /dev/null +++ b/examples/react/start-next-migration/src/routes/saved.tsx @@ -0,0 +1,79 @@ +import { + createFileRoute, + redirect, + useHydrated, + useRouter, +} from '@tanstack/react-router' +import { useServerFn } from '@tanstack/react-start' +import { useState } from 'react' +import { getAccount, signOut, toggleSaved } from '../server/account' +export const Route = createFileRoute('/saved')({ + loader: async () => { + const account = await getAccount() + if (!account) { + throw redirect({ to: '/login' }) + } + return account + }, + headers: () => ({ 'Cache-Control': 'private, no-store' }), + head: () => ({ + meta: [ + { title: 'Saved articles | Field notes' }, + { name: 'robots', content: 'noindex' }, + ], + }), + component: Saved, +}) +function Saved() { + const hydrated = useHydrated() + const account = Route.useLoaderData() + const toggle = useServerFn(toggleSaved), + logout = useServerFn(signOut) + const router = useRouter() + const [pending, setPending] = useState(false), + [error, setError] = useState('') + return ( +
+

Saved articles

+

{account.email}

+

+ {account.saved ? 'Keeping your URLs is saved' : 'No saved articles'} +

+ + +

{error}

+
+ ) +} diff --git a/examples/react/start-next-migration/src/routes/sitemap[.]xml.ts b/examples/react/start-next-migration/src/routes/sitemap[.]xml.ts new file mode 100644 index 0000000000..a7dfcaa594 --- /dev/null +++ b/examples/react/start-next-migration/src/routes/sitemap[.]xml.ts @@ -0,0 +1,13 @@ +import { createFileRoute } from '@tanstack/react-router' +import { articles, siteUrl } from '../content' +export const Route = createFileRoute('/sitemap.xml')({ + server: { + handlers: { + GET: () => + new Response( + `${siteUrl}${articles.map((article) => `${siteUrl}/posts/${article.slug}`).join('')}`, + { headers: { 'Content-Type': 'application/xml' } }, + ), + }, + }, +}) diff --git a/examples/react/start-next-migration/src/server/account.ts b/examples/react/start-next-migration/src/server/account.ts new file mode 100644 index 0000000000..85e921c74b --- /dev/null +++ b/examples/react/start-next-migration/src/server/account.ts @@ -0,0 +1,77 @@ +import { getIronSession } from 'iron-session' +import { createServerFn } from '@tanstack/react-start' +import { + getCookie, + setCookie, + setResponseStatus, + setResponseHeader, +} from '@tanstack/react-start/server' +import { redirect } from '@tanstack/react-router' +async function session() { + setResponseHeader('Cache-Control', 'private, no-store') + const password = process.env.SESSION_PASSWORD + if (!password || password.length < 32) { + throw new Error('Set SESSION_PASSWORD to at least 32 characters') + } + return getIronSession<{ email: string; saved: boolean }>( + { read: getCookie, write: setCookie }, + { + cookieName: 'start-migration-session', + password, + ttl: 7 * 24 * 60 * 60, + cookieOptions: { + httpOnly: true, + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + path: '/', + }, + }, + ) +} +export const getAccount = createServerFn({ method: 'GET' }).handler( + async () => { + const current = await session() + return current.email + ? { email: current.email, saved: current.saved ?? false } + : null + }, +) +export const signIn = createServerFn({ method: 'POST' }) + .validator((input: { email: string; password: string }) => { + if (typeof input.email !== 'string' || typeof input.password !== 'string') { + throw new Error('Invalid credentials') + } + return input + }) + .handler(async ({ data }) => { + if (!process.env.DEMO_PASSWORD) { + throw new Error('Set DEMO_PASSWORD before running the example') + } + if ( + data.email !== 'reader@example.com' || + data.password !== process.env.DEMO_PASSWORD + ) { + return { error: 'Invalid credentials' } + } + const current = await session() + current.email = data.email + current.saved = false + await current.save() + return { error: '' } + }) +export const toggleSaved = createServerFn({ method: 'POST' }).handler( + async () => { + const current = await session() + if (!current.email) { + setResponseStatus(401) + throw new Error('Unauthorized') + } + current.saved = !current.saved + await current.save() + }, +) +export const signOut = createServerFn({ method: 'POST' }).handler(async () => { + const current = await session() + current.destroy() + throw redirect({ to: '/login' }) +}) diff --git a/examples/react/start-next-migration/src/start.ts b/examples/react/start-next-migration/src/start.ts new file mode 100644 index 0000000000..5fb1e247fb --- /dev/null +++ b/examples/react/start-next-migration/src/start.ts @@ -0,0 +1,9 @@ +import { createCsrfMiddleware, createStart } from '@tanstack/react-start' + +export const startInstance = createStart(() => ({ + requestMiddleware: [ + createCsrfMiddleware({ + filter: (ctx) => ctx.handlerType === 'serverFn', + }), + ], +})) diff --git a/examples/react/start-next-migration/tests/migration.spec.ts b/examples/react/start-next-migration/tests/migration.spec.ts new file mode 100644 index 0000000000..7009095977 --- /dev/null +++ b/examples/react/start-next-migration/tests/migration.spec.ts @@ -0,0 +1,163 @@ +import { expect, test } from '@playwright/test' + +test('public URLs, server metadata, search, redirects, and missing pages survive migration', async ({ + page, + request, +}) => { + const response = await request.get('/posts/keeping-your-urls') + expect(response.status()).toBe(200) + const html = await response.text() + expect(html).toContain('Keeping your URLs') + expect(html).toMatch( + /]+name="description"[^>]+content="Preserve public URLs when changing frameworks\."/, + ) + expect(html).toMatch( + /]+rel="canonical"[^>]+href="https:\/\/field-notes\.example\/posts\/keeping-your-urls"/, + ) + expect(html).toMatch( + /]+property="og:title"[^>]+content="Keeping your URLs"/, + ) + expect(html).toContain( + 'A framework migration can keep the URLs your readers already use.', + ) + + const old = await request.get('/old-notes', { maxRedirects: 0 }) + expect(old.status()).toBe(308) + expect(new URL(old.headers().location, old.url()).pathname).toBe( + '/posts/keeping-your-urls', + ) + expect((await request.get('/posts/missing')).status()).toBe(404) + const sitemap = await (await request.get('/sitemap.xml')).text() + expect(sitemap).toContain( + 'https://field-notes.example/posts/keeping-your-urls', + ) + expect(sitemap).not.toContain('/saved') + + await page.goto('/?q=metadata') + await expect( + page.getByRole('link', { name: 'Checking your metadata' }), + ).toBeVisible() + await expect( + page.getByRole('link', { name: 'Keeping your URLs' }), + ).toHaveCount(0) + await page.getByRole('link', { name: 'Checking your metadata' }).click() + await expect(page).toHaveURL(/\/posts\/checking-your-metadata$/) + await expect(page).toHaveTitle('Checking your metadata') + await expect(page.locator('link[rel="canonical"]')).toHaveAttribute( + 'href', + 'https://field-notes.example/posts/checking-your-metadata', + ) +}) + +test('sessions and protected mutations survive reload but cannot run after sign-out', async ({ + page, +}, testInfo) => { + await page.goto('/saved') + await expect(page).toHaveURL(/\/login$/) + await page.getByLabel('Email', { exact: true }).fill('reader@example.com') + await page.getByLabel('Password', { exact: true }).fill('wrong-password') + await page.getByRole('button', { name: 'Sign in', exact: true }).click() + await expect(page.getByRole('main').getByRole('alert')).toHaveText( + 'Invalid credentials', + ) + await page.getByLabel('Email', { exact: true }).fill('reader@example.com') + await page + .getByLabel('Password', { exact: true }) + .fill('migration-test-password') + await page.getByRole('button', { name: 'Sign in', exact: true }).click() + await expect(page).toHaveURL(/\/saved$/) + await expect(page.getByTestId('saved-state')).toHaveText('No saved articles') + const mutation = page.waitForRequest((request) => request.method() === 'POST') + await page.getByRole('button', { name: 'Save article', exact: true }).click() + const savedRequest = await mutation + await expect(page.getByTestId('saved-state')).toHaveText( + 'Keeping your URLs is saved', + ) + // Keep the authenticated cookie jar while replaying a cross-site request. + const crossSiteHeaders = await savedRequest.allHeaders() + delete crossSiteHeaders.cookie + delete crossSiteHeaders['content-length'] + crossSiteHeaders.origin = 'https://untrusted.example' + crossSiteHeaders['sec-fetch-site'] = 'cross-site' + const crossSite = await page.request.post(savedRequest.url(), { + headers: crossSiteHeaders, + data: savedRequest.postData() ?? '', + }) + if (testInfo.project.name === 'start') { + expect(crossSite.status()).toBe(403) + } else { + expect(crossSite.status()).toBeGreaterThanOrEqual(400) + } + + const response = await page.reload() + expect(response?.headers()['cache-control']).toMatch( + process.env.MIGRATION_PRODUCTION ? /no-store/ : /no-store|no-cache/, + ) + await expect(page.getByTestId('saved-state')).toHaveText( + 'Keeping your URLs is saved', + ) + await page.getByRole('button', { name: 'Sign out', exact: true }).click() + await expect(page).toHaveURL(/\/login$/) + + // Replay the real mutation with the now-signed-out browser cookie jar. + const headers = await savedRequest.allHeaders() + delete headers.cookie + delete headers['content-length'] + const denied = await page.request.post(savedRequest.url(), { + headers, + data: savedRequest.postData() ?? '', + }) + expect(denied.status()).toBeGreaterThanOrEqual(400) + await page.goto('/saved') + await expect(page).toHaveURL(/\/login$/) +}) + +test('Start serializes saving and signing out so their responses cannot arrive out of order', async ({ + page, +}, testInfo) => { + test.skip(testInfo.project.name !== 'start', 'Start event-handler regression') + await page.goto('/login') + await page.getByLabel('Email', { exact: true }).fill('reader@example.com') + await page + .getByLabel('Password', { exact: true }) + .fill('migration-test-password') + await page.getByRole('button', { name: 'Sign in', exact: true }).click() + await expect(page).toHaveURL(/\/saved$/) + + for (const action of ['Save article', 'Sign out']) { + let release = () => {} + const held = new Promise((resolve) => { + release = resolve + }) + await page.route('**/_serverFn/**', async (route) => { + if (route.request().method() === 'POST') { + await held + } + await route.continue() + }) + await page.getByRole('button', { name: action, exact: true }).click() + try { + await expect( + page.getByRole('button', { name: /^(Save|Remove) article$/ }), + ).toBeDisabled() + await expect( + page.getByRole('button', { name: 'Sign out', exact: true }), + ).toBeDisabled() + } finally { + release() + } + if (action === 'Save article') { + await expect(page.getByTestId('saved-state')).toHaveText( + 'Keeping your URLs is saved', + ) + await expect( + page.getByRole('button', { name: 'Sign out', exact: true }), + ).toBeEnabled() + } else { + await expect(page).toHaveURL(/\/login$/) + } + await page.unrouteAll({ behavior: 'wait' }) + } + await page.goto('/saved') + await expect(page).toHaveURL(/\/login$/) +}) diff --git a/examples/react/start-next-migration/tsconfig.json b/examples/react/start-next-migration/tsconfig.json new file mode 100644 index 0000000000..a41553b9a1 --- /dev/null +++ b/examples/react/start-next-migration/tsconfig.json @@ -0,0 +1,21 @@ +{ + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "vite.config.ts", + "playwright.config.ts", + "tests/**/*.ts" + ], + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["DOM", "DOM.Iterable", "ES2024"], + "skipLibCheck": true, + "target": "ES2024", + "noEmit": true, + "types": ["vite/client"] + } +} diff --git a/examples/react/start-next-migration/vite.config.ts b/examples/react/start-next-migration/vite.config.ts new file mode 100644 index 0000000000..26d0e455d5 --- /dev/null +++ b/examples/react/start-next-migration/vite.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import { nitro } from 'nitro/vite' +export default defineConfig({ plugins: [tanstackStart(), react(), nitro()] }) diff --git a/examples/react/start-rscs/package.json b/examples/react/start-rscs/package.json index e27ccb6aea..00c88681d7 100644 --- a/examples/react/start-rscs/package.json +++ b/examples/react/start-rscs/package.json @@ -10,9 +10,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "dexie": "^4.0.10", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -26,8 +26,8 @@ "@types/react": "^19.2.2", "@types/react-dom": "^19.2.2", "@vitejs/plugin-react": "^6.0.1", - "@vitejs/plugin-rsc": "^0.5.20", - "nitro": "^3.0.260311-beta", + "@vitejs/plugin-rsc": "^0.5.39", + "nitro": "^3.0.260903-beta", "tailwindcss": "^4.1.18", "typescript": "^5.7.2", "vite": "^8.0.14" diff --git a/examples/react/start-streaming-data-from-server-functions/package.json b/examples/react/start-streaming-data-from-server-functions/package.json index 7f4ec5c9a6..762bbff733 100644 --- a/examples/react/start-streaming-data-from-server-functions/package.json +++ b/examples/react/start-streaming-data-from-server-functions/package.json @@ -10,9 +10,9 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "zod": "^4.4.3" @@ -22,7 +22,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-streaming-data-from-server-functions/src/router.tsx b/examples/react/start-streaming-data-from-server-functions/src/router.tsx index a464233af9..6f82cbf378 100644 --- a/examples/react/start-streaming-data-from-server-functions/src/router.tsx +++ b/examples/react/start-streaming-data-from-server-functions/src/router.tsx @@ -5,7 +5,9 @@ export function getRouter() { const router = createRouter({ routeTree, defaultPreload: 'intent', - defaultErrorComponent: (err) =>

{err.error.stack}

, + defaultErrorComponent: (err) => ( +

{err.error instanceof Error ? err.error.stack : String(err.error)}

+ ), defaultNotFoundComponent: () =>

not found

, scrollRestoration: true, }) diff --git a/examples/react/start-supabase-basic/.gitignore b/examples/react/start-supabase-basic/.gitignore index 8293849e8d..372dc30373 100644 --- a/examples/react/start-supabase-basic/.gitignore +++ b/examples/react/start-supabase-basic/.gitignore @@ -1,12 +1,11 @@ node_modules -# Keep environment variables out of version control -!.env package-lock.json yarn.lock .DS_Store .cache -.env +# The checked-in .env contains public demo values used by the build. +!.env .vercel .output /build/ diff --git a/examples/react/start-supabase-basic/package.json b/examples/react/start-supabase-basic/package.json index 578efbab92..0bf4b2c246 100644 --- a/examples/react/start-supabase-basic/package.json +++ b/examples/react/start-supabase-basic/package.json @@ -15,9 +15,9 @@ "dependencies": { "@supabase/ssr": "^0.5.2", "@supabase/supabase-js": "^2.48.1", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1" @@ -28,7 +28,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-supabase-basic/src/routes/_authed.tsx b/examples/react/start-supabase-basic/src/routes/_authed.tsx index ed97848e6a..697e35e427 100644 --- a/examples/react/start-supabase-basic/src/routes/_authed.tsx +++ b/examples/react/start-supabase-basic/src/routes/_authed.tsx @@ -27,7 +27,7 @@ export const Route = createFileRoute('/_authed')({ } }, errorComponent: ({ error }) => { - if (error.message === 'Not authenticated') { + if (error instanceof Error && error.message === 'Not authenticated') { return } diff --git a/examples/react/start-tailwind-v4/package.json b/examples/react/start-tailwind-v4/package.json index f032589511..b58fbe4ff0 100644 --- a/examples/react/start-tailwind-v4/package.json +++ b/examples/react/start-tailwind-v4/package.json @@ -10,9 +10,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "react": "^19.0.0", "react-dom": "^19.0.0", "tailwind-merge": "^3.6.0", @@ -25,7 +25,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json index d63357d985..7755d227fc 100644 --- a/examples/react/start-trellaux/package.json +++ b/examples/react/start-trellaux/package.json @@ -10,12 +10,12 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-router-ssr-query": "^1.167.1", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-router-ssr-query": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "ky": "^1.7.4", "msw": "^2.7.0", "react": "^19.0.0", @@ -32,7 +32,8 @@ "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/start-workos/package.json b/examples/react/start-workos/package.json index 91f966cb78..0ab7e89c2d 100644 --- a/examples/react/start-workos/package.json +++ b/examples/react/start-workos/package.json @@ -14,9 +14,9 @@ "license": "MIT", "dependencies": { "@radix-ui/themes": "^3.3.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/react-start": "^1.168.32", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/react-start": "^1.169.6", "@workos/authkit-tanstack-react-start": "^0.5.0", "react": "^19.0.0", "react-dom": "^19.0.0" @@ -25,7 +25,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/view-transitions/package.json b/examples/react/view-transitions/package.json index 04c3a5dc81..0be3c60e8f 100644 --- a/examples/react/view-transitions/package.json +++ b/examples/react/view-transitions/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "react": "^19.0.0", "react-dom": "^19.0.0", "redaxios": "^0.5.1", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/with-framer-motion/package.json b/examples/react/with-framer-motion/package.json index b690bb1c9a..c606070dfb 100644 --- a/examples/react/with-framer-motion/package.json +++ b/examples/react/with-framer-motion/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", "framer-motion": "^11.18.2", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -23,7 +23,8 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/react/with-trpc-react-query/package.json b/examples/react/with-trpc-react-query/package.json index c230435543..11df7bf03b 100644 --- a/examples/react/with-trpc-react-query/package.json +++ b/examples/react/with-trpc-react-query/package.json @@ -11,11 +11,11 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-query": "^5.90.0", + "@tanstack/react-query": "^5.102.0", "@tanstack/react-query-devtools": "^5.90.0", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@trpc/client": "^11.4.3", "@trpc/server": "^11.4.3", "@trpc/tanstack-react-query": "^11.4.3", diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json index 3281bd02d4..5612419cae 100644 --- a/examples/react/with-trpc/package.json +++ b/examples/react/with-trpc/package.json @@ -11,9 +11,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-router": "^1.170.18", - "@tanstack/react-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@trpc/client": "^11.4.3", "@trpc/server": "^11.4.3", "express": "^5.2.1", diff --git a/examples/solid/authenticated-routes-firebase/package.json b/examples/solid/authenticated-routes-firebase/package.json index 39cbab3677..110b4d2621 100644 --- a/examples/solid/authenticated-routes-firebase/package.json +++ b/examples/solid/authenticated-routes-firebase/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "firebase": "^11.4.0", "redaxios": "^0.5.1", "simple-icons": "^14.9.0", @@ -21,7 +21,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/authenticated-routes-firebase/src/auth.tsx b/examples/solid/authenticated-routes-firebase/src/auth.tsx index 84f1df8c99..97337889b7 100644 --- a/examples/solid/authenticated-routes-firebase/src/auth.tsx +++ b/examples/solid/authenticated-routes-firebase/src/auth.tsx @@ -1,7 +1,6 @@ import * as Solid from 'solid-js' import { onAuthStateChanged, signInWithPopup, signOut } from 'firebase/auth' -import { flushSync } from 'react-dom' import { auth } from './firebase/config' import type { AuthProvider, User } from 'firebase/auth' @@ -22,7 +21,7 @@ export function AuthContextProvider(props: { children: Solid.JSX.Element }) { Solid.createEffect(() => { const unsubscribe = onAuthStateChanged(auth, (user) => { - flushSync(() => { + Solid.batch(() => { setUser(user) setIsInitialLoading(false) }) @@ -39,7 +38,7 @@ export function AuthContextProvider(props: { children: Solid.JSX.Element }) { const login = async (provider: AuthProvider) => { const result = await signInWithPopup(auth, provider) - flushSync(() => { + Solid.batch(() => { setUser(result.user) setIsInitialLoading(false) }) diff --git a/examples/solid/authenticated-routes/package.json b/examples/solid/authenticated-routes/package.json index 4b0f71d795..ea7d05c902 100644 --- a/examples/solid/authenticated-routes/package.json +++ b/examples/solid/authenticated-routes/package.json @@ -10,16 +10,17 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-default-search-params/package.json b/examples/solid/basic-default-search-params/package.json index a41e918fe4..830df7b9cf 100644 --- a/examples/solid/basic-default-search-params/package.json +++ b/examples/solid/basic-default-search-params/package.json @@ -11,15 +11,16 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-devtools-panel/package.json b/examples/solid/basic-devtools-panel/package.json index fcc8d093ed..e7d608f5fe 100644 --- a/examples/solid/basic-devtools-panel/package.json +++ b/examples/solid/basic-devtools-panel/package.json @@ -10,14 +10,15 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-file-based/package.json b/examples/solid/basic-file-based/package.json index 5287319ec0..867118382e 100644 --- a/examples/solid/basic-file-based/package.json +++ b/examples/solid/basic-file-based/package.json @@ -10,16 +10,17 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2", + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-non-nested-devtools/package.json b/examples/solid/basic-non-nested-devtools/package.json index 64bf1df09f..c8e00ee43e 100644 --- a/examples/solid/basic-non-nested-devtools/package.json +++ b/examples/solid/basic-non-nested-devtools/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" @@ -19,7 +19,8 @@ "devDependencies": { "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-solid-query-file-based/package.json b/examples/solid/basic-solid-query-file-based/package.json index d2923c2d56..fdb5f05f52 100644 --- a/examples/solid/basic-solid-query-file-based/package.json +++ b/examples/solid/basic-solid-query-file-based/package.json @@ -13,16 +13,17 @@ "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2", + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-solid-query/package.json b/examples/solid/basic-solid-query/package.json index b344e5778e..7b132b11a1 100644 --- a/examples/solid/basic-solid-query/package.json +++ b/examples/solid/basic-solid-query/package.json @@ -12,15 +12,16 @@ "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2", + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-ssr-file-based/package.json b/examples/solid/basic-ssr-file-based/package.json index 53cbc0b6eb..e3699970a9 100644 --- a/examples/solid/basic-ssr-file-based/package.json +++ b/examples/solid/basic-ssr-file-based/package.json @@ -11,8 +11,8 @@ "debug": "node --inspect-brk server" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/router-plugin": "^1.169.0", "compression": "^1.8.0", "express": "^5.2.1", "get-port": "^7.1.0", @@ -20,10 +20,11 @@ "solid-js": "^1.9.10" }, "devDependencies": { - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router-devtools": "^1.167.3", "@types/express": "^5.0.6", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/basic-ssr-streaming-file-based/package.json b/examples/solid/basic-ssr-streaming-file-based/package.json index e991502566..92367442fc 100644 --- a/examples/solid/basic-ssr-streaming-file-based/package.json +++ b/examples/solid/basic-ssr-streaming-file-based/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "compression": "^1.8.0", "express": "^5.2.1", "get-port": "^7.1.0", @@ -24,9 +24,10 @@ "zod": "^4.4.3" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "@types/express": "^5.0.6", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-virtual-file-based/package.json b/examples/solid/basic-virtual-file-based/package.json index e735eec2f4..801b452192 100644 --- a/examples/solid/basic-virtual-file-based/package.json +++ b/examples/solid/basic-virtual-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "@tanstack/virtual-file-routes": "^1.162.0", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -20,7 +20,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic-virtual-inside-file-based/package.json b/examples/solid/basic-virtual-inside-file-based/package.json index b5f149c152..a9cc6360a5 100644 --- a/examples/solid/basic-virtual-inside-file-based/package.json +++ b/examples/solid/basic-virtual-inside-file-based/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "@tanstack/virtual-file-routes": "^1.162.0", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -20,7 +20,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/basic/package.json b/examples/solid/basic/package.json index f13e5f3afb..95ec804011 100644 --- a/examples/solid/basic/package.json +++ b/examples/solid/basic/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" @@ -19,7 +19,8 @@ "devDependencies": { "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/deferred-data/package.json b/examples/solid/deferred-data/package.json index c9851e71e5..56114afd04 100644 --- a/examples/solid/deferred-data/package.json +++ b/examples/solid/deferred-data/package.json @@ -10,15 +10,16 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/i18n-paraglide/package.json b/examples/solid/i18n-paraglide/package.json index b10932c863..6493a3c7c8 100644 --- a/examples/solid/i18n-paraglide/package.json +++ b/examples/solid/i18n-paraglide/package.json @@ -11,16 +11,28 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/router-plugin": "^1.169.0", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { "@types/node": "^22.18.6", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@inlang/paraglide-js": "^2.4.0" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/examples/solid/kitchen-sink-file-based/package.json b/examples/solid/kitchen-sink-file-based/package.json index 953c3432a5..8cd73e38ff 100644 --- a/examples/solid/kitchen-sink-file-based/package.json +++ b/examples/solid/kitchen-sink-file-based/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "immer": "^10.1.1", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -19,8 +19,9 @@ "zod": "^4.4.3" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2", + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/kitchen-sink-solid-query-file-based/package.json b/examples/solid/kitchen-sink-solid-query-file-based/package.json index 07e59de122..25a1c29953 100644 --- a/examples/solid/kitchen-sink-solid-query-file-based/package.json +++ b/examples/solid/kitchen-sink-solid-query-file-based/package.json @@ -10,11 +10,11 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "immer": "^10.1.1", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -22,7 +22,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/kitchen-sink-solid-query/package.json b/examples/solid/kitchen-sink-solid-query/package.json index 73b9eb16aa..7a7dc81025 100644 --- a/examples/solid/kitchen-sink-solid-query/package.json +++ b/examples/solid/kitchen-sink-solid-query/package.json @@ -12,8 +12,8 @@ "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "immer": "^10.1.1", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -21,7 +21,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/kitchen-sink/package.json b/examples/solid/kitchen-sink/package.json index 25833261e7..08ad918a60 100644 --- a/examples/solid/kitchen-sink/package.json +++ b/examples/solid/kitchen-sink/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "immer": "^10.1.1", "redaxios": "^0.5.1", "solid-js": "^1.9.10", @@ -19,7 +19,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/large-file-based/package.json b/examples/solid/large-file-based/package.json index cb5e474a03..cd758ab704 100644 --- a/examples/solid/large-file-based/package.json +++ b/examples/solid/large-file-based/package.json @@ -12,17 +12,18 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/location-masking/package.json b/examples/solid/location-masking/package.json index 5b0b9df7e3..7d2fbb6756 100644 --- a/examples/solid/location-masking/package.json +++ b/examples/solid/location-masking/package.json @@ -11,15 +11,16 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "solid-js": "^1.9.10", "redaxios": "^0.5.1", "tailwindcss": "^4.2.2" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/navigation-blocking/package.json b/examples/solid/navigation-blocking/package.json index 9b2ef78745..2338d32305 100644 --- a/examples/solid/navigation-blocking/package.json +++ b/examples/solid/navigation-blocking/package.json @@ -11,15 +11,16 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "solid-js": "^1.9.10", "redaxios": "^0.5.1", "tailwindcss": "^4.2.2" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/quickstart-esbuild-file-based/build.js b/examples/solid/quickstart-esbuild-file-based/build.js index f8d31fbbd9..af5e01b4cd 100644 --- a/examples/solid/quickstart-esbuild-file-based/build.js +++ b/examples/solid/quickstart-esbuild-file-based/build.js @@ -14,10 +14,7 @@ const ctx = await esbuild.context({ target: ['esnext'], sourcemap: true, conditions: ['style'], - plugins: [ - solidPlugin(), - tanstackRouter({ target: 'solid', autoCodeSplitting: true }), - ], + plugins: [solidPlugin(), tanstackRouter({ target: 'solid' })], }) if (isDev) { diff --git a/examples/solid/quickstart-esbuild-file-based/package.json b/examples/solid/quickstart-esbuild-file-based/package.json index 118afd0bab..9bcc9a08d0 100644 --- a/examples/solid/quickstart-esbuild-file-based/package.json +++ b/examples/solid/quickstart-esbuild-file-based/package.json @@ -9,9 +9,9 @@ "start": "dev" }, "dependencies": { - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", diff --git a/examples/solid/quickstart-file-based/package.json b/examples/solid/quickstart-file-based/package.json index 4792ee2010..920154566d 100644 --- a/examples/solid/quickstart-file-based/package.json +++ b/examples/solid/quickstart-file-based/package.json @@ -10,16 +10,17 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2", + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/quickstart-rspack-file-based/package.json b/examples/solid/quickstart-rspack-file-based/package.json index df94063b32..2d9c886ac3 100644 --- a/examples/solid/quickstart-rspack-file-based/package.json +++ b/examples/solid/quickstart-rspack-file-based/package.json @@ -9,17 +9,18 @@ }, "dependencies": { "@tailwindcss/postcss": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "postcss": "^8.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-babel": "^1.1.2", "@rsbuild/plugin-solid": "^1.1.1", - "@tanstack/router-plugin": "^1.168.23", - "typescript": "^6.0.2" + "@tanstack/router-plugin": "^1.169.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2" } } diff --git a/examples/solid/quickstart-webpack-file-based/package.json b/examples/solid/quickstart-webpack-file-based/package.json index 661a7ceece..16167be207 100644 --- a/examples/solid/quickstart-webpack-file-based/package.json +++ b/examples/solid/quickstart-webpack-file-based/package.json @@ -7,15 +7,15 @@ "build": "webpack build && tsc --noEmit" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { "@babel/core": "^7.28.5", "@babel/preset-typescript": "^7.27.1", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/router-plugin": "^1.169.0", "babel-loader": "^10.0.0", "babel-preset-solid": "^1.9.10", "css-loader": "^7.1.2", @@ -23,7 +23,8 @@ "postcss": "^8.5.6", "postcss-loader": "^8.2.0", "style-loader": "^4.0.0", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "webpack": "^5.97.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.2.4" diff --git a/examples/solid/quickstart/package.json b/examples/solid/quickstart/package.json index b8ee528ba1..454382e8cc 100644 --- a/examples/solid/quickstart/package.json +++ b/examples/solid/quickstart/package.json @@ -10,14 +10,15 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/router-monorepo-simple-lazy/package.json b/examples/solid/router-monorepo-simple-lazy/package.json index 8bae80e6c3..1d60ab2765 100644 --- a/examples/solid/router-monorepo-simple-lazy/package.json +++ b/examples/solid/router-monorepo-simple-lazy/package.json @@ -8,16 +8,17 @@ "dev": "pnpm router build && pnpm post-feature build && pnpm app dev" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "solid-js": "^1.9.10", "redaxios": "^0.5.1" }, "devDependencies": { "@types/node": "^22.7.4", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" }, diff --git a/examples/solid/router-monorepo-simple-lazy/packages/app/package.json b/examples/solid/router-monorepo-simple-lazy/packages/app/package.json index 23b7a2bdfa..a2e018fa96 100644 --- a/examples/solid/router-monorepo-simple-lazy/packages/app/package.json +++ b/examples/solid/router-monorepo-simple-lazy/packages/app/package.json @@ -18,8 +18,9 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@vitejs/plugin-react": "^6.0.1", - "typescript": "^6.0.2", - "@tanstack/solid-router-devtools": "^1.167.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "@tanstack/solid-router-devtools": "^1.167.3", "tailwindcss": "^4.2.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4", diff --git a/examples/solid/router-monorepo-simple-lazy/packages/post-feature/package.json b/examples/solid/router-monorepo-simple-lazy/packages/post-feature/package.json index dd09d18b06..849be06ce6 100644 --- a/examples/solid/router-monorepo-simple-lazy/packages/post-feature/package.json +++ b/examples/solid/router-monorepo-simple-lazy/packages/post-feature/package.json @@ -22,7 +22,8 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-simple-lazy/packages/router/package.json b/examples/solid/router-monorepo-simple-lazy/packages/router/package.json index f2b477f0a0..0672c42931 100644 --- a/examples/solid/router-monorepo-simple-lazy/packages/router/package.json +++ b/examples/solid/router-monorepo-simple-lazy/packages/router/package.json @@ -8,16 +8,17 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/history": "^1.162.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/history": "^1.162.5", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/router-plugin": "^1.169.0", "redaxios": "^0.5.1", "zod": "^4.4.3", "solid-js": "^1.9.10" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-simple/package.json b/examples/solid/router-monorepo-simple/package.json index d45c47b06a..3770256692 100644 --- a/examples/solid/router-monorepo-simple/package.json +++ b/examples/solid/router-monorepo-simple/package.json @@ -8,16 +8,17 @@ "dev": "pnpm router build && pnpm post-feature build && pnpm app dev" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "solid-js": "^1.9.10", "redaxios": "^0.5.1" }, "devDependencies": { "@types/node": "^22.7.4", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" }, diff --git a/examples/solid/router-monorepo-simple/packages/app/package.json b/examples/solid/router-monorepo-simple/packages/app/package.json index cf6e11f42c..61234ac455 100644 --- a/examples/solid/router-monorepo-simple/packages/app/package.json +++ b/examples/solid/router-monorepo-simple/packages/app/package.json @@ -15,8 +15,9 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", - "@tanstack/solid-router-devtools": "^1.167.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "@tanstack/solid-router-devtools": "^1.167.3", "vite": "^8.0.14", "tailwindcss": "^4.2.2", "vite-plugin-dts": "^4.5.4", diff --git a/examples/solid/router-monorepo-simple/packages/post-feature/package.json b/examples/solid/router-monorepo-simple/packages/post-feature/package.json index 798eca44ab..eb8005b953 100644 --- a/examples/solid/router-monorepo-simple/packages/post-feature/package.json +++ b/examples/solid/router-monorepo-simple/packages/post-feature/package.json @@ -13,7 +13,8 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-simple/packages/router/package.json b/examples/solid/router-monorepo-simple/packages/router/package.json index 9df7595ae8..ca08511d3e 100644 --- a/examples/solid/router-monorepo-simple/packages/router/package.json +++ b/examples/solid/router-monorepo-simple/packages/router/package.json @@ -8,16 +8,17 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/history": "^1.162.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/history": "^1.162.5", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/router-plugin": "^1.169.0", "redaxios": "^0.5.1", "zod": "^4.4.3", "solid-js": "^1.9.10" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-solid-query/package.json b/examples/solid/router-monorepo-solid-query/package.json index 82be9960af..3d9fd2e2d0 100644 --- a/examples/solid/router-monorepo-solid-query/package.json +++ b/examples/solid/router-monorepo-solid-query/package.json @@ -12,15 +12,16 @@ "dependencies": { "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "solid-js": "^1.9.10", "redaxios": "^0.5.1" }, "devDependencies": { "@types/node": "^22.10.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite-plugin-solid": "^2.11.11", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" diff --git a/examples/solid/router-monorepo-solid-query/packages/app/package.json b/examples/solid/router-monorepo-solid-query/packages/app/package.json index 39481dc9ad..76bb059de5 100644 --- a/examples/solid/router-monorepo-solid-query/packages/app/package.json +++ b/examples/solid/router-monorepo-solid-query/packages/app/package.json @@ -16,8 +16,9 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", - "@tanstack/solid-router-devtools": "^1.167.0", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "@tanstack/solid-router-devtools": "^1.167.3", "tailwindcss": "^4.2.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4", diff --git a/examples/solid/router-monorepo-solid-query/packages/post-feature/package.json b/examples/solid/router-monorepo-solid-query/packages/post-feature/package.json index 842b0c3049..39b57c7dfa 100644 --- a/examples/solid/router-monorepo-solid-query/packages/post-feature/package.json +++ b/examples/solid/router-monorepo-solid-query/packages/post-feature/package.json @@ -15,7 +15,8 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-solid-query/packages/post-query/package.json b/examples/solid/router-monorepo-solid-query/packages/post-query/package.json index cc9a5a18ed..8e3a4b0e71 100644 --- a/examples/solid/router-monorepo-solid-query/packages/post-query/package.json +++ b/examples/solid/router-monorepo-solid-query/packages/post-query/package.json @@ -14,7 +14,8 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/router-monorepo-solid-query/packages/router/package.json b/examples/solid/router-monorepo-solid-query/packages/router/package.json index 5511587ac4..93943a1df8 100644 --- a/examples/solid/router-monorepo-solid-query/packages/router/package.json +++ b/examples/solid/router-monorepo-solid-query/packages/router/package.json @@ -8,10 +8,10 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@tanstack/history": "^1.162.0", + "@tanstack/history": "^1.162.5", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/router-plugin": "^1.169.0", "@router-solid-mono-solid-query/post-query": "workspace:*", "redaxios": "^0.5.1", "zod": "^4.4.3", @@ -19,7 +19,8 @@ }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-dts": "^4.5.4" } diff --git a/examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx b/examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx index 6153a54a8b..99874f49e5 100644 --- a/examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx +++ b/examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx @@ -1,4 +1,3 @@ -import React from 'react' import { createRouter } from '@tanstack/solid-router' // Import the generated route tree diff --git a/examples/solid/scroll-restoration/package.json b/examples/solid/scroll-restoration/package.json index e80c7aea3b..eaa5a5aaea 100644 --- a/examples/solid/scroll-restoration/package.json +++ b/examples/solid/scroll-restoration/package.json @@ -10,15 +10,16 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "@tanstack/solid-virtual": "^3.13.0", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, "devDependencies": { "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14" } } diff --git a/examples/solid/search-validator-adapters/package.json b/examples/solid/search-validator-adapters/package.json index 3c63435630..59991edb36 100644 --- a/examples/solid/search-validator-adapters/package.json +++ b/examples/solid/search-validator-adapters/package.json @@ -13,9 +13,9 @@ "@tailwindcss/vite": "^4.2.2", "@tanstack/arktype-adapter": "^1.167.0", "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/router-plugin": "^1.169.0", "@tanstack/valibot-adapter": "^1.167.0", "@tanstack/zod-adapter": "^1.167.0", "arktype": "^2.1.7", @@ -25,10 +25,13 @@ "zod": "^3.24.2" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", + "@testing-library/jest-dom": "^7.0.1", "@solidjs/testing-library": "^0.8.10", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", - "vite": "^8.0.14" + "@typescript/native": "npm:typescript@^7.0.2", + "jsdom": "^27.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14", + "vitest": "^5.0.4" } } diff --git a/examples/solid/search-validator-adapters/tests/arktype.test.tsx b/examples/solid/search-validator-adapters/tests/arktype.test.tsx index 4ec555fc7b..f22a359995 100644 --- a/examples/solid/search-validator-adapters/tests/arktype.test.tsx +++ b/examples/solid/search-validator-adapters/tests/arktype.test.tsx @@ -8,7 +8,6 @@ import { createRouter, } from '@tanstack/solid-router' -import '@testing-library/jest-dom/vitest' import { type } from 'arktype' test('can navigate to the route', async () => { diff --git a/examples/solid/search-validator-adapters/tests/jest-dom.setup.ts b/examples/solid/search-validator-adapters/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/examples/solid/search-validator-adapters/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/examples/solid/search-validator-adapters/tests/valibot.test.tsx b/examples/solid/search-validator-adapters/tests/valibot.test.tsx index cd4545397c..8594c1cb29 100644 --- a/examples/solid/search-validator-adapters/tests/valibot.test.tsx +++ b/examples/solid/search-validator-adapters/tests/valibot.test.tsx @@ -8,7 +8,6 @@ import { createRouter, } from '@tanstack/solid-router' import * as v from 'valibot' -import '@testing-library/jest-dom/vitest' test('can navigate to the route', async () => { const rootRoute = createRootRoute() diff --git a/examples/solid/search-validator-adapters/vite.config.ts b/examples/solid/search-validator-adapters/vite.config.ts index 5b9dbebfef..4e05d81e75 100644 --- a/examples/solid/search-validator-adapters/vite.config.ts +++ b/examples/solid/search-validator-adapters/vite.config.ts @@ -11,6 +11,7 @@ export default defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, + setupFiles: ['./tests/jest-dom.setup.ts'], server: { deps: { inline: [/@solidjs/, /@tanstack\/solid-store/], diff --git a/examples/solid/start-basic-auth/README.md b/examples/solid/start-basic-auth/README.md index 90cba4aac1..313c930051 100644 --- a/examples/solid/start-basic-auth/README.md +++ b/examples/solid/start-basic-auth/README.md @@ -70,3 +70,13 @@ pnpm dev > [!WARNING] > You will need to update the `docs/config.json` file (in the project's repo) if you add a new doc page! + +## Session configuration + +This example uses [iron-session](https://github.com/vvo/iron-session) through Start's `getCookie` and `setCookie` helpers. Set `SESSION_PASSWORD` to a random secret of at least 32 characters before starting the app, for example: + +```sh +export SESSION_PASSWORD="$(openssl rand -base64 32)" +``` + +Keep the same secret across instances and deployments that must read the same sessions. The cookie requires HTTPS in production. Each handler reads its own session, then awaits `session.save()` before redirecting or returning. diff --git a/examples/solid/start-basic-auth/package.json b/examples/solid/start-basic-auth/package.json index 1cf7e6ca8e..d686fdf616 100644 --- a/examples/solid/start-basic-auth/package.json +++ b/examples/solid/start-basic-auth/package.json @@ -14,9 +14,10 @@ "@libsql/client": "^0.15.15", "@prisma/adapter-libsql": "^7.0.0", "@prisma/client": "^7.0.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", + "iron-session": "^9.0.1", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0" @@ -27,7 +28,8 @@ "dotenv": "^17.2.3", "prisma": "^7.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic-auth/src/routes/__root.tsx b/examples/solid/start-basic-auth/src/routes/__root.tsx index 3aa0bfa18b..05ad0d298a 100644 --- a/examples/solid/start-basic-auth/src/routes/__root.tsx +++ b/examples/solid/start-basic-auth/src/routes/__root.tsx @@ -14,18 +14,18 @@ import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js' import { NotFound } from '~/components/NotFound.js' import appCss from '~/styles/app.css?url' import { seo } from '~/utils/seo.js' -import { useAppSession } from '~/utils/session.js' +import { getAppSession } from '~/utils/session.js' const fetchUser = createServerFn({ method: 'GET' }).handler(async () => { // We need to auth on the server so we have access to secure cookies - const session = await useAppSession() + const session = await getAppSession() - if (!session.data.userEmail) { + if (!session.userEmail) { return null } return { - email: session.data.userEmail, + email: session.userEmail, } }) diff --git a/examples/solid/start-basic-auth/src/routes/_authed.tsx b/examples/solid/start-basic-auth/src/routes/_authed.tsx index 60ad613e56..cded7ca880 100644 --- a/examples/solid/start-basic-auth/src/routes/_authed.tsx +++ b/examples/solid/start-basic-auth/src/routes/_authed.tsx @@ -2,7 +2,7 @@ import { createFileRoute } from '@tanstack/solid-router' import { createServerFn } from '@tanstack/solid-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { Login } from '~/components/Login' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const loginFn = createServerFn({ method: 'POST' }) .validator((d: { email: string; password: string }) => d) @@ -33,13 +33,10 @@ export const loginFn = createServerFn({ method: 'POST' }) } } - // Create a session - const session = await useAppSession() - // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + const session = await getAppSession() + session.userEmail = user.email + await session.save() }) export const Route = createFileRoute('/_authed')({ diff --git a/examples/solid/start-basic-auth/src/routes/logout.tsx b/examples/solid/start-basic-auth/src/routes/logout.tsx index f7d624ff15..56cd70cbc2 100644 --- a/examples/solid/start-basic-auth/src/routes/logout.tsx +++ b/examples/solid/start-basic-auth/src/routes/logout.tsx @@ -1,11 +1,10 @@ import { createFileRoute, redirect } from '@tanstack/solid-router' import { createServerFn } from '@tanstack/solid-start' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' const logoutFn = createServerFn().handler(async () => { - const session = await useAppSession() - - session.clear() + const session = await getAppSession() + session.destroy() throw redirect({ href: '/', diff --git a/examples/solid/start-basic-auth/src/routes/signup.tsx b/examples/solid/start-basic-auth/src/routes/signup.tsx index 7cb9ae7161..b8d6bf89fa 100644 --- a/examples/solid/start-basic-auth/src/routes/signup.tsx +++ b/examples/solid/start-basic-auth/src/routes/signup.tsx @@ -3,7 +3,7 @@ import { createServerFn, useServerFn } from '@tanstack/solid-start' import { hashPassword, prismaClient } from '~/utils/prisma' import { useMutation } from '~/hooks/useMutation' import { Auth } from '~/components/Auth' -import { useAppSession } from '~/utils/session' +import { getAppSession } from '~/utils/session' export const signupFn = createServerFn({ method: 'POST' }) .validator( @@ -20,9 +20,6 @@ export const signupFn = createServerFn({ method: 'POST' }) // Encrypt the password using Sha256 into plaintext const password = await hashPassword(data.password) - // Create a session - const session = await useAppSession() - if (found) { if (found.password !== password) { return { @@ -33,9 +30,9 @@ export const signupFn = createServerFn({ method: 'POST' }) } // Store the user's email in the session - await session.update({ - userEmail: found.email, - }) + const session = await getAppSession() + session.userEmail = found.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ @@ -52,9 +49,9 @@ export const signupFn = createServerFn({ method: 'POST' }) }) // Store the user's email in the session - await session.update({ - userEmail: user.email, - }) + const session = await getAppSession() + session.userEmail = user.email + await session.save() // Redirect to the prev page stored in the "redirect" search param throw redirect({ diff --git a/examples/solid/start-basic-auth/src/utils/session.ts b/examples/solid/start-basic-auth/src/utils/session.ts index 120a410b60..4577764d28 100644 --- a/examples/solid/start-basic-auth/src/utils/session.ts +++ b/examples/solid/start-basic-auth/src/utils/session.ts @@ -1,13 +1,29 @@ -// src/services/session.server.ts -import { useSession } from '@tanstack/solid-start/server' +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/solid-start/server' import type { User } from '@prisma/client' type SessionUser = { userEmail: User['email'] } -export function useAppSession() { - return useSession({ - password: 'ChangeThisBeforeShippingToProdOrYouWillBeFired', - }) +export function getAppSession() { + const password = process.env.SESSION_PASSWORD + if (!password || password.length < 32) { + throw new Error('Set SESSION_PASSWORD to at least 32 characters') + } + + return getIronSession( + { read: getCookie, write: setCookie }, + { + cookieName: 'app-session', + password, + ttl: 7 * 24 * 60 * 60, + cookieOptions: { + httpOnly: true, + sameSite: 'lax', + secure: process.env.NODE_ENV === 'production', + path: '/', + }, + }, + ) } diff --git a/examples/solid/start-basic-authjs/package.json b/examples/solid/start-basic-authjs/package.json index 20dfc7b4c8..2c910663bd 100644 --- a/examples/solid/start-basic-authjs/package.json +++ b/examples/solid/start-basic-authjs/package.json @@ -11,9 +11,9 @@ }, "dependencies": { "@auth/core": "^0.41.1", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10", "start-authjs": "^1.0.0", "tailwind-merge": "^3.6.0" @@ -22,7 +22,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic-cloudflare/package.json b/examples/solid/start-basic-cloudflare/package.json index 61ec997672..7ece143f61 100644 --- a/examples/solid/start-basic-cloudflare/package.json +++ b/examples/solid/start-basic-cloudflare/package.json @@ -12,9 +12,9 @@ "postinstall": "WRANGLER_LOG=warn npm run --silent cf-typegen" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10" }, "devDependencies": { @@ -22,7 +22,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11", "wrangler": "^4.74.0" diff --git a/examples/solid/start-basic-netlify/package.json b/examples/solid/start-basic-netlify/package.json index 300731993a..69299cdb79 100644 --- a/examples/solid/start-basic-netlify/package.json +++ b/examples/solid/start-basic-netlify/package.json @@ -9,17 +9,18 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10" }, "devDependencies": { - "@netlify/vite-plugin-tanstack-start": "^1.1.4", + "@netlify/vite-plugin-tanstack-start": "^1.3.19", "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic-nitro/package.json b/examples/solid/start-basic-nitro/package.json index eb242e0cdc..2c0dc7dad6 100644 --- a/examples/solid/start-basic-nitro/package.json +++ b/examples/solid/start-basic-nitro/package.json @@ -9,17 +9,18 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10" }, "devDependencies": { "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", - "nitro": "^3.0.260311-beta", + "nitro": "^3.0.260903-beta", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic-solid-query/package.json b/examples/solid/start-basic-solid-query/package.json index 2ed9b408a0..ddbb7d8764 100644 --- a/examples/solid/start-basic-solid-query/package.json +++ b/examples/solid/start-basic-solid-query/package.json @@ -12,10 +12,10 @@ "dependencies": { "@tanstack/solid-query": "^5.90.9", "@tanstack/solid-query-devtools": "^5.90.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-router-ssr-query": "^1.167.1", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-router-ssr-query": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0" @@ -24,7 +24,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic-static/package.json b/examples/solid/start-basic-static/package.json index e378294c01..8b639da68a 100644 --- a/examples/solid/start-basic-static/package.json +++ b/examples/solid/start-basic-static/package.json @@ -10,10 +10,10 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", - "@tanstack/start-static-server-functions": "^1.167.19", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", + "@tanstack/start-static-server-functions": "^1.167.44", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0" @@ -22,7 +22,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-basic/package.json b/examples/solid/start-basic/package.json index 2edd8c3478..758815b669 100644 --- a/examples/solid/start-basic/package.json +++ b/examples/solid/start-basic/package.json @@ -10,9 +10,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0" @@ -20,9 +20,10 @@ "devDependencies": { "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", - "nitro": "^3.0.260311-beta", + "nitro": "^3.0.260903-beta", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-bun/package.json b/examples/solid/start-bun/package.json index c04beb9bd4..d1ad9a9563 100644 --- a/examples/solid/start-bun/package.json +++ b/examples/solid/start-bun/package.json @@ -15,11 +15,11 @@ "dependencies": { "@tailwindcss/vite": "^4.2.2", "@tanstack/solid-devtools": "^0.7.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-router-ssr-query": "^1.167.1", - "@tanstack/solid-start": "^1.168.32", - "@tanstack/router-plugin": "^1.168.23", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-router-ssr-query": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", + "@tanstack/router-plugin": "^1.169.0", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2" }, @@ -32,9 +32,10 @@ "vite-plugin-solid": "^2.11.11", "jsdom": "^27.0.0", "prettier": "^3.6.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", - "vitest": "^4.1.4", + "vitest": "^5.0.4", "web-vitals": "^5.1.0" } } diff --git a/examples/solid/start-convex-better-auth/package.json b/examples/solid/start-convex-better-auth/package.json index 7d0d3b748c..ea13a1c1e3 100644 --- a/examples/solid/start-convex-better-auth/package.json +++ b/examples/solid/start-convex-better-auth/package.json @@ -13,9 +13,9 @@ "dependencies": { "@convex-dev/better-auth": "^0.9.7", "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "better-auth": "^1.6.19", "clsx": "^2.1.1", "convex": "^1.28.2", @@ -29,7 +29,8 @@ "devDependencies": { "@types/node": "^22.10.2", "combinate": "^1.1.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-counter/package.json b/examples/solid/start-counter/package.json index 55f0def296..8b49c516bd 100644 --- a/examples/solid/start-counter/package.json +++ b/examples/solid/start-counter/package.json @@ -10,9 +10,9 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0", @@ -21,7 +21,8 @@ "devDependencies": { "@types/node": "^22.10.2", "combinate": "^1.1.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-i18n-paraglide/package.json b/examples/solid/start-i18n-paraglide/package.json index afa9366193..076c9b41dc 100644 --- a/examples/solid/start-i18n-paraglide/package.json +++ b/examples/solid/start-i18n-paraglide/package.json @@ -10,18 +10,30 @@ }, "dependencies": { "@tanstack/solid-devtools": "^0.7.0", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10" }, "devDependencies": { "@types/node": "^22.18.6", "vite-plugin-solid": "^2.11.11", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "@tailwindcss/vite": "^4.2.2", "tailwindcss": "^4.2.2", "@inlang/paraglide-js": "^2.4.0" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "...", + "{projectRoot}/src/paraglide", + "{projectRoot}/project.inlang/cache" + ] + } + } } } diff --git a/examples/solid/start-large/package.json b/examples/solid/start-large/package.json index f5e06de43e..83f3589cc2 100644 --- a/examples/solid/start-large/package.json +++ b/examples/solid/start-large/package.json @@ -13,9 +13,9 @@ }, "dependencies": { "@tanstack/solid-query": "^5.90.9", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0", @@ -25,7 +25,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" }, diff --git a/examples/solid/start-streaming-data-from-server-functions/package.json b/examples/solid/start-streaming-data-from-server-functions/package.json index c72208a3f3..83e0719b39 100644 --- a/examples/solid/start-streaming-data-from-server-functions/package.json +++ b/examples/solid/start-streaming-data-from-server-functions/package.json @@ -10,15 +10,16 @@ "start": "pnpx srvx --prod -s ../client dist/server/server.js" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10", "zod": "^4.4.3" }, "devDependencies": { "@types/node": "^22.5.4", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-supabase-basic/package.json b/examples/solid/start-supabase-basic/package.json index 3e8c7c063a..81ab5cd63c 100644 --- a/examples/solid/start-supabase-basic/package.json +++ b/examples/solid/start-supabase-basic/package.json @@ -14,9 +14,9 @@ "dependencies": { "@supabase/ssr": "^0.5.2", "@supabase/supabase-js": "^2.48.1", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.9", "redaxios": "^0.5.1" }, @@ -24,7 +24,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-tailwind-v4/package.json b/examples/solid/start-tailwind-v4/package.json index 323ff0ecaf..94db6ac790 100644 --- a/examples/solid/start-tailwind-v4/package.json +++ b/examples/solid/start-tailwind-v4/package.json @@ -10,9 +10,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", - "@tanstack/solid-start": "^1.168.32", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", + "@tanstack/solid-start": "^1.169.6", "solid-js": "^1.9.10", "tailwind-merge": "^3.6.0", "zod": "^4.4.3" @@ -21,7 +21,8 @@ "@tailwindcss/vite": "^4.2.2", "@types/node": "^22.5.4", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/start-tailwind-v4/src/routes/__root.tsx b/examples/solid/start-tailwind-v4/src/routes/__root.tsx index 8347bb3b5a..489680b739 100644 --- a/examples/solid/start-tailwind-v4/src/routes/__root.tsx +++ b/examples/solid/start-tailwind-v4/src/routes/__root.tsx @@ -7,7 +7,6 @@ import { createRootRoute, } from '@tanstack/solid-router' import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools' -import * as React from 'react' import { HydrationScript } from 'solid-js/web' import type { JSX } from 'solid-js' import appCss from '~/styles/app.css?url' diff --git a/examples/solid/view-transitions/package.json b/examples/solid/view-transitions/package.json index 0ea0691e97..2acb2432bf 100644 --- a/examples/solid/view-transitions/package.json +++ b/examples/solid/view-transitions/package.json @@ -10,16 +10,17 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "tailwindcss": "^4.2.2", "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/with-framer-motion/package.json b/examples/solid/with-framer-motion/package.json index 898d248ec9..449d8a3927 100644 --- a/examples/solid/with-framer-motion/package.json +++ b/examples/solid/with-framer-motion/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "solid-js": "^1.9.10", "solid-motionone": "^1.0.4", @@ -19,7 +19,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", "vite-plugin-solid": "^2.11.11" } diff --git a/examples/solid/with-trpc/package.json b/examples/solid/with-trpc/package.json index 9bcca25387..46d33436db 100644 --- a/examples/solid/with-trpc/package.json +++ b/examples/solid/with-trpc/package.json @@ -11,9 +11,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/solid-router": "^1.170.18", - "@tanstack/solid-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/solid-router": "^1.170.43", + "@tanstack/solid-router-devtools": "^1.167.3", "@trpc/client": "^11.4.3", "@trpc/server": "^11.4.3", "express": "^5.2.1", diff --git a/examples/vue/basic-file-based-jsx/package.json b/examples/vue/basic-file-based-jsx/package.json index d2de76f46f..9cc36a6991 100644 --- a/examples/vue/basic-file-based-jsx/package.json +++ b/examples/vue/basic-file-based-jsx/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/vue-router": "^1.170.17", - "@tanstack/vue-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/vue-router": "^1.170.42", + "@tanstack/vue-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "tailwindcss": "^4.2.2", "vue": "^3.5.16", @@ -28,6 +28,6 @@ "typescript": "~5.8.3", "vite": "^8.0.14", "vue-eslint-parser": "^9.4.3", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/examples/vue/basic-file-based-jsx/src/posts.tsx b/examples/vue/basic-file-based-jsx/src/posts.tsx index 1b4c92b41d..f7a1941605 100644 --- a/examples/vue/basic-file-based-jsx/src/posts.tsx +++ b/examples/vue/basic-file-based-jsx/src/posts.tsx @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/examples/vue/basic-file-based-jsx/src/routeTree.gen.ts b/examples/vue/basic-file-based-jsx/src/routeTree.gen.ts index 3922025c82..5922c5f7b1 100644 --- a/examples/vue/basic-file-based-jsx/src/routeTree.gen.ts +++ b/examples/vue/basic-file-based-jsx/src/routeTree.gen.ts @@ -364,7 +364,7 @@ declare module '@tanstack/vue-router' { '/(group)/_layout': { id: '/(group)/_layout' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupLayoutRouteImport parentRoute: typeof rootRouteImport } diff --git a/examples/vue/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx b/examples/vue/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx index 727c1b4d94..e475111e40 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx @@ -1,27 +1,32 @@ import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { z } from 'zod' +const OnlyRouteInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ + from: '/(another-group)/onlyrouteinside', + }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(another-group)/onlyrouteinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: OnlyRouteInsideComponent, }) const routeApi = getRouteApi('/(another-group)/onlyrouteinside') - -function OnlyRouteInsideComponent() { - const searchViaHook = useSearch({ from: '/(another-group)/onlyrouteinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx b/examples/vue/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx index 4b239f3ef4..869e536811 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/(group)/_layout.insidelayout.tsx @@ -1,27 +1,30 @@ import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { z } from 'zod' +const InsideLayoutComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/_layout/insidelayout')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideLayoutComponent, }) const routeApi = getRouteApi('/(group)/_layout/insidelayout') - -function InsideLayoutComponent() { - const searchViaHook = useSearch({ from: '/(group)/_layout/insidelayout' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/(group)/inside.tsx b/examples/vue/basic-file-based-jsx/src/routes/(group)/inside.tsx index f12ca517d3..4a0caa8f8d 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/(group)/inside.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/(group)/inside.tsx @@ -1,27 +1,30 @@ import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { z } from 'zod' +const InsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: InsideComponent, }) const routeApi = getRouteApi('/(group)/inside') - -function InsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx b/examples/vue/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx index 05b34eb201..fdae632aee 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/(group)/lazyinside.tsx @@ -1,27 +1,30 @@ import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { z } from 'zod' +const LazyInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/lazyinside')({ validateSearch: z.object({ hello: z.string().optional() }), component: LazyInsideComponent, }) const routeApi = getRouteApi('/(group)/lazyinside') - -function LazyInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/lazyinside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx b/examples/vue/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx index 317c766186..8c7222ee70 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/(group)/subfolder/inside.tsx @@ -1,27 +1,30 @@ import { createFileRoute, getRouteApi, useSearch } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { z } from 'zod' +const SubfolderInsideComponent = defineComponent({ + setup() { + const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) + const searchViaRouteHook = routeApi.useSearch() + const searchViaRouteApi = routeApi.useSearch() + + return () => ( +
+
{searchViaHook.value.hello}
+
+ {searchViaRouteHook.value.hello} +
+
+ {searchViaRouteApi.value.hello} +
+
+ ) + }, +}) + export const Route = createFileRoute('/(group)/subfolder/inside')({ validateSearch: z.object({ hello: z.string().optional() }), component: SubfolderInsideComponent, }) const routeApi = getRouteApi('/(group)/subfolder/inside') - -function SubfolderInsideComponent() { - const searchViaHook = useSearch({ from: '/(group)/subfolder/inside' }) - const searchViaRouteHook = routeApi.useSearch() - const searchViaRouteApi = routeApi.useSearch() - - return ( -
-
{searchViaHook.value.hello}
-
- {searchViaRouteHook.value.hello} -
-
- {searchViaRouteApi.value.hello} -
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/__root.tsx b/examples/vue/basic-file-based-jsx/src/routes/__root.tsx index 59c9e6fa48..adcc3acbd7 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/__root.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/__root.tsx @@ -8,97 +8,100 @@ import { useRouterState, } from '@tanstack/vue-router' import { TanStackRouterDevtools } from '@tanstack/vue-router-devtools' +import { defineComponent } from 'vue' import NotFoundComponent from '../components/NotFoundComponent.vue' +const RootComponent = defineComponent({ + setup() { + const router = useRouter() + const canGoBack = useCanGoBack() + // test useRouterState doesn't crash client side navigation + const _state = useRouterState() + + return () => ( + <> + +
+ + + Home + + + Posts + + + Layout + + + Only Route Inside Group + + + Inside Group + + + Inside Subfolder Inside Group + + + Inside Group Inside Layout + + + Lazy Inside Group + + + unicode path + + + This Route Does Not Exist + +
+
+ + + + ) + }, +}) + export const Route = createRootRoute({ component: RootComponent, notFoundComponent: NotFoundComponent, }) - -function RootComponent() { - const router = useRouter() - const canGoBack = useCanGoBack() - // test useRouterState doesn't crash client side navigation - const _state = useRouterState() - - return ( - <> - -
- - - Home - - - Posts - - - Layout - - - Only Route Inside Group - - - Inside Group - - - Inside Subfolder Inside Group - - - Inside Group Inside Layout - - - Lazy Inside Group - - - unicode path - - - This Route Does Not Exist - -
-
- - - - ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/posts.$postId.tsx b/examples/vue/basic-file-based-jsx/src/routes/posts.$postId.tsx index 15d17387c8..bc1dbfbbd0 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/posts.$postId.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/posts.$postId.tsx @@ -1,24 +1,27 @@ import { createFileRoute } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import PostErrorComponent from '../components/PostErrorComponent.vue' import { fetchPost } from '../posts' import type { PostType } from '../posts' +const PostComponent = defineComponent({ + setup() { + const post = Route.useLoaderData() + + return () => ( +
+

+ {(post.value as PostType).title} +

+
{(post.value as PostType).body}
+
+ ) + }, +}) + export const Route = createFileRoute('/posts/$postId')({ loader: async ({ params: { postId } }) => fetchPost(postId), component: PostComponent, errorComponent: PostErrorComponent, notFoundComponent: () =>

Post not found

, }) - -function PostComponent() { - const post = Route.useLoaderData() - - return ( -
-

- {(post.value as PostType).title} -

-
{(post.value as PostType).body}
-
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/posts.tsx b/examples/vue/basic-file-based-jsx/src/routes/posts.tsx index ae580dfc02..522988e52b 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/posts.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/posts.tsx @@ -1,7 +1,38 @@ import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' +import { defineComponent } from 'vue' import { fetchPosts } from '../posts' import type { PostType } from '../posts' +const PostsComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...(posts.value as Array), + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ))} +
+
+ +
+ ) + }, +}) + export const Route = createFileRoute('/posts')({ head: () => ({ meta: [ @@ -13,31 +44,3 @@ export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: PostsComponent, }) - -function PostsComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...(posts.value as Array), - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ))} -
-
- -
- ) -} diff --git a/examples/vue/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx b/examples/vue/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx index 57963c6b64..ad20bcdf97 100644 --- a/examples/vue/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx +++ b/examples/vue/basic-file-based-jsx/src/routes/posts_.$postId.edit.tsx @@ -1,23 +1,28 @@ import { createFileRoute, getRouteApi, useParams } from '@tanstack/vue-router' +import { defineComponent } from 'vue' + +const PostEditComponent = defineComponent({ + setup() { + const paramsViaApi = api.useParams() + const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) + const paramsViaRouteHook = api.useParams() + + return () => ( +
+
{paramsViaHook.value.postId}
+
+ {paramsViaRouteHook.value.postId} +
+
+ {paramsViaApi.value.postId} +
+
+ ) + }, +}) export const Route = createFileRoute('/posts_/$postId/edit')({ component: PostEditComponent, }) const api = getRouteApi('/posts_/$postId/edit') - -function PostEditComponent() { - const paramsViaApi = api.useParams() - const paramsViaHook = useParams({ from: '/posts_/$postId/edit' }) - const paramsViaRouteHook = api.useParams() - - return ( -
-
{paramsViaHook.value.postId}
-
- {paramsViaRouteHook.value.postId} -
-
{paramsViaApi.value.postId}
-
- ) -} diff --git a/examples/vue/basic-file-based-sfc/package.json b/examples/vue/basic-file-based-sfc/package.json index 3fba023a59..87ab2c332b 100644 --- a/examples/vue/basic-file-based-sfc/package.json +++ b/examples/vue/basic-file-based-sfc/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@tailwindcss/vite": "^4.2.2", - "@tanstack/router-plugin": "^1.168.23", - "@tanstack/vue-router": "^1.170.17", - "@tanstack/vue-router-devtools": "^1.167.0", + "@tanstack/router-plugin": "^1.169.0", + "@tanstack/vue-router": "^1.170.42", + "@tanstack/vue-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "tailwindcss": "^4.2.2", "vue": "^3.5.16", @@ -23,6 +23,6 @@ "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "~5.8.3", "vite": "^8.0.14", - "vue-tsc": "^3.1.5" + "vue-tsc": "^3.3.8" } } diff --git a/examples/vue/basic-file-based-sfc/src/posts.ts b/examples/vue/basic-file-based-sfc/src/posts.ts index 1b4c92b41d..f7a1941605 100644 --- a/examples/vue/basic-file-based-sfc/src/posts.ts +++ b/examples/vue/basic-file-based-sfc/src/posts.ts @@ -7,11 +7,7 @@ export type PostType = { body: string } -let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = 'https://jsonplaceholder.typicode.com' export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) diff --git a/examples/vue/basic-file-based-sfc/src/routeTree.gen.ts b/examples/vue/basic-file-based-sfc/src/routeTree.gen.ts index 09d62b0706..0bfdddab3d 100644 --- a/examples/vue/basic-file-based-sfc/src/routeTree.gen.ts +++ b/examples/vue/basic-file-based-sfc/src/routeTree.gen.ts @@ -454,7 +454,7 @@ declare module '@tanstack/vue-router' { '/(group)/_layout': { id: '/(group)/_layout' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupLayoutRouteImport parentRoute: typeof rootRouteImport } diff --git a/examples/vue/basic/package.json b/examples/vue/basic/package.json index 49b88fa665..af74afff3a 100644 --- a/examples/vue/basic/package.json +++ b/examples/vue/basic/package.json @@ -9,16 +9,17 @@ "start": "vite" }, "dependencies": { - "@tanstack/vue-router": "^1.170.17", - "@tanstack/vue-router-devtools": "^1.167.0", + "@tanstack/vue-router": "^1.170.42", + "@tanstack/vue-router-devtools": "^1.167.3", "redaxios": "^0.5.1", "vue": "^3.5.13", "tailwindcss": "4.1.18" }, "devDependencies": { - "typescript": "^6.0.2", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "^8.0.14", - "vue-tsc": "^3.1.5", + "vue-tsc": "^3.3.8", "@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue-jsx": "^5.1.5", "@tailwindcss/vite": "^4.2.2" diff --git a/examples/vue/basic/src/main.tsx b/examples/vue/basic/src/main.tsx index dc12871db0..09878913a8 100644 --- a/examples/vue/basic/src/main.tsx +++ b/examples/vue/basic/src/main.tsx @@ -1,4 +1,4 @@ -import { createApp } from 'vue' +import { createApp, defineComponent } from 'vue' import { ErrorComponent, Link, @@ -102,6 +102,20 @@ function PostsIndexComponent() { return
Select a post.
} +const PostComponent = defineComponent({ + setup() { + const post = postRoute.useLoaderData() + + return () => ( +
+

{post.value.title}

+
+
{post.value.body}
+
+ ) + }, +}) + const postRoute = createRoute({ getParentRoute: () => postsLayoutRoute, path: '$postId', @@ -118,18 +132,6 @@ function PostErrorComponent({ error }: ErrorComponentProps) { return } -function PostComponent() { - const post = postRoute.useLoaderData() - - return ( -
-

{post.value.title}

-
-
{post.value.body}
-
- ) -} - const pathlessLayoutRoute = createRoute({ getParentRoute: () => rootRoute, id: '_pathlessLayout', diff --git a/examples/vue/basic/src/posts.lazy.tsx b/examples/vue/basic/src/posts.lazy.tsx index 1fd64723e5..8602de045f 100644 --- a/examples/vue/basic/src/posts.lazy.tsx +++ b/examples/vue/basic/src/posts.lazy.tsx @@ -1,36 +1,39 @@ import { Link, Outlet, createLazyRoute } from '@tanstack/vue-router' +import { defineComponent } from 'vue' + +const PostsLayoutComponent = defineComponent({ + setup() { + const posts = Route.useLoaderData() + + return () => ( +
+
    + {[ + ...posts.value, + { id: 'i-do-not-exist', title: 'Non-existent Post' }, + ].map((post) => { + return ( +
  • + +
    {post.title.substring(0, 20)}
    + +
  • + ) + })} +
+ +
+ ) + }, +}) export const Route = createLazyRoute('/posts')({ component: PostsLayoutComponent, }) - -function PostsLayoutComponent() { - const posts = Route.useLoaderData() - - return ( -
-
    - {[ - ...posts.value, - { id: 'i-do-not-exist', title: 'Non-existent Post' }, - ].map((post) => { - return ( -
  • - -
    {post.title.substring(0, 20)}
    - -
  • - ) - })} -
- -
- ) -} diff --git a/labeler-config.yml b/labeler-config.yml index a5b908cbac..9da92bf7ff 100644 --- a/labeler-config.yml +++ b/labeler-config.yml @@ -10,12 +10,6 @@ 'package: history': - changed-files: - any-glob-to-any-file: 'packages/history/**/*' -'package: nitro-v2-vite-plugin': - - changed-files: - - any-glob-to-any-file: 'packages/nitro-v2-vite-plugin/**/*' -'package: react-nativescript-router': - - changed-files: - - any-glob-to-any-file: 'packages/react-nativescript-router/**/*' 'package: react-router': - changed-files: - any-glob-to-any-file: 'packages/react-router/**/*' diff --git a/media/header_router.png b/media/header_router.png deleted file mode 100644 index 5f2d58134d..0000000000 Binary files a/media/header_router.png and /dev/null differ diff --git a/media/header_start.png b/media/header_start.png deleted file mode 100644 index 8622986ee1..0000000000 Binary files a/media/header_start.png and /dev/null differ diff --git a/nx.json b/nx.json index 08e7563642..b7df8b2c09 100644 --- a/nx.json +++ b/nx.json @@ -1,6 +1,7 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", "defaultBase": "main", + "bust": "nx24-exclusive-e2e-16-medium-baseline-2026-10-25-05", "nxCloudId": "6442f7de8226a6291646a813", "useInferencePlugins": false, "parallel": 5, @@ -9,10 +10,26 @@ }, "namedInputs": { "sharedGlobals": [ + "{workspaceRoot}/.npmrc", + "{workspaceRoot}/nx.json", + "{workspaceRoot}/.github/workflows/pr.yml", + "{workspaceRoot}/.nx/ci-config.yaml", + "{workspaceRoot}/.nx/workflows/ultracache-config.yaml", "{workspaceRoot}/.nvmrc", "{workspaceRoot}/package.json", "{workspaceRoot}/tsconfig.json" ], + "dependentTaskOutputs": [ + { + "dependentTasksOutputFiles": "**/*", + "transitive": true + } + ], + "streamingSsrTests": [ + "{workspaceRoot}/e2e/streaming-ssr-assertions.ts", + "{workspaceRoot}/e2e/streaming-ssr-fixtures/**/*", + "{workspaceRoot}/e2e/streaming-ssr-specs/**/*" + ], "default": [ "sharedGlobals", "{projectRoot}/**/*", @@ -22,64 +39,119 @@ "default", "!{projectRoot}/tests/**/*", "!{projectRoot}/eslint.config.js" - ] + ], + "buildProduction": ["sharedGlobals", "{projectRoot}/**/*"] }, "targetDefaults": { "test:docs": { "cache": true, - "inputs": ["{workspaceRoot}/docs/**/*"] + "inputs": ["sharedGlobals", "{workspaceRoot}/docs/**/*"] }, "test:eslint": { "cache": true, - "dependsOn": ["^build"], - "inputs": ["default", "^production", "{workspaceRoot}/eslint.config.js"] + "dependsOn": ["^build", "build"], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "dependentTaskOutputs" + ] }, "test:unit": { "cache": true, "dependsOn": ["^build"], - "inputs": ["default", "^production"], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "dependentTaskOutputs" + ], "outputs": ["{projectRoot}/coverage"] }, "test:e2e": { "cache": true, "dependsOn": ["^build", "test:e2e--*"], - "inputs": ["default", "^production"] + "inputs": ["buildProduction", "^production", "dependentTaskOutputs"], + "outputs": ["{projectRoot}/dist", "{projectRoot}/test-results"], + "parallelism": false }, "test:e2e:nitro": { "cache": true, "dependsOn": ["^build"], - "inputs": ["default", "^production"] + "inputs": ["default", "^production"], + "parallelism": false }, "test:e2e:basepath": { "cache": true, "dependsOn": ["^build"], - "inputs": ["default", "^production"] + "inputs": ["default", "^production"], + "parallelism": false }, "test:e2e:preview": { "cache": true, "dependsOn": ["^build"], - "inputs": ["default", "^production"] + "inputs": ["default", "^production"], + "parallelism": false }, "test:types": { "cache": true, - "dependsOn": ["^build"], - "inputs": ["default", "^production"] + "dependsOn": ["^build", "build"], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/eslint.config.js", + "dependentTaskOutputs" + ] + }, + "test:types:client": { + "cache": true, + "inputs": [ + "default", + "^production", + "{workspaceRoot}/benchmarks/client-nav/*.{ts,json}", + "{workspaceRoot}/benchmarks/client-nav/scenarios/*.ts", + "{workspaceRoot}/benchmarks/client-nav/scenarios/*/*.ts", + "{workspaceRoot}/benchmarks/memory/*.ts", + "{workspaceRoot}/benchmarks/memory/client/*.{ts,json}", + "{workspaceRoot}/benchmarks/memory/client/scenarios/*/*.ts", + "{workspaceRoot}/benchmarks/cpu-simulation.ts", + "dependentTaskOutputs" + ] }, "test:types:ssr": { "cache": true, - "dependsOn": ["^build"], - "inputs": ["default", "^production"] + "dependsOn": ["^build", "build"], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/benchmarks/ssr/bench-utils.ts", + "{workspaceRoot}/benchmarks/cpu-simulation.ts", + "{workspaceRoot}/benchmarks/ssr/scenarios/*/*.ts", + "{workspaceRoot}/benchmarks/memory/*.ts", + "{workspaceRoot}/benchmarks/memory/server/*.ts", + "{workspaceRoot}/benchmarks/memory/server/scenarios/*/*.ts", + "dependentTaskOutputs" + ] }, "build": { "cache": true, "dependsOn": ["^build"], - "inputs": ["production", "^production"], - "outputs": ["{projectRoot}/build", "{projectRoot}/dist"] + "inputs": ["buildProduction", "^buildProduction", "dependentTaskOutputs"], + "outputs": [ + "{projectRoot}/.netlify", + "{projectRoot}/.wrangler", + "{projectRoot}/.output", + "{projectRoot}/build", + "{projectRoot}/dist" + ] }, "test:build": { "cache": true, "dependsOn": ["build"], - "inputs": ["production"] + "inputs": ["buildProduction", "dependentTaskOutputs"] + }, + "test:e2e*": { + "parallelism": false } }, "plugins": [ diff --git a/package.json b/package.json index cdc2bf2bc8..3ef11b1969 100644 --- a/package.json +++ b/package.json @@ -5,24 +5,25 @@ "type": "git", "url": "git+https://github.com/TanStack/router.git" }, - "packageManager": "pnpm@11.9.0", + "packageManager": "pnpm@12.18.0", "engines": { - "pnpm": ">=11.9.0" + "pnpm": ">=12.18.0" }, "type": "module", "scripts": { "cleanNodeModules": "pnpm -r exec rm -rf node_modules", "clean": "pnpm --filter \"./packages/**\" run clean", "test": "pnpm run test:ci", - "test:pr": "nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build", - "test:ci": "nx run-many --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build", + "test:pr": "nx affected --targets=test:eslint,test:unit,test:integration,test:e2e,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:eslint,test:unit,test:integration,test:e2e,test:types,test:build,build", "test:eslint": "nx affected --target=test:eslint --exclude=examples/**,e2e/**", "test:unit": "nx affected --target=test:unit --exclude=examples/**,e2e/**", "test:unit:dev": "pnpm run test:unit && nx watch --all -- pnpm run test:unit", "test:build": "nx affected --target=test:build --exclude=examples/**", "test:types": "nx affected --target=test:types --exclude=examples/**", "test:e2e": "nx run-many --target=test:e2e", - "benchmark:bundle-size": "nx run @benchmarks/bundle-size:build", + "benchmark:bundle-size": "node scripts/benchmarks/bundle-size/build.mjs", + "benchmark:bundle-size:run": "node scripts/benchmarks/bundle-size/run.mjs", "benchmark:bundle-size:query": "node scripts/benchmarks/bundle-size/query.mjs", "benchmark:bundle-size:diff": "node scripts/benchmarks/bundle-size/diff.mjs", "benchmark:bundle-size:history": "node scripts/benchmarks/bundle-size/history.mjs", @@ -44,7 +45,8 @@ "format": "prettier --experimental-cli --ignore-unknown '**/*' --write", "changeset": "changeset", "changeset:publish": "changeset publish", - "changeset:version": "changeset version && node scripts/update-example-deps.mjs && pnpm install --lockfile-only --ignore-scripts --no-frozen-lockfile && pnpm format", + "changeset:version": "changeset version && pnpm run update:example-deps && pnpm install --lockfile-only --ignore-scripts --no-frozen-lockfile && pnpm format", + "update:example-deps": "node scripts/update-example-deps.mjs", "gpt-generate": "node gpt/generate.js", "set-ts-version": "node scripts/set-ts-version.js", "labeler-generate": "node scripts/generate-labeler-config.ts", @@ -61,45 +63,25 @@ ] }, "devDependencies": { - "@arethetypeswrong/cli": "^0.18.4", "@changesets/changelog-github": "^0.7.0", "@changesets/cli": "^2.30.0", - "@eslint-react/eslint-plugin": "^1.26.2", - "@nx/devkit": "22.7.5", + "@nx/devkit": "24.0.0", "@playwright/test": "catalog:", - "@swc-node/core": "^1.14.1", "@swc-node/register": "^1.11.1", "@tanstack/eslint-config": "0.4.0", - "@tanstack/query-core": "catalog:", - "@tanstack/react-query": "catalog:", - "@tanstack/solid-query": "catalog:", - "@tanstack/vite-config": "0.5.2", - "@tanstack/vue-query": "catalog:", "@types/node": "catalog:", - "@types/react": "catalog:", - "@types/react-dom": "catalog:", - "@vitest/browser": "^4.1.4", - "@vitest/ui": "^4.1.4", "eslint": "catalog:", - "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-unused-imports": "^4.1.4", - "jsdom": "^25.0.1", "markdown-link-extractor": "^4.0.3", - "nx": "22.7.5", + "nx": "24.0.0", "prettier": "^3.8.0", - "publint": "^0.3.16", - "react": "catalog:", - "react-dom": "catalog:", - "redaxios": "^0.5.1", - "rimraf": "^6.1.2", "tinyglobby": "^0.2.15", - "typescript": "^6.0.2", - "typescript55": "npm:typescript@5.5", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "catalog:", + "@typescript/native": "npm:typescript@^7.0.2", "typescript56": "npm:typescript@5.6", "typescript57": "npm:typescript@5.7", "typescript58": "npm:typescript@5.8", - "typescript59": "npm:typescript@5.9", - "vite": "catalog:", - "vitest": "^4.1.4" + "typescript59": "npm:typescript@5.9" } } diff --git a/packages/AGENTS.md b/packages/AGENTS.md new file mode 100644 index 0000000000..0c63c3a15c --- /dev/null +++ b/packages/AGENTS.md @@ -0,0 +1,16 @@ +# Packages + +- Route generation/code splitting live in `router-generator`/`router-plugin`; Start build transforms live in `start-plugin-core`. + +## Router bindings + +- Navigation/render identity is more than href or route membership: same-href navigations can have different history keys, and suspended renders must acknowledge only their own match publication. Preserve those identity checks when optimizing stores or render notifications. +- In navigation params/search, an explicit `undefined` can clear an inherited value; an absent key can inherit it. Preserve that distinction when comparing or memoizing options; React's `useValueStable` uses `deepEqual` with `ignoreUndefined: false`. + +## Tests + +- Inspect test commands: several `test:unit` scripts immediately exit or only echo a message. For these packages, validate behavior in the shared core or consuming e2e app; a successful placeholder target provides no unit coverage. +- For `*-router-ssr-query` changes, run `router-ssr-query-core` unit tests and the affected framework's `e2e/-start/query-integration` tests. The framework wrapper unit targets currently exit without running tests. +- For single-command Vitest targets, append filters after `--`, e.g. `-- tests/link.test.tsx -t "preloading"`. +- `solid-router` and `router-generator` chain two Vitest commands in `test:unit`. Trailing file/name/update arguments reach only the final command. Run the full target for verification: Solid needs browser and server suites; the generator needs fixture generation followed by typechecking. +- For public type changes, add `*.test-d.*` inference regressions and run both unit and type targets. React/Solid Router's TypeScript compiler matrix checks `src`; Vitest runs their inference tests. For changes to inference cost, follow the [type-safety performance guidance](../docs/router/guide/type-safety.md#performance-recommendations); `test:perf` measures runtime, not compiler cost. diff --git a/packages/arktype-adapter/package.json b/packages/arktype-adapter/package.json index f7840ba4f8..ceca3fad73 100644 --- a/packages/arktype-adapter/package.json +++ b/packages/arktype-adapter/package.json @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --typecheck", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -66,11 +66,19 @@ "devDependencies": { "@tanstack/react-router": "workspace:*", "arktype": "^2.1.7", - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.2.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "vite": "*" + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "arktype": ">=2.0.0-rc <3", diff --git a/packages/arktype-adapter/tests/index.test.tsx b/packages/arktype-adapter/tests/index.test.tsx index a99ecda9c4..ce6eb74756 100644 --- a/packages/arktype-adapter/tests/index.test.tsx +++ b/packages/arktype-adapter/tests/index.test.tsx @@ -9,7 +9,6 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, expect, test, vi } from 'vitest' import { type } from 'arktype' import { arkTypeValidator } from '../src' -import '@testing-library/jest-dom/vitest' afterEach(() => { vi.resetAllMocks() diff --git a/packages/arktype-adapter/tests/jest-dom.setup.ts b/packages/arktype-adapter/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/packages/arktype-adapter/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/packages/arktype-adapter/vite.config.ts b/packages/arktype-adapter/vite.config.ts index 8c8c0c519f..8d553e0a59 100644 --- a/packages/arktype-adapter/vite.config.ts +++ b/packages/arktype-adapter/vite.config.ts @@ -9,6 +9,7 @@ const config = defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, + setupFiles: ['./tests/jest-dom.setup.ts'], }, }) diff --git a/packages/eslint-plugin-router/package.json b/packages/eslint-plugin-router/package.json index b99ee55e13..9be54c220e 100644 --- a/packages/eslint-plugin-router/package.json +++ b/packages/eslint-plugin-router/package.json @@ -18,12 +18,12 @@ "clean": "rimraf ./dist ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --typecheck", "test:build": "publint --strict && attw --pack .", @@ -56,11 +56,26 @@ }, "devDependencies": { "@typescript-eslint/rule-tester": "^8.23.0", - "combinate": "^1.1.11", + "combinate": "catalog:", "eslint": "^9.22.0", - "vite": "*" + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0" + }, + "nx": { + "targets": { + "build": { + "inputs": [ + "...", + "{workspaceRoot}/eslint.config.js" + ] + } + } } } diff --git a/packages/eslint-plugin-start/package.json b/packages/eslint-plugin-start/package.json index c4867c58d0..803264ed10 100644 --- a/packages/eslint-plugin-start/package.json +++ b/packages/eslint-plugin-start/package.json @@ -18,29 +18,29 @@ "clean": "rimraf ./dist ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --typecheck", "test:build": "publint --strict && attw --pack .", "build": "vite build && tsc --noEmit" }, "type": "module", - "types": "dist/esm/src/index.d.ts", + "types": "dist/esm/index.d.ts", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.js", "exports": { ".": { "import": { - "types": "./dist/esm/src/index.d.ts", + "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "types": "./dist/cjs/src/index.d.cts", + "types": "./dist/cjs/index.d.cts", "default": "./dist/cjs/index.cjs" } }, @@ -58,10 +58,25 @@ "devDependencies": { "@typescript-eslint/rule-tester": "^8.44.1", "eslint": "^9.22.0", - "typescript": "^5.8.2" + "typescript": "^5.8.2", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.7.0" + }, + "nx": { + "targets": { + "build": { + "inputs": [ + "...", + "{workspaceRoot}/eslint.config.js" + ] + } + } } } diff --git a/packages/history/AGENTS.md b/packages/history/AGENTS.md new file mode 100644 index 0000000000..509da6a4ec --- /dev/null +++ b/packages/history/AGENTS.md @@ -0,0 +1,3 @@ +# History + +Accepted browser push/replace operations update the in-memory location immediately and batch native writes into a microtask. Preserve coalescing: the latest href/state wins, but any queued push wins over replaces. Use `history.flush()` when native browser state must be current; verify subsequent updates still flush afterward in `tests/createBrowserHistory.test.ts`. diff --git a/packages/history/CHANGELOG.md b/packages/history/CHANGELOG.md index dbd02474bf..ca3341088c 100644 --- a/packages/history/CHANGELOG.md +++ b/packages/history/CHANGELOG.md @@ -1,5 +1,63 @@ # @tanstack/history +## 1.162.5 + +### Patch Changes + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Drop a duplicated current-location flag and a redundant `createHref` wrapper. + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Avoid temporary arrays when reading hash-history locations. + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Keep a leading query or fragment out of the parsed pathname, so hash-history URLs like `/#?x=1` no longer repeat the query in the router location. + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Fixed Link destinations that resolve to a route mask are now reused across navigations instead of being rebuilt every time. A mounted Link now follows changes to its `href` and `reloadDocument` props, and React Links no longer each subscribe to a hydration flag. + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Use `slice` instead of `substring` where the bounds are always ordered and non-negative. + +## 1.162.4 + +### Patch Changes + +- [#8359](https://github.com/TanStack/router/pull/8359) [`8fff7fa`](https://github.com/TanStack/router/commit/8fff7fa1f2e6f061916b0bf5e0ec486b2e732f94) - Normalize memory history hrefs consistently with browser and server history, including protocol-relative paths and control characters. + +- [#8352](https://github.com/TanStack/router/pull/8352) [`f021f6d`](https://github.com/TanStack/router/commit/f021f6d1c6dce6c9b54d70766f1d636d8fd9e184) - Avoid temporary arrays when replacing forward memory-history entries. + +- [#8349](https://github.com/TanStack/router/pull/8349) [`ae68535`](https://github.com/TanStack/router/commit/ae68535929043607d4ee9438f8ae401f3a064862) - Avoid generating unused history keys for locations with existing state. + +- [#8354](https://github.com/TanStack/router/pull/8354) [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244) - Use lightweight request history for SSR and make server navigation a no-op. Use redirect() to issue HTTP redirects. Server hrefs use the same normalization as browser history to handle protocol-relative URLs and control characters. + +## 1.162.3 + +### Patch Changes + +- [#8308](https://github.com/TanStack/router/pull/8308) [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8) - Validate navigation and redirect destinations, keep ambiguous relative URLs on the current origin, and constrain prerender requests and output paths. Prevent redirect headers from appearing in serialized server function response bodies. + + Preserve native form HTTP redirects, route error handling and masks for document redirects, and per-navigation destinations for shared loader redirects. Avoid redundant origin parsing and reduce link styling and server-rendering work. Configured origins must already be normalized. + + Keep blocked-link inactive props consistent during React hydration, honor explicit redirect Location headers before checking route options, and refresh Vue link state when destinations become internal. Reuse the protocol-relative URL check while parsing redirect schemes once. + + Reduce React link bundle size by sharing pathname comparisons, state-prop selection, and element creation. + + Share normalized pathname comparisons in Solid and Vue links to reduce bundle size. + +- [#8287](https://github.com/TanStack/router/pull/8287) [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9) - Use full-document navigation when an output rewrite produces a cross-origin destination, including the public URL of a route mask. + + Respect registered history blockers during document navigation, passing history locations and the requested push or replace action. + +## 1.162.2 + +### Patch Changes + +- [#8264](https://github.com/TanStack/router/pull/8264) [`9035abc`](https://github.com/TanStack/router/commit/9035abc41163d83409ef582f7743a3c7be57dd93) - Respect `ignoreBlocker` during `go()` navigation, including document unload warnings. Preserve beforeunload warnings during back and forward navigation unless `ignoreBlocker` is requested, and clear the bypass after same-document traversal so later document navigation still warns about unsaved changes. + + Restore the original browser history entry when forward or multi-entry navigation is blocked. + +## 1.162.1 + +### Patch Changes + +- [#7985](https://github.com/TanStack/router/pull/7985) [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b) - perf: compact private bundle boundaries- [#7975](https://github.com/TanStack/router/issues/7975) + ## 1.162.0 ### Minor Changes diff --git a/packages/history/package.json b/packages/history/package.json index 790acabc3c..d09c710d2f 100644 --- a/packages/history/package.json +++ b/packages/history/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/history", - "version": "1.162.0", + "version": "1.162.5", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -22,12 +22,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch", @@ -59,6 +59,12 @@ "node": ">=20.19" }, "devDependencies": { - "vite": "*" + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" } } diff --git a/packages/history/src/index.ts b/packages/history/src/index.ts index ad40c80fa5..d2f80581b9 100644 --- a/packages/history/src/index.ts +++ b/packages/history/src/index.ts @@ -36,9 +36,9 @@ export interface RouterHistory { flush: () => void destroy: () => void notify: (action: SubscriberHistoryAction) => void + _getBlockers: () => Array _ignoreSubscribers?: boolean - /** Return addressable entries when the host exposes its navigation stack. */ - getEntries?: () => ReadonlyArray + _ignoreNextBeforeUnload?: (href: string) => void } export interface HistoryLocation extends ParsedPath { @@ -58,8 +58,6 @@ export type ParsedHistoryState = HistoryState & { key?: string // TODO: Remove in v2 - use __TSR_key instead __TSR_key?: string __TSR_index: number - __TSR_entryId?: string - __TSR_nativeMinStackState?: 'active' | 'paused' } type ShouldAllowNavigation = any @@ -100,12 +98,40 @@ const stateIndexKey = '__TSR_index' const popStateEvent = 'popstate' const beforeUnloadEvent = 'beforeunload' +/** + * Turn protocol-relative inputs such as "//evil.example" into paths + * such as "/evil.example", keeping navigation on the current origin. + * + * For HTTP(S) URLs, WHATWG parsing ignores leading C0 controls and spaces, + * removes tabs/newlines, and treats backslashes as slashes, so inputs like + * "/\evil.example" also need normalization. This only allocates when those + * rules would make the input protocol-relative. + */ +// eslint-disable-next-line no-control-regex +const protocolRelativePrefix = /^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/ + +export function normalizeProtocolRelative(url: string): string { + const match = protocolRelativePrefix.exec(url) + return match ? '/' + url.slice(match[0].length) : url +} + +function normalizeHref(href: string): string { + // eslint-disable-next-line no-control-regex + if (/[\x00-\x1f\x7f]/.test(href)) { + // eslint-disable-next-line no-control-regex + href = href.replace(/[\x00-\x1f\x7f]/g, (character) => + '\t\n\r'.includes(character) ? '' : encodeURIComponent(character), + ) + } + return normalizeProtocolRelative(href) +} + export function createHistory(opts: { getLocation: () => HistoryLocation getLength: () => number pushState: (path: string, state: any) => void replaceState: (path: string, state: any) => void - go: (n: number) => void + go: (n: number, ignoreBlocker: boolean) => void back: (ignoreBlocker: boolean) => void forward: (ignoreBlocker: boolean) => void createHref: (path: string) => string @@ -114,7 +140,6 @@ export function createHistory(opts: { onBlocked?: () => void getBlockers?: () => Array setBlockers?: (blockers: Array) => void - getEntries?: () => ReadonlyArray // Avoid notifying on forward/back/go, used for browser history as we already get notified by the popstate event notifyOnIndexChange?: boolean }): RouterHistory { @@ -131,27 +156,21 @@ export function createHistory(opts: { else location = opts.getLocation() } - const tryNavigation = async ({ - task, - navigateOpts, - ...actionInfo - }: TryNavigateArgs) => { - const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false - if (ignoreBlocker) { - task() - return - } - - const blockers = opts.getBlockers?.() ?? [] - const isPushOrReplace = - actionInfo.type === 'PUSH' || actionInfo.type === 'REPLACE' - if (typeof document !== 'undefined' && blockers.length && isPushOrReplace) { + const tryNavigation = async (args: TryNavigateArgs) => { + const blockers = args.navigateOpts?.ignoreBlocker + ? undefined + : opts.getBlockers?.() + if ( + typeof document !== 'undefined' && + blockers?.length && + (args.type === 'PUSH' || args.type === 'REPLACE') + ) { for (const blocker of blockers) { - const nextLocation = parseHref(actionInfo.path, actionInfo.state) + const nextLocation = parseHref(args.path, args.state) const isBlocked = await blocker.blockerFn({ currentLocation: location, nextLocation, - action: actionInfo.type, + action: args.type, }) if (isBlocked) { opts.onBlocked?.() @@ -160,7 +179,7 @@ export function createHistory(opts: { } } - task() + args.task() } return { @@ -209,7 +228,7 @@ export function createHistory(opts: { go: (index, navigateOpts) => { tryNavigation({ task: () => { - opts.go(index) + opts.go(index, navigateOpts?.ignoreBlocker ?? false) handleIndexChange({ type: 'GO', index }) }, navigateOpts, @@ -251,14 +270,11 @@ export function createHistory(opts: { flush: () => opts.flush?.(), destroy: () => opts.destroy?.(), notify, - ...(opts.getEntries ? { getEntries: opts.getEntries } : {}), + _getBlockers: () => opts.getBlockers?.() ?? [], } } function assignKeyAndIndex(index: number, state: HistoryState | undefined) { - if (!state) { - state = {} - } const key = createRandomKey() return { ...state, @@ -301,7 +317,8 @@ export function createBrowserHistory(opts?: { const _setBlockers = (newBlockers: Array) => (blockers = newBlockers) - const createHref = opts?.createHref ?? ((path) => path) + const createHref = (path: string) => + normalizeHref(opts?.createHref ? opts.createHref(path) : path) const parseLocation = opts?.parseLocation ?? (() => @@ -328,6 +345,9 @@ export function createBrowserHistory(opts?: { let nextPopIsGo = false let ignoreNextPop = false + // TODO: An ignored traversal past a history boundary emits neither popstate + // nor beforeunload, leaving these bypasses active for a later navigation. + // The History API provides no completion signal for such no-op traversals. let skipBlockerNextPop = false let ignoreNextBeforeUnload = false @@ -335,18 +355,14 @@ export function createBrowserHistory(opts?: { let next: | undefined - | { - // This is the latest location that we were attempting to push/replace - href: string - // This is the latest state that we were attempting to push/replace - state: any - // This is the latest type that we were attempting to push/replace - isPush: boolean - } - - // We need to track the current scheduled update to prevent - // multiple updates from being scheduled at the same time. - let scheduled: undefined | boolean + | [ + // The latest location that we were attempting to push/replace + href: string, + // The latest state that we were attempting to push/replace + state: any, + // Whether any queued update needs to push rather than replace + isPush: boolean, + ] // This function flushes the next update to the browser history const flush = () => { @@ -358,46 +374,47 @@ export function createBrowserHistory(opts?: { history._ignoreSubscribers = true // Update the browser history - ;(next.isPush ? win.history.pushState : win.history.replaceState)( - next.state, + ;(next[2 /* is push */] ? win.history.pushState : win.history.replaceState)( + next[1 /* state */], '', - next.href, + next[0 /* href */], ) // Stop ignoring subscriber updates history._ignoreSubscribers = false - // Reset the nextIsPush flag and clear the scheduled update + // Clear the queued action after it reaches browser history. next = undefined - scheduled = false rollbackLocation = undefined } // This function queues up a call to update the browser history const queueHistoryAction = ( - type: 'push' | 'replace', + isPush: boolean, destHref: string, state: any, ) => { - const href = createHref(destHref) + // A formatter changes the URL space and must receive the original input. + // Otherwise parseHref below already produces the browser destination. + const href = opts?.createHref ? createHref(destHref) : undefined + const hasPendingAction = !!next - if (!scheduled) { + if (!hasPendingAction) { rollbackLocation = currentLocation } - // Update the location in memory + // Keep the optimistic location in the router's logical URL space. currentLocation = parseHref(destHref, state) // Keep track of the next location we need to flush to the URL - next = { - href, + next = [ + href ?? currentLocation.href, state, - isPush: next?.isPush || type === 'push', - } + next?.[2 /* is push */] || isPush, + ] - if (!scheduled) { + if (!hasPendingAction) { // Schedule an update to the browser history - scheduled = true queueMicrotask(() => flush()) } } @@ -409,6 +426,10 @@ export function createBrowserHistory(opts?: { } const onPushPopEvent = async () => { + // Same-document traversals do not fire beforeunload, so consume their + // exemption here instead of carrying it into a later document navigation. + ignoreNextBeforeUnload = false + if (ignoreNextPop) { ignoreNextPop = false return @@ -445,7 +466,7 @@ export function createBrowserHistory(opts?: { }) if (isBlocked) { ignoreNextPop = true - win.history.go(1) + win.history.go(-delta) history.notify(notify) return } @@ -495,23 +516,31 @@ export function createBrowserHistory(opts?: { const history = createHistory({ getLocation, getLength: () => win.history.length, - pushState: (href, state) => queueHistoryAction('push', href, state), - replaceState: (href, state) => queueHistoryAction('replace', href, state), + pushState: (href, state) => queueHistoryAction(true, href, state), + replaceState: (href, state) => queueHistoryAction(false, href, state), back: (ignoreBlocker) => { - if (ignoreBlocker) skipBlockerNextPop = true - ignoreNextBeforeUnload = true + if (ignoreBlocker) { + skipBlockerNextPop = true + ignoreNextBeforeUnload = true + } return win.history.back() }, forward: (ignoreBlocker) => { - if (ignoreBlocker) skipBlockerNextPop = true - ignoreNextBeforeUnload = true + if (ignoreBlocker) { + skipBlockerNextPop = true + ignoreNextBeforeUnload = true + } win.history.forward() }, - go: (n) => { + go: (n, ignoreBlocker) => { nextPopIsGo = true + if (ignoreBlocker) { + skipBlockerNextPop = true + ignoreNextBeforeUnload = true + } win.history.go(n) }, - createHref: (href) => createHref(href), + createHref, flush, destroy: () => { win.history.pushState = originalPushState @@ -533,6 +562,21 @@ export function createBrowserHistory(opts?: { notifyOnIndexChange: false, }) + history._ignoreNextBeforeUnload = (href) => { + ignoreNextBeforeUnload = false + try { + href = new URL(href, win.document.baseURI).href + // External handlers and same-document fragments may emit neither + // beforeunload nor popstate, leaving an exemption for a later departure. + ignoreNextBeforeUnload = + /^https?:/.test(href) && + (!href.includes('#') || + href.split('#')[0] !== win.location.href.split('#')[0]) + } catch { + // Invalid URLs cannot unload the document. + } + } + win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true }) win.addEventListener(popStateEvent, onPushPopEvent) @@ -563,14 +607,17 @@ export function createHashHistory(opts?: { window?: any }): RouterHistory { return createBrowserHistory({ window: win, parseLocation: () => { - const hashSplit = win.location.hash.split('#').slice(1) - const pathPart = hashSplit[0] ?? '/' - const searchPart = win.location.search - const hashEntries = hashSplit.slice(1) - const hashPart = - hashEntries.length === 0 ? '' : `#${hashEntries.join('#')}` - const hashHref = `${pathPart}${searchPart}${hashPart}` - return parseHref(hashHref, win.history.state) + // `#/path?query#fragment`: the router's own fragment starts at the + // second '#'. A non-empty `location.hash` always starts with '#'. + const hash = win.location.hash + let hashIndex = hash.indexOf('#', 1) + if (hashIndex < 0) { + hashIndex = hash.length + } + return parseHref( + `${hash ? hash.slice(1, hashIndex) : '/'}${win.location.search}${hash.slice(hashIndex)}`, + win.history.state, + ) }, createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`, @@ -610,13 +657,13 @@ export function createMemoryHistory( getLength: () => entries.length, pushState: (path, state) => { // Removes all subsequent entries after the current index to start a new branch + index = index < entries.length - 1 ? index + 1 : entries.length + states[index] = state + entries[index] = path if (index < entries.length - 1) { - entries.splice(index + 1) - states.splice(index + 1) + entries.length = index + 1 + states.length = index + 1 } - states.push(state) - entries.push(path) - index = Math.max(entries.length - 1, 0) }, replaceState: (path, state) => { states[index] = state @@ -631,56 +678,89 @@ export function createMemoryHistory( go: (n) => { index = Math.min(Math.max(index + n, 0), entries.length - 1) }, - createHref: (path) => path, + createHref: normalizeHref, getBlockers: _getBlockers, setBlockers: _setBlockers, - getEntries: () => - entries.map((entry, entryIndex) => parseHref(entry, states[entryIndex])), }) } -/** - * Sanitize a path to prevent open redirect vulnerabilities. - * Removes control characters and collapses leading double slashes. - */ -function sanitizePath(path: string): string { - // Remove ASCII control characters (0x00-0x1F) and DEL (0x7F) - // These include CR (\r = 0x0D), LF (\n = 0x0A), and other potentially dangerous characters - // eslint-disable-next-line no-control-regex - let sanitized = path.replace(/[\x00-\x1f\x7f]/g, '') +const noop = () => {} - // Prevent open redirect via protocol-relative URLs (e.g. "//evil.com") - // Collapse leading double slashes to a single slash - if (sanitized.startsWith('//')) { - sanitized = '/' + sanitized.replace(/^\/+/, '') +class ServerHistory implements RouterHistory { + declare private _subscribers?: RouterHistory['subscribers'] + + constructor(public location: HistoryLocation) {} + + get length() { + return 1 } - return sanitized + // Preserve the history interface without allocating a Set for each request. + get subscribers() { + return (this._subscribers ??= new Set()) + } + + subscribe() { + return noop + } + + push() {} + replace() {} + go() {} + back() {} + forward() {} + + canGoBack() { + return false + } + + createHref(href: string) { + return normalizeHref(href) + } + + block() { + return noop + } + + flush() {} + destroy() {} + notify() {} + + _getBlockers(): Array { + return [] + } +} + +/** A fixed request location; server navigation is a no-op. */ +export function createServerHistory(href: string): RouterHistory { + return new ServerHistory(parseHref(href, undefined)) } export function parseHref( href: string, state: ParsedHistoryState | undefined, ): HistoryLocation { - const sanitizedHref = sanitizePath(href) + const sanitizedHref = normalizeHref(href) const hashIndex = sanitizedHref.indexOf('#') const searchIndex = sanitizedHref.indexOf('?') - - const addedKey = createRandomKey() + if (!state) { + const key = createRandomKey() + state = { [stateIndexKey]: 0, key, __TSR_key: key } + } return { href: sanitizedHref, - pathname: sanitizedHref.substring( + pathname: sanitizedHref.slice( 0, - hashIndex > 0 - ? searchIndex > 0 + hashIndex > -1 + ? searchIndex > -1 ? Math.min(hashIndex, searchIndex) : hashIndex - : searchIndex > 0 + : searchIndex > -1 ? searchIndex : sanitizedHref.length, ), - hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : '', + hash: hashIndex > -1 ? sanitizedHref.slice(hashIndex) : '', search: searchIndex > -1 ? sanitizedHref.slice( @@ -688,11 +768,11 @@ export function parseHref( hashIndex === -1 ? undefined : hashIndex, ) : '', - state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey }, + state, } } // Thanks co-pilot! function createRandomKey() { - return (Math.random() + 1).toString(36).substring(7) + return (Math.random() + 1).toString(36).slice(7) } diff --git a/packages/history/tests/createBrowserHistory.test.ts b/packages/history/tests/createBrowserHistory.test.ts new file mode 100644 index 0000000000..5b24744fb5 --- /dev/null +++ b/packages/history/tests/createBrowserHistory.test.ts @@ -0,0 +1,307 @@ +import { describe, expect, test, vi } from 'vitest' +import { createBrowserHistory } from '../src' + +function createBrowserHistoryHarness(createHref?: (path: string) => string) { + const listeners = new Map any>() + const location = { + pathname: '/', + search: '', + hash: '', + } + const pushState = vi.fn() + const replaceState = vi.fn() + const nativeHistory = { + state: { __TSR_index: 0, __TSR_key: 'initial' }, + length: 1, + pushState, + replaceState, + back: vi.fn(), + forward: vi.fn(), + go: vi.fn(), + } + const window = { + location, + history: nativeHistory, + addEventListener: vi.fn((type: string, listener: (event: any) => any) => { + listeners.set(type, listener) + }), + removeEventListener: vi.fn((type: string) => { + listeners.delete(type) + }), + dispatchEvent: (event: { type: string }) => + listeners.get(event.type)?.(event), + } + const history = createBrowserHistory({ window, createHref }) + + return { + history, + pushState, + replaceState, + window, + } +} + +describe('createBrowserHistory', () => { + test('passes the original destination to a custom formatter', () => { + const { history, pushState } = createBrowserHistoryHarness( + (href) => '/mapped?value=' + encodeURIComponent(href), + ) + history.push('/a\tb') + history.flush() + expect(pushState).toHaveBeenCalledWith( + expect.anything(), + '', + '/mapped?value=%2Fa%09b', + ) + expect(history.location.href).toBe('/ab') + history.destroy() + }) + + test.each(['/a\x00b?q=a\x01b#/\\section\x7f', '/a\tb?q=a\nb#/\\section\r'])( + 'preserves the browser interpretation of %j', + (href) => { + const originalHref = window.location.href + const expected = new URL(href, originalHref) + const history = createBrowserHistory() + try { + expect(new URL(history.createHref(href), originalHref).href).toBe( + expected.href, + ) + history.push(href) + history.flush() + expect(window.location.href).toBe(expected.href) + expect(new URL(history.location.href, originalHref).href).toBe( + expected.href, + ) + } finally { + history.destroy() + window.history.replaceState(null, '', originalHref) + } + }, + ) + + test('coalesces consecutive replaces into the latest replace', async () => { + const { history, pushState, replaceState } = createBrowserHistoryHarness() + + history.replace('/first', { value: 1 }) + history.replace('/second', { value: 2 }) + await Promise.resolve() + + expect(pushState).not.toHaveBeenCalled() + expect(replaceState).toHaveBeenCalledTimes(1) + expect(replaceState).toHaveBeenCalledWith( + expect.objectContaining({ value: 2 }), + '', + '/second', + ) + history.destroy() + }) + + test('promotes a queued replace to a push', async () => { + const { history, pushState, replaceState } = createBrowserHistoryHarness() + + history.replace('/first', { value: 1 }) + history.push('/second', { value: 2 }) + await Promise.resolve() + + expect(replaceState).not.toHaveBeenCalled() + expect(pushState).toHaveBeenCalledTimes(1) + expect(pushState).toHaveBeenCalledWith( + expect.objectContaining({ value: 2 }), + '', + '/second', + ) + history.destroy() + }) + + test('keeps a queued push when followed by a replace', async () => { + const { history, pushState, replaceState } = createBrowserHistoryHarness() + + history.push('/first', { value: 1 }) + history.replace('/second', { value: 2 }) + await Promise.resolve() + + expect(replaceState).not.toHaveBeenCalled() + expect(pushState).toHaveBeenCalledTimes(1) + expect(pushState).toHaveBeenCalledWith( + expect.objectContaining({ value: 2 }), + '', + '/second', + ) + history.destroy() + }) + + test('flushes a later action after an explicit flush', async () => { + const { history, pushState, replaceState } = createBrowserHistoryHarness() + + history.replace('/first', { value: 1 }) + history.flush() + await Promise.resolve() + history.replace('/second', { value: 2 }) + await Promise.resolve() + + expect(pushState).not.toHaveBeenCalled() + expect(replaceState).toHaveBeenCalledTimes(2) + expect(replaceState).toHaveBeenLastCalledWith( + expect.objectContaining({ value: 2 }), + '', + '/second', + ) + history.destroy() + }) + + test.each([ + '//evil.com/path', + '///evil.com/path', + '/\\evil.com/path', + '/\\\\evil.com/path', + '/\\/evil.com/path', + '\\/evil.com/path', + '\\\\evil.com/path', + ' /\\evil.com/path', + '\x01//evil.com/path', + '/\t/evil.com/path', + ])('sanitizes %j before calling the native History API', async (href) => { + const { history, pushState } = createBrowserHistoryHarness() + + history.push(href) + await Promise.resolve() + + expect(pushState).toHaveBeenCalledOnce() + const pushedHref = pushState.mock.calls[0]![2] + const serializedUrl = new URL(pushedHref, 'https://victim.example') + expect(serializedUrl.origin).toBe('https://victim.example') + expect(serializedUrl.pathname).toBe( + href === '\x01//evil.com/path' ? '/%01//evil.com/path' : '/evil.com/path', + ) + expect( + new URL(history.location.href, 'https://victim.example').origin, + ).toBe('https://victim.example') + history.destroy() + }) + + test('does not exempt a normal traversal from beforeunload blockers', () => { + const { history, window } = createBrowserHistoryHarness() + history.block({ blockerFn: vi.fn(), enableBeforeUnload: true }) + + history.back() + const event = { + type: 'beforeunload', + preventDefault: vi.fn(), + returnValue: undefined, + } + window.dispatchEvent(event) + + expect(event.preventDefault).toHaveBeenCalledOnce() + expect(event.returnValue).toBe('') + history.destroy() + }) + + test('exempts an ignored document traversal from beforeunload blockers', () => { + const { history, window } = createBrowserHistoryHarness() + history.block({ blockerFn: vi.fn(), enableBeforeUnload: true }) + + history.back({ ignoreBlocker: true }) + const event = { + type: 'beforeunload', + preventDefault: vi.fn(), + returnValue: undefined, + } + window.dispatchEvent(event) + + expect(event.preventDefault).not.toHaveBeenCalled() + expect(event.returnValue).toBeUndefined() + history.destroy() + }) + + test('passes the logical requested destination to blockers', async () => { + const { history } = createBrowserHistoryHarness( + () => '/mapped/../browser-destination', + ) + const blockerFn = vi.fn(() => true) + history.block({ blockerFn, enableBeforeUnload: false }) + + history.push('/logical/../destination?query=value#hash') + await Promise.resolve() + + expect(blockerFn).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'PUSH', + nextLocation: expect.objectContaining({ + href: '/logical/../destination?query=value#hash', + pathname: '/logical/../destination', + search: '?query=value', + hash: '#hash', + }), + }), + ) + history.destroy() + }) + + test('normalizes the final result of a custom createHref', async () => { + const { history, pushState, replaceState } = createBrowserHistoryHarness( + () => ' \t/\\evil.example/path', + ) + + expect(history.createHref('/safe')).toBe('/evil.example/path') + + history.push('/safe') + await Promise.resolve() + history.replace('/safe') + await Promise.resolve() + + expect(pushState).toHaveBeenCalledWith( + expect.anything(), + '', + '/evil.example/path', + ) + expect(replaceState).toHaveBeenCalledWith( + expect.anything(), + '', + '/evil.example/path', + ) + expect(history.location.href).toBe('/safe') + history.destroy() + }) + + test('keeps the optimistic location in the logical URL space', async () => { + const { history, pushState } = createBrowserHistoryHarness( + () => '/mapped/../browser-destination', + ) + + history.push('/logical/../destination?query=value#hash') + await Promise.resolve() + + expect(history.location).toMatchObject({ + href: '/logical/../destination?query=value#hash', + pathname: '/logical/../destination', + search: '?query=value', + hash: '#hash', + }) + expect(pushState).toHaveBeenCalledWith( + expect.anything(), + '', + '/mapped/../browser-destination', + ) + history.destroy() + }) + + test('does not retain a beforeunload exemption after a same-document traversal', async () => { + const { history, window } = createBrowserHistoryHarness() + history.block({ blockerFn: vi.fn(), enableBeforeUnload: true }) + + history.back({ ignoreBlocker: true }) + await window.dispatchEvent({ type: 'popstate' }) + + const event = { + type: 'beforeunload', + preventDefault: vi.fn(), + returnValue: undefined, + } + window.dispatchEvent(event) + + expect(event.preventDefault).toHaveBeenCalledOnce() + expect(event.returnValue).toBe('') + history.destroy() + }) +}) diff --git a/packages/history/tests/createHashHistory.test.ts b/packages/history/tests/createHashHistory.test.ts index 4d68238249..e54b1a1ae1 100644 --- a/packages/history/tests/createHashHistory.test.ts +++ b/packages/history/tests/createHashHistory.test.ts @@ -1,8 +1,162 @@ -import { describe, expect, test } from 'vitest' +import { describe, expect, test, vi } from 'vitest' import { createHashHistory } from '../src' describe('createHashHistory', () => { + test.each(['\x00/route', '/route\x01', '/route?q=a\x1fb#c\x7fd'])( + 'keeps logical control data stable after reading the browser URL again: %j', + (href) => { + const originalHref = window.location.href + window.history.replaceState(null, '', '/shell') + const history = createHashHistory() + let reloaded: ReturnType | undefined + try { + history.push(href) + history.flush() + const location = history.location + history.destroy() + reloaded = createHashHistory() + expect(reloaded.location).toEqual(location) + } finally { + history.destroy() + reloaded?.destroy() + window.history.replaceState(null, '', originalHref) + } + }, + ) + + test('reads a hash route that starts with a query without leaking it into the pathname', () => { + const window = { + location: { pathname: '/', search: '', hash: '#?x=1' }, + history: { + state: { __TSR_index: 0, __TSR_key: 'initial' }, + length: 1, + pushState: vi.fn(), + replaceState: vi.fn(), + back: vi.fn(), + forward: vi.fn(), + go: vi.fn(), + }, + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + } + const history = createHashHistory({ window }) + + expect(history.location).toMatchObject({ + href: '?x=1', + pathname: '', + search: '?x=1', + hash: '', + }) + history.destroy() + }) + + test('normalizes the final browser href without changing the logical hash location', async () => { + const pushState = vi.fn() + const window = { + location: { + pathname: '//nested/path', + search: '', + hash: '', + }, + history: { + state: { __TSR_index: 0, __TSR_key: 'initial' }, + length: 1, + pushState, + replaceState: vi.fn(), + back: vi.fn(), + forward: vi.fn(), + go: vi.fn(), + }, + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + } + const history = createHashHistory({ window }) + + history.push('/logical') + await Promise.resolve() + + expect(pushState).toHaveBeenCalledWith( + expect.anything(), + '', + '/nested/path#/logical', + ) + expect(history.location.href).toBe('/logical') + history.destroy() + }) + + test.each([ + [ + '/?shell=1#/hello#section#tail', + { + href: '/hello?shell=1#section#tail', + pathname: '/hello', + search: '?shell=1', + hash: '#section#tail', + }, + ], + [ + '/?shell=1#/hello?route=2#section', + { + href: '/hello?route=2?shell=1#section', + pathname: '/hello', + search: '?route=2?shell=1', + hash: '#section', + }, + ], + [ + '/#/hello##tail#', + { + href: '/hello##tail#', + pathname: '/hello', + search: '', + hash: '##tail#', + }, + ], + [ + '/#/hello%23nested?value=%23#anchor%23tail', + { + href: '/hello%23nested?value=%23#anchor%23tail', + pathname: '/hello%23nested', + search: '?value=%23', + hash: '#anchor%23tail', + }, + ], + [ + '/?shell=1#//evil.example/path#fragment', + { + href: '/evil.example/path?shell=1#fragment', + pathname: '/evil.example/path', + search: '?shell=1', + hash: '#fragment', + }, + ], + [ + '/?shell=1#', + { + href: '/?shell=1', + pathname: '/', + search: '?shell=1', + hash: '', + }, + ], + ])('preserves the logical URL when reading %s', (href, expected) => { + const originalHref = window.location.href + const originalState = window.history.state + window.history.replaceState(null, '', href) + const history = createHashHistory() + + try { + expect(history.location).toMatchObject(expected) + window.history.replaceState(window.history.state, '', '/shell') + window.history.pushState(window.history.state, '', href) + expect(history.location).toMatchObject(expected) + } finally { + history.destroy() + window.history.replaceState(originalState, '', originalHref) + } + }) + describe('parseLocation', () => { describe.each([ ['/', { pathname: '/', search: '' }, 'neither search params nor hash'], diff --git a/packages/history/tests/createMemoryHistory.test.ts b/packages/history/tests/createMemoryHistory.test.ts index 1a27c04919..c0f565115e 100644 --- a/packages/history/tests/createMemoryHistory.test.ts +++ b/packages/history/tests/createMemoryHistory.test.ts @@ -2,6 +2,53 @@ import { describe, expect, test, vi } from 'vitest' import { createMemoryHistory } from '../src' describe('createMemoryHistory', () => { + test.each([ + ['//example.com/path', '/example.com/path'], + ['/\\example.com/path', '/example.com/path'], + ['\\/example.com/path', '/example.com/path'], + ['\\\\example.com/path', '/example.com/path'], + [' \t/\r\\example.com/path', '/example.com/path'], + ['/\t/example.com/path', '/example.com/path'], + ['/a\tb?q=a\nb#section\r', '/ab?q=ab#section'], + ['/a\u0000b?q=a\u0001b#section\u007f', '/a%00b?q=a%01b#section%7F'], + ['/', '/'], + ['/posts/123?sort=new#comments', '/posts/123?sort=new#comments'], + ['/caf%C3%A9?q=%2F#//section', '/caf%C3%A9?q=%2F#//section'], + ['/a//b?q=//value#\\/section', '/a//b?q=//value#\\/section'], + ['/%2Fexample.com/path', '/%2Fexample.com/path'], + ])('creates href %j consistent with navigation', (href, expected) => { + const history = createMemoryHistory() + const location = history.location + const createdHref = history.createHref(href) + + expect(createdHref).toBe(expected) + expect(history.location).toBe(location) + expect(new URL(createdHref, 'https://app.example').origin).toBe( + 'https://app.example', + ) + + history.push(href) + expect(history.location.href).toBe(createdHref) + }) + + test('exposes the current blocker registry after registration and removal', () => { + const history = createMemoryHistory() + const first = { blockerFn: vi.fn(() => true) } + const second = { blockerFn: vi.fn(() => false) } + + expect(history._getBlockers()).toEqual([]) + + const removeFirst = history.block(first) + const removeSecond = history.block(second) + expect(history._getBlockers()).toEqual([first, second]) + + removeFirst() + expect(history._getBlockers()).toEqual([second]) + + removeSecond() + expect(history._getBlockers()).toEqual([]) + }) + test('back', () => { const initialEntry = '/initial' const history = createMemoryHistory({ initialEntries: [initialEntry] }) @@ -52,6 +99,38 @@ describe('createMemoryHistory', () => { expect(history.location.pathname).toBe('/b') }) + test('discards forward entries and their state when pushing a new branch', () => { + const initialEntries = ['/'] + const history = createMemoryHistory({ initialEntries }) + history.push('/kept', { marker: 'kept' }) + const keptState = history.location.state + history.push('/discarded-first', { marker: 'discarded-first' }) + history.push('/discarded-last', { marker: 'discarded-last' }) + history.go(-2) + history.push('/new', { marker: 'new' }) + + expect(initialEntries).toEqual(['/', '/kept', '/new']) + expect(history.length).toBe(3) + expect(history.location.pathname).toBe('/new') + expect(history.location.state).toMatchObject({ + __TSR_index: 2, + marker: 'new', + }) + const newState = history.location.state + + history.forward() + expect(history.location.pathname).toBe('/new') + expect(history.location.state).toBe(newState) + + history.back() + expect(history.location.pathname).toBe('/kept') + expect(history.location.state).toBe(keptState) + + history.forward() + expect(history.location.pathname).toBe('/new') + expect(history.location.state).toBe(newState) + }) + test('length', () => { const history = createMemoryHistory() expect(history.length).toBe(1) diff --git a/packages/history/tests/createServerHistory.test.ts b/packages/history/tests/createServerHistory.test.ts new file mode 100644 index 0000000000..c036cea185 --- /dev/null +++ b/packages/history/tests/createServerHistory.test.ts @@ -0,0 +1,95 @@ +import { describe, expect, test, vi } from 'vitest' +import { + createBrowserHistory, + createMemoryHistory, + createServerHistory, +} from '../src' + +describe('server history', () => { + test.each([ + '/', + '/posts/123?sort=new#comments', + '/caf%C3%A9?q=%2F#//section', + '//example.com/path', + '/\\example.com/path', + '/path\nname?value=\u0000', + ])('parses and sanitizes %j like memory history', (href) => { + const history = createServerHistory(href) + const memory = createMemoryHistory({ initialEntries: [href] }) + expect(history.location).toEqual({ + ...memory.location, + state: { + key: expect.any(String), + __TSR_key: expect.any(String), + __TSR_index: 0, + }, + }) + expect(history.location.state.key).toBe(history.location.state.__TSR_key) + }) + + test.each([ + '//evil.example/path', + '/\\evil.example/path', + '\\/evil.example/path', + '\\\\evil.example/path', + ' \t/\r\\evil.example/path', + '/\t/evil.example/path', + '/a\tb?q=a\nb#section\r', + '/a\u0000b?q=a\u0001b#section\u007f', + '/', + '/posts/123?sort=new#comments', + '/caf%C3%A9?q=%2F#//section', + '/a//b?q=//value#\\/section', + '/%2Fevil.example/path', + ])('normalizes href %j like browser history', (href) => { + const history = createServerHistory('/request') + const browser = createBrowserHistory() + try { + expect(history.createHref(href)).toBe(browser.createHref(href)) + expect(history.location.href).toBe('/request') + } finally { + browser.destroy() + } + }) + + test('ignores navigation, subscriptions, and blockers', () => { + const history = createServerHistory('/request?q=1') + const location = history.location + const subscriber = vi.fn() + const blockerFn = vi.fn(() => true) + const unsubscribe = history.subscribe(subscriber) + const unblock = history.block({ blockerFn }) + + history.push('/pushed', { value: 1 }) + history.replace('/replaced', { value: 2 }) + history.go(-1) + history.back() + history.forward() + history.notify({ type: 'PUSH' }) + history.flush() + history.destroy() + unsubscribe() + unblock() + + expect(history.location).toBe(location) + expect(history.length).toBe(1) + expect(history.canGoBack()).toBe(false) + expect(history.subscribers.size).toBe(0) + expect(history._getBlockers()).toEqual([]) + expect(subscriber).not.toHaveBeenCalled() + expect(blockerFn).not.toHaveBeenCalled() + }) + + test('isolates state and exposed collections between requests', () => { + const first = createServerHistory('/first') + const second = createServerHistory('/second') + first.location.state.__TSR_index = 10 + first.subscribers.add(vi.fn()) + first._getBlockers().push({ blockerFn: () => true }) + + expect(second.location.pathname).toBe('/second') + expect(second.location.state.__TSR_index).toBe(0) + expect(second.subscribers.size).toBe(0) + expect(second._getBlockers()).toEqual([]) + }) +}) diff --git a/packages/history/tests/parseHref.test.ts b/packages/history/tests/parseHref.test.ts index e1b8db9c1a..aa6882e6fc 100644 --- a/packages/history/tests/parseHref.test.ts +++ b/packages/history/tests/parseHref.test.ts @@ -1,7 +1,19 @@ import { describe, expect, test } from 'vitest' import { parseHref } from '../src' +const baseUrl = new URL('https://victim.example/base') + describe('parseHref', () => { + test.each(['\x00', '\x01', '\x1f', '\x7f', '\t', '\n', '\r'])( + 'preserves browser path, query, and fragment interpretation for %j', + (character) => { + const href = `/a${character}b?q=a${character}b#a${character}b` + expect(new URL(parseHref(href, undefined).href, baseUrl).href).toBe( + new URL(href, baseUrl).href, + ) + }, + ) + test('works', () => { const parsed = parseHref('/foo?bar=baz#qux', {} as any) expect(parsed.pathname).toEqual('/foo') @@ -9,6 +21,42 @@ describe('parseHref', () => { expect(parsed.hash).toEqual('#qux') }) + test.each([ + ['?x=1', { pathname: '', search: '?x=1', hash: '' }], + ['#top', { pathname: '', search: '', hash: '#top' }], + ['?x=1#top', { pathname: '', search: '?x=1', hash: '#top' }], + ['#top?x=1', { pathname: '', search: '', hash: '#top?x=1' }], + ])( + 'keeps a leading query or fragment out of the pathname: %j', + (href, expected) => { + expect(parseHref(href, undefined)).toMatchObject({ href, ...expected }) + }, + ) + + test.each([ + { __TSR_index: 2 }, + { __TSR_index: 2, key: 'legacy-key', __TSR_key: 'current-key' }, + ])('preserves supplied state %j', (state) => { + Object.freeze(state) + expect(parseHref('/foo', state).state).toBe(state) + }) + + test('creates independent initial states with matching history keys', () => { + const first = parseHref('/foo', undefined) + const second = parseHref('/bar', undefined) + + for (const location of [first, second]) { + expect(location.state).toEqual({ + __TSR_index: 0, + key: expect.any(String), + __TSR_key: location.state.key, + }) + } + + first.state.__TSR_index = 1 + expect(second.state.__TSR_index).toBe(0) + }) + describe('open redirect prevention', () => { test('strips CR characters to prevent open redirect', () => { // If \r (CR) is in the href, it should be stripped @@ -45,6 +93,86 @@ describe('parseHref', () => { expect(url.pathname).toBe('/evil.com/') }) + test.each([ + '//evil.com/path', + '///evil.com/path', + '/\\evil.com/path', + '/\\\\evil.com/path', + '/\\/evil.com/path', + '\\/evil.com/path', + '\\\\evil.com/path', + ' /\\evil.com/path', + '\x01//evil.com/path', + '/\t/evil.com/path', + ])('keeps protocol-relative input %j on the current origin', (href) => { + const parsed = parseHref(href, undefined) + const url = new URL(parsed.href, 'https://victim.example') + + expect(url.origin).toBe('https://victim.example') + }) + + test.each([ + 'h\x00ttps://evil.example', + 'java\x00script:alert(1)', + '/\x00/evil.example', + '\x7f//evil.example', + '/%5c/evil.example', + '/%2f/evil.example', + '?next=//evil.example', + '#//evil.example', + '//evil.example', + '', + ' ', + '\x00', + '\x00\t\n', + ])('does not make same-origin input %j cross-origin', (href) => { + expect(new URL(href, baseUrl).origin).toBe(baseUrl.origin) + + const parsed = parseHref(href, undefined) + + expect(new URL(parsed.href, baseUrl).origin).toBe(baseUrl.origin) + }) + + test('matches WHATWG parsing of protocol-relative prefixes', () => { + const alphabet = [ + '/', + '\\', + '\t', + '\n', + '\r', + '\x00', + '\x0b', + ' ', + '\x7f', + ] + + for (let length = 0; length <= 4; length++) { + const count = alphabet.length ** length + for (let value = 0; value < count; value++) { + let input = '' + let cursor = value + for (let index = 0; index < length; index++) { + input += alphabet[cursor % alphabet.length] + cursor = Math.floor(cursor / alphabet.length) + } + input += 'evil.example/path' + + try { + new URL(input, baseUrl) + } catch { + continue + } + + const parsed = parseHref(input, undefined) + + expect( + new URL(parsed.href, baseUrl).origin, + JSON.stringify(input), + ).toBe(baseUrl.origin) + } + } + }) + test('normal paths remain unchanged', () => { const parsed = parseHref('/users/profile?id=1#section', undefined) expect(parsed.href).toBe('/users/profile?id=1#section') diff --git a/packages/nitro-v2-vite-plugin/CHANGELOG.md b/packages/nitro-v2-vite-plugin/CHANGELOG.md deleted file mode 100644 index 934532d11b..0000000000 --- a/packages/nitro-v2-vite-plugin/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -# @tanstack/nitro-v2-vite-plugin - -## 1.155.0 - -### Minor Changes - -- Clean minor bump, fresh start ([#7395](https://github.com/TanStack/router/pull/7395)) - -## 1.154.9 - -### Patch Changes - -- build: update to vite-config 5.x (rolldown) ([#6926](https://github.com/TanStack/router/pull/6926)) - -## 1.154.8 - -### Patch Changes - -- fix: build with @tanstack/vite-config 0.4.3 ([#6923](https://github.com/TanStack/router/pull/6923)) diff --git a/packages/nitro-v2-vite-plugin/README.md b/packages/nitro-v2-vite-plugin/README.md deleted file mode 100644 index 5882e61120..0000000000 --- a/packages/nitro-v2-vite-plugin/README.md +++ /dev/null @@ -1 +0,0 @@ -# Experimental Nitro v2 Vite Plugin diff --git a/packages/nitro-v2-vite-plugin/eslint.config.js b/packages/nitro-v2-vite-plugin/eslint.config.js deleted file mode 100644 index 8ce6ad05fc..0000000000 --- a/packages/nitro-v2-vite-plugin/eslint.config.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [...rootConfig] diff --git a/packages/nitro-v2-vite-plugin/package.json b/packages/nitro-v2-vite-plugin/package.json deleted file mode 100644 index b3021ea3c6..0000000000 --- a/packages/nitro-v2-vite-plugin/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@tanstack/nitro-v2-vite-plugin", - "version": "1.155.0", - "description": "Modern and scalable routing for React applications", - "author": "Tanner Linsley", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/TanStack/router.git", - "directory": "packages/nitro-v2-vite-plugin" - }, - "homepage": "https://tanstack.com/router", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "keywords": [ - "react", - "location", - "router", - "routing", - "async", - "async router", - "typescript" - ], - "scripts": { - "clean": "rimraf ./dist && rimraf ./coverage", - "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit", - "test:unit": "echo 'No unit tests are needed here since we do them in @tanstack/router-plugin!'", - "test:eslint": "eslint ./src", - "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", - "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", - "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", - "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", - "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", - "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", - "build": "vite build" - }, - "type": "module", - "types": "dist/esm/index.d.ts", - "main": "dist/cjs/index.cjs", - "module": "dist/esm/index.js", - "exports": { - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "dist", - "src" - ], - "engines": { - "node": ">=22.12" - }, - "dependencies": { - "nitropack": "^2.13.1", - "pathe": "^2.0.3" - }, - "peerDependencies": { - "vite": ">=7.0.0" - } -} diff --git a/packages/nitro-v2-vite-plugin/src/index.ts b/packages/nitro-v2-vite-plugin/src/index.ts deleted file mode 100644 index d8ae5009de..0000000000 --- a/packages/nitro-v2-vite-plugin/src/index.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { build, copyPublicAssets, createNitro, prepare } from 'nitropack' -import { dirname, resolve } from 'pathe' - -import type { PluginOption, ResolvedConfig, Rollup } from 'vite' -import type { NitroConfig } from 'nitropack' - -let ssrBundle: Rollup.OutputBundle -let ssrEntryFile: string - -function isFullUrl(str: string): boolean { - try { - new URL(str) - return true - } catch { - return false - } -} - -export function nitroV2Plugin(nitroConfig?: NitroConfig): Array { - let resolvedConfig: ResolvedConfig - return [ - { - name: 'tanstack-nitro-v2-vite-plugin', - - generateBundle: { - handler(_options, bundle) { - if (this.environment.name !== 'ssr') { - return - } - - // find entry point of ssr bundle - let entryFile: string | undefined - for (const [_name, file] of Object.entries(bundle)) { - if (file.type === 'chunk') { - if (file.isEntry) { - if (entryFile !== undefined) { - this.error( - `Multiple entry points found for service "${this.environment.name}". Only one entry point is allowed.`, - ) - } - entryFile = file.fileName - } - } - } - if (entryFile === undefined) { - this.error( - `No entry point found for service "${this.environment.name}".`, - ) - } - ssrEntryFile = entryFile! - ssrBundle = bundle - }, - }, - - configResolved(config) { - resolvedConfig = config - }, - config(_, env) { - if (env.command !== 'build') { - return - } - - return { - environments: { - ssr: { - consumer: 'server', - build: { - ssr: true, - // we don't write to the file system as the below 'capture-output' plugin will - // capture the output and write it to the virtual file system - write: false, - copyPublicDir: false, - commonjsOptions: { - include: [/node_modules/], - }, - }, - }, - }, - builder: { - sharedPlugins: true, - async buildApp(builder) { - const client = builder.environments.client - const server = builder.environments.ssr - - if (!client) { - throw new Error('Client environment not found') - } - - if (!server) { - throw new Error('SSR environment not found') - } - - await builder.build(client) - await builder.build(server) - - const virtualEntry = '#tanstack/start/entry' - const baseURL = !isFullUrl(resolvedConfig.base) - ? resolvedConfig.base - : undefined - const config: NitroConfig = { - baseURL, - publicAssets: [ - { - dir: client.config.build.outDir, - maxAge: 31536000, // 1 year - baseURL: '/', - }, - ], - ...nitroConfig, - esbuild: { - options: { - target: server.config.build.target || undefined, - ...nitroConfig?.esbuild?.options, - }, - }, - renderer: virtualEntry, - rollupConfig: { - ...nitroConfig?.rollupConfig, - plugins: [virtualBundlePlugin(ssrBundle) as any], - }, - virtual: { - ...nitroConfig?.virtual, - [virtualEntry]: `import { fromWebHandler } from 'h3' - import handler from '${ssrEntryFile}' - export default fromWebHandler(handler.fetch)`, - }, - } - - const nitro = await createNitro(config) - - await prepare(nitro) - await copyPublicAssets(nitro) - await build(nitro) - - await nitro.close() - }, - }, - } - }, - }, - ] -} - -function virtualBundlePlugin(bundle: Rollup.OutputBundle): Rollup.Plugin { - type VirtualModule = { code: string; map: string | null } - let _modules: Map | null = null - - // lazy initialize _modules since at the time of plugin creation, the bundles are not available yet - const getModules = () => { - if (_modules) { - return _modules - } - _modules = new Map() - // group chunks and source maps - for (const [fileName, content] of Object.entries(bundle)) { - if (content.type === 'chunk') { - const virtualModule: VirtualModule = { - code: content.code, - map: null, - } - const maybeMap = bundle[`${fileName}.map`] - if (maybeMap && maybeMap.type === 'asset') { - virtualModule.map = maybeMap.source as string - } - _modules.set(fileName, virtualModule) - _modules.set(resolve(fileName), virtualModule) - } - } - return _modules - } - - return { - name: 'virtual-bundle', - resolveId(id, importer) { - const modules = getModules() - if (modules.has(id)) { - return resolve(id) - } - - if (importer) { - const resolved = resolve(dirname(importer), id) - if (modules.has(resolved)) { - return resolved - } - } - return null - }, - load(id) { - const modules = getModules() - const m = modules.get(id) - if (!m) { - return null - } - return m - }, - } -} diff --git a/packages/nitro-v2-vite-plugin/tsconfig.build.json b/packages/nitro-v2-vite-plugin/tsconfig.build.json deleted file mode 100644 index 92be18587f..0000000000 --- a/packages/nitro-v2-vite-plugin/tsconfig.build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "rootDir": "./src" - }, - "include": ["src"] -} diff --git a/packages/nitro-v2-vite-plugin/tsconfig.json b/packages/nitro-v2-vite-plugin/tsconfig.json deleted file mode 100644 index bd398a8728..0000000000 --- a/packages/nitro-v2-vite-plugin/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": ["src", "vite.config.ts", "tests"], - "exclude": ["tests/test-files/**", "tests/snapshots/**"], - "compilerOptions": { - "jsx": "react-jsx" - } -} diff --git a/packages/nitro-v2-vite-plugin/vite.config.ts b/packages/nitro-v2-vite-plugin/vite.config.ts deleted file mode 100644 index 7401092b13..0000000000 --- a/packages/nitro-v2-vite-plugin/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig, mergeConfig } from 'vitest/config' -import { tanstackViteConfig } from '@tanstack/vite-config' - -const config = defineConfig({}) - -export default mergeConfig( - config, - tanstackViteConfig({ - tsconfigPath: './tsconfig.build.json', - entry: './src/index.ts', - srcDir: './src', - exclude: ['./src/tests/'], - }), -) diff --git a/packages/react-nativescript-router/README.md b/packages/react-nativescript-router/README.md deleted file mode 100644 index ce041d4c0a..0000000000 --- a/packages/react-nativescript-router/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# TanStack React NativeScript Router - -`@tanstack/react-nativescript-router` renders a TanStack React Router route -tree through NativeScript's native `Frame`, `Page`, and `ActionBar` primitives. -It does not use a WebView. - -## Add a native target - -From an existing React app using TanStack Router or TanStack Start: - -```sh -npx @tanstack/router-cli@latest native init -``` - -The command adds the NativeScript resources, entry point, Vite configuration, -scripts, and dependencies. It is idempotent and preflights conflicting files -before writing. It also ignores NativeScript build output and, for pnpm, -merges an explicit build-script policy without replacing workspace settings. -Then run one of: - -```sh -npm run native:ios -npm run native:android -``` - -The current stable toolchain requires React 19, NativeScript 9, -`@nativescript-community/react` 19, a `react-nativescript` npm alias pointing -to that renderer, `@nativescript/vite@2.0.3`, and Vite 7.3 or newer within the -Vite 7 major. -The initializer refuses an existing Vite 8 range unless `--force` is used. - -NativeScript Vite 2.0.3 does not register an HMR server for React. Generated -React scripts therefore use its supported `ns debug --no-hmr` workflow. Source -changes rebuild and restart the native app instead of hot-patching it. - -## What is shared - -Route definitions, generated route types, params, search validation, loaders, -router context, redirects, not-found behavior, navigation blockers, and Start -server functions can be shared with the web app. - -DOM elements and CSS are not native views. Pair host-specific screen modules: - -```text -src/screens/AccountScreen.tsx -src/screens/AccountScreen-native.tsx -``` - -An import of `AccountScreen` resolves to the `-native` sibling only in the -NativeScript build. The initializer also creates a native root route so a web -root containing `html`, `head`, and `body` is not loaded by NativeScript. - -## Native navigation - -Each history entry owns a retained NativeScript `Page` and an independent -Router state snapshot. On iOS, `Page.enableSwipeBackNavigation` drives the -platform's interactive back gesture, including the already-rendered previous -page and native action bar. Registered Router blockers disable the gesture -until navigation is allowed. Android's system back button calls `router.back()`. - -```tsx -export const Route = createFileRoute('/posts/$postId')({ - native: ({ params }) => ({ - title: `Post ${params.postId}`, - gestureEnabled: true, - animation: 'slide_from_right', - getId: ({ params }) => `post:${params.postId}`, - }), - component: PostRoute, -}) -``` - -Links and imperative navigation support native stack policies: - -```tsx -; - -await router.back({ to: '/posts/$postId', params: { postId: '42' } }) -``` - -`stackBehavior` accepts `auto`, `push`, `replace`, or `reuse`. Reuse identity -defaults to the complete href, including search and hash, and can be overridden -with `entryId` or route-level `native.getId`. - -## Manual setup - -The NativeScript Vite config composes the platform renderer with the Router -adapter: - -```ts -import { reactConfig } from '@nativescript/vite/react' -import { tanstackReactNativeScript } from '@tanstack/react-nativescript-router/vite' -import { tanstackRouterGenerator } from '@tanstack/router-plugin/vite' -import { defineConfig, mergeConfig } from 'vite' - -export default defineConfig(({ mode }) => - mergeConfig(reactConfig({ mode }), { - plugins: [ - tanstackReactNativeScript({ - nativeRootRoute: 'src/native/root-route.tsx', - }), - tanstackRouterGenerator({ target: 'react' }), - ], - }), -) -``` - -Create and start the router from the native entry: - -```tsx -import { startNativeScriptApp } from '@tanstack/react-nativescript-router' -import { getRouter } from '../router' - -void startNativeScriptApp({ router: getRouter() }) -``` - -For TanStack Start, use `tanstackStartNativeScript` and configure the native -Start client. See the -[NativeScript Start guide](https://tanstack.com/start/latest/docs/framework/react/guide/nativescript). - -## Current scope - -- Native push, replace, multi-pop, iOS swipe-back, and Android system back -- Native action bars and route-derived headers -- Search/hash-aware stack identity and targeted back navigation -- Injectable app/universal-link parsing and subscriptions -- Standalone TanStack Start server-function clients -- Native sibling module resolution and a generated native root route - -Modal presentation is not part of the first release. NativeScript route edits -may remount the app during development; production navigation is unaffected. - -This adapter builds on the NativeScript team's -[`@nativescript/tanstack-router`](https://github.com/NativeScript/tanstack) -experiments and the Router API design from -[React Native pull request #7622](https://github.com/TanStack/router/pull/7622). diff --git a/packages/react-nativescript-router/eslint.config.ts b/packages/react-nativescript-router/eslint.config.ts deleted file mode 100644 index 1c54dbd9ca..0000000000 --- a/packages/react-nativescript-router/eslint.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import pluginReact from '@eslint-react/eslint-plugin' -// @ts-expect-error -import pluginReactHooks from 'eslint-plugin-react-hooks' -import rootConfig from '../../eslint.config.js' -import type { Linter } from 'eslint' - -export default [ - ...rootConfig, - { - files: ['src/**/*.{ts,tsx}', 'tests/**/*.{ts,tsx}'], - plugins: { - 'react-hooks': pluginReactHooks, - '@eslint-react': pluginReact, - }, - rules: { - '@eslint-react/dom/no-missing-button-type': 'off', - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/rules-of-hooks': 'error', - '@typescript-eslint/no-unnecessary-condition': 'off', - }, - }, -] as Array diff --git a/packages/react-nativescript-router/package.json b/packages/react-nativescript-router/package.json deleted file mode 100644 index bfa477901b..0000000000 --- a/packages/react-nativescript-router/package.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "name": "@tanstack/react-nativescript-router", - "version": "0.0.1", - "description": "NativeScript navigation adapter for TanStack React Router", - "author": "TanStack and NativeScript contributors", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/TanStack/router.git", - "directory": "packages/react-nativescript-router" - }, - "homepage": "https://tanstack.com/router", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "keywords": [ - "react", - "nativescript", - "router", - "routing", - "navigation", - "ios", - "android" - ], - "scripts": { - "clean": "rimraf ./dist && rimraf ./coverage", - "test:eslint": "eslint", - "test:types": "tsc -p tsconfig.json --noEmit", - "test:unit": "vitest", - "test:unit:dev": "vitest --watch", - "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", - "build": "vite build" - }, - "type": "module", - "types": "dist/esm/index.d.ts", - "main": "dist/cjs/index.cjs", - "module": "dist/esm/index.js", - "exports": { - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.cts", - "default": "./dist/cjs/index.cjs" - } - }, - "./history": { - "import": { - "types": "./dist/esm/history.d.ts", - "default": "./dist/esm/history.js" - }, - "require": { - "types": "./dist/cjs/history.d.cts", - "default": "./dist/cjs/history.cjs" - } - }, - "./react-dom": { - "import": { - "types": "./dist/esm/react-dom.d.ts", - "default": "./dist/esm/react-dom.js" - }, - "require": { - "types": "./dist/cjs/react-dom.d.cts", - "default": "./dist/cjs/react-dom.cjs" - } - }, - "./vite": { - "import": { - "types": "./dist/esm/vite.d.ts", - "default": "./dist/esm/vite.js" - }, - "require": { - "types": "./dist/cjs/vite.d.cts", - "default": "./dist/cjs/vite.cjs" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "dist", - "src", - "README.md" - ], - "engines": { - "node": ">=20.19" - }, - "dependencies": { - "@tanstack/history": "workspace:*", - "@tanstack/react-store": "^0.9.3", - "@tanstack/react-router": "workspace:*", - "@tanstack/router-core": "workspace:*", - "@tanstack/store": "^0.9.3" - }, - "peerDependencies": { - "@nativescript-community/react": ">=19.0.0 <20.0.0", - "@nativescript/core": ">=9.0.0 <10.0.0", - "dominative": ">=0.1.2", - "react": ">=19.0.0 <20.0.0", - "react-nativescript": ">=19.0.0 <20.0.0", - "undom-ng": ">=1.1.2", - "vite": ">=7.3.0 <8.0.0" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - }, - "devDependencies": { - "@nativescript-community/react": "^19.0.0", - "@nativescript/core": "^9.0.20", - "@nativescript/types": "^9.0.0", - "@types/node": ">=20", - "@types/react": "^19.0.0", - "@vitejs/plugin-react": "^4.3.4", - "dominative": "^0.1.3", - "react": "^19.0.0", - "react-nativescript": "npm:@nativescript-community/react@^19.0.0", - "undom-ng": "^1.1.2", - "vite": "*" - } -} diff --git a/packages/react-nativescript-router/src/Link.tsx b/packages/react-nativescript-router/src/Link.tsx deleted file mode 100644 index 47b20bf2ee..0000000000 --- a/packages/react-nativescript-router/src/Link.tsx +++ /dev/null @@ -1,296 +0,0 @@ -import * as React from 'react' -import { - deepEqual, - exactPathTest, - removeTrailingSlash, -} from '@tanstack/router-core' -import { buildLocationFromHref } from '@tanstack/router-core/native-navigation' -import { useRouter, useRouterState } from '@tanstack/react-router/native' -import type { - AnyRouter, - LinkOptions, - NavigateOptions, - RegisteredRouter, - ValidateLinkOptions, - ValidateLinkOptionsArray, -} from '@tanstack/react-router/native' - -export interface NativeScriptActiveLinkOptions { - activeClass?: string - inactiveClass?: string - activeStyle?: string | Record - inactiveStyle?: string | Record - activeOptions?: { - exact?: boolean - includeSearch?: boolean - includeHash?: boolean - explicitUndefined?: boolean - } -} - -export type NativeScriptLinkOptionsFnOptions< - TOptions, - TRouter extends AnyRouter = RegisteredRouter, -> = - TOptions extends ReadonlyArray - ? ValidateLinkOptionsArray - : ValidateLinkOptions - -export type NativeScriptLinkOptionsFn = < - const TOptions, - TRouter extends AnyRouter = RegisteredRouter, ->( - options: NativeScriptLinkOptionsFnOptions, -) => TOptions - -/** Type-check and reuse options for a NativeScript Link or navigation. */ -export function linkOptions< - const TOptions, - TRouter extends AnyRouter = RegisteredRouter, ->(options: NativeScriptLinkOptionsFnOptions): TOptions { - return options as TOptions -} - -export type NativeScriptLinkProps< - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends string = string, - TTo extends string | undefined = '.', - TMaskFrom extends string = TFrom, - TMaskTo extends string = '.', -> = LinkOptions & - NativeScriptActiveLinkOptions & { - children?: - | React.ReactNode - | ((state: { - isActive: boolean - isTransitioning: boolean - }) => React.ReactNode) - class?: string - className?: string - style?: string | Record - disabled?: boolean - onTap?: (event: unknown) => void - accessibilityLabel?: string - [key: string]: unknown - } - -export function useNativeScriptLinkProps(props: NativeScriptLinkProps) { - const router = useRouter() - const [isTransitioning, setIsTransitioning] = React.useState(false) - const pendingNavigationCountRef = React.useRef(0) - const { disabled, onTap: onTapProp } = props - const navigationOptions = React.useMemo( - () => ({ - to: props.to, - from: props.from, - params: props.params, - search: props.search, - hash: props.hash, - state: props.state, - mask: props.mask, - replace: props.replace, - resetScroll: props.resetScroll, - hashScrollIntoView: props.hashScrollIntoView, - startTransition: props.startTransition, - viewTransition: props.viewTransition, - ignoreBlocker: props.ignoreBlocker, - reloadDocument: props.reloadDocument, - href: props.href, - publicHref: props.publicHref, - _fromLocation: props._fromLocation, - unsafeRelative: props.unsafeRelative, - stackBehavior: props.stackBehavior, - stackMatch: props.stackMatch, - entryId: props.entryId, - native: props.native, - }), - [ - props._fromLocation, - props.entryId, - props.from, - props.hash, - props.hashScrollIntoView, - props.href, - props.ignoreBlocker, - props.mask, - props.native, - props.params, - props.publicHref, - props.reloadDocument, - props.replace, - props.resetScroll, - props.search, - props.stackBehavior, - props.stackMatch, - props.startTransition, - props.state, - props.to, - props.unsafeRelative, - props.viewTransition, - ], - ) - const next = React.useMemo( - () => - navigationOptions.href - ? buildLocationFromHref( - router, - String(navigationOptions.href), - navigationOptions as never, - ) - : router.buildLocation(navigationOptions), - [navigationOptions, router], - ) - const isActive = useRouterState({ - select: (state) => { - const exact = props.activeOptions?.exact ?? false - if (exact) { - if ( - !exactPathTest( - state.location.pathname, - next.pathname, - router.basepath, - ) - ) { - return false - } - } else { - const currentPath = removeTrailingSlash( - state.location.pathname, - router.basepath, - ) - const nextPath = removeTrailingSlash(next.pathname, router.basepath) - if ( - !currentPath.startsWith(nextPath) || - (currentPath.length !== nextPath.length && - currentPath[nextPath.length] !== '/') - ) { - return false - } - } - - if ( - (props.activeOptions?.includeSearch ?? true) && - !deepEqual(state.location.search, next.search, { - partial: !exact, - ignoreUndefined: !props.activeOptions?.explicitUndefined, - }) - ) { - return false - } - - return ( - !props.activeOptions?.includeHash || state.location.hash === next.hash - ) - }, - }) - - const onTap = React.useCallback( - async (event: unknown) => { - if (disabled) { - return - } - onTapProp?.(event) - if ((event as { defaultPrevented?: boolean }).defaultPrevented) { - return - } - - pendingNavigationCountRef.current += 1 - if (pendingNavigationCountRef.current === 1) { - setIsTransitioning(true) - } - try { - await router.navigate(navigationOptions) - } finally { - pendingNavigationCountRef.current -= 1 - if (pendingNavigationCountRef.current === 0) { - setIsTransitioning(false) - } - } - }, - [disabled, navigationOptions, onTapProp, router], - ) - - return { - isActive, - isTransitioning, - onTap, - } -} - -/** A tap-driven, type-safe NativeScript Link. */ -export function Link(props: NativeScriptLinkProps) { - const link = useNativeScriptLinkProps(props) - const { - children, - activeClass, - inactiveClass, - activeStyle, - inactiveStyle, - activeOptions: _activeOptions, - to: _to, - from: _from, - params: _params, - search: _search, - hash: _hash, - state: _state, - mask: _mask, - replace: _replace, - resetScroll: _resetScroll, - hashScrollIntoView: _hashScrollIntoView, - startTransition: _startTransition, - viewTransition: _viewTransition, - ignoreBlocker: _ignoreBlocker, - reloadDocument: _reloadDocument, - href: _href, - publicHref: _publicHref, - _fromLocation, - unsafeRelative: _unsafeRelative, - stackBehavior: _stackBehavior, - stackMatch: _stackMatch, - entryId: _entryId, - native: _native, - target: _target, - preload: _preload, - preloadDelay: _preloadDelay, - preloadIntentProximity: _preloadIntentProximity, - class: classProp, - className, - style, - onTap: _onTap, - disabled, - ...rest - } = props - const stateClass = link.isActive ? activeClass : inactiveClass - const resolvedClass = [classProp ?? className, stateClass] - .filter(Boolean) - .join(' ') - const stateStyle = link.isActive ? activeStyle : inactiveStyle - const resolvedStyle = - typeof style === 'object' && typeof stateStyle === 'object' - ? { ...style, ...stateStyle } - : (stateStyle ?? style) - const content = - typeof children === 'function' - ? children({ - isActive: link.isActive, - isTransitioning: link.isTransitioning, - }) - : children - - const hostProps = { - ...rest, - class: resolvedClass || undefined, - style: resolvedStyle, - isUserInteractionEnabled: !disabled, - onTap: link.onTap, - } - - if (typeof content === 'string' || typeof content === 'number') { - return React.createElement('label', { - ...hostProps, - text: String(content), - }) - } - - return React.createElement('contentview', hostProps, content) -} diff --git a/packages/react-nativescript-router/src/NativeScriptRouterProvider.tsx b/packages/react-nativescript-router/src/NativeScriptRouterProvider.tsx deleted file mode 100644 index 0f3f40e280..0000000000 --- a/packages/react-nativescript-router/src/NativeScriptRouterProvider.tsx +++ /dev/null @@ -1,203 +0,0 @@ -import * as React from 'react' -import { Application, isAndroid } from '@nativescript/core' -import { - RouteLinkProvider, - RouterContextProviderBase, - RouterRendererProvider, - Transitioner, - useRouterState, -} from '@tanstack/react-router/native' -import { NativeStackController } from './native-stack-controller' -import { createNativeScreenSnapshot } from './screen' -import { setupNativeScriptLinking } from './linking' -import { Link } from './Link' -import { nativeScriptRouterRenderer } from './fallbacks' -import { assertNativeScriptRouter } from './router' -import type { - AnyRouter, - RegisteredRouter, - RouterProps, -} from '@tanstack/react-router/native' -import type { AnyNativeScriptRouter } from './router' -import type { - NativeScriptFrameLike, - NativeStackControllerOptions, -} from './native-stack-controller' -import type { NativeScriptActionBarProps } from './page' -import type { NativeScriptLinkingOptions } from './linking' -import type { AndroidActivityBackPressedEventData } from '@nativescript/core' - -export interface NativeScriptRouterProviderProps< - TRouter extends AnyRouter = RegisteredRouter, -> extends NativeStackControllerOptions { - router: TRouter - context?: RouterProps['context'] - actionBarVisibility?: 'auto' | 'never' | 'always' - linking?: false | NativeScriptLinkingOptions - children?: React.ReactNode - actionBar?: (props: NativeScriptActionBarProps) => React.ReactNode | undefined -} - -function useNativeScriptLinking( - router: AnyRouter, - linking: false | NativeScriptLinkingOptions | undefined, -) { - React.useEffect(() => { - if (linking === false || !linking) { - return - } - - return setupNativeScriptLinking(router, linking) - }, [linking, router]) -} - -function useAndroidBackHandler(router: AnyNativeScriptRouter) { - React.useEffect(() => { - if (!isAndroid) { - return - } - - const handler = (event: AndroidActivityBackPressedEventData) => { - if (!router.history.canGoBack()) { - return - } - - event.cancel = true - void router.back() - } - - Application.android.on( - Application.android.activityBackPressedEvent, - handler, - ) - return () => { - Application.android.off( - Application.android.activityBackPressedEvent, - handler, - ) - } - }, [router]) -} - -function NativeFrameHost({ - router, - actionBarVisibility, - controllerOptions, -}: { - router: AnyNativeScriptRouter - actionBarVisibility: 'auto' | 'never' | 'always' - controllerOptions: NativeStackControllerOptions -}) { - const state = useRouterState() - const [frame, setFrame] = React.useState() - const controllerRef = React.useRef( - undefined, - ) - - React.useLayoutEffect(() => { - if (!frame) { - return - } - - const controller = new NativeStackController(frame, router, {}) - controllerRef.current = controller - return () => { - controller.dispose() - if (controllerRef.current === controller) { - controllerRef.current = undefined - } - } - }, [frame, router]) - - React.useLayoutEffect(() => { - controllerRef.current?.setOptions(controllerOptions) - }, [controllerOptions]) - - React.useLayoutEffect(() => { - if ( - !controllerRef.current || - !state.matches.length || - state.status !== 'idle' - ) { - return - } - - controllerRef.current.sync(createNativeScreenSnapshot(router, state)) - }, [router, state]) - - return React.createElement('frame', { - ref: setFrame, - actionBarVisibility, - }) -} - -/** - * Render TanStack Router through a NativeScript Frame and native Page stack. - */ -export function NativeScriptRouterProvider< - TRouter extends AnyRouter = RegisteredRouter, ->({ - router, - context, - actionBarVisibility = 'auto', - linking, - children, - actionBar, - defaultActionBar, - actionBarBackgroundColor, - actionBarColor, - onNavigationError, - animated, - transition, -}: NativeScriptRouterProviderProps) { - assertNativeScriptRouter(router) - - const resolvedLinking = - linking === undefined - ? (( - router.options as { - native?: { linking?: false | NativeScriptLinkingOptions } - } - ).native?.linking ?? false) - : linking - - useNativeScriptLinking(router, resolvedLinking) - useAndroidBackHandler(router) - - const controllerOptions = React.useMemo( - () => ({ - actionBar, - defaultActionBar, - actionBarBackgroundColor, - actionBarColor, - onNavigationError, - animated, - transition, - }), - [ - actionBar, - actionBarBackgroundColor, - actionBarColor, - defaultActionBar, - onNavigationError, - animated, - transition, - ], - ) - - return ( - - - - - - {children} - - - - ) -} diff --git a/packages/react-nativescript-router/src/action-bar.ts b/packages/react-nativescript-router/src/action-bar.ts deleted file mode 100644 index 2039676e9a..0000000000 --- a/packages/react-nativescript-router/src/action-bar.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { BackFn } from '@tanstack/router-core' - -export function getDefaultNavigationButtonProps( - router: { back: BackFn }, - backTitle: string | undefined, - visible: boolean, -) { - return { - text: backTitle ?? 'Back', - 'android.systemIcon': 'ic_menu_back', - visibility: visible ? 'visible' : 'collapsed', - onTap: () => { - void router.back() - }, - } as const -} diff --git a/packages/react-nativescript-router/src/fallbacks.tsx b/packages/react-nativescript-router/src/fallbacks.tsx deleted file mode 100644 index 2959cf0da8..0000000000 --- a/packages/react-nativescript-router/src/fallbacks.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import * as React from 'react' -import type { RouterRenderer } from '@tanstack/react-router/native' -import type { - ErrorComponentProps, - NotFoundRouteProps, -} from '@tanstack/router-core' - -export function NativeScriptErrorComponent({ - error, - reset, -}: ErrorComponentProps) { - return React.createElement( - 'stacklayout', - { padding: 24, verticalAlignment: 'middle' }, - React.createElement('label', { - text: 'Something went wrong', - fontSize: 20, - fontWeight: 'bold', - }), - React.createElement('label', { - text: error.message || String(error), - textWrap: true, - marginTop: 8, - color: '#b91c1c', - }), - React.createElement('button', { - text: 'Try again', - onTap: reset, - marginTop: 16, - }), - ) -} - -export function NativeScriptNotFoundComponent(_props: NotFoundRouteProps) { - return React.createElement( - 'stacklayout', - { padding: 24, verticalAlignment: 'middle' }, - React.createElement('label', { - text: 'Not Found', - fontSize: 20, - fontWeight: 'bold', - }), - ) -} - -export const nativeScriptRouterRenderer: RouterRenderer = { - errorComponent: NativeScriptErrorComponent, - notFoundComponent: NativeScriptNotFoundComponent, -} diff --git a/packages/react-nativescript-router/src/history.ts b/packages/react-nativescript-router/src/history.ts deleted file mode 100644 index 08627c41be..0000000000 --- a/packages/react-nativescript-router/src/history.ts +++ /dev/null @@ -1,271 +0,0 @@ -import { parseHref } from '@tanstack/history' -import type { - HistoryAction, - HistoryLocation, - NavigateOptions, - NavigationBlocker, - ParsedHistoryState, - RouterHistory, -} from '@tanstack/history' - -export interface NativeScriptHistoryOptions { - initialEntries?: Array - initialIndex?: number - initialPath?: string -} - -export interface NativeScriptHistoryStackEntry { - href: string - index: number - state: ParsedHistoryState -} - -export interface NativeScriptRouterHistory extends Omit< - RouterHistory, - 'push' | 'replace' | 'go' | 'back' | 'forward' -> { - push: (...args: Parameters) => void | Promise - replace: ( - ...args: Parameters - ) => void | Promise - go: (...args: Parameters) => void | Promise - back: (...args: Parameters) => void | Promise - forward: ( - ...args: Parameters - ) => void | Promise - getStackSnapshot: () => Array - hasBlockers: () => boolean - getBlockers: () => ReadonlyArray - subscribeBlockers: (listener: () => void) => () => void -} - -const stateIndexKey = '__TSR_index' - -function createRandomKey() { - return (Math.random() + 1).toString(36).substring(7) -} - -function assignKeyAndIndex( - index: number, - state: Record | undefined, -): ParsedHistoryState { - const key = createRandomKey() - return { - ...(state ?? {}), - key, - __TSR_key: key, - [stateIndexKey]: index, - } as ParsedHistoryState -} - -/** - * Create the URL history mirrored by a NativeScript Frame. - * - * Unlike generic memory history, this implementation evaluates blockers for - * pop navigation too. Native back buttons can therefore ask the router for - * permission before changing the Frame, while iOS swipe-back is disabled for - * as long as a blocker is registered. - */ -export function createNativeScriptHistory( - options: NativeScriptHistoryOptions = {}, -): NativeScriptRouterHistory { - const initialEntries = options.initialEntries ?? [options.initialPath ?? '/'] - const entries = initialEntries.length ? [...initialEntries] : ['/'] - let index = - options.initialIndex === undefined - ? entries.length - 1 - : Math.min(Math.max(options.initialIndex, 0), entries.length - 1) - const states = entries.map((_entry, entryIndex) => - assignKeyAndIndex(entryIndex, undefined), - ) - let location = parseHref(entries[index]!, states[index]) - let blockers: Array = [] - let destroyed = false - - const subscribers: RouterHistory['subscribers'] = new Set() - const blockerSubscribers = new Set<() => void>() - - const notifyBlockers = () => { - blockerSubscribers.forEach((subscriber) => subscriber()) - } - - const notify: RouterHistory['notify'] = (action) => { - location = parseHref(entries[index]!, states[index]) - if (!history._ignoreSubscribers) { - subscribers.forEach((subscriber) => subscriber({ location, action })) - } - } - - const commit = ( - nextIndex: number, - action: Parameters[0], - ) => { - index = nextIndex - notify(action) - } - - const tryNavigation = ( - action: HistoryAction, - getNextLocation: () => HistoryLocation, - task: () => void, - navigateOptions?: NavigateOptions, - ): void | Promise => { - if (destroyed) { - return - } - - if (navigateOptions?.ignoreBlocker || blockers.length === 0) { - task() - return - } - - const currentBlockers = [...blockers] - const currentLocation = location - const nextLocation = getNextLocation() - - return (async () => { - for (const blocker of currentBlockers) { - const isBlocked = await blocker.blockerFn({ - currentLocation, - nextLocation, - action, - }) - if (isBlocked) { - return - } - } - - if (!destroyed && location === currentLocation) { - task() - } - })() - } - - const move = ( - delta: number, - action: 'BACK' | 'FORWARD' | 'GO', - navigateOptions?: NavigateOptions, - ): void | Promise => { - const nextIndex = Math.min(Math.max(index + delta, 0), entries.length - 1) - if (nextIndex === index) { - return - } - - return tryNavigation( - action, - () => parseHref(entries[nextIndex]!, states[nextIndex]), - () => - commit( - nextIndex, - action === 'GO' ? { type: 'GO', index: delta } : { type: action }, - ), - navigateOptions, - ) - } - - const history: NativeScriptRouterHistory = { - get location() { - return location - }, - get length() { - return entries.length - }, - subscribers, - subscribe: (subscriber) => { - subscribers.add(subscriber) - return () => { - subscribers.delete(subscriber) - } - }, - push: (href, state, navigateOptions) => { - const nextIndex = index + 1 - const nextState = assignKeyAndIndex(nextIndex, state) - return tryNavigation( - 'PUSH', - () => parseHref(href, nextState), - () => { - entries.splice(nextIndex) - states.splice(nextIndex) - entries.push(href) - states.push(nextState) - commit(nextIndex, { type: 'PUSH' }) - }, - navigateOptions, - ) - }, - replace: (href, state, navigateOptions) => { - const nextState = assignKeyAndIndex(index, state) - return tryNavigation( - 'REPLACE', - () => parseHref(href, nextState), - () => { - entries[index] = href - states[index] = nextState - notify({ type: 'REPLACE' }) - }, - navigateOptions, - ) - }, - go: (delta, navigateOptions) => { - return move(delta, 'GO', navigateOptions) - }, - back: (navigateOptions) => { - return move(-1, 'BACK', navigateOptions) - }, - forward: (navigateOptions) => { - return move(1, 'FORWARD', navigateOptions) - }, - canGoBack: () => index > 0, - createHref: (href) => href, - block: (blocker) => { - blockers = [...blockers, blocker] - notifyBlockers() - return () => { - const nextBlockers = blockers.filter( - (candidate) => candidate !== blocker, - ) - if (nextBlockers.length !== blockers.length) { - blockers = nextBlockers - notifyBlockers() - } - } - }, - flush: () => {}, - destroy: () => { - destroyed = true - blockers = [] - subscribers.clear() - blockerSubscribers.clear() - }, - notify, - getEntries: () => - entries.map((href, entryIndex) => parseHref(href, states[entryIndex])), - getStackSnapshot: () => - entries.map((href, entryIndex) => ({ - href, - index: entryIndex, - state: { ...states[entryIndex]! }, - })), - hasBlockers: () => blockers.length > 0, - getBlockers: () => [...blockers], - subscribeBlockers: (subscriber) => { - blockerSubscribers.add(subscriber) - return () => { - blockerSubscribers.delete(subscriber) - } - }, - } - - return history -} - -export function isNativeScriptHistory( - history: RouterHistory, -): history is NativeScriptRouterHistory { - return ( - typeof (history as Partial).hasBlockers === - 'function' && - typeof (history as Partial).subscribeBlockers === - 'function' - ) -} diff --git a/packages/react-nativescript-router/src/index.tsx b/packages/react-nativescript-router/src/index.tsx deleted file mode 100644 index 21b736c2a2..0000000000 --- a/packages/react-nativescript-router/src/index.tsx +++ /dev/null @@ -1,74 +0,0 @@ -export * from '@tanstack/react-router/native' - -export { createNativeScriptHistory, isNativeScriptHistory } from './history' -export type { - NativeScriptHistoryOptions, - NativeScriptHistoryStackEntry, - NativeScriptRouterHistory, -} from './history' - -export { - NativeScriptRouter, - assertNativeScriptRouter, - createNativeScriptRouter, - createNativeScriptRouter as createRouter, - isNativeScriptRouter, -} from './router' -export type { - AnyNativeScriptRouter, - CreateNativeScriptRouterOptions, - NativeScriptRouterOptions, -} from './router' - -export { - NativeScriptRouterProvider, - NativeScriptRouterProvider as RouterProvider, -} from './NativeScriptRouterProvider' -export type { NativeScriptRouterProviderProps } from './NativeScriptRouterProvider' - -export { - Link, - linkOptions, - useNativeScriptLinkProps, - useNativeScriptLinkProps as useLinkProps, -} from './Link' -export type { - NativeScriptActiveLinkOptions, - NativeScriptLinkProps, -} from './Link' - -export { - NativeScriptErrorComponent, - NativeScriptNotFoundComponent, -} from './fallbacks' - -export { Navigate, useNavigate } from './useNavigate' -export { resolveNativeScriptNavigateOptions } from './native-navigation' - -export { startNativeScriptApp } from './start' -export type { StartNativeScriptAppOptions } from './start' - -export { navigateNativeScriptURL, parseNativeScriptURL } from './linking' -export type { - NativeScriptLinkingMode, - NativeScriptLinkingOptions, -} from './linking' - -export { - createNativeScriptNavigationState, - createNativeScriptTransitionState, -} from './navigation-state' -export type { - NativeScriptNavigationOptions, - NativeScriptNavigationState, -} from './navigation-state' - -export type { - NativeAnimation, - NativeScriptHeaderStyle, - NativeScriptGetIdContext, - NativeScriptNavigationTransition, - NativeScriptRouteContext, - NativeScriptRouteOptions, - NativeScriptRouteOptionsInput, -} from './route-options' diff --git a/packages/react-nativescript-router/src/linking.ts b/packages/react-nativescript-router/src/linking.ts deleted file mode 100644 index 5dec06016e..0000000000 --- a/packages/react-nativescript-router/src/linking.ts +++ /dev/null @@ -1,157 +0,0 @@ -import type { AnyRouter } from '@tanstack/router-core' - -export type NativeScriptLinkingMode = 'push' | 'replace' - -export interface NativeScriptLinkingOptions { - prefixes?: Array - getInitialURL?: () => Promise | string | null - subscribe?: (listener: (url: string) => void) => () => void - parseURL?: (url: string) => string | null - initialMode?: NativeScriptLinkingMode - incomingMode?: NativeScriptLinkingMode - onUnhandledURL?: (url: string) => void - onError?: (error: unknown, url?: string) => void -} - -function ensureLeadingSlash(value: string): string { - if (!value) { - return '/' - } - return value.startsWith('/') ? value : `/${value}` -} - -function normalizeURLAuthorityCase(value: string): string { - const match = value.match(/^([A-Za-z][A-Za-z\d+.-]*:\/\/)([^/?#]*)/) - if (!match) { - return value - } - - const scheme = match[1]!.toLowerCase() - const authority = match[2]! - const userInfoEnd = authority.lastIndexOf('@') + 1 - const userInfo = authority.slice(0, userInfoEnd) - const host = authority.slice(userInfoEnd).toLowerCase() - return `${scheme}${userInfo}${host}${value.slice(match[0].length)}` -} - -/** Convert an app/universal link into a router href. */ -export function parseNativeScriptURL( - url: string, - prefixes: Array = [], -): string | null { - if (!url) { - return null - } - if (url.startsWith('/')) { - return url - } - - const normalizedURL = normalizeURLAuthorityCase(url) - const normalizedPrefixes = prefixes - .map((prefix) => normalizeURLAuthorityCase(prefix).replace(/\/$/, '')) - .sort((left, right) => right.length - left.length) - const prefix = normalizedPrefixes.find( - (candidate) => - normalizedURL === candidate || - normalizedURL.startsWith(`${candidate}/`) || - normalizedURL.startsWith(`${candidate}?`) || - normalizedURL.startsWith(`${candidate}#`), - ) - if (prefix) { - return ensureLeadingSlash(normalizedURL.slice(prefix.length)) - } - if (prefixes.length) { - return null - } - - try { - const parsed = new URL(url) - if (parsed.protocol === 'http:' || parsed.protocol === 'https:') { - return ensureLeadingSlash( - `${parsed.pathname}${parsed.search}${parsed.hash}`, - ) - } - - return ensureLeadingSlash( - `${parsed.host ? `/${parsed.host}` : ''}${parsed.pathname}${parsed.search}${parsed.hash}`, - ) - } catch { - return null - } -} - -export async function navigateNativeScriptURL( - router: AnyRouter, - options: NativeScriptLinkingOptions, - url: string, - mode: NativeScriptLinkingMode, -): Promise { - try { - const href = options.parseURL - ? options.parseURL(url) - : parseNativeScriptURL(url, options.prefixes) - if (!href) { - options.onUnhandledURL?.(url) - return - } - if (router.history.location.href === href) { - return - } - - await router.navigate({ - to: undefined, - href, - stackBehavior: mode, - }) - } catch (error) { - options.onError?.(error, url) - } -} - -export function setupNativeScriptLinking( - router: AnyRouter, - options: NativeScriptLinkingOptions, -): () => void { - let active = true - let receivedIncomingURL = false - let unsubscribe: (() => void) | undefined - - try { - unsubscribe = options.subscribe?.((url) => { - if (!active) { - return - } - receivedIncomingURL = true - void navigateNativeScriptURL( - router, - options, - url, - options.incomingMode ?? 'push', - ) - }) - } catch (error) { - options.onError?.(error) - } - - const initialize = async () => { - try { - const initialURL = await options.getInitialURL?.() - if (active && initialURL && !receivedIncomingURL) { - await navigateNativeScriptURL( - router, - options, - initialURL, - options.initialMode ?? 'replace', - ) - } - } catch (error) { - options.onError?.(error) - } - } - - void initialize() - return () => { - active = false - unsubscribe?.() - } -} diff --git a/packages/react-nativescript-router/src/native-navigation.ts b/packages/react-nativescript-router/src/native-navigation.ts deleted file mode 100644 index ef983664fe..0000000000 --- a/packages/react-nativescript-router/src/native-navigation.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { resolveNativeRouteOptions } from '@tanstack/react-router/native' -import { buildLocationFromHref } from '@tanstack/router-core/native-navigation' -import type { - AnyRoute, - AnyRouter, - NavigateOptions, - RouterState, -} from '@tanstack/router-core' - -/** Apply NativeScript route identity and stack defaults to a navigation. */ -export function resolveNativeScriptNavigateOptions< - TRouter extends AnyRouter, - TFrom extends string = string, - TTo extends string | undefined = undefined, - TMaskFrom extends string = TFrom, - TMaskTo extends string = '', ->( - router: TRouter, - options: NavigateOptions, -): NavigateOptions { - const location = options.href - ? buildLocationFromHref(router, String(options.href), { - ...options, - _includeValidateSearch: true, - } as never) - : router.buildLocation({ - ...options, - _includeValidateSearch: true, - }) - const matches = router.matchRoutes(location) - const { options: routeOptions } = resolveNativeRouteOptions(router, { - ...router.state, - location, - resolvedLocation: location, - matches, - } as RouterState) - const { routeParams } = router.getMatchedRoutes(location.pathname) - const nativeRouterOptions = router.options.native as - | { defaultStackBehavior?: NavigateOptions['stackBehavior'] } - | undefined - const stackBehavior = - options.stackBehavior ?? - (options.replace === true - ? 'replace' - : options.replace === false - ? 'push' - : (nativeRouterOptions?.defaultStackBehavior ?? 'reuse')) - const stackMatch = options.stackMatch ?? routeOptions.stackMatch ?? 'nearest' - const entryId = - options.entryId ?? - routeOptions.getId?.({ - pathname: location.pathname, - href: location.href, - params: routeParams, - search: location.search, - }) ?? - location.href - - return { - ...options, - stackBehavior, - stackMatch, - entryId, - } -} diff --git a/packages/react-nativescript-router/src/native-stack-controller.ts b/packages/react-nativescript-router/src/native-stack-controller.ts deleted file mode 100644 index f2cc933aa1..0000000000 --- a/packages/react-nativescript-router/src/native-stack-controller.ts +++ /dev/null @@ -1,395 +0,0 @@ -import { createNativePageRecord, getNativePageRecord } from './page' -import { getNativeScriptNavigationOptions } from './navigation-state' -import { resolveNativeScriptTransition } from './route-options' -import { getNativeStackAction } from './screen' -import type { BackstackEntry, NavigationEntry, Page } from '@nativescript/core' -import type { NativePageRecord, NativePageRenderOptions } from './page' -import type { NativeScriptRouterHistory } from './history' -import type { NativeScreenSnapshot } from './screen' -import type { AnyNativeScriptRouter } from './router' - -export interface NativeScriptBackstackEntryLike { - resolvedPage: Page -} - -export interface NativeScriptFrameLike { - currentPage?: Page - backStack: Array - navigate: (entry: NavigationEntry) => void - replacePage: (entry: NavigationEntry) => void - goBack: (entry?: BackstackEntry | NativeScriptBackstackEntryLike) => void -} - -export interface NativeStackControllerOptions extends NativePageRenderOptions { - onNavigationError?: (error: Error) => void -} - -export interface NativeStackControllerDependencies { - createPageRecord?: typeof createNativePageRecord -} - -type PendingNativeNavigation = { - kind: 'initialize' | 'push' | 'replace' | 'pop' - target: NativePageRecord - previous?: NativePageRecord -} - -export class NativeStackController { - private current: NativeScreenSnapshot | undefined - private desired: NativeScreenSnapshot | undefined - private records = new Map() - private screens = new Map() - private pending: PendingNativeNavigation | undefined - private disposed = false - private options: NativeStackControllerOptions - private readonly createPageRecord: typeof createNativePageRecord - - constructor( - private frame: NativeScriptFrameLike, - private router: AnyNativeScriptRouter, - options: NativeStackControllerOptions, - dependencies: NativeStackControllerDependencies = {}, - ) { - this.options = options - this.createPageRecord = - dependencies.createPageRecord ?? createNativePageRecord - } - - setOptions(options: NativeStackControllerOptions): void { - this.options = options - for (const record of this.records.values()) { - record.updateOptions(options) - } - } - - sync(next: NativeScreenSnapshot): void { - if (this.disposed) { - return - } - - this.rememberScreen(next) - this.desired = next - this.findRecord(next)?.update(next) - this.reconcile() - } - - private reconcile(): void { - if (this.disposed || this.pending || !this.desired) { - return - } - - const next = this.getNextScreen(this.desired) - const action = getNativeStackAction(this.current, next) - - if (action === 'none') { - return - } - - if (action === 'update') { - const record = this.findRecord(next) - if (!record) { - this.fail( - new Error( - `NativeScript current page is missing history entry ${next.historyIndex} (${next.href}).`, - ), - ) - } - record.update(next) - this.current = next - this.reconcile() - return - } - - if (action === 'initialize' || action === 'push') { - const existing = this.findRecord(next) - const record = existing ?? this.createRecord(next) - this.startNavigation( - { kind: action, target: record }, - () => { - this.frame.navigate( - this.getNavigationEntry(record, action === 'push'), - ) - }, - existing === undefined, - ) - return - } - - if (action === 'replace') { - const previousRecord = this.current - ? this.findRecord(this.current) - : undefined - const existing = this.findRecord(next) - const record = existing ?? this.createRecord(next) - this.startNavigation( - { - kind: 'replace', - target: record, - previous: - previousRecord && previousRecord !== record - ? previousRecord - : undefined, - }, - () => { - this.frame.replacePage(this.getNavigationEntry(record, true)) - }, - existing === undefined, - ) - return - } - - const target = this.findRecord(next) - if (!target) { - this.fail( - new Error( - `NativeScript back stack is missing history entry ${next.historyIndex} (${next.href}).`, - ), - ) - } - - target.update(next) - - if (this.getVisibleRecord() === target) { - this.current = next - this.activate(target) - this.pruneAbove(next.historyIndex) - this.reconcile() - return - } - - const targetEntry = this.frame.backStack.find( - (entry) => entry.resolvedPage === target.page, - ) - if (!targetEntry) { - this.fail( - new Error( - `NativeScript Frame cannot pop to history entry ${next.historyIndex} (${next.href}).`, - ), - ) - } - - this.startNavigation({ kind: 'pop', target }, () => { - this.frame.goBack(targetEntry) - }) - } - - dispose(): void { - if (this.disposed) { - return - } - - this.disposed = true - for (const record of [...this.records.values()]) { - record.dispose() - } - this.records.clear() - this.screens.clear() - this.pending = undefined - this.desired = undefined - } - - private startNavigation( - pending: PendingNativeNavigation, - navigate: () => void, - disposeTargetOnError = false, - ): void { - this.pending = pending - try { - navigate() - } catch (error) { - const failedBeforeCommit = this.pending === pending - if (failedBeforeCommit) { - this.pending = undefined - } - if (disposeTargetOnError && failedBeforeCommit) { - pending.target.dispose() - } - this.fail( - error instanceof Error - ? error - : new Error('NativeScript navigation failed', { cause: error }), - ) - } - } - - private createRecord(screen: NativeScreenSnapshot): NativePageRecord { - const existing = this.findRecord(screen) - if (existing) { - existing.update(screen) - return existing - } - - const record = this.createPageRecord({ - router: this.router, - screen, - options: this.options, - onNavigatedTo: (visibleRecord, isBackNavigation) => { - this.handlePageNavigatedTo(visibleRecord, isBackNavigation) - }, - onDisposed: (disposedRecord) => { - const key = disposedRecord.screen.locationKey - if (this.records.get(key) === disposedRecord) { - this.records.delete(key) - } - }, - }) - this.records.set(screen.locationKey, record) - return record - } - - private findRecord( - screen: NativeScreenSnapshot, - ): NativePageRecord | undefined { - return this.records.get(screen.locationKey) - } - - private getVisibleRecord(): NativePageRecord | undefined { - return getNativePageRecord(this.frame.currentPage) - } - - private rememberScreen(screen: NativeScreenSnapshot): void { - const stack = this.getHistoryStack() - if (stack) { - const liveKeys = new Set( - stack.map( - (entry) => entry.state.__TSR_key ?? entry.state.key ?? entry.href, - ), - ) - for (const key of this.screens.keys()) { - if (!liveKeys.has(key)) { - this.screens.delete(key) - } - } - } - - this.screens.set(screen.locationKey, screen) - } - - private getHistoryStack() { - const history = this.router.history as Partial - return typeof history.getStackSnapshot === 'function' - ? history.getStackSnapshot() - : undefined - } - - private getNextScreen(desired: NativeScreenSnapshot): NativeScreenSnapshot { - if ( - !this.current || - desired.historyIndex <= this.current.historyIndex + 1 - ) { - return desired - } - - const stack = this.getHistoryStack() - if (!stack) { - return desired - } - - for ( - let index = this.current.historyIndex + 1; - index < desired.historyIndex; - index++ - ) { - const entry = stack[index] - const key = entry?.state.__TSR_key ?? entry?.state.key ?? entry?.href - if (!key) { - continue - } - const screen = this.screens.get(key) - if (screen) { - return screen - } - } - - return desired - } - - private getNavigationEntry( - record: NativePageRecord, - hasPreviousPage: boolean, - ): NavigationEntry { - const routeTransition = resolveNativeScriptTransition( - record.screen.routeOptions, - ) - const navigationOptions = getNativeScriptNavigationOptions( - record.screen.state.location.state, - ) - - return { - create: () => record.page, - animated: hasPreviousPage - ? (navigationOptions?.animated ?? - routeTransition.animated ?? - this.options.animated ?? - true) - : false, - transition: - navigationOptions?.transition ?? - routeTransition.transition ?? - this.options.transition, - backstackVisible: true, - clearHistory: false, - } - } - - private handlePageNavigatedTo( - record: NativePageRecord, - isBackNavigation: boolean, - ): void { - if (this.disposed) { - return - } - - const pending = this.pending - if (pending?.target === record) { - this.pending = undefined - this.current = record.screen - this.activate(record) - if (pending.kind === 'replace') { - pending.previous?.dispose() - } - if (pending.kind === 'pop' || isBackNavigation) { - this.pruneAbove(record.screen.historyIndex) - } - this.reconcile() - return - } - - if (!isBackNavigation) { - return - } - - const routerIndex = this.router.history.location.state.__TSR_index ?? 0 - const targetIndex = record.screen.historyIndex - this.current = record.screen - this.desired = record.screen - this.activate(record) - this.rememberScreen(record.screen) - this.pruneAbove(targetIndex) - - if (targetIndex < routerIndex) { - this.router.history.go(targetIndex - routerIndex, { - ignoreBlocker: true, - }) - } - } - - private pruneAbove(historyIndex: number): void { - for (const record of [...this.records.values()]) { - if (record.screen.historyIndex > historyIndex) { - record.dispose() - } - } - } - - private activate(activeRecord: NativePageRecord): void { - for (const record of this.records.values()) { - record.setActive(record === activeRecord) - } - } - - private fail(error: Error): never { - this.options.onNavigationError?.(error) - throw error - } -} diff --git a/packages/react-nativescript-router/src/navigation-state.ts b/packages/react-nativescript-router/src/navigation-state.ts deleted file mode 100644 index 7771134790..0000000000 --- a/packages/react-nativescript-router/src/navigation-state.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { NativeScriptNavigationTransition } from './route-options' - -export interface NativeScriptNavigationOptions { - animated?: boolean - transition?: NativeScriptNavigationTransition -} - -export interface NativeScriptNavigationState { - __nsNavigation?: NativeScriptNavigationOptions -} - -export function createNativeScriptNavigationState( - options: NativeScriptNavigationOptions, -): NativeScriptNavigationState { - return { __nsNavigation: options } -} - -export function createNativeScriptTransitionState( - transition: NativeScriptNavigationTransition, -): NativeScriptNavigationState { - return createNativeScriptNavigationState({ transition }) -} - -export function getNativeScriptNavigationOptions( - state: unknown, -): NativeScriptNavigationOptions | undefined { - if (!state || typeof state !== 'object') { - return undefined - } - - return (state as NativeScriptNavigationState).__nsNavigation -} diff --git a/packages/react-nativescript-router/src/page.tsx b/packages/react-nativescript-router/src/page.tsx deleted file mode 100644 index 0d92415eeb..0000000000 --- a/packages/react-nativescript-router/src/page.tsx +++ /dev/null @@ -1,315 +0,0 @@ -import * as React from 'react' -import { render } from '@nativescript-community/react' -import { useStore } from '@tanstack/react-store' -import { Store } from '@tanstack/store' -import { - Matches, - RouteLinkProvider, - RouterContextProviderBase, - RouterRendererProvider, - RouterStateSnapshotProvider, - createRouterStateSnapshotStore, - resolveNativeRouteOptions, - useRouterState, -} from '@tanstack/react-router/native' -import { isNativeScriptHistory } from './history' -import { Link } from './Link' -import { getDefaultNavigationButtonProps } from './action-bar' -import { nativeScriptRouterRenderer } from './fallbacks' -import type { - AnyRouter, - WritableRouterStateSnapshotStore, -} from '@tanstack/react-router/native' -import type { AnyNativeScriptRouter } from './router' -import type { EventData, Page } from '@nativescript/core' -import type { NativeScreenSnapshot } from './screen' -import type { - NativeScriptNavigationTransition, - NativeScriptRouteContext, -} from './route-options' - -export interface NativeScriptActionBarProps { - router: AnyNativeScriptRouter - context: NativeScriptRouteContext -} - -export interface NativePageRenderOptions { - actionBar?: (props: NativeScriptActionBarProps) => React.ReactNode | undefined - defaultActionBar?: boolean - actionBarBackgroundColor?: string - actionBarColor?: string - animated?: boolean - transition?: NativeScriptNavigationTransition -} - -export interface NativePageRecord { - readonly page: Page - readonly store: WritableRouterStateSnapshotStore - screen: NativeScreenSnapshot - setActive: (active: boolean) => void - update: (screen: NativeScreenSnapshot) => void - updateOptions: (options: NativePageRenderOptions) => void - dispose: () => void -} - -export const nativePageRecordKey = '__TSR_nativePageRecord' - -export type NativePageWithRecord = Page & { - [nativePageRecordKey]?: NativePageRecord -} - -export function getNativePageRecord( - page: Page | undefined, -): NativePageRecord | undefined { - return (page as NativePageWithRecord | undefined)?.[nativePageRecordKey] -} - -function getDefaultTitle(context: NativeScriptRouteContext): string { - const staticTitle = context.staticData.title - if (typeof staticTitle === 'string') { - return staticTitle - } - - const metas = context.match.meta - if (metas) { - for (let index = metas.length - 1; index >= 0; index--) { - const title = metas[index]?.title - if (title) { - return title - } - } - } - - if (context.pathname === '/') { - return 'Home' - } - - const segment = context.pathname.split('/').filter(Boolean).at(-1) - if (!segment) { - return '' - } - - let decodedSegment = segment - try { - decodedSegment = decodeURIComponent(segment) - } catch { - // Keep malformed URL text renderable on an error or not-found page. - } - - return decodedSegment - .replace(/[-_]/g, ' ') - .replace(/\b\w/g, (character) => character.toUpperCase()) -} - -function NativeActionBar({ - router, - options, -}: { - router: AnyNativeScriptRouter - options: NativePageRenderOptions -}) { - const state = useRouterState() - const screen = React.useMemo( - () => resolveNativeRouteOptions(router, state), - [router, state], - ) - - const resolveBooleanOption = ( - value: - | boolean - | ((context: NativeScriptRouteContext) => boolean) - | undefined, - fallback: boolean, - ) => - typeof value === 'function' ? value(screen.context) : (value ?? fallback) - - if (!resolveBooleanOption(screen.options.headerShown, true)) { - return null - } - - const routeHeader = screen.options.header - if (typeof routeHeader === 'function') { - return routeHeader(screen.context) - } - if (routeHeader !== undefined) { - return routeHeader - } - - const customActionBar = options.actionBar?.({ - router, - context: screen.context, - }) - if (customActionBar !== undefined) { - return customActionBar - } - if (options.defaultActionBar === false) { - return null - } - - const title = - typeof screen.options.title === 'function' - ? screen.options.title(screen.context) - : (screen.options.title ?? getDefaultTitle(screen.context)) - const canGoBack = screen.context.canGoBack - const showBackButton = - canGoBack && resolveBooleanOption(screen.options.headerBackVisible, true) - - return React.createElement( - 'actionbar', - { - title, - iosLargeTitle: screen.options.headerLargeTitle, - backgroundColor: - screen.options.headerStyle?.backgroundColor ?? - options.actionBarBackgroundColor, - color: screen.options.headerStyle?.color ?? options.actionBarColor, - flat: screen.options.headerStyle?.flat, - }, - canGoBack - ? React.createElement( - 'navigationbutton', - getDefaultNavigationButtonProps( - router, - screen.options.headerBackTitle, - showBackButton, - ), - ) - : null, - ) -} - -function NativePageTree({ - router, - store, - activeStore, - optionsStore, -}: { - router: AnyNativeScriptRouter - store: WritableRouterStateSnapshotStore - activeStore: Store - optionsStore: Store -}) { - const options = useStore(optionsStore, (value) => value) - - return ( - - - - - - - - - - - ) -} - -export function createNativePageRecord({ - router, - screen, - options, - onNavigatedTo, - onDisposed, -}: { - router: AnyNativeScriptRouter - screen: NativeScreenSnapshot - options: NativePageRenderOptions - onNavigatedTo: (record: NativePageRecord, isBackNavigation: boolean) => void - onDisposed: (record: NativePageRecord) => void -}): NativePageRecord { - const page = document.createElement('Page') as unknown as NativePageWithRecord - const store = createRouterStateSnapshotStore(screen.state) - const activeStore = new Store(false) - const optionsStore = new Store(options) - const history = router.history - let disposed = false - let disposeTree: (() => void) | undefined - - const updateSwipeBack = () => { - const blocked = isNativeScriptHistory(history) && history.hasBlockers() - page.enableSwipeBackNavigation = - !blocked && (record.screen.routeOptions.gestureEnabled ?? true) - } - - const mountTree = () => { - if (disposed || disposeTree) { - return - } - - disposeTree = render( - , - page, - ) - } - - const unmountTree = () => { - disposeTree?.() - disposeTree = undefined - } - - const record: NativePageRecord = { - page, - store, - screen, - setActive(active) { - activeStore.setState(() => active) - }, - update(nextScreen) { - record.screen = nextScreen - updateSwipeBack() - store.set(nextScreen.state) - }, - updateOptions(nextOptions) { - optionsStore.setState(() => nextOptions) - }, - dispose() { - if (disposed) { - return - } - - disposed = true - unmountTree() - unsubscribeBlockers?.() - page.off('loaded', handleLoaded) - page.off('navigatedTo', handleNavigatedTo) - page.off('disposeNativeView', handleDisposeNativeView) - delete page[nativePageRecordKey] - onDisposed(record) - }, - } - - const handleLoaded = () => { - mountTree() - } - const handleNavigatedTo = (event: EventData) => { - const navigationEvent = event as EventData & { - isBackNavigation?: boolean - } - onNavigatedTo(record, navigationEvent.isBackNavigation === true) - } - const handleDisposeNativeView = () => { - unmountTree() - } - const unsubscribeBlockers = isNativeScriptHistory(history) - ? history.subscribeBlockers(updateSwipeBack) - : undefined - - page[nativePageRecordKey] = record - page.on('loaded', handleLoaded) - page.on('navigatedTo', handleNavigatedTo) - page.on('disposeNativeView', handleDisposeNativeView) - updateSwipeBack() - mountTree() - - return record -} diff --git a/packages/react-nativescript-router/src/react-dom.ts b/packages/react-nativescript-router/src/react-dom.ts deleted file mode 100644 index 8d9491dab9..0000000000 --- a/packages/react-nativescript-router/src/react-dom.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { reconciler } from '@nativescript-community/react' - -/** NativeScript renderer equivalent of `react-dom.flushSync`. */ -export function flushSync(callback: () => T): T { - try { - return callback() - } finally { - reconciler.flushSyncWork() - } -} diff --git a/packages/react-nativescript-router/src/route-options.ts b/packages/react-nativescript-router/src/route-options.ts deleted file mode 100644 index e323feeb65..0000000000 --- a/packages/react-nativescript-router/src/route-options.ts +++ /dev/null @@ -1,60 +0,0 @@ -import type { NavigationTransition } from '@nativescript/core' -import type { - NativeAnimation, - NativeGetIdContext, - NativeHeaderStyle, - NativeRouteContext, - NativeRouteOptions, - NativeRouteOptionsInput, -} from '@tanstack/react-router/native' - -export type NativeScriptNavigationTransition = NavigationTransition - -declare module '@tanstack/react-router/native' { - interface NativeHeaderStyleExtensions { - color?: string - flat?: boolean - } - - interface NativeRouteOptionsExtensions { - animated?: boolean - transition?: NativeScriptNavigationTransition - } -} - -export type NativeScriptRouteContext = NativeRouteContext -export type NativeScriptHeaderStyle = NativeHeaderStyle -export type NativeScriptGetIdContext = NativeGetIdContext -export type NativeScriptRouteOptions = NativeRouteOptions -export type NativeScriptRouteOptionsInput = NativeRouteOptionsInput -export type { NativeAnimation } - -export function resolveNativeScriptTransition( - options: NativeScriptRouteOptions, -): { animated?: boolean; transition?: NativeScriptNavigationTransition } { - if (options.transition) { - return { - animated: options.animated, - transition: options.transition, - } - } - - switch (options.animation) { - case 'none': - return { animated: false } - case 'fade': - case 'fade_from_bottom': - return { animated: options.animated, transition: { name: 'fade' } } - case 'flip': - return { animated: options.animated, transition: { name: 'flipRight' } } - case 'slide_from_left': - return { animated: options.animated, transition: { name: 'slideRight' } } - case 'slide_from_bottom': - return { animated: options.animated, transition: { name: 'slideTop' } } - case 'simple_push': - case 'slide_from_right': - return { animated: options.animated, transition: { name: 'slideLeft' } } - default: - return { animated: options.animated } - } -} diff --git a/packages/react-nativescript-router/src/router.ts b/packages/react-nativescript-router/src/router.ts deleted file mode 100644 index 30532a3807..0000000000 --- a/packages/react-nativescript-router/src/router.ts +++ /dev/null @@ -1,264 +0,0 @@ -import { Router as ReactRouter } from '@tanstack/react-router/native' -import { isDangerousProtocol } from '@tanstack/router-core' -import { - backWithStack, - navigateWithStack, -} from '@tanstack/router-core/native-navigation' -import { parseHref } from '@tanstack/history' -import { - AbortController as NativeScriptAbortController, - AbortSignal as NativeScriptAbortSignal, -} from '@nativescript/core/abortcontroller' -import { openUrlAsync } from '@nativescript/core/utils' -import { createNativeScriptHistory, isNativeScriptHistory } from './history' -import { resolveNativeScriptNavigateOptions } from './native-navigation' -import type { AnyRoute, AnyRouter } from '@tanstack/react-router/native' -import type { - BackFn, - CommitLocationFn, - NavigateFn, - RouterConstructorOptions, - StackBehavior, - TrailingSlashOption, -} from '@tanstack/router-core' -import type { - NativeScriptHistoryOptions, - NativeScriptRouterHistory, -} from './history' -import type { NativeScriptLinkingOptions } from './linking' - -export interface NativeScriptRouterOptions { - linking?: false | NativeScriptLinkingOptions - /** Default native stack policy used by Link and useNavigate. */ - defaultStackBehavior?: StackBehavior - /** Override how absolute URLs are handed to the host platform. */ - openExternalUrl?: (url: string) => boolean | void | Promise -} - -declare module '@tanstack/router-core' { - interface RouterOptionsExtensions { - native?: NativeScriptRouterOptions - } -} - -if (typeof globalThis.self === 'undefined') { - Object.assign(globalThis, { self: globalThis }) -} - -if (typeof globalThis.AbortController === 'undefined') { - Object.assign(globalThis, { - AbortController: NativeScriptAbortController, - AbortSignal: NativeScriptAbortSignal, - }) -} - -export type CreateNativeScriptRouterOptions< - TRouteTree extends AnyRoute, - TTrailingSlashOption extends TrailingSlashOption = 'never', - TDefaultStructuralSharingOption extends boolean = false, - TDehydrated extends Record = Record, -> = Omit< - RouterConstructorOptions< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - NativeScriptRouterHistory, - TDehydrated - >, - 'history' -> & - Pick - -export type CreateNativeScriptRouterFn = < - TRouteTree extends AnyRoute, - TTrailingSlashOption extends TrailingSlashOption = 'never', - TDefaultStructuralSharingOption extends boolean = false, - TDehydrated extends Record = Record, ->( - options: CreateNativeScriptRouterOptions< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - TDehydrated - >, -) => NativeScriptRouter< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - TDehydrated -> - -export class NativeScriptRouter< - in out TRouteTree extends AnyRoute, - in out TTrailingSlashOption extends TrailingSlashOption = 'never', - in out TDefaultStructuralSharingOption extends boolean = false, - in out TDehydrated extends Record = Record, -> extends ReactRouter< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - NativeScriptRouterHistory, - TDehydrated -> { - back!: BackFn - - constructor( - options: RouterConstructorOptions< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - NativeScriptRouterHistory, - TDehydrated - >, - ) { - super(options) - - const navigate = this.navigate - const commitLocation = this.commitLocation - - this.commitLocation = (async (next) => { - const blockers = this.history.getBlockers() - if (next.ignoreBlocker || blockers.length === 0) { - return commitLocation(next) - } - - const currentLocation = this.history.location - const nextLocation = parseHref(next.publicHref, next.state) - const action = next.replace ? 'REPLACE' : 'PUSH' - - for (const blocker of blockers) { - const isBlocked = await blocker.blockerFn({ - currentLocation, - nextLocation, - action, - }) - if (isBlocked) { - return - } - } - - if (this.history.location !== currentLocation) { - return - } - - return commitLocation({ ...next, ignoreBlocker: true }) - }) as CommitLocationFn - - this.navigate = (async (options) => { - const href = options.href ? String(options.href) : undefined - let isExternal = false - if (href) { - try { - new URL(href) - isExternal = true - } catch { - // Relative hrefs continue through normal Router navigation. - } - } - - if (href && isExternal) { - if (isDangerousProtocol(href, this.protocolAllowlist)) { - if (process.env.NODE_ENV !== 'production') { - console.warn(`Blocked navigation to dangerous protocol: ${href}`) - } - return - } - - if (!options.ignoreBlocker) { - for (const blocker of this.history.getBlockers()) { - const isBlocked = await blocker.blockerFn({ - currentLocation: this.history.location, - nextLocation: this.history.location, - action: 'PUSH', - }) - if (isBlocked) { - return - } - } - } - - const nativeOptions = this.options.native as NativeScriptRouterOptions - const opened = await (nativeOptions.openExternalUrl ?? openUrlAsync)( - href, - ) - if (opened === false) { - throw new Error(`NativeScript could not open external URL: ${href}`) - } - return - } - - const resolved = resolveNativeScriptNavigateOptions( - this, - options as never, - ) - return navigateWithStack( - this, - { ...resolved, reloadDocument: false } as never, - navigate, - ) - }) as NavigateFn - - this.back = ((backOptions) => - backWithStack(this, backOptions as never, this.navigate)) as BackFn - } -} - -export type AnyNativeScriptRouter = NativeScriptRouter - -export function isNativeScriptRouter( - router: AnyRouter, -): router is AnyNativeScriptRouter { - return ( - router instanceof NativeScriptRouter && - isNativeScriptHistory(router.history) - ) -} - -export function assertNativeScriptRouter( - router: AnyRouter, -): asserts router is AnyNativeScriptRouter { - if (!isNativeScriptRouter(router)) { - throw new Error( - 'NativeScriptRouterProvider requires a NativeScriptRouter. Create it with createNativeScriptRouter, or configure the NativeScript Vite plugin to alias @tanstack/react-router.', - ) - } -} - -/** Create a React Router backed by NativeScript-compatible memory history. */ -export function createNativeScriptRouter< - TRouteTree extends AnyRoute, - TTrailingSlashOption extends TrailingSlashOption = 'never', - TDefaultStructuralSharingOption extends boolean = false, - TDehydrated extends Record = Record, ->( - options: CreateNativeScriptRouterOptions< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - TDehydrated - >, -): NativeScriptRouter< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - TDehydrated -> { - const { initialPath, ...routerOptions } = options - const resolvedOptions = { - ...routerOptions, - history: createNativeScriptHistory({ initialPath }), - } as RouterConstructorOptions< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - NativeScriptRouterHistory, - TDehydrated - > - - return new NativeScriptRouter< - TRouteTree, - TTrailingSlashOption, - TDefaultStructuralSharingOption, - TDehydrated - >(resolvedOptions) -} diff --git a/packages/react-nativescript-router/src/screen.ts b/packages/react-nativescript-router/src/screen.ts deleted file mode 100644 index a8d8842daf..0000000000 --- a/packages/react-nativescript-router/src/screen.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { resolveNativeRouteOptions } from '@tanstack/react-router/native' -import type { AnyRoute, AnyRouter, RouterState } from '@tanstack/router-core' -import type { - NativeScriptRouteContext, - NativeScriptRouteOptions, -} from './route-options' - -export interface NativeScreenSnapshot { - historyIndex: number - locationKey: string - href: string - revision: number - state: RouterState - routeContext: NativeScriptRouteContext - routeOptions: NativeScriptRouteOptions -} - -export type NativeStackAction = - | 'initialize' - | 'push' - | 'pop' - | 'replace' - | 'update' - | 'none' - -export function cloneRouterState( - state: RouterState, -): RouterState { - return { - ...state, - location: { - ...state.location, - state: { ...state.location.state }, - }, - resolvedLocation: state.resolvedLocation - ? { - ...state.resolvedLocation, - state: { ...state.resolvedLocation.state }, - } - : undefined, - matches: state.matches.map((match) => ({ ...match })), - } -} - -export function createNativeScreenSnapshot( - router: AnyRouter, - state: RouterState, -): NativeScreenSnapshot { - const snapshot = cloneRouterState(state) - const { context, options } = resolveNativeRouteOptions(router, snapshot) - - return { - historyIndex: snapshot.location.state.__TSR_index ?? 0, - locationKey: - snapshot.location.state.__TSR_key ?? - snapshot.location.state.key ?? - snapshot.location.href, - href: snapshot.location.href, - revision: snapshot.loadedAt, - state: snapshot, - routeContext: context, - routeOptions: options, - } -} - -export function getNativeStackAction( - current: NativeScreenSnapshot | undefined, - next: NativeScreenSnapshot, -): NativeStackAction { - if (!current) { - return 'initialize' - } - - if (next.historyIndex > current.historyIndex) { - return 'push' - } - - if (next.historyIndex < current.historyIndex) { - return 'pop' - } - - if (next.locationKey !== current.locationKey) { - return 'replace' - } - - if (next.href !== current.href || next.revision !== current.revision) { - return 'update' - } - - return 'none' -} diff --git a/packages/react-nativescript-router/src/start.tsx b/packages/react-nativescript-router/src/start.tsx deleted file mode 100644 index f368752dcd..0000000000 --- a/packages/react-nativescript-router/src/start.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { Application } from '@nativescript/core' -import { startReactApp } from '@nativescript-community/react' -import { NativeScriptRouterProvider } from './NativeScriptRouterProvider' -import type { AnyRouter } from '@tanstack/react-router/native' -import type { NativeScriptRouterProviderProps } from './NativeScriptRouterProvider' - -export interface StartNativeScriptAppOptions< - TRouter extends AnyRouter, -> extends Omit, 'router'> { - router: TRouter - initialize?: () => Promise | void - root?: React.ReactNode -} - -/** Initialize optional runtime state, then launch the NativeScript React app. */ -export async function startNativeScriptApp({ - router, - initialize, - root, - ...providerOptions -}: StartNativeScriptAppOptions): Promise { - await initialize?.() - startReactApp({ - Application, - root: - root ?? - React.createElement(NativeScriptRouterProvider, { - ...providerOptions, - router, - }), - }) -} diff --git a/packages/react-nativescript-router/src/useNavigate.tsx b/packages/react-nativescript-router/src/useNavigate.tsx deleted file mode 100644 index fbf7ce3926..0000000000 --- a/packages/react-nativescript-router/src/useNavigate.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import * as React from 'react' -import { useRouter } from '@tanstack/react-router/native' -import type { - AnyRouter, - FromPathOption, - NavigateOptions, - RegisteredRouter, - UseNavigateResult, -} from '@tanstack/router-core' - -/** Navigate with NativeScript stack defaults and route identity. */ -export function useNavigate< - TRouter extends AnyRouter = RegisteredRouter, - TDefaultFrom extends string = string, ->(_defaultOptions?: { - from?: FromPathOption -}): UseNavigateResult { - const router = useRouter() - - return React.useCallback( - (options: NavigateOptions) => { - return router.navigate({ - ...options, - from: options.from ?? _defaultOptions?.from, - }) - }, - [_defaultOptions?.from, router], - ) as UseNavigateResult -} - -/** Navigate after this component mounts. */ -export function Navigate< - TRouter extends AnyRouter = RegisteredRouter, - const TFrom extends string = string, - const TTo extends string | undefined = undefined, - const TMaskFrom extends string = TFrom, - const TMaskTo extends string = '', ->(props: NavigateOptions): null { - const navigate = useNavigate() - const previousPropsRef = React.useRef(null) - - React.useLayoutEffect(() => { - if (previousPropsRef.current !== props) { - void navigate(props) - previousPropsRef.current = props - } - }, [navigate, props]) - - return null -} diff --git a/packages/react-nativescript-router/src/vite.ts b/packages/react-nativescript-router/src/vite.ts deleted file mode 100644 index 4c11690050..0000000000 --- a/packages/react-nativescript-router/src/vite.ts +++ /dev/null @@ -1,487 +0,0 @@ -import { existsSync, readFileSync } from 'node:fs' -import { createRequire } from 'node:module' -import path from 'node:path' -import type { Plugin, ResolvedConfig } from 'vite' - -const nativeModuleExtensions = [ - '.tsx', - '.ts', - '.jsx', - '.js', - '.mts', - '.mjs', - '.cts', - '.cjs', -] as const - -const nativeScriptReactModuleId = 'virtual:tanstack-start-nativescript-react' -const resolvedNativeScriptReactModuleId = `\0${nativeScriptReactModuleId}` -const nativeScriptJsxRuntimeModuleId = - 'virtual:tanstack-start-nativescript-jsx-runtime' -const resolvedNativeScriptJsxRuntimeModuleId = `\0${nativeScriptJsxRuntimeModuleId}` -const nativeScriptJsxDevRuntimeModuleId = - 'virtual:tanstack-start-nativescript-jsx-dev-runtime' -const resolvedNativeScriptJsxDevRuntimeModuleId = `\0${nativeScriptJsxDevRuntimeModuleId}` -const nativeScriptReactDomModuleId = - 'virtual:tanstack-start-nativescript-react-dom' -const resolvedNativeScriptReactDomModuleId = `\0${nativeScriptReactDomModuleId}` -const nativeScriptReactReconcilerModuleId = - 'virtual:tanstack-start-nativescript-react-reconciler' -const resolvedNativeScriptReactReconcilerModuleId = `\0${nativeScriptReactReconcilerModuleId}` -const nativeScriptExternalStoreModuleId = - 'virtual:tanstack-start-nativescript-external-store' -const resolvedNativeScriptExternalStoreModuleId = `\0${nativeScriptExternalStoreModuleId}` -const nativeScriptExternalStoreSelectorModuleId = - 'virtual:tanstack-start-nativescript-external-store-selector' -const resolvedNativeScriptExternalStoreSelectorModuleId = `\0${nativeScriptExternalStoreSelectorModuleId}` - -export interface TanStackReactNativeScriptViteOptions { - /** Directories whose imports may be redirected to NativeScript modules. */ - appDirectories?: Array - /** Route directory used to identify the root route module. */ - routesDirectory?: string - /** Resolve sibling `*-native` modules inside appDirectories. */ - nativeOverrides?: boolean - /** - * Native root-route module, relative to the Vite root. This replaces the - * generated route tree's web `__root` import without placing another route - * file in the routes directory. - */ - nativeRootRoute?: string - /** Additional app-only package aliases, or false to disable a default alias. */ - packageAliases?: Record -} - -function cleanId(id: string): string { - const queryIndex = id.indexOf('?') - const hashIndex = id.indexOf('#') - const end = [queryIndex, hashIndex] - .filter((index) => index >= 0) - .reduce((current, index) => Math.min(current, index), id.length) - return id.slice(0, end) -} - -function isInsideDirectory(file: string, directory: string): boolean { - const relative = path.relative(directory, file) - return ( - relative === '' || - (!relative.startsWith(`..${path.sep}`) && - relative !== '..' && - !path.isAbsolute(relative)) - ) -} - -function stripNativeModuleExtension(file: string): string | undefined { - const extension = nativeModuleExtensions.find((candidate) => - file.endsWith(candidate), - ) - return extension ? file.slice(0, -extension.length) : undefined -} - -function createNativeScriptResolver( - options: TanStackReactNativeScriptViteOptions, -): Plugin { - let root = process.cwd() - let appDirectories: Array = [] - let routesDirectory = '' - let nativeRootRoute: string | undefined - let isProduction = false - let rendererBridgeInitialized = false - let reactSource = '' - let reactExportNames: Array = [] - let jsxRuntimeSource = '' - let jsxRuntimeExportNames: Array = [] - let jsxDevRuntimeSource = '' - let jsxDevRuntimeExportNames: Array = [] - let reactDomModule = '' - let reactReconcilerSource = '' - let schedulerSource = '' - let externalStoreSelectorSource = '' - let sourceMapModule = '' - - const resolveSourceMapModule = () => { - if (sourceMapModule) { - return sourceMapModule - } - - const rootRequire = createRequire(path.join(root, 'package.json')) - try { - sourceMapModule = rootRequire.resolve('source-map-js') - return sourceMapModule - } catch { - const nativeScriptViteEntry = rootRequire.resolve('@nativescript/vite') - const nativeScriptViteRequire = createRequire(nativeScriptViteEntry) - const viteEntry = nativeScriptViteRequire.resolve('vite') - sourceMapModule = createRequire(viteEntry).resolve('source-map-js') - return sourceMapModule - } - } - - const initializeRendererBridge = () => { - if (rendererBridgeInitialized) { - return - } - - const require = createRequire(path.join(root, 'package.json')) - const reactPackagePath = require.resolve('react/package.json') - const reactPackageRoot = path.dirname(reactPackagePath) - const environment = isProduction ? 'production' : 'development' - reactSource = readFileSync( - path.join(reactPackageRoot, 'cjs', `react.${environment}.js`), - 'utf8', - ) - jsxRuntimeSource = readFileSync( - path.join(reactPackageRoot, 'cjs', `react-jsx-runtime.${environment}.js`), - 'utf8', - ) - jsxDevRuntimeSource = readFileSync( - path.join( - reactPackageRoot, - 'cjs', - `react-jsx-dev-runtime.${environment}.js`, - ), - 'utf8', - ) - - const isIdentifier = (name: string) => /^[$A-Z_a-z][$\w]*$/.test(name) - reactExportNames = Object.keys(require('react')).filter(isIdentifier) - jsxRuntimeExportNames = Object.keys(require('react/jsx-runtime')).filter( - isIdentifier, - ) - jsxDevRuntimeExportNames = Object.keys( - require('react/jsx-dev-runtime'), - ).filter(isIdentifier) - - const adapterPackagePath = - require.resolve('@tanstack/react-nativescript-router/package.json') - reactDomModule = path.join( - path.dirname(adapterPackagePath), - 'dist/esm/react-dom.js', - ) - - const rendererPackagePath = - require.resolve('react-nativescript/package.json') - const rendererRequire = createRequire(rendererPackagePath) - const reactReconcilerPackagePath = rendererRequire.resolve( - 'react-reconciler/package.json', - ) - const reactReconcilerRequire = createRequire(reactReconcilerPackagePath) - reactReconcilerSource = readFileSync( - path.join( - path.dirname(reactReconcilerPackagePath), - 'cjs', - `react-reconciler.${environment}.js`, - ), - 'utf8', - ) - const schedulerPackagePath = reactReconcilerRequire.resolve( - 'scheduler/package.json', - ) - schedulerSource = readFileSync( - path.join( - path.dirname(schedulerPackagePath), - 'cjs', - `scheduler.${environment}.js`, - ), - 'utf8', - ) - - const adapterRequire = createRequire(adapterPackagePath) - const reactStorePackagePath = adapterRequire.resolve( - '@tanstack/react-store/package.json', - ) - const reactStoreRequire = createRequire(reactStorePackagePath) - const externalStorePackagePath = reactStoreRequire.resolve( - 'use-sync-external-store/package.json', - ) - externalStoreSelectorSource = readFileSync( - path.join( - path.dirname(externalStorePackagePath), - 'cjs', - 'use-sync-external-store-shim', - `with-selector.${environment}.js`, - ), - 'utf8', - ) - - rendererBridgeInitialized = true - } - - const configurePaths = (config: ResolvedConfig) => { - root = config.root - isProduction = config.isProduction - rendererBridgeInitialized = false - sourceMapModule = '' - appDirectories = (options.appDirectories ?? ['src']).map((directory) => - path.resolve(root, directory), - ) - routesDirectory = path.resolve( - root, - options.routesDirectory ?? 'src/routes', - ) - nativeRootRoute = options.nativeRootRoute - ? path.resolve(root, options.nativeRootRoute) - : undefined - - if (nativeRootRoute && !existsSync(nativeRootRoute)) { - throw new Error( - `NativeScript root route does not exist: ${nativeRootRoute}`, - ) - } - } - - const isAppModule = (id: string | undefined): boolean => { - if (!id || id.startsWith('\0')) { - return false - } - const file = cleanId(id) - return appDirectories.some((directory) => - isInsideDirectory(file, directory), - ) - } - - return { - name: 'tanstack-react-start:nativescript-resolver', - enforce: 'pre', - configResolved(config: ResolvedConfig) { - configurePaths(config) - }, - async resolveId(source, importer) { - if (source === 'source-map-js') { - return resolveSourceMapModule() - } - if (source === nativeScriptReactModuleId) { - return resolvedNativeScriptReactModuleId - } - if (source === nativeScriptJsxRuntimeModuleId) { - return resolvedNativeScriptJsxRuntimeModuleId - } - if (source === nativeScriptJsxDevRuntimeModuleId) { - return resolvedNativeScriptJsxDevRuntimeModuleId - } - if (source === nativeScriptReactDomModuleId) { - return resolvedNativeScriptReactDomModuleId - } - if (source === nativeScriptReactReconcilerModuleId) { - return resolvedNativeScriptReactReconcilerModuleId - } - if (source === nativeScriptExternalStoreModuleId) { - return resolvedNativeScriptExternalStoreModuleId - } - if (source === nativeScriptExternalStoreSelectorModuleId) { - return resolvedNativeScriptExternalStoreSelectorModuleId - } - - if (!isAppModule(importer)) { - return null - } - - const aliasTarget = { - '@tanstack/react-router': '@tanstack/react-nativescript-router', - ...options.packageAliases, - }[source] - - if (aliasTarget) { - const resolved = await this.resolve(aliasTarget, importer, { - skipSelf: true, - }) - if (!resolved) { - this.error( - `Could not resolve ${aliasTarget}. Install the NativeScript adapter before building the native client.`, - ) - } - return resolved - } - - const resolved = await this.resolve(source, importer, { skipSelf: true }) - if (!resolved || resolved.external) { - return null - } - - const resolvedFile = cleanId(resolved.id) - if (!isAppModule(resolvedFile)) { - return null - } - - const base = stripNativeModuleExtension(resolvedFile) - if (!base || base.endsWith('-native')) { - return null - } - - if ( - nativeRootRoute && - path.basename(base) === '__root' && - isInsideDirectory(resolvedFile, routesDirectory) - ) { - return nativeRootRoute - } - - if (options.nativeOverrides === false) { - return null - } - - for (const extension of nativeModuleExtensions) { - const candidate = `${base}-native${extension}` - if (existsSync(candidate)) { - return candidate - } - } - - return null - }, - load(id) { - if ( - id === resolvedNativeScriptReactModuleId || - id === resolvedNativeScriptJsxRuntimeModuleId || - id === resolvedNativeScriptJsxDevRuntimeModuleId || - id === resolvedNativeScriptReactDomModuleId || - id === resolvedNativeScriptReactReconcilerModuleId || - id === resolvedNativeScriptExternalStoreSelectorModuleId - ) { - initializeRendererBridge() - } - - if (id === resolvedNativeScriptReactModuleId) { - return ` -const __module = { exports: {} } -const __exports = __module.exports -const __require = (id) => { throw new Error('Unexpected React dependency: ' + id) } -;(function (module, exports, require) { -${reactSource} -})(__module, __exports, __require) -const React = __module.exports -export default React -export const { ${reactExportNames.join(', ')} } = React -` - } - if (id === resolvedNativeScriptJsxRuntimeModuleId) { - return ` -import React from ${JSON.stringify(nativeScriptReactModuleId)} -const __module = { exports: {} } -const __exports = __module.exports -const __require = (id) => { - if (id === 'react') return React - throw new Error('Unexpected React JSX runtime dependency: ' + id) -} -;(function (module, exports, require) { -${jsxRuntimeSource} -})(__module, __exports, __require) -const runtime = __module.exports -export default runtime -export const { ${jsxRuntimeExportNames.join(', ')} } = runtime -` - } - if (id === resolvedNativeScriptJsxDevRuntimeModuleId) { - return ` -import React from ${JSON.stringify(nativeScriptReactModuleId)} -const __module = { exports: {} } -const __exports = __module.exports -const __require = (id) => { - if (id === 'react') return React - throw new Error('Unexpected React JSX dev runtime dependency: ' + id) -} -;(function (module, exports, require) { -${jsxDevRuntimeSource} -})(__module, __exports, __require) -const runtime = __module.exports -export default runtime -export const { ${jsxDevRuntimeExportNames.join(', ')} } = runtime -` - } - if (id === resolvedNativeScriptReactDomModuleId) { - return `export { flushSync } from ${JSON.stringify(reactDomModule)}` - } - if (id === resolvedNativeScriptReactReconcilerModuleId) { - return ` -import React from ${JSON.stringify(nativeScriptReactModuleId)} -const __schedulerModule = { exports: {} } -const __schedulerExports = __schedulerModule.exports -;(function (module, exports) { -${schedulerSource} -})(__schedulerModule, __schedulerExports) -const Scheduler = __schedulerModule.exports -const __module = { exports: {} } -const __exports = __module.exports -const __require = (id) => { - if (id === 'react') return React - if (id === 'scheduler') return Scheduler - throw new Error('Unexpected React reconciler dependency: ' + id) -} -;(function (module, exports, require) { -${reactReconcilerSource} -})(__module, __exports, __require) -const ReactReconciler = __module.exports -export default ReactReconciler -` - } - if (id === resolvedNativeScriptExternalStoreModuleId) { - return `export { useSyncExternalStore } from ${JSON.stringify(nativeScriptReactModuleId)}` - } - if (id === resolvedNativeScriptExternalStoreSelectorModuleId) { - return ` -import * as React from ${JSON.stringify(nativeScriptReactModuleId)} -import * as shim from ${JSON.stringify(nativeScriptExternalStoreModuleId)} -const __module = { exports: {} } -const __exports = __module.exports -const __require = (id) => { - if (id === 'react') return React - if (id === 'use-sync-external-store/shim') return shim - throw new Error('Unexpected external-store selector dependency: ' + id) -} -;(function (module, exports, require) { -${externalStoreSelectorSource} -})(__module, __exports, __require) -const selector = __module.exports -export const { useSyncExternalStoreWithSelector } = selector -` - } - return null - }, - config() { - return { - build: { - modulePreload: false, - }, - resolve: { - alias: [ - { - find: /^react-reconciler$/, - replacement: nativeScriptReactReconcilerModuleId, - }, - { - find: /^react\/jsx-runtime$/, - replacement: nativeScriptJsxRuntimeModuleId, - }, - { - find: /^react\/jsx-dev-runtime$/, - replacement: nativeScriptJsxDevRuntimeModuleId, - }, - { - find: /^react$/, - replacement: nativeScriptReactModuleId, - }, - { - find: /^react-dom$/, - replacement: nativeScriptReactDomModuleId, - }, - { - find: /^use-sync-external-store\/shim\/with-selector$/, - replacement: nativeScriptExternalStoreSelectorModuleId, - }, - { - find: /^use-sync-external-store\/shim$/, - replacement: nativeScriptExternalStoreModuleId, - }, - ], - }, - } - }, - } -} - -/** Configure Vite for React rendered by NativeScript rather than React DOM. */ -export function tanstackReactNativeScript( - options: TanStackReactNativeScriptViteOptions = {}, -): Plugin { - return createNativeScriptResolver(options) -} diff --git a/packages/react-nativescript-router/tests/history.test.ts b/packages/react-nativescript-router/tests/history.test.ts deleted file mode 100644 index 7314714509..0000000000 --- a/packages/react-nativescript-router/tests/history.test.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { describe, expect, test, vi } from 'vitest' -import { createNativeScriptHistory } from '../src/history' -import type { BlockerFnArgs } from '@tanstack/history' - -describe('createNativeScriptHistory', () => { - test('preserves URL state and branches after back navigation', () => { - const history = createNativeScriptHistory({ initialPath: '/?tab=home' }) - - history.push('/posts?sort=new#top', { source: 'test' }) - history.push('/settings') - history.back() - history.push('/profile') - - expect(history.location).toMatchObject({ - href: '/profile', - pathname: '/profile', - search: '', - hash: '', - state: { __TSR_index: 2 }, - }) - expect(history.getStackSnapshot().map((entry) => entry.href)).toEqual([ - '/?tab=home', - '/posts?sort=new#top', - '/profile', - ]) - }) - - test('honors an initial index of zero', () => { - const history = createNativeScriptHistory({ - initialEntries: ['/', '/one', '/two'], - initialIndex: 0, - }) - - expect(history.location.pathname).toBe('/') - expect(history.canGoBack()).toBe(false) - }) - - test('assigns a new location key on replace without changing depth', () => { - const history = createNativeScriptHistory() - const previousKey = history.location.state.__TSR_key - - history.replace('/replacement') - - expect(history.length).toBe(1) - expect(history.location.state.__TSR_index).toBe(0) - expect(history.location.state.__TSR_key).not.toBe(previousKey) - }) - - test('blocks push and pop navigation before mutating history', async () => { - const history = createNativeScriptHistory() - history.push('/one') - const blocker = vi.fn((_args: BlockerFnArgs) => true) - history.block({ blockerFn: blocker }) - - await history.push('/two') - expect(history.location.pathname).toBe('/one') - - await history.back() - expect(history.location.pathname).toBe('/one') - expect(blocker).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ action: 'PUSH' }), - ) - expect(blocker).toHaveBeenNthCalledWith( - 2, - expect.objectContaining({ - action: 'BACK', - nextLocation: expect.objectContaining({ pathname: '/' }), - }), - ) - }) - - test('continues an asynchronous blocker and supports ignoreBlocker', async () => { - const history = createNativeScriptHistory() - history.push('/one') - history.block({ blockerFn: () => Promise.resolve(false) }) - - await history.back() - expect(history.location.pathname).toBe('/') - - history.push('/two', undefined, { ignoreBlocker: true }) - expect(history.location.pathname).toBe('/two') - }) - - test('settles only after an asynchronous blocker decides', async () => { - const history = createNativeScriptHistory() - history.push('/one') - let allowNavigation!: (blocked: boolean) => void - history.block({ - blockerFn: () => - new Promise((resolve) => { - allowNavigation = resolve - }), - }) - - const navigation = history.back() - expect(history.location.pathname).toBe('/one') - - allowNavigation(false) - await navigation - - expect(history.location.pathname).toBe('/') - }) - - test('notifies when blocker availability changes', () => { - const history = createNativeScriptHistory() - const listener = vi.fn() - const unsubscribe = history.subscribeBlockers(listener) - const unblock = history.block({ blockerFn: () => false }) - - expect(history.hasBlockers()).toBe(true) - unblock() - expect(history.hasBlockers()).toBe(false) - expect(listener).toHaveBeenCalledTimes(2) - - unsubscribe() - }) - - test('exposes a defensive blocker snapshot to host navigation', () => { - const history = createNativeScriptHistory() - const blocker = { blockerFn: vi.fn(() => false) } - const unblock = history.block(blocker) - const blockers = history.getBlockers() - - expect(blockers).toEqual([blocker]) - expect(blockers).not.toBe(history.getBlockers()) - - unblock() - expect(history.getBlockers()).toEqual([]) - }) -}) diff --git a/packages/react-nativescript-router/tests/linking.test.ts b/packages/react-nativescript-router/tests/linking.test.ts deleted file mode 100644 index e625eca162..0000000000 --- a/packages/react-nativescript-router/tests/linking.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { describe, expect, test, vi } from 'vitest' -import { - navigateNativeScriptURL, - parseNativeScriptURL, - setupNativeScriptLinking, -} from '../src/linking' -import type { AnyRouter } from '@tanstack/router-core' - -function createRouter() { - const navigate = vi.fn().mockResolvedValue(undefined) - const router = { - history: { location: { href: '/' } }, - navigate, - } as unknown as AnyRouter - - return { navigate, router } -} - -describe('parseNativeScriptURL', () => { - test.each([ - ['/posts/1?tab=activity#reply', [], '/posts/1?tab=activity#reply'], - [ - 'tanstack://app/posts/1?tab=activity#reply', - ['tanstack://app'], - '/posts/1?tab=activity#reply', - ], - [ - 'https://example.com/posts/1?tab=activity#reply', - ['https://example.com'], - '/posts/1?tab=activity#reply', - ], - ['https://example.com#reply', ['https://example.com'], '/#reply'], - ['TANSTACK://APP/posts/1', ['tanstack://app'], '/posts/1'], - ['https://EXAMPLE.COM/posts/1', ['https://example.com'], '/posts/1'], - ['tanstack://posts/1?tab=activity', [], '/posts/1?tab=activity'], - ['https://other.example/posts/1', ['https://example.com'], null], - ['', [], null], - ] as const)('parses %s', (url, prefixes, expected) => { - expect(parseNativeScriptURL(url, [...prefixes])).toBe(expected) - }) - - test('matches the longest configured prefix', () => { - expect( - parseNativeScriptURL('https://example.com/app/posts', [ - 'https://example.com', - 'https://example.com/app', - ]), - ).toBe('/posts') - }) - - test('reports asynchronous navigation errors', async () => { - const { navigate, router } = createRouter() - const error = new Error('navigation failed') - const onError = vi.fn() - navigate.mockRejectedValueOnce(error) - - await navigateNativeScriptURL( - router, - { prefixes: ['tanstack://app'], onError }, - 'tanstack://app/details', - 'push', - ) - - expect(navigate).toHaveBeenCalledWith({ - to: undefined, - href: '/details', - stackBehavior: 'push', - }) - expect(onError).toHaveBeenCalledWith(error, 'tanstack://app/details') - }) - - test('respects a custom parser rejecting a URL', async () => { - const { navigate, router } = createRouter() - const onUnhandledURL = vi.fn() - - await navigateNativeScriptURL( - router, - { - parseURL: () => null, - onUnhandledURL, - }, - 'https://example.com/details', - 'push', - ) - - expect(navigate).not.toHaveBeenCalled() - expect(onUnhandledURL).toHaveBeenCalledWith('https://example.com/details') - }) - - test('subscribes before resolving the initial URL', async () => { - const { navigate, router } = createRouter() - let resolveInitialURL: (url: string) => void = () => undefined - const initialURL = new Promise((resolve) => { - resolveInitialURL = resolve - }) - let listener: (url: string) => void = () => undefined - const unsubscribe = vi.fn() - const subscribe = vi.fn((next: (url: string) => void) => { - listener = next - return unsubscribe - }) - - const dispose = setupNativeScriptLinking(router, { - getInitialURL: () => initialURL, - subscribe, - }) - - expect(subscribe).toHaveBeenCalledOnce() - listener('/incoming') - resolveInitialURL('/initial') - await initialURL - await Promise.resolve() - - expect(navigate).toHaveBeenCalledOnce() - expect(navigate).toHaveBeenCalledWith({ - to: undefined, - href: '/incoming', - stackBehavior: 'push', - }) - - dispose() - expect(unsubscribe).toHaveBeenCalledOnce() - }) -}) diff --git a/packages/react-nativescript-router/tests/native-navigation.test.ts b/packages/react-nativescript-router/tests/native-navigation.test.ts deleted file mode 100644 index cce38429e7..0000000000 --- a/packages/react-nativescript-router/tests/native-navigation.test.ts +++ /dev/null @@ -1,319 +0,0 @@ -import { - createRootRoute, - createRoute, - createRouter as createWebRouter, -} from '@tanstack/react-router' -import { describe, expect, test, vi } from 'vitest' -import { resolveNativeScriptNavigateOptions } from '../src/native-navigation' -import { - assertNativeScriptRouter, - createNativeScriptRouter, - isNativeScriptRouter, -} from '../src/router' - -vi.mock('@nativescript/core/abortcontroller', () => ({ - AbortController: globalThis.AbortController, - AbortSignal: globalThis.AbortSignal, -})) -vi.mock('@nativescript/core/utils', () => ({ - openUrlAsync: vi.fn(), -})) - -function createRouter(options?: { - defaultStackBehavior?: 'push' | 'reuse' - openExternalUrl?: (url: string) => boolean | Promise -}) { - const getId = vi.fn( - ({ params, search }: { params: Record; search: unknown }) => - `item:${params.itemId}:${(search as { tab?: string }).tab ?? 'main'}`, - ) - const rootRoute = createRootRoute() - const plainRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/plain', - }) - const itemRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/items/$itemId', - native: { - getId, - stackMatch: 'oldest', - }, - }) - const router = createNativeScriptRouter({ - routeTree: rootRoute.addChildren([plainRoute, itemRoute]), - native: { - defaultStackBehavior: options?.defaultStackBehavior, - openExternalUrl: options?.openExternalUrl, - }, - }) - - return { getId, router } -} - -describe('resolveNativeScriptNavigateOptions', () => { - test('identifies adapter routers and rejects web routers', () => { - const rootRoute = createRootRoute() - const nativeRouter = createNativeScriptRouter({ routeTree: rootRoute }) - const webRouter = createWebRouter({ routeTree: rootRoute }) - - expect(isNativeScriptRouter(nativeRouter)).toBe(true) - expect(isNativeScriptRouter(webRouter)).toBe(false) - expect(() => assertNativeScriptRouter(nativeRouter)).not.toThrow() - expect(() => assertNativeScriptRouter(webRouter)).toThrow( - 'NativeScriptRouterProvider requires a NativeScriptRouter', - ) - }) - - test('defaults to exact-location reuse', async () => { - const { router } = createRouter() - await router.load() - - const resolved = resolveNativeScriptNavigateOptions(router, { - to: '/plain', - search: { tab: 'one' }, - hash: 'heading', - }) - - expect(resolved).toMatchObject({ - stackBehavior: 'reuse', - stackMatch: 'nearest', - entryId: '/plain?tab=one#heading', - }) - }) - - test('uses route identity and match policy', async () => { - const { getId, router } = createRouter() - await router.load() - - const resolved = resolveNativeScriptNavigateOptions(router, { - to: '/items/$itemId', - params: { itemId: '42' }, - search: { tab: 'activity' }, - }) - - expect(resolved.entryId).toBe('item:42:activity') - expect(resolved.stackMatch).toBe('oldest') - expect(getId).toHaveBeenCalledWith({ - pathname: '/items/42', - href: '/items/42?tab=activity', - params: { itemId: '42' }, - search: { tab: 'activity' }, - }) - }) - - test('honors router and navigation overrides', async () => { - const { router } = createRouter({ defaultStackBehavior: 'push' }) - await router.load() - - const routerDefault = resolveNativeScriptNavigateOptions(router, { - to: '/plain', - }) - const navigationOverride = resolveNativeScriptNavigateOptions(router, { - to: '/plain', - stackBehavior: 'reuse', - stackMatch: 'oldest', - entryId: 'explicit', - }) - - expect(routerDefault.stackBehavior).toBe('push') - expect(navigationOverride).toMatchObject({ - stackBehavior: 'reuse', - stackMatch: 'oldest', - entryId: 'explicit', - }) - }) - - test('preserves explicit standard replace semantics', async () => { - const { router } = createRouter({ defaultStackBehavior: 'reuse' }) - await router.load() - - expect( - resolveNativeScriptNavigateOptions(router, { - to: '/plain', - replace: true, - }).stackBehavior, - ).toBe('replace') - expect( - resolveNativeScriptNavigateOptions(router, { - to: '/plain', - replace: false, - }).stackBehavior, - ).toBe('push') - expect( - resolveNativeScriptNavigateOptions(router, { - to: '/plain', - replace: true, - stackBehavior: 'reuse', - }).stackBehavior, - ).toBe('reuse') - }) - - test('applies native identity to direct router.navigate calls', async () => { - const rootRoute = createRootRoute() - const plainRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/plain', - }) - const itemRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/items/$itemId', - native: { - getId: ({ params }) => `item:${params.itemId}`, - }, - }) - const router = createNativeScriptRouter({ - routeTree: rootRoute.addChildren([plainRoute, itemRoute]), - native: { defaultStackBehavior: 'reuse' }, - }) - await router.load() - - await router.navigate({ - to: '/items/$itemId', - params: { itemId: '42' }, - search: { tab: 'first' }, - }) - expect(router.history.location.state.__TSR_entryId).toBe('item:42') - - await router.navigate({ to: '/plain' }) - await router.navigate({ - to: '/items/$itemId', - params: { itemId: '42' }, - search: { tab: 'second' }, - }) - - expect(router.history.location.state.__TSR_index).toBe(1) - expect(router.history.location.href).toBe('/items/42?tab=first') - }) - - test('opens absolute URLs through the NativeScript host', async () => { - const openExternalUrl = vi.fn(() => Promise.resolve(true)) - const rootRoute = createRootRoute() - const router = createNativeScriptRouter({ - routeTree: rootRoute, - native: { openExternalUrl }, - }) - await router.load() - - await router.navigate({ href: 'https://example.com/account' }) - - expect(openExternalUrl).toHaveBeenCalledWith('https://example.com/account') - expect(router.history.location.pathname).toBe('/') - }) - - test('applies active blockers to external URLs', async () => { - const openExternalUrl = vi.fn(() => Promise.resolve(true)) - const rootRoute = createRootRoute() - const router = createNativeScriptRouter({ - routeTree: rootRoute, - native: { openExternalUrl }, - }) - await router.load() - const blockerFn = vi.fn(() => Promise.resolve(true)) - const unblock = router.history.block({ blockerFn }) - - await router.navigate({ href: 'https://example.com/account' }) - expect(openExternalUrl).not.toHaveBeenCalled() - expect(blockerFn).toHaveBeenCalledWith({ - currentLocation: router.history.location, - nextLocation: router.history.location, - action: 'PUSH', - }) - - await router.navigate({ - href: 'https://example.com/account', - ignoreBlocker: true, - }) - expect(openExternalUrl).toHaveBeenCalledOnce() - unblock() - }) - - test('blocks dangerous external protocols', async () => { - const openExternalUrl = vi.fn(() => Promise.resolve(true)) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - const rootRoute = createRootRoute() - const router = createNativeScriptRouter({ - routeTree: rootRoute, - native: { openExternalUrl }, - }) - await router.load() - - await router.navigate({ href: 'javascript:alert(1)' }) - - expect(openExternalUrl).not.toHaveBeenCalled() - expect(warn).toHaveBeenCalledWith( - 'Blocked navigation to dangerous protocol: javascript:alert(1)', - ) - }) - - test('rejects when the host cannot open an external URL', async () => { - const rootRoute = createRootRoute() - const router = createNativeScriptRouter({ - routeTree: rootRoute, - native: { openExternalUrl: () => false }, - }) - await router.load() - - await expect( - router.navigate({ href: 'https://example.com/account' }), - ).rejects.toThrow( - 'NativeScript could not open external URL: https://example.com/account', - ) - }) - - test('keeps shared reloadDocument links inside the native stack', async () => { - const openExternalUrl = vi.fn(() => Promise.resolve(true)) - const rootRoute = createRootRoute() - const plainRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/plain', - }) - const router = createNativeScriptRouter({ - routeTree: rootRoute.addChildren([plainRoute]), - native: { openExternalUrl }, - }) - await router.load() - - await router.navigate({ to: '/plain', reloadDocument: true }) - - expect(openExternalUrl).not.toHaveBeenCalled() - expect(router.history.location.pathname).toBe('/plain') - }) - - test('waits for asynchronous blockers before settling back navigation', async () => { - const { router } = createRouter() - await router.load() - await router.navigate({ to: '/plain' }) - let decide!: (blocked: boolean) => void - const unblock = router.history.block({ - blockerFn: () => - new Promise((resolve) => { - decide = resolve - }), - }) - - const navigation = router.back() - expect(router.history.location.pathname).toBe('/plain') - - decide(false) - await navigation - - expect(router.history.location.pathname).toBe('/') - expect(router.state.location.pathname).toBe('/') - unblock() - }) - - test('resolves blocked navigation without loading the rejected location', async () => { - const { router } = createRouter() - await router.load() - const unblock = router.history.block({ - blockerFn: () => Promise.resolve(true), - }) - - await router.navigate({ to: '/plain' }) - - expect(router.history.location.pathname).toBe('/') - expect(router.state.location.pathname).toBe('/') - unblock() - }) -}) diff --git a/packages/react-nativescript-router/tests/native-stack-controller.test.ts b/packages/react-nativescript-router/tests/native-stack-controller.test.ts deleted file mode 100644 index 9b97aa1306..0000000000 --- a/packages/react-nativescript-router/tests/native-stack-controller.test.ts +++ /dev/null @@ -1,409 +0,0 @@ -import { describe, expect, test, vi } from 'vitest' - -import { createNativeScriptHistory } from '../src/history' -import { createNativeScriptNavigationState } from '../src/navigation-state' -import { NativeStackController } from '../src/native-stack-controller' -import { nativePageRecordKey } from '../src/page' -import type { AnyNativeScriptRouter } from '../src/router' -import type { - NativeScriptBackstackEntryLike, - NativeScriptFrameLike, -} from '../src/native-stack-controller' -import type { - NativePageRecord, - NativePageWithRecord, - createNativePageRecord, -} from '../src/page' -import type { NativeScreenSnapshot } from '../src/screen' -import type { BackstackEntry, NavigationEntry, Page } from '@nativescript/core' - -vi.mock('../src/page', () => ({ - createNativePageRecord: vi.fn(() => { - throw new Error('Test must inject a page-record factory') - }), - getNativePageRecord: (page: Record | undefined) => - page?.__TSR_nativePageRecord, - nativePageRecordKey: '__TSR_nativePageRecord', -})) - -type CreatePageRecordArgs = Parameters[0] - -class TestFrame implements NativeScriptFrameLike { - currentPage?: Page - backStack: Array = [] - navigateCalls: Array = [] - replacePageCalls: Array = [] - goBackCalls: Array< - BackstackEntry | NativeScriptBackstackEntryLike | undefined - > = [] - - navigate(entry: NavigationEntry) { - this.navigateCalls.push(entry) - if (this.currentPage) { - this.backStack.push({ resolvedPage: this.currentPage }) - } - this.currentPage = entry.create!() as Page - } - - replacePage(entry: NavigationEntry) { - this.replacePageCalls.push(entry) - this.currentPage = entry.create!() as Page - } - - goBack(entry?: BackstackEntry | NativeScriptBackstackEntryLike) { - this.goBackCalls.push(entry) - const targetIndex = entry - ? this.backStack.findIndex( - (backstackEntry) => - backstackEntry.resolvedPage === entry.resolvedPage, - ) - : this.backStack.length - 1 - if (targetIndex < 0) { - return - } - this.currentPage = this.backStack[targetIndex]!.resolvedPage - this.backStack = this.backStack.slice(0, targetIndex) - } -} - -function createHarness(initialEntries: Array = ['/']) { - const history = createNativeScriptHistory({ initialEntries }) - const router = { history } as AnyNativeScriptRouter - const frame = new TestFrame() - const callbacks = new Map>() - const records = new Map() - const disposedKeys: Array = [] - - const createPageRecord = vi.fn((args: CreatePageRecordArgs) => { - const page = {} as NativePageWithRecord - let disposed = false - const record: NativePageRecord = { - page, - store: {} as NativePageRecord['store'], - screen: args.screen, - setActive: vi.fn(), - update(next) { - record.screen = next - }, - updateOptions: vi.fn(), - dispose() { - if (disposed) { - return - } - disposed = true - disposedKeys.push(record.screen.locationKey) - args.onDisposed(record) - }, - } - page[nativePageRecordKey] = record - callbacks.set(page, { onNavigatedTo: args.onNavigatedTo }) - records.set(args.screen.locationKey, record) - return record - }) as typeof createNativePageRecord - - const controller = new NativeStackController( - frame, - router, - {}, - { - createPageRecord, - }, - ) - let revision = 0 - - const snapshot = ( - routeOptions: NativeScreenSnapshot['routeOptions'] = {}, - ): NativeScreenSnapshot => { - revision += 1 - const location = history.location - return { - historyIndex: location.state.__TSR_index, - locationKey: location.state.__TSR_key!, - href: location.href, - revision, - state: { - location, - loadedAt: revision, - } as NativeScreenSnapshot['state'], - routeContext: { - pathname: location.pathname, - href: location.href, - canGoBack: history.canGoBack(), - } as NativeScreenSnapshot['routeContext'], - routeOptions, - } - } - - const finishNavigation = (isBackNavigation = false) => { - const page = frame.currentPage as NativePageWithRecord | undefined - if (!page) { - throw new Error('No current page') - } - const callback = callbacks.get(page) - if (!callback) { - throw new Error('No page callback registered') - } - const record = page[nativePageRecordKey] - if (!record) { - throw new Error('No page record registered') - } - callback.onNavigatedTo(record, isBackNavigation) - } - - return { - callbacks, - controller, - createPageRecord, - disposedKeys, - finishNavigation, - frame, - history, - records, - snapshot, - } -} - -describe('NativeStackController', () => { - test('initializes without animation and pushes search-only entries', () => { - const harness = createHarness() - harness.controller.sync(harness.snapshot()) - - expect(harness.frame.navigateCalls[0]).toMatchObject({ - animated: false, - backstackVisible: true, - clearHistory: false, - }) - harness.finishNavigation() - - harness.history.push('/?query=native') - harness.controller.sync(harness.snapshot()) - - expect(harness.frame.navigateCalls).toHaveLength(2) - expect(harness.frame.navigateCalls[1]).toMatchObject({ animated: true }) - expect(harness.frame.backStack).toHaveLength(1) - }) - - test('uses Frame.replacePage and disposes the replaced tree after commit', () => { - const harness = createHarness() - const initial = harness.snapshot() - harness.controller.sync(initial) - harness.finishNavigation() - - harness.history.replace('/replacement') - const replacement = harness.snapshot() - harness.controller.sync(replacement) - - expect(harness.frame.replacePageCalls).toHaveLength(1) - expect(harness.disposedKeys).toEqual([]) - - harness.finishNavigation() - expect(harness.disposedKeys).toEqual([initial.locationKey]) - }) - - test('pops to the exact native entry for Router-originated back', () => { - const harness = createHarness() - const root = harness.snapshot() - harness.controller.sync(root) - harness.finishNavigation() - harness.history.push('/one') - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - harness.history.push('/two') - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - - const go = vi.spyOn(harness.history, 'go') - harness.history.go(-2) - go.mockClear() - harness.controller.sync(root) - - expect(harness.frame.goBackCalls).toHaveLength(1) - expect(harness.frame.currentPage).toBe( - harness.records.get(root.locationKey)!.page, - ) - - harness.finishNavigation(true) - expect(go).not.toHaveBeenCalled() - }) - - test('synchronizes a completed native swipe once and prunes popped pages', () => { - const harness = createHarness() - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - harness.history.push('/one') - const one = harness.snapshot() - harness.controller.sync(one) - harness.finishNavigation() - harness.history.push('/two') - const two = harness.snapshot() - harness.controller.sync(two) - harness.finishNavigation() - - const targetEntry = harness.frame.backStack.find( - (entry) => - entry.resolvedPage === harness.records.get(one.locationKey)!.page, - )! - const go = vi.spyOn(harness.history, 'go') - harness.frame.goBack(targetEntry) - harness.finishNavigation(true) - - expect(go).toHaveBeenCalledOnce() - expect(go).toHaveBeenCalledWith(-1, { ignoreBlocker: true }) - expect(harness.history.location.pathname).toBe('/one') - expect(harness.disposedKeys).toContain(two.locationKey) - }) - - test('fails instead of replacing when native and Router stacks diverge', () => { - const harness = createHarness(['/', '/one', '/two']) - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - const onNavigationError = vi.fn() - harness.controller.setOptions({ onNavigationError }) - - harness.history.back() - expect(() => harness.controller.sync(harness.snapshot())).toThrow( - 'NativeScript back stack is missing history entry', - ) - expect(onNavigationError).toHaveBeenCalledOnce() - expect(harness.frame.replacePageCalls).toEqual([]) - }) - - test('prefers navigation-state transitions over route and provider defaults', () => { - const harness = createHarness() - harness.controller.setOptions({ - animated: false, - transition: { name: 'slideRight' }, - }) - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - - harness.history.push( - '/one', - createNativeScriptNavigationState({ - animated: true, - transition: { name: 'flipLeft' }, - }), - ) - harness.controller.sync( - harness.snapshot({ animation: 'fade', animated: false }), - ) - - expect(harness.frame.navigateCalls[1]).toMatchObject({ - animated: true, - transition: { name: 'flipLeft' }, - }) - }) - - test('updates render options without recreating native pages', () => { - const harness = createHarness() - const initial = harness.snapshot() - harness.controller.sync(initial) - const record = harness.records.get(initial.locationKey)! - - harness.controller.setOptions({ actionBarColor: 'red' }) - - expect(record.updateOptions).toHaveBeenCalledWith({ - actionBarColor: 'red', - }) - expect(harness.createPageRecord).toHaveBeenCalledOnce() - }) - - test('activates blockers only for the committed visible Page', () => { - const harness = createHarness() - const root = harness.snapshot() - harness.controller.sync(root) - const rootRecord = harness.records.get(root.locationKey)! - - expect(rootRecord.setActive).not.toHaveBeenCalled() - harness.finishNavigation() - expect(rootRecord.setActive).toHaveBeenLastCalledWith(true) - - harness.history.push('/one') - const one = harness.snapshot() - harness.controller.sync(one) - const oneRecord = harness.records.get(one.locationKey)! - - expect(rootRecord.setActive).toHaveBeenLastCalledWith(true) - expect(oneRecord.setActive).not.toHaveBeenCalled() - - harness.finishNavigation() - expect(rootRecord.setActive).toHaveBeenLastCalledWith(false) - expect(oneRecord.setActive).toHaveBeenLastCalledWith(true) - }) - - test('waits for the initial Page before calling Frame.replacePage', () => { - const harness = createHarness() - const initial = harness.snapshot() - harness.controller.sync(initial) - - harness.history.replace('/replacement') - const replacement = harness.snapshot() - harness.controller.sync(replacement) - - expect(harness.frame.replacePageCalls).toEqual([]) - - harness.finishNavigation() - expect(harness.frame.replacePageCalls).toHaveLength(1) - expect(harness.disposedKeys).toEqual([]) - - harness.finishNavigation() - expect(harness.disposedKeys).toEqual([initial.locationKey]) - }) - - test('keeps resolved intermediate Pages during rapid pushes', () => { - const harness = createHarness() - harness.controller.sync(harness.snapshot()) - harness.finishNavigation() - - harness.history.push('/one') - harness.controller.sync(harness.snapshot()) - harness.history.push('/two') - const two = harness.snapshot() - harness.controller.sync(two) - harness.history.push('/three') - const three = harness.snapshot() - harness.controller.sync(three) - - expect(harness.frame.navigateCalls).toHaveLength(2) - - harness.finishNavigation() - expect(harness.frame.navigateCalls).toHaveLength(3) - expect(harness.frame.currentPage).toBe( - harness.records.get(two.locationKey)!.page, - ) - - harness.finishNavigation() - expect(harness.frame.navigateCalls).toHaveLength(4) - expect(harness.frame.currentPage).toBe( - harness.records.get(three.locationKey)!.page, - ) - - harness.finishNavigation() - expect(harness.frame.backStack).toHaveLength(3) - }) - - test('finishes an in-flight push before reconciling a Router back', () => { - const harness = createHarness() - const root = harness.snapshot() - harness.controller.sync(root) - harness.finishNavigation() - - harness.history.push('/one') - const one = harness.snapshot() - harness.controller.sync(one) - harness.history.back() - harness.controller.sync(root) - - expect(harness.frame.goBackCalls).toEqual([]) - - harness.finishNavigation() - expect(harness.frame.goBackCalls).toHaveLength(1) - expect(harness.frame.currentPage).toBe( - harness.records.get(root.locationKey)!.page, - ) - - harness.finishNavigation(true) - expect(harness.disposedKeys).toContain(one.locationKey) - expect(harness.history.location.pathname).toBe('/') - }) -}) diff --git a/packages/react-nativescript-router/tests/page.test.ts b/packages/react-nativescript-router/tests/page.test.ts deleted file mode 100644 index 362c98b905..0000000000 --- a/packages/react-nativescript-router/tests/page.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { describe, expect, test, vi } from 'vitest' -import { getDefaultNavigationButtonProps } from '../src/action-bar' - -describe('NativeScript action bar', () => { - test('uses an accessible Android system back button', () => { - const back = vi.fn().mockResolvedValue(undefined) - const props = getDefaultNavigationButtonProps({ back }, undefined, true) - - expect(props).toMatchObject({ - text: 'Back', - 'android.systemIcon': 'ic_menu_back', - visibility: 'visible', - }) - - props.onTap() - expect(back).toHaveBeenCalledOnce() - }) - - test('preserves an explicit back title and collapsed state', () => { - const props = getDefaultNavigationButtonProps( - { back: vi.fn() }, - 'Accounts', - false, - ) - - expect(props.text).toBe('Accounts') - expect(props.visibility).toBe('collapsed') - }) -}) diff --git a/packages/react-nativescript-router/tests/router.test-d.ts b/packages/react-nativescript-router/tests/router.test-d.ts deleted file mode 100644 index 8cf5a7c071..0000000000 --- a/packages/react-nativescript-router/tests/router.test-d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { createRouter as createWebRouter } from '@tanstack/react-router' -import { - NativeScriptRouterProvider, - createNativeScriptRouter, - createRootRoute, - startNativeScriptApp, -} from '../src' -import type { AnyNativeScriptRouter } from '../src' - -declare module '@tanstack/react-router/native' { - interface NativeRouteOptionsExtensions { - presentation?: 'push' | 'modal' - } -} - -const routeTree = createRootRoute({ - native: (context) => ({ - title: context.pathname, - headerShown: ({ canGoBack }) => canGoBack, - headerStyle: { - backgroundColor: 'white', - color: 'black', - flat: true, - }, - animated: true, - transition: { name: 'slideLeft' }, - presentation: 'push', - }), -}) - -const router = createNativeScriptRouter({ - routeTree, - initialPath: '/account', -}) - -const anyNativeRouter: AnyNativeScriptRouter = router -void anyNativeRouter.back() -NativeScriptRouterProvider({ router }) -void startNativeScriptApp({ router }) - -const sharedRouter = createWebRouter({ routeTree }) -NativeScriptRouterProvider({ router: sharedRouter }) -void startNativeScriptApp({ router: sharedRouter }) - -// @ts-expect-error A web Router is accepted at the aliased app boundary, but is not itself a NativeScriptRouter. -const invalidNativeRouter: AnyNativeScriptRouter = sharedRouter -void invalidNativeRouter - -createNativeScriptRouter({ - routeTree, - // @ts-expect-error Native pages cannot be synthesized for seeded entries. - initialEntries: ['/', '/account'], -}) diff --git a/packages/react-nativescript-router/tests/screen.test.ts b/packages/react-nativescript-router/tests/screen.test.ts deleted file mode 100644 index 0f5715a428..0000000000 --- a/packages/react-nativescript-router/tests/screen.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { describe, expect, test } from 'vitest' -import { getNativeStackAction } from '../src/screen' -import type { NativeScreenSnapshot } from '../src/screen' - -function screen( - historyIndex: number, - locationKey: string, - href: string, - revision = 1, -): NativeScreenSnapshot { - return { - historyIndex, - locationKey, - href, - revision, - state: {} as NativeScreenSnapshot['state'], - routeContext: {} as NativeScreenSnapshot['routeContext'], - routeOptions: {}, - } -} - -describe('getNativeStackAction', () => { - test.each([ - [undefined, screen(0, 'root', '/'), 'initialize'], - [screen(0, 'root', '/'), screen(1, 'details', '/details'), 'push'], - [screen(2, 'two', '/two'), screen(0, 'root', '/'), 'pop'], - [screen(1, 'old', '/one'), screen(1, 'new', '/two'), 'replace'], - [screen(1, 'same', '/one'), screen(1, 'same', '/one?tab=2'), 'update'], - [screen(1, 'same', '/one'), screen(1, 'same', '/one', 2), 'update'], - [screen(1, 'same', '/one'), screen(1, 'same', '/one'), 'none'], - ] as const)('%s -> %s is %s', (current, next, expected) => { - expect(getNativeStackAction(current, next)).toBe(expected) - }) -}) diff --git a/packages/react-nativescript-router/tests/vite.test.ts b/packages/react-nativescript-router/tests/vite.test.ts deleted file mode 100644 index 4ad814e3e7..0000000000 --- a/packages/react-nativescript-router/tests/vite.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe, expect, test } from 'vitest' -import { tanstackReactNativeScript } from '../src/vite' -import type { UserConfig } from 'vite' - -describe('tanstackReactNativeScript', () => { - test('disables browser module preload handling', () => { - const plugin = tanstackReactNativeScript() - const config = (plugin.config as () => UserConfig)() - - expect(config.build?.modulePreload).toBe(false) - }) -}) diff --git a/packages/react-nativescript-router/tsconfig.build.json b/packages/react-nativescript-router/tsconfig.build.json deleted file mode 100644 index 92be18587f..0000000000 --- a/packages/react-nativescript-router/tsconfig.build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "rootDir": "./src" - }, - "include": ["src"] -} diff --git a/packages/react-nativescript-router/tsconfig.json b/packages/react-nativescript-router/tsconfig.json deleted file mode 100644 index 79cccb61b0..0000000000 --- a/packages/react-nativescript-router/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "react", - "types": ["node", "@nativescript/types"] - }, - "include": ["src", "tests", "vite.config.ts", "eslint.config.ts"] -} diff --git a/packages/react-nativescript-router/vite.config.ts b/packages/react-nativescript-router/vite.config.ts deleted file mode 100644 index a3096c50d9..0000000000 --- a/packages/react-nativescript-router/vite.config.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { defineConfig, mergeConfig } from 'vitest/config' -import { tanstackViteConfig } from '@tanstack/vite-config' -import react from '@vitejs/plugin-react' -import packageJson from './package.json' - -const config = defineConfig({ - plugins: [react()], - resolve: { - conditions: ['development'], - }, - test: { - name: packageJson.name, - dir: './tests', - watch: false, - environment: 'node', - }, -}) - -export default mergeConfig( - config, - tanstackViteConfig({ - tsconfigPath: './tsconfig.build.json', - entry: [ - './src/index.tsx', - './src/history.ts', - './src/react-dom.ts', - './src/vite.ts', - ], - srcDir: './src', - }), -) diff --git a/packages/react-router-devtools/CHANGELOG.md b/packages/react-router-devtools/CHANGELOG.md index 40e065c673..f74de5f187 100644 --- a/packages/react-router-devtools/CHANGELOG.md +++ b/packages/react-router-devtools/CHANGELOG.md @@ -1,5 +1,30 @@ # @tanstack/react-router-devtools +## 1.167.3 + +### Patch Changes + +- Updated dependencies [[`bbf9b75`](https://github.com/TanStack/router/commit/bbf9b75808d8eee497a6dd1663f0cf08426512e0)]: + - @tanstack/router-devtools-core@1.168.3 + +## 1.167.2 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/react-router@1.170.36 + - @tanstack/router-devtools-core@1.168.2 + +## 1.167.1 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/react-router@1.170.19 + - @tanstack/router-devtools-core@1.168.1 + ## 1.167.0 ### Minor Changes diff --git a/packages/react-router-devtools/README.md b/packages/react-router-devtools/README.md index 7be76f46c2..0079d7c065 100644 --- a/packages/react-router-devtools/README.md +++ b/packages/react-router-devtools/README.md @@ -1,5 +1,22 @@ +
+ + + + TanStack React Router + +
# TanStack React Router Devtools See https://tanstack.com/router/latest/docs/framework/react/devtools diff --git a/packages/react-router-devtools/package.json b/packages/react-router-devtools/package.json index 3cb40e24b0..969371a6a6 100644 --- a/packages/react-router-devtools/package.json +++ b/packages/react-router-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-router-devtools", - "version": "1.167.0", + "version": "1.167.3", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -65,11 +65,21 @@ "@tanstack/router-devtools-core": "workspace:*" }, "devDependencies": { - "@vitejs/plugin-react": "^4.3.4", - "react": ">=19", - "react-dom": ">=19", + "@vitejs/plugin-react": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", "vite": "*", - "@types/node": ">=20" + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@eslint-react/eslint-plugin": "catalog:", + "eslint-plugin-react-hooks": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "@tanstack/react-router": "workspace:^", diff --git a/packages/react-router-ssr-query/CHANGELOG.md b/packages/react-router-ssr-query/CHANGELOG.md index 8e4f3df45d..d0fc73ff50 100644 --- a/packages/react-router-ssr-query/CHANGELOG.md +++ b/packages/react-router-ssr-query/CHANGELOG.md @@ -1,5 +1,39 @@ # @tanstack/react-router-ssr-query +## 1.167.3 + +### Patch Changes + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26)]: + - @tanstack/router-ssr-query-core@1.169.3 + +## 1.167.2 + +### Patch Changes + +- Updated dependencies [[`79e3533`](https://github.com/TanStack/router/commit/79e35335b4bb1c3b5e2275a8df5181aa05036628)]: + - @tanstack/router-ssr-query-core@1.169.2 + ## 1.167.1 ### Patch Changes diff --git a/packages/react-router-ssr-query/README.md b/packages/react-router-ssr-query/README.md index 0a19fd3b81..c3a60d1008 100644 --- a/packages/react-router-ssr-query/README.md +++ b/packages/react-router-ssr-query/README.md @@ -2,7 +2,21 @@ # TanStack React Router -![TanStack Router Header](https://raw.githubusercontent.com/TanStack/router/main/media/header_router.png) + + + + TanStack React Router + 🤖 Type-safe router w/ built-in caching & URL state management for React! diff --git a/packages/react-router-ssr-query/package.json b/packages/react-router-ssr-query/package.json index 82d9917747..7333146047 100644 --- a/packages/react-router-ssr-query/package.json +++ b/packages/react-router-ssr-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-router-ssr-query", - "version": "1.167.1", + "version": "1.167.3", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "exit 0; vitest", "test:unit:dev": "pnpm run test:unit --watch", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -67,18 +67,28 @@ "@tanstack/router-ssr-query-core": "workspace:*" }, "devDependencies": { - "@vitejs/plugin-react": "^4.3.4", - "react": ">=19", - "react-dom": ">=19", + "@vitejs/plugin-react": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", "@tanstack/react-router": "workspace:*", - "@tanstack/react-query": ">=5.90.0", - "vite": "*" + "@tanstack/react-query": ">=5.102.0", + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@eslint-react/eslint-plugin": "catalog:", + "eslint-plugin-react-hooks": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0", - "@tanstack/query-core": ">=5.90.0", - "@tanstack/react-router": ">=1.127.0", - "@tanstack/react-query": ">=5.90.0" + "@tanstack/query-core": ">=5.102.0", + "@tanstack/react-router": ">=1.170.33", + "@tanstack/react-query": ">=5.102.0" } } diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 46909b1699..7e1e2f1a62 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -1,5 +1,357 @@ # @tanstack/react-router +## 1.170.46 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +- [#8671](https://github.com/TanStack/router/pull/8671) [`689a7c5`](https://github.com/TanStack/router/commit/689a7c5419de68bce0aaaef72b9a36f115ea1398) - Publish the `@tanstack/react-router` agent skills (`react-router`, `compositions/router-query`, `lifecycle/migrate-from-react-router`), which were missing from the package's `files` list. + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + +## 1.170.45 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + +## 1.170.44 + +### Patch Changes + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + +## 1.170.43 + +### Patch Changes + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + +## 1.170.42 + +### Patch Changes + +- [#8594](https://github.com/TanStack/router/pull/8594) [`2413cc0`](https://github.com/TanStack/router/commit/2413cc009826fba4f97b166a35a8a50a4a8fe4bb) - reduce component nesting per route match + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Links of a route that the pending navigation leaves skip deriving the destination location, and clicks and preloads follow the href a Link displays. `buildLocation` now builds `mask` and `routeMasks` locations from the same `_fromLocation` as the destination. + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Fixed Link destinations that resolve to a route mask are now reused across navigations instead of being rebuilt every time. A mounted Link now follows changes to its `href` and `reloadDocument` props, and React Links no longer each subscribe to a hydration flag. + +- [#8579](https://github.com/TanStack/router/pull/8579) [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b) - Cancel pending link preload timers when starting navigation to avoid redundant preloading while the destination is loading. + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/history@1.162.5 + - @tanstack/router-core@1.171.35 + +## 1.170.41 + +### Patch Changes + +- [#8529](https://github.com/TanStack/router/pull/8529) [`60b8ad1`](https://github.com/TanStack/router/commit/60b8ad1ad00812bf966a8eeee6be238c37ddad74) - Compose only enabled route boundaries instead of rendering inactive wrapper components. + +- [#8568](https://github.com/TanStack/router/pull/8568) [`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949) - Update TanStack Store to 0.11.2 to prevent unrelated atom reads inside subscription observers from triggering extra notifications. + +- [#8530](https://github.com/TanStack/router/pull/8530) [`ff66a03`](https://github.com/TanStack/router/commit/ff66a03df4816f44a48a4a37189fc4021b1c8480) - Consolidate the root match context provider while preserving match context in the root shell. + +- [#8522](https://github.com/TanStack/router/pull/8522) [`863c8a7`](https://github.com/TanStack/router/commit/863c8a736b96746c56278a16c50554356f5523d1) - Reuse Link href classification and active/inactive results across location updates while preserving live history href formatting. + +- Updated dependencies [[`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/router-core@1.171.34 + +## 1.170.40 + +### Patch Changes + +- [#8436](https://github.com/TanStack/router/pull/8436) [`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676) - Skip unused Link preload cleanup when preloading is disabled and ignore queued viewport notifications after their effect has been cleaned up. + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/router-core@1.171.33 + +## 1.170.39 + +### Patch Changes + +- [#8435](https://github.com/TanStack/router/pull/8435) [`73bfc15`](https://github.com/TanStack/router/commit/73bfc153eef460e9b670556215a5adb2b5cbf542) - Avoid hydration-triggered rerenders for links that do not compare URL hashes while preserving hash-sensitive active state and ClientOnly behavior. + +## 1.170.38 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + +## 1.170.37 + +### Patch Changes + +- [#8418](https://github.com/TanStack/router/pull/8418) [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387) - `deepEqual` now takes its flags as positional arguments — `deepEqual(a, b, partial?, explicitUndefined?)` — instead of an options object. The router's hot callers (Link option stabilization and active-state checks, `matchRoute`) no longer allocate an options object per comparison, and the comparator reads two booleans instead of a polymorphic object. `explicitUndefined` replaces `ignoreUndefined: false`. `deepEqual` is an internal helper; it stays exported for compatibility of two-argument calls. + +- [#8419](https://github.com/TanStack/router/pull/8419) [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd) - `resolvePath` (internal helper) now takes positional arguments — `resolvePath(base, to, trailingSlash?, cache?)` — so `buildLocation` and `matchRoute` no longer allocate an options object per path resolution. + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- [#8420](https://github.com/TanStack/router/pull/8420) [`8e164d2`](https://github.com/TanStack/router/commit/8e164d28f9e9eb1a7301109230d7ece9817492a8) - `useLinkProps` no longer calls through an internal wrapper. The host element `Link` renders on is an `@internal` overload parameter that is stripped from the published declarations, so the public `useLinkProps(options, forwardedRef?)` signature is unchanged. + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + +## 1.170.36 + +### Patch Changes + +- [#8390](https://github.com/TanStack/router/pull/8390) [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776) - Keep the Link location cache out of server bundles: `buildLocation` only creates, reads and writes it when `isServer` is false. Render React Links on the server without the extra prop copies and the forwarded-ref hook. Link SSR rendering is 20-40% faster in the Link benchmarks and the React Start SSR request loop about 7% faster. + + React `activeProps` and `inactiveProps` now follow one precedence rule on every link, including links whose destination is blocked for using a disallowed scheme: state props override element props, `ref` and event handlers, while `href`, `disabled` and `target` stay controlled by the router. Previously a blocked link ignored a `ref` or handler from its inactive props. + + React `Link` and `useLinkProps` split router options from element props with one key set on the client and the server. Element props pass through as given: external links forward them verbatim, falsy values included, and `useLinkProps` now returns `children` for router-controlled links as it already did for external ones. + +- [#8324](https://github.com/TanStack/router/pull/8324) [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2) - Reuse hydration snapshot getters to avoid unnecessary store-instance effect updates when Links and other hydration-aware components rerender. + +- [#8318](https://github.com/TanStack/router/pull/8318) [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8) - Allow active and inactive Link props to override base element props in React and Solid while preserving class/style merging. Keep React's `href`, `target`, and `disabled` values controlled by routing options. Preserve Vue object and nested-array class bindings, including reactive updates and server rendering, without mutating cached bindings during VNode normalization. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Make `pathParamsAllowedCharacters` initialization-only. Configure it when creating the router; changing allowed characters requires a new router instance. Remove decoder-update bookkeeping and decoder-change checks from route-owned path caches. + +- [#8370](https://github.com/TanStack/router/pull/8370) [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5) - Stop exporting the internal `isPlainObject` and `isPlainArray` helpers. + +- [#8324](https://github.com/TanStack/router/pull/8324) [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2) - Avoid a redundant prop copy when rendering native Links while preserving custom-component props and the public hook result. + +- [#8252](https://github.com/TanStack/router/pull/8252) [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734) - Reduce the bundle cost of shared Link pathname interpolation while preserving its rendering performance. Reuse one interpolation pass for pathname and optional metadata, keep the bounded cache on the router, and simplify React Link active-state and prop merging. + +- [#8370](https://github.com/TanStack/router/pull/8370) [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5) - Reuse built locations for Links whose destination does not depend on the current location. `buildLocation` keeps the result per options object when the build never read the current location, and the React `Link` passes one stable options object per instance, so navigations resolve unchanged Links with a lookup instead of a full build. The per-route pathname interpolation cache this replaces is removed. Link `params`, `search` and `activeOptions` are compared by value on render, so inline object literals with unchanged contents keep reusing the Link's location. Pass a new object to change a destination; like any other React prop, an object mutated in place is not re-read. + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`8fff7fa`](https://github.com/TanStack/router/commit/8fff7fa1f2e6f061916b0bf5e0ec486b2e732f94), [`f021f6d`](https://github.com/TanStack/router/commit/f021f6d1c6dce6c9b54d70766f1d636d8fd9e184), [`ae68535`](https://github.com/TanStack/router/commit/ae68535929043607d4ee9438f8ae401f3a064862), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/history@1.162.4 + +## 1.170.35 + +### Patch Changes + +- [#7824](https://github.com/TanStack/router/pull/7824) [`8c43c71`](https://github.com/TanStack/router/commit/8c43c712523fc63dc3a814f3a19617e270ce8ed1) - Upgrade TanStack Store to 0.11 and migrate router subscriptions to useSelector, preserving selector comparisons and Vue subscription cleanup. + +## 1.170.34 + +### Patch Changes + +- [#8279](https://github.com/TanStack/router/pull/8279) [`aee42c6`](https://github.com/TanStack/router/commit/aee42c6b641d8e919bfed9e0f04bb1b72092f3a6) - Avoid allocating event-handler arrays and wrapper functions for links without user-supplied event handlers. + +- [#8308](https://github.com/TanStack/router/pull/8308) [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8) - Validate navigation and redirect destinations, keep ambiguous relative URLs on the current origin, and constrain prerender requests and output paths. Prevent redirect headers from appearing in serialized server function response bodies. + + Preserve native form HTTP redirects, route error handling and masks for document redirects, and per-navigation destinations for shared loader redirects. Avoid redundant origin parsing and reduce link styling and server-rendering work. Configured origins must already be normalized. + + Keep blocked-link inactive props consistent during React hydration, honor explicit redirect Location headers before checking route options, and refresh Vue link state when destinations become internal. Reuse the protocol-relative URL check while parsing redirect schemes once. + + Reduce React link bundle size by sharing pathname comparisons, state-prop selection, and element creation. + + Share normalized pathname comparisons in Solid and Vue links to reduce bundle size. + +- [#8311](https://github.com/TanStack/router/pull/8311) [`9aec5a7`](https://github.com/TanStack/router/commit/9aec5a7012c47e83ec23bb4763494b72a5e68bfc) - React Links resolve state props without temporary class-name arrays or unnecessary style copies. + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/history@1.162.3 + +## 1.170.33 + +### Patch Changes + +- [#8165](https://github.com/TanStack/router/pull/8165) [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2) - Exclude structural descendants below error and not-found boundaries from route lifecycle callbacks. Preserve lifecycle membership through invalidation, hydration, background reloads, and superseded navigation publication. + +- [#8209](https://github.com/TanStack/router/pull/8209) [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f) - Preserve falsy thrown values in React and Vue error boundaries. Type React and Vue boundary error components and `onCatch` callbacks as `unknown`. Solid boundary errors remain typed as `Error`; SSR now wraps non-`Error` loader errors to match Solid’s native boundary behavior, preserving the original value in `cause`. Router state and loader `onError` values are unchanged. + + When upgrading React or Vue, narrow boundary errors (for example, with `error instanceof Error`) before reading `message` or `stack`. `ErrorComponentProps` remains available for values narrowed to a specific error type. Route `onError` types are unchanged. + +- [#8161](https://github.com/TanStack/router/pull/8161) [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96) - Retain successful not-found matches as terminal shared boundaries during client navigation, preserving route context while the destination loads. + +- [#8251](https://github.com/TanStack/router/pull/8251) [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b) - Use URL.canParse for absolute URL checks in links, navigation, redirects, and build configuration. Preserve a URL constructor fallback for older browsers. + +- [#8169](https://github.com/TanStack/router/pull/8169) [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5) - Fix route-scoped `useMatch`, `useSearch`, and `useParams` APIs to forward the `shouldThrow` option and preserve optional return types when `shouldThrow: false`. + +- [#8257](https://github.com/TanStack/router/pull/8257) [`cf166d1`](https://github.com/TanStack/router/commit/cf166d160e6397007a979bfc7065b45ff69ea543) - Fix repeated `innerHTML` writes for unchanged styles and data scripts during React re-renders. This prevents unnecessary CSS parsing and Trusted Types errors during client navigation. + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`9035abc`](https://github.com/TanStack/router/commit/9035abc41163d83409ef582f7743a3c7be57dd93), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/history@1.162.2 + +## 1.170.32 + +### Patch Changes + +- [#8130](https://github.com/TanStack/router/pull/8130) [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b) - preserve context during reloads + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + +## 1.170.31 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + +## 1.170.30 + +### Patch Changes + +- [#8084](https://github.com/TanStack/router/pull/8084) [`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175) - preserve pending UI across retained routes + +- [#8068](https://github.com/TanStack/router/pull/8068) [`f75cada`](https://github.com/TanStack/router/commit/f75cada01707e51fb9650dd301bc04f8b2265a2a) - direct export of CatchBoundary class component, remove function wrapper + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + +## 1.170.29 + +### Patch Changes + +- [#8073](https://github.com/TanStack/router/pull/8073) [`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720) - inline isCtrlKey inside Link component for byte shaving + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + +## 1.170.28 + +### Patch Changes + +- [#8055](https://github.com/TanStack/router/pull/8055) [`0c25a7b`](https://github.com/TanStack/router/commit/0c25a7b43b5331ee6ebf94d50e9793002783adab) - Avoid wrapping root components that may render the HTML document in a Suspense boundary during SSR and hydration. + +- [#8054](https://github.com/TanStack/router/pull/8054) [`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90) - Reuse resolved lazy route components when revisiting code-split routes, preventing unnecessary pending UI. + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/router-core@1.171.23 + +## 1.170.27 + +### Patch Changes + +- [#8047](https://github.com/TanStack/router/pull/8047) [`b0817f5`](https://github.com/TanStack/router/commit/b0817f50cc639ae50b6c30cd11c5adbf7eed028c) - useMatchRoute w/ React Compiler + +## 1.170.26 + +### Patch Changes + +- [#8045](https://github.com/TanStack/router/pull/8045) [`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3) - Warn when an Outlet is rendered inside a pending, error, or not-found component. + +- [#8043](https://github.com/TanStack/router/pull/8043) [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1) - remove the undocumented Link `isTransitioning` state and `data-transitioning` attribute + +- [#8044](https://github.com/TanStack/router/pull/8044) [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e) - Apply `preloadDelay` to viewport link preloading and cancel pending preloads when links leave the viewport. + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13)]: + - @tanstack/router-core@1.171.22 + +## 1.170.25 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + +## 1.170.24 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + +## 1.170.23 + +### Patch Changes + +- [#7952](https://github.com/TanStack/router/pull/7952) [`95dec51`](https://github.com/TanStack/router/commit/95dec51018d01483949c6f1fe3094b019ccf3b4f) - bail out of `Link` re-renders when the resolved href and active state are unchanged + +## 1.170.22 + +### Patch Changes + +- [#7992](https://github.com/TanStack/router/pull/7992) [`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9) - retain mounted UI during revalidation + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + +## 1.170.21 + +### Patch Changes + +- [#7961](https://github.com/TanStack/router/pull/7961) [`697ebb6`](https://github.com/TanStack/router/commit/697ebb6ddbd433d052b6b4707938a5c595865d58) - Prevent a blank frame before zero-delay initial pending UI by using a + component-scoped React transition for match publication. Pending timing, + boundary selection, and rendered matches continue to come from the router + core. + +- [#7970](https://github.com/TanStack/router/pull/7970) [`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf) - createFileRoute does not rely on FileRoute class + +- [#7971](https://github.com/TanStack/router/pull/7971) [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7) - clean intersection observer options in link component + +- [#7967](https://github.com/TanStack/router/pull/7967) [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c) - Preserve path params in their raw string form while matching routes so structured values returned by `params.parse` produce stable match IDs and do not reuse stale loader data. + + `RouterCore.getMatchedRoutes()` now returns `[matchedRoutes, rawParams, foundRoute]` instead of an object. + +- Updated dependencies [[`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/router-core@1.171.18 + - @tanstack/history@1.162.1 + +## 1.170.20 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + +## 1.170.19 + +### Patch Changes + +- [#7805](https://github.com/TanStack/router/pull/7805) [`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd) - Rewrite match loading around a lane-based scheduler that tracks each navigation, preload, and background reload as an ordered unit of work. This fixes pending/redirect/retry state leaking between overlapping navigations, restores correct SSR status codes for redirects, errors, and not-found responses, and closes hydration gaps where the client re-ran work the server had already completed. + - Invalidation now retires matching active preloads so older speculative loader results cannot become fresh cache data after invalidation. + - Route `headers()` now only runs on the server, matching the documented behavior — it is no longer invoked during client-side asset projection. + - The documented default `gcTime` and `preloadGcTime` now match the existing runtime default of 5 minutes (`300_000`). + + **Removed / changed exported internals** + - `RouterState` no longer includes `loadedAt`, `isTransitioning`, `statusCode`, or `redirect`. Use `match.updatedAt` in place of `loadedAt`; subscribe to `router.state.status` / `router.state.isLoading` in place of `isTransitioning`; server response status and redirect handling are now internal to the server loader and are no longer exposed on `router.state`. + - `RouteMatch.fetchCount` has been removed, with no replacement — it was purely informational. + - `RouteMatch.status` no longer includes `'redirected'` (it remains `'pending' | 'success' | 'error' | 'notFound'`) — redirected matches are dropped from the match list instead of being rendered. + - `RouteMatch.globalNotFound` has been renamed and privatized to the internal `_notFound` field. Use `match.status === 'notFound'` instead. + - The exported React, Solid, and Vue `Match` components now accept `routeId` instead of `matchId`. + - The exported `RouterStores` adapter contract now uses route-keyed presentation stores: `matchesId` is replaced by `ids`, `matchStores` by `byRoute`, and `getRouteMatchStore()` by `getMatchStore()`. The separate `loadedAt`, `isLoading`, `isTransitioning`, `statusCode`, and `redirect` stores have been removed, along with the pending/cache stores and their setters. `StoreConfig.init` has also been removed. Read application-facing state from `router.state`; preload and cache coordination are now internal. + - Removed `RouterCore` members `getMatch()`, `updateMatch()`, `cancelMatch()`, and `cancelMatches()` — read matches from `router.state.matches` (e.g. `router.state.matches.find((m) => m.id === id)`); there is no replacement for mutating or cancelling an individual in-flight match from outside the router. + - Removed `RouterCore.hasNotFoundMatch()` — use `router.state.matches.some((m) => m.status === 'notFound')`. + - Removed `RouterCore.looseRoutesById` — use `routesById`. + - Removed `RouterCore.isPrerendering()`, `RouterCore.isViewTransitionTypesSupported`, and `RouterCore.viewTransitionPromise`, with no replacement. + - Removed `RouterCore.getParsedLocationHref()` and `RouterCore.clearExpiredCache()`, with no replacement — expired cache entries are now reconciled automatically as part of match commit. + - Removed `RouterCore.latestLoadPromise` and `RouterCore.beforeLoad()`, with no replacement. + - `RouterCore.commitLocationPromise` and `RouterCore.pendingBuiltLocation` have been replaced by the internal `_commitPromise` and `_pendingLocation` fields. + - Removed the exported `GetMatchFn` and `UpdateMatchFn` types, along with the methods they typed. + - Removed the standalone `getMatchedRoutes()` export from `@tanstack/router-core` — use the `router.getMatchedRoutes()` instance method instead. + - `RouterCore.loadRouteChunk()` no longer accepts an array of component types as its second argument. One-argument usage is unchanged; the optional second argument is now `'errorComponent'`, `'notFoundComponent'`, or `false` for internal boundary loading. + - Removed `Redirect.redirectHandled`, which was internal redirect bookkeeping. + - `MatchRoutesOpts.preload` and `MatchRoutesOpts.dest` have been removed. + - `StartTransitionFn` is now `(fn, expected) => Promise` (previously `(fn) => void`). This only affects custom framework adapters that implement `startTransition`. + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + ## 1.170.18 ### Patch Changes diff --git a/packages/react-router/README.md b/packages/react-router/README.md index 0a19fd3b81..c3a60d1008 100644 --- a/packages/react-router/README.md +++ b/packages/react-router/README.md @@ -2,7 +2,21 @@ # TanStack React Router -![TanStack Router Header](https://raw.githubusercontent.com/TanStack/router/main/media/header_router.png) + + + + TanStack React Router + 🤖 Type-safe router w/ built-in caching & URL state management for React! diff --git a/packages/react-router/package.json b/packages/react-router/package.json index 7c243d4d36..9a61d5af25 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-router", - "version": "1.170.18", + "version": "1.170.46", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts60": "tsc -p tsconfig.legacy.json", + "test:types:ts60": "tsc6 -p tsconfig.legacy.json", + "test:types:ts70": "tsc -p tsconfig.legacy.json", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests", "test:perf": "vitest bench", @@ -81,43 +81,45 @@ "default": "./dist/cjs/ssr/client.cjs" } }, - "./native": { - "import": { - "types": "./dist/esm/native.d.ts", - "default": "./dist/esm/native.js" - }, - "require": { - "types": "./dist/cjs/native.d.cts", - "default": "./dist/cjs/native.cjs" - } - }, "./package.json": "./package.json" }, "sideEffects": false, "files": [ "dist", - "src" + "src", + "skills", + "!skills/_artifacts" ], "engines": { "node": ">=20.19" }, "dependencies": { "@tanstack/history": "workspace:*", - "@tanstack/react-store": "^0.9.3", + "@tanstack/react-store": "^0.11.2", "@tanstack/router-core": "workspace:*", - "@tanstack/store": "^0.9.3", - "isbot": "^5.1.22" + "isbot": "catalog:" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.2.0", + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", + "@tanstack/react-query": "catalog:", "@types/node": ">=20", - "@vitejs/plugin-react": "^4.3.4", - "combinate": "^1.1.11", - "react": "^19.0.0", - "react-dom": "^19.0.0", + "@vitejs/plugin-react": "catalog:", + "combinate": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", "vite": "*", - "zod": "^4.4.3" + "zod": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@eslint-react/eslint-plugin": "catalog:", + "eslint-plugin-react-hooks": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", diff --git a/packages/react-router/skills/compositions/router-query/SKILL.md b/packages/react-router/skills/compositions/router-query/SKILL.md index 89fba76b54..4fdd74fc30 100644 --- a/packages/react-router/skills/compositions/router-query/SKILL.md +++ b/packages/react-router/skills/compositions/router-query/SKILL.md @@ -1,14 +1,15 @@ --- -name: compositions/router-query +name: router-query description: >- Integrating TanStack Router with TanStack Query: queryClient - in router context, ensureQueryData/prefetchQuery in loaders, + in router context, static queries and fire-and-forget queries in loaders, useSuspenseQuery in components, defaultPreloadStaleTime: 0, setupRouterSsrQueryIntegration for SSR dehydration/hydration and streaming, per-request QueryClient isolation. -type: composition -library: tanstack-router -library_version: '1.166.2' +metadata: + type: composition + library: tanstack-router + library_version: '1.166.2' requires: - router-core - router-core/data-loading @@ -20,7 +21,7 @@ sources: # TanStack Router + TanStack Query Integration -This skill requires familiarity with both TanStack Router and TanStack Query. Read [router-core](../../../../router-core/skills/router-core/SKILL.md) and [react-router](../../react-router/SKILL.md) first. +This skill requires familiarity with both TanStack Router and TanStack Query. Read `@tanstack/router-core#router-core` and [react-router](../../react-router/SKILL.md) first. This skill covers coordinating TanStack Query as an external data cache with TanStack Router's loader system. The router acts as a **coordinator** — it triggers data fetching during navigation, while Query manages caching, background refetching, and data lifecycle. @@ -181,9 +182,9 @@ export function createAppRouter() { } ``` -## Core Pattern: `ensureQueryData` in Loader + `useSuspenseQuery` in Component +## Core Pattern: Static `query` in Loader + `useSuspenseQuery` in Component -This is the recommended pattern. The loader ensures data is in the cache before render (no loading flash). The component subscribes to the cache for updates. +This is the recommended pattern. The loader queries data before render (no loading flash), using `staleTime: 'static'` to reuse cached data without a stale refetch. The component subscribes to the cache for updates. ```tsx // src/routes/posts.tsx @@ -203,9 +204,12 @@ const postsQueryOptions = queryOptions({ export const Route = createFileRoute('/posts')({ loader: ({ context }) => { - // ensureQueryData returns cached data if available, fetches if not in cache - // To also refetch stale data, pass revalidateIfStale: true - return context.queryClient.ensureQueryData(postsQueryOptions) + // query returns cached data when available and fetches when it is missing + // Keep this query static so a stale refetch does not block navigation + return context.queryClient.query({ + ...postsQueryOptions, + staleTime: 'static', + }) }, component: PostsPage, }) @@ -245,7 +249,10 @@ const postQueryOptions = (postId: string) => export const Route = createFileRoute('/posts/$postId')({ loader: ({ context, params }) => { - return context.queryClient.ensureQueryData(postQueryOptions(params.postId)) + return context.queryClient.query({ + ...postQueryOptions(params.postId), + staleTime: 'static', + }) }, component: PostPage, }) @@ -258,20 +265,23 @@ function PostPage() { } ``` -## Streaming Pattern: `prefetchQuery` (Not Awaited) +## Streaming Pattern: Fire-and-Forget `query` (Not Awaited) -For non-critical data, start the fetch without blocking navigation: +For non-critical data, start a query without blocking navigation. Handle its rejection with `noop` so a background failure does not become an unhandled rejection: ```tsx -import { useQuery, useSuspenseQuery } from '@tanstack/react-query' +import { noop, useQuery, useSuspenseQuery } from '@tanstack/react-query' export const Route = createFileRoute('/dashboard')({ loader: ({ context }) => { // Await critical data - const user = context.queryClient.ensureQueryData(userQueryOptions) + const user = context.queryClient.query({ + ...userQueryOptions, + staleTime: 'static', + }) - // Start non-critical fetch without awaiting — streams during SSR - context.queryClient.prefetchQuery(analyticsQueryOptions) + // Start non-critical query without awaiting — streams during SSR + void context.queryClient.query({ ...analyticsQueryOptions }).catch(noop) return user }, @@ -303,7 +313,10 @@ import { useRouter } from '@tanstack/react-router' export const Route = createFileRoute('/posts')({ loader: ({ context }) => - context.queryClient.ensureQueryData(postsQueryOptions), + context.queryClient.query({ + ...postsQueryOptions, + staleTime: 'static', + }), errorComponent: PostsErrorComponent, component: PostsPage, }) @@ -312,7 +325,7 @@ function PostsErrorComponent({ error, reset, }: { - error: Error + error: unknown reset: () => void }) { const router = useRouter() @@ -324,7 +337,7 @@ function PostsErrorComponent({ return (
-

{error.message}

+

{error instanceof Error ? error.message : String(error)}

) @@ -372,24 +385,29 @@ export function createAppRouter() { } ``` -### 3. MEDIUM: Awaiting `prefetchQuery` in loader blocks rendering +### 3. MEDIUM: Awaiting a fire-and-forget query in a loader blocks rendering -`prefetchQuery` is designed to fire-and-forget. Awaiting it blocks the navigation transition until the data resolves, defeating the purpose of streaming. +A query used for streaming should start in the background and handle errors with `catch(noop)`. Awaiting it blocks the navigation transition until the data resolves, defeating the purpose of streaming. ```tsx +import { noop } from '@tanstack/react-query' + // WRONG — blocks navigation, no streaming benefit loader: async ({ context }) => { - await context.queryClient.prefetchQuery(analyticsQueryOptions) + await context.queryClient.query({ ...analyticsQueryOptions }).catch(noop) } -// CORRECT — fire and forget for streaming +// CORRECT — fire and forget for streaming, with handled rejection loader: ({ context }) => { - context.queryClient.prefetchQuery(analyticsQueryOptions) + void context.queryClient.query({ ...analyticsQueryOptions }).catch(noop) } -// If you need to block (critical data), use ensureQueryData instead: +// If you need to block (critical data), use a static query instead: loader: ({ context }) => { - return context.queryClient.ensureQueryData(criticalQueryOptions) + return context.queryClient.query({ + ...criticalQueryOptions, + staleTime: 'static', + }) } ``` @@ -414,10 +432,10 @@ const rootRoute = createRootRouteWithContext<{ queryClient: QueryClient }>()({ TanStack Router has its own SWR cache (`staleTime`, `gcTime`, `defaultPreloadStaleTime`). When using Query as an external cache: - Set `defaultPreloadStaleTime: 0` to prevent Router's cache from short-circuiting Query's freshness logic -- Router's `staleTime`/`gcTime` still apply to the loader return value. For pure Query patterns, return nothing from the loader (just `ensureQueryData` for the side effect) and read data exclusively from `useSuspenseQuery` -- `router.invalidate()` re-runs loaders (which call `ensureQueryData`), but Query decides whether to actually refetch based on its own `staleTime` +- Router's `staleTime`/`gcTime` still apply to the loader return value. For pure Query patterns, return nothing from the loader (just a static `query` for the side effect) and read data exclusively from `useSuspenseQuery` +- `router.invalidate()` re-runs loaders (which call `query` with `staleTime: 'static'`), so the cached Query data remains the freshness authority ## Cross-References -- [router-core/data-loading](../../../../router-core/skills/router-core/data-loading/SKILL.md) — built-in loader caching fundamentals -- [router-core/ssr](../../../../router-core/skills/router-core/ssr/SKILL.md) — SSR setup for dehydration/hydration +- `@tanstack/router-core#router-core/data-loading` — built-in loader caching fundamentals +- `@tanstack/router-core#router-core/ssr` — SSR setup for dehydration/hydration diff --git a/packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md b/packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md index c9f53358e6..fdc4f4c4e5 100644 --- a/packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md +++ b/packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md @@ -1,13 +1,14 @@ --- -name: lifecycle/migrate-from-react-router +name: migrate-from-react-router description: >- Step-by-step migration from React Router v7 to TanStack Router: route definition conversion, Link/useNavigate API differences, useSearchParams to validateSearch + useSearch, useParams with from, Outlet replacement, loader conversion, code splitting differences. -type: lifecycle -library: tanstack-router -library_version: '1.166.2' +metadata: + type: lifecycle + library: tanstack-router + library_version: '1.166.2' requires: - router-core - react-router diff --git a/packages/react-router/skills/react-router/SKILL.md b/packages/react-router/skills/react-router/SKILL.md index 074f23e091..f8df76df02 100644 --- a/packages/react-router/skills/react-router/SKILL.md +++ b/packages/react-router/skills/react-router/SKILL.md @@ -8,10 +8,11 @@ description: >- Outlet, CatchBoundary, ErrorComponent. React-specific patterns for hooks, providers, SSR hydration, and createLink with forwardRef. -type: framework -library: tanstack-router -library_version: '1.166.2' -framework: react +metadata: + type: framework + library: tanstack-router + library_version: '1.166.2' + framework: react requires: - router-core sources: @@ -22,9 +23,7 @@ sources: # React Router (`@tanstack/react-router`) -This skill builds on router-core. Read [router-core](../../../router-core/skills/router-core/SKILL.md) first for foundational concepts. - -This skill covers the React-specific bindings, components, hooks, and setup for TanStack Router. +This skill builds on router-core. Read `@tanstack/router-core#router-core` first for foundational concepts. > **CRITICAL**: TanStack Router types are FULLY INFERRED. Never cast, never annotate inferred values. > **CRITICAL**: TanStack Router is CLIENT-FIRST. Loaders run on the client by default, not on the server. @@ -347,7 +346,7 @@ import { CatchBoundary } from '@tanstack/react-router' ; 'widget'} onCatch={(error) => console.error(error)} - errorComponent={({ error }) =>
Error: {error.message}
} + errorComponent={({ error }) =>
{String(error)}
} >
@@ -496,4 +495,4 @@ function App() { ## Cross-References -- [router-core/SKILL.md](../../../router-core/skills/router-core/SKILL.md) — all sub-skills for domain-specific patterns (search params, data loading, navigation, auth, SSR, etc.) +- `@tanstack/router-core#router-core` — all sub-skills for domain-specific patterns (search params, data loading, navigation, auth, SSR, etc.) diff --git a/packages/react-router/src/Asset.tsx b/packages/react-router/src/Asset.tsx index 5e4f159f52..04cbac9064 100644 --- a/packages/react-router/src/Asset.tsx +++ b/packages/react-router/src/Asset.tsx @@ -42,6 +42,11 @@ export function Asset( }, ): React.ReactElement | null { const { attrs, children, nonce, preventScriptHoist } = asset + // React 19 compares this object by reference before assigning innerHTML. + const innerHTML = React.useMemo( + () => (children === undefined ? undefined : { __html: children }), + [children], + ) switch (asset.tag) { case 'title': @@ -78,11 +83,7 @@ export function Asset( } return ( - - - - - - - - - - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml b/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml deleted file mode 100644 index e3c3e148ca..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values-v29/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/colors.xml b/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/colors.xml deleted file mode 100644 index ea02632534..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/colors.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - #F5F5F5 - - - #757575 - - - #65ADF1 - - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml b/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fdf..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/styles.xml b/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/styles.xml deleted file mode 100644 index 4f91b610a1..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/values/styles.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml b/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml deleted file mode 100644 index e9b6aa1508..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/Android/src/main/res/xml/network_security_config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - 10.0.2.2 - localhost - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/LICENSE b/packages/router-cli/src/templates/nativescript/App_Resources/LICENSE deleted file mode 100644 index 216f6d024b..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of such Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) 2015-2019 Progress Software Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/NOTICE b/packages/router-cli/src/templates/nativescript/App_Resources/NOTICE deleted file mode 100644 index 78faff35c0..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -The App_Resources directory is derived from @nativescript/template-blank -version 9.0.0, maintained by the NativeScript team: - -https://github.com/NativeScript/nativescript-app-templates - -The files have been modified for the TanStack NativeScript scaffold. The -original resources are licensed under the Apache License 2.0 included in this -directory. diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 6d19987b31..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images": [ - { - "size": "20x20", - "idiom": "iphone", - "filename": "icon-20@2x.png", - "scale": "2x" - }, - { - "size": "20x20", - "idiom": "iphone", - "filename": "icon-20@3x.png", - "scale": "3x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29.png", - "scale": "1x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29@2x.png", - "scale": "2x" - }, - { - "size": "29x29", - "idiom": "iphone", - "filename": "icon-29@3x.png", - "scale": "3x" - }, - { - "size": "40x40", - "idiom": "iphone", - "filename": "icon-40@2x.png", - "scale": "2x" - }, - { - "size": "40x40", - "idiom": "iphone", - "filename": "icon-40@3x.png", - "scale": "3x" - }, - { - "size": "60x60", - "idiom": "iphone", - "filename": "icon-60@2x.png", - "scale": "2x" - }, - { - "size": "60x60", - "idiom": "iphone", - "filename": "icon-60@3x.png", - "scale": "3x" - }, - { - "size": "20x20", - "idiom": "ipad", - "filename": "icon-20.png", - "scale": "1x" - }, - { - "size": "20x20", - "idiom": "ipad", - "filename": "icon-20@2x.png", - "scale": "2x" - }, - { - "size": "29x29", - "idiom": "ipad", - "filename": "icon-29.png", - "scale": "1x" - }, - { - "size": "29x29", - "idiom": "ipad", - "filename": "icon-29@2x.png", - "scale": "2x" - }, - { - "size": "40x40", - "idiom": "ipad", - "filename": "icon-40.png", - "scale": "1x" - }, - { - "size": "40x40", - "idiom": "ipad", - "filename": "icon-40@2x.png", - "scale": "2x" - }, - { - "size": "76x76", - "idiom": "ipad", - "filename": "icon-76.png", - "scale": "1x" - }, - { - "size": "76x76", - "idiom": "ipad", - "filename": "icon-76@2x.png", - "scale": "2x" - }, - { - "size": "83.5x83.5", - "idiom": "ipad", - "filename": "icon-83.5@2x.png", - "scale": "2x" - }, - { - "size": "1024x1024", - "idiom": "ios-marketing", - "filename": "icon-1024.png", - "scale": "1x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png deleted file mode 100644 index b46c8bb2f7..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png deleted file mode 100644 index d73288a7f4..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png deleted file mode 100644 index c8d24cdc75..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png deleted file mode 100644 index 1b00c84854..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png deleted file mode 100644 index 72a164103c..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png deleted file mode 100644 index 05ab752b86..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png deleted file mode 100644 index ee72082583..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png deleted file mode 100644 index 2859288b88..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png deleted file mode 100644 index 88824fa7ca..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png deleted file mode 100644 index 02a930cc79..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png deleted file mode 100644 index d7b077f1b6..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png deleted file mode 100644 index 2f872dd4e6..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png deleted file mode 100644 index 7fb23a706a..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png deleted file mode 100644 index cb04c367d0..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png deleted file mode 100644 index e882226b2d..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/Contents.json b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/Contents.json deleted file mode 100644 index 97a8662ebd..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json deleted file mode 100644 index 9180be41d0..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill.png", - "scale": "1x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill@2x.png", - "scale": "2x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-AspectFill@3x.png", - "scale": "3x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png deleted file mode 100644 index cb35cfae14..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png deleted file mode 100644 index 6eefb9a762..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png deleted file mode 100644 index 0ef5102069..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json deleted file mode 100644 index 7a03e93a60..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "filename": "LaunchScreen-Center.png", - "scale": "1x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-Center@2x.png", - "scale": "2x" - }, - { - "idiom": "universal", - "filename": "LaunchScreen-Center@3x.png", - "scale": "3x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png deleted file mode 100644 index 280c30e083..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png deleted file mode 100644 index f984b9e44d..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png deleted file mode 100644 index 95d86f3f76..0000000000 Binary files a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png and /dev/null differ diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Info.plist b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Info.plist deleted file mode 100644 index 43cd6b1f2b..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsLocalNetworking - - - UILaunchStoryboardName - LaunchScreen - UIRequiresFullScreen - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/LaunchScreen.storyboard b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/LaunchScreen.storyboard deleted file mode 100644 index c4e5a3f394..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/LaunchScreen.storyboard +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/build.xcconfig b/packages/router-cli/src/templates/nativescript/App_Resources/iOS/build.xcconfig deleted file mode 100644 index eb70be2dfb..0000000000 --- a/packages/router-cli/src/templates/nativescript/App_Resources/iOS/build.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// You can add custom settings here -// for example you can uncomment the following line to force distribution code signing -// CODE_SIGN_IDENTITY = iPhone Distribution -// To build for device with XCode you need to specify your development team. -// DEVELOPMENT_TEAM = YOUR_TEAM_ID; -ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; -IPHONEOS_DEPLOYMENT_TARGET = 16.0; diff --git a/packages/router-cli/tests/native-init.test.ts b/packages/router-cli/tests/native-init.test.ts deleted file mode 100644 index 5eabce6975..0000000000 --- a/packages/router-cli/tests/native-init.test.ts +++ /dev/null @@ -1,402 +0,0 @@ -import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import path from 'node:path' -import { afterEach, expect, test } from 'vitest' -import { parse } from 'yaml' -import { - NativeScriptScaffoldConflictError, - initializeNativeScript, -} from '../src/native-init' - -const temporaryDirectories: Array = [] -const templateDirectory = path.resolve( - import.meta.dirname, - '../src/templates/nativescript', -) - -afterEach(async () => { - await Promise.all( - temporaryDirectories - .splice(0) - .map((directory) => rm(directory, { recursive: true, force: true })), - ) -}) - -async function writeFixture(root: string, mode: 'router' | 'start') { - await mkdir(path.join(root, 'src'), { recursive: true }) - - const dependencies: Record = { - '@tanstack/react-router': '^1.200.0', - react: '^19.0.0', - } - if (mode === 'start') { - dependencies['@tanstack/react-start'] = '^1.200.0' - } - - await writeFile( - path.join(root, 'package.json'), - `${JSON.stringify( - { - name: `fixture-${mode}`, - private: true, - type: 'module', - scripts: { dev: 'vite dev' }, - dependencies, - }, - null, - 2, - )}\n`, - ) - await writeFile( - path.join(root, 'src/router.tsx'), - 'export function getRouter() { return {} }\n', - ) - - return root -} - -async function createFixture(mode: 'router' | 'start') { - const root = await mkdtemp(path.join(tmpdir(), 'tanstack-native-init-')) - temporaryDirectories.push(root) - return writeFixture(root, mode) -} - -test('initializes a Start app and is idempotent', async () => { - const root = await createFixture('start') - const options = { - root, - templateDirectory, - packageManager: 'pnpm' as const, - install: false, - } - - const first = await initializeNativeScript(options) - expect(first.mode).toBe('start') - expect(first.appId).toBe('org.nativescript.fixturestart') - expect(first.created).toContain('src/native/index.tsx') - expect(first.created).toContain( - 'App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png', - ) - expect(first.created).toContain('App_Resources/LICENSE') - expect(first.created).toContain('App_Resources/NOTICE') - expect(first.created).toContain('pnpm-workspace.yaml') - expect(first.created).toContain('.gitignore') - await expect( - readFile( - path.join(root, 'App_Resources/Android/src/main/AndroidManifest.xml'), - 'utf8', - ), - ).resolves.toContain('@xml/network_security_config') - await expect( - readFile( - path.join(root, 'App_Resources/Android/src/main/AndroidManifest.xml'), - 'utf8', - ), - ).resolves.not.toContain('EXTERNAL_STORAGE') - await expect( - readFile(path.join(root, 'App_Resources/iOS/Info.plist'), 'utf8'), - ).resolves.toContain('NSAllowsLocalNetworking') - await expect( - readFile(path.join(root, 'App_Resources/LICENSE'), 'utf8'), - ).resolves.toContain('Apache License') - await expect( - readFile(path.join(root, 'App_Resources/NOTICE'), 'utf8'), - ).resolves.toContain('@nativescript/template-blank') - - const packageJson = JSON.parse( - await readFile(path.join(root, 'package.json'), 'utf8'), - ) as { - main: string - scripts: Record - dependencies: Record - devDependencies: Record - } - expect(packageJson.main).toBe('src/native/index.tsx') - expect(packageJson.scripts['native:ios']).toContain('concurrently') - expect(packageJson.scripts['native:ios']).toContain('pnpm run native:server') - expect(packageJson.scripts['native:ios']).toContain('ns debug ios --no-hmr') - expect(packageJson.scripts['native:build:ios']).toContain( - 'ns build ios --release --env.production', - ) - expect(packageJson.scripts['native:build:android']).toContain( - 'ns build android --release --env.production', - ) - expect(packageJson.dependencies['@tanstack/react-nativescript-router']).toBe( - 'latest', - ) - expect(packageJson.devDependencies.vite).toBe('^7.3.6') - const pnpmWorkspace = parse( - await readFile(path.join(root, 'pnpm-workspace.yaml'), 'utf8'), - ) as { allowBuilds: Record } - expect(pnpmWorkspace.allowBuilds['@nativescript/core']).toBe(true) - expect(pnpmWorkspace.allowBuilds['@parcel/watcher']).toBe(true) - expect(pnpmWorkspace.allowBuilds.esbuild).toBe(true) - expect(pnpmWorkspace.allowBuilds.lmdb).toBe(false) - expect(pnpmWorkspace.allowBuilds['msgpackr-extract']).toBe(false) - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).resolves.toContain('tanstackStartNativeScript') - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).resolves.toContain("serverFnMode: mode === 'production' ? 'build' : 'dev'") - - const second = await initializeNativeScript(options) - expect(second.created).toEqual([]) - expect(second.updated).toEqual([]) - expect(second.unchanged).toContain('package.json') - expect(second.unchanged).toContain('.gitignore') - expect(second.unchanged).toContain('pnpm-workspace.yaml') - expect(second.unchanged).toContain('src/native/index.tsx') -}) - -test('merges pnpm build trust into the nearest workspace config', async () => { - const workspace = await mkdtemp( - path.join(tmpdir(), 'tanstack-native-workspace-'), - ) - temporaryDirectories.push(workspace) - const root = await writeFixture(path.join(workspace, 'apps/app'), 'start') - const workspaceFile = path.join(workspace, 'pnpm-workspace.yaml') - await writeFile( - workspaceFile, - "# existing workspace\npackages:\n - 'apps/*'\nallowBuilds:\n esbuild: true\n", - ) - await writeFile(path.join(root, '.gitignore'), '# existing ignore\ndist/\n') - - const result = await initializeNativeScript({ - root, - templateDirectory, - packageManager: 'pnpm', - install: false, - }) - - expect(result.updated).toContain('../../pnpm-workspace.yaml') - const contents = await readFile(workspaceFile, 'utf8') - expect(contents).toContain('# existing workspace') - expect(contents).toContain("- 'apps/*'") - expect(contents).toContain('esbuild: true') - const config = parse(contents) as { - allowBuilds: Record - } - expect(config.allowBuilds['@nativescript/core']).toBe(true) - expect(config.allowBuilds.nativescript).toBe(true) - const gitIgnore = await readFile(path.join(root, '.gitignore'), 'utf8') - expect(gitIgnore).toContain('# existing ignore') - expect(gitIgnore).toContain('dist/') - expect(gitIgnore).toContain('.ns-vite-build/') -}) - -test('does not override an explicit pnpm build denial without force', async () => { - const root = await createFixture('start') - const workspaceFile = path.join(root, 'pnpm-workspace.yaml') - const contents = "allowBuilds:\n '@nativescript/core': false\n" - await writeFile(workspaceFile, contents) - - await expect( - initializeNativeScript({ - root, - templateDirectory, - packageManager: 'pnpm', - install: false, - }), - ).rejects.toMatchObject({ - conflicts: ['pnpm-workspace.yaml#allowBuilds.@nativescript/core'], - }) - await expect(readFile(workspaceFile, 'utf8')).resolves.toBe(contents) - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() - - await initializeNativeScript({ - root, - templateDirectory, - packageManager: 'pnpm', - install: false, - force: true, - }) - const forcedConfig = parse(await readFile(workspaceFile, 'utf8')) as { - allowBuilds: Record - } - expect(forcedConfig.allowBuilds['@nativescript/core']).toBe(true) -}) - -test('initializes a Router-only app with the shared NativeScript Vite bridge', async () => { - const root = await createFixture('router') - await initializeNativeScript({ - root, - templateDirectory, - packageManager: 'npm', - install: false, - }) - - const viteConfig = await readFile( - path.join(root, 'vite.native.config.ts'), - 'utf8', - ) - expect(viteConfig).toContain('tanstackReactNativeScript') - expect(viteConfig).toContain('tanstackRouterGenerator') - expect(viteConfig).not.toContain('tanstackStartNativeScript') - - const packageJson = JSON.parse( - await readFile(path.join(root, 'package.json'), 'utf8'), - ) as { - devDependencies: Record - } - expect(packageJson.devDependencies['@tanstack/router-plugin']).toBe( - '^1.200.0', - ) -}) - -test('rejects React 18 before writing files', async () => { - const root = await createFixture('router') - const packageJsonPath = path.join(root, 'package.json') - const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8')) as { - dependencies: Record - } - packageJson.dependencies.react = '^18.3.1' - await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`) - - await expect( - initializeNativeScript({ - root, - templateDirectory, - packageManager: 'npm', - install: false, - }), - ).rejects.toThrow('requires React 19') - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() -}) - -test('rejects React 20 before writing files', async () => { - const root = await createFixture('router') - const packageJsonPath = path.join(root, 'package.json') - const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8')) as { - dependencies: Record - } - packageJson.dependencies.react = '^20.0.0' - await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`) - - await expect( - initializeNativeScript({ - root, - templateDirectory, - packageManager: 'npm', - install: false, - }), - ).rejects.toThrow('requires React 19') - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() -}) - -test.each(['^19.0.0 || ^20.0.0', '>=19.0.0'])( - 'rejects ambiguous React range %s before writing files', - async (reactVersion) => { - const root = await createFixture('router') - const packageJsonPath = path.join(root, 'package.json') - const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8')) as { - dependencies: Record - } - packageJson.dependencies.react = reactVersion - await writeFile( - packageJsonPath, - `${JSON.stringify(packageJson, null, 2)}\n`, - ) - - await expect( - initializeNativeScript({ - root, - templateDirectory, - packageManager: 'npm', - install: false, - }), - ).rejects.toThrow('requires React 19') - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() - }, -) - -test('rejects an invalid server function base before writing files', async () => { - const root = await createFixture('start') - - await expect( - initializeNativeScript({ - root, - templateDirectory, - packageManager: 'npm', - serverFnBase: '/_serverFn/', - install: false, - }), - ).rejects.toThrow('must be an absolute URL') - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() -}) - -test('rejects Vite 8 atomically and replaces it only with force', async () => { - const root = await createFixture('start') - const packageJsonPath = path.join(root, 'package.json') - const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8')) as { - devDependencies?: Record - } - packageJson.devDependencies = { vite: '^8.0.0' } - const packageJsonBefore = `${JSON.stringify(packageJson, null, 2)}\n` - await writeFile(packageJsonPath, packageJsonBefore) - - const options = { - root, - templateDirectory, - packageManager: 'pnpm' as const, - install: false, - } - await expect(initializeNativeScript(options)).rejects.toMatchObject({ - conflicts: ['package.json#devDependencies.vite'], - }) - await expect(readFile(packageJsonPath, 'utf8')).resolves.toBe( - packageJsonBefore, - ) - await expect( - readFile(path.join(root, 'vite.native.config.ts'), 'utf8'), - ).rejects.toThrow() - - await initializeNativeScript({ ...options, force: true }) - const forcedPackageJson = JSON.parse( - await readFile(packageJsonPath, 'utf8'), - ) as { - devDependencies: Record - } - expect(forcedPackageJson.devDependencies.vite).toBe('^7.3.6') -}) - -test('preflights conflicts before changing the project', async () => { - const root = await createFixture('start') - const options = { - root, - templateDirectory, - packageManager: 'pnpm' as const, - install: false, - } - await initializeNativeScript(options) - - const viteConfigPath = path.join(root, 'vite.native.config.ts') - await writeFile(viteConfigPath, '// user configuration\n') - const packageJsonPath = path.join(root, 'package.json') - const packageJsonBefore = await readFile(packageJsonPath, 'utf8') - - await expect( - initializeNativeScript({ ...options, serverPort: 4000 }), - ).rejects.toBeInstanceOf(NativeScriptScaffoldConflictError) - await expect(readFile(viteConfigPath, 'utf8')).resolves.toBe( - '// user configuration\n', - ) - await expect(readFile(packageJsonPath, 'utf8')).resolves.toBe( - packageJsonBefore, - ) - - await initializeNativeScript({ ...options, force: true }) - await expect(readFile(viteConfigPath, 'utf8')).resolves.toContain( - 'tanstackStartNativeScript', - ) -}) diff --git a/packages/router-cli/tsconfig.json b/packages/router-cli/tsconfig.json index aed76c01b9..09d7037393 100644 --- a/packages/router-cli/tsconfig.json +++ b/packages/router-cli/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../tsconfig.json", - "include": ["src", "tests", "vite.config.ts"], + "include": ["src", "vite.config.ts"], "compilerOptions": { "types": ["node"] } diff --git a/packages/router-cli/vite.config.ts b/packages/router-cli/vite.config.ts index 5f2fb651ad..0eac9e6ed4 100644 --- a/packages/router-cli/vite.config.ts +++ b/packages/router-cli/vite.config.ts @@ -1,11 +1,10 @@ import { defineConfig, mergeConfig } from 'vitest/config' import { tanstackViteConfig } from '@tanstack/vite-config' +import packageJson from './package.json' const config = defineConfig({ - test: { - name: '@tanstack/router-cli', - environment: 'node', - watch: false, + define: { + __TSR_VERSION__: JSON.stringify(packageJson.version), }, }) diff --git a/packages/router-core/AGENTS.md b/packages/router-core/AGENTS.md new file mode 100644 index 0000000000..7402f0bdfe --- /dev/null +++ b/packages/router-core/AGENTS.md @@ -0,0 +1,12 @@ +# Router core + +- `RouterCore.update` gates shared route-tree caching with `process.env.NODE_ENV !== 'development'`. `loadRouteChunk` checks promise ownership outside production so obsolete lazy imports cannot overwrite HMR changes. Preserve both behaviors; validate hot updates while imports are pending. +- Route hooks, lifecycle callbacks, and abort listeners can navigate synchronously. Recheck the internal navigation owner after callbacks and awaits before publishing state/assets. Public loader abort signals belong to shared data generations; self-aborting a loader does not discard its result or error. Preserve loader ownership when transferring work between preload, navigation, cache, and background loads; see [`tests/preload-public-signal-lifetime.test.ts`](tests/preload-public-signal-lifetime.test.ts). +- Reusing loader work/data does not reuse `beforeLoad`: each active preload and subsequent navigation reruns it. Keep its returned context separate from reusable route-context contributions; see [`tests/public-preload-lane-contract.test.ts`](tests/public-preload-lane-contract.test.ts). +- Code emitted into HTML (`?script-string` entries and RawStream factories) executes without module scope. Keep it self-contained; pass dependencies explicitly. Validate emitted strings through the existing execution tests after refactors (`RawStream`, `scroll-restoration-script`, `tsr-script-teardown`). +- Before changing SSR streaming or hydration transport, read [`src/ssr/STREAMING.md`](src/ssr/STREAMING.md). Byte ordering, renderer safe points, and completion handling have framework-specific contracts. +- Backpressure tests are excluded from normal unit runs. For buffering/backpressure changes, run the gated suite below. Its memory case requires exposed GC; bypass Nx cache so a previous run with the gate disabled cannot count as validation. + +```sh +RUN_BACKPRESSURE_PERF=1 CI=1 NX_DAEMON=false pnpm nx run-many -p @tanstack/router-core -t test:unit --skipRemoteCache --skipNxCache -- tests/transformStreamBackpressure.perf.test.ts --pool=forks --execArgv=--expose-gc +``` diff --git a/packages/router-core/CHANGELOG.md b/packages/router-core/CHANGELOG.md index 360436487b..b01991e223 100644 --- a/packages/router-core/CHANGELOG.md +++ b/packages/router-core/CHANGELOG.md @@ -1,5 +1,351 @@ # @tanstack/router-core +## 1.171.39 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +## 1.171.38 + +### Patch Changes + +- [#8212](https://github.com/TanStack/router/pull/8212) [`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031) - Render generated script preloads (`modulepreload`, or `preload as="script"` for IIFE output) with `fetchPriority="low"` and forward it into static Early Hints, so they no longer compete with render-blocking stylesheets, fonts and images. + +## 1.171.37 + +### Patch Changes + +- [#8441](https://github.com/TanStack/router/pull/8441) [`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82) - Reuse the parsed request location during SSR instead of repeating input rewrites. Match server routes against the app router's parsed pathname while preserving encoded pathnames for server handlers and middleware. + +## 1.171.36 + +### Patch Changes + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Reduce per-request work in Start: `getNormalizedURL` reads a `URL` input without cloning it, and `runWithStartContext` returns the callback's own result instead of wrapping it in a promise, so a synchronous throw from the callback now propagates synchronously. + +## 1.171.35 + +### Patch Changes + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Drop a duplicated current-location flag and a redundant `createHref` wrapper. + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Links of a route that the pending navigation leaves skip deriving the destination location, and clicks and preloads follow the href a Link displays. `buildLocation` now builds `mask` and `routeMasks` locations from the same `_fromLocation` as the destination. + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Fixed Link destinations that resolve to a route mask are now reused across navigations instead of being rebuilt every time. A mounted Link now follows changes to its `href` and `reloadDocument` props, and React Links no longer each subscribe to a hydration flag. + +- [#8605](https://github.com/TanStack/router/pull/8605) [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2) - Use `slice` instead of `substring` where the bounds are always ordered and non-negative. + +- [#7654](https://github.com/TanStack/router/pull/7654) [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e) - Encode slashes in dehydrated SSR match IDs with `#` instead of a null byte, so the inlined hydration payload no longer contains U+0000 (which is invalid in HTML and rejected by markup validators) + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2)]: + - @tanstack/history@1.162.5 + +## 1.171.34 + +### Patch Changes + +- [#8573](https://github.com/TanStack/router/pull/8573) [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb) - Align server function request and response handling. + +## 1.171.33 + +### Patch Changes + +- [#8297](https://github.com/TanStack/router/pull/8297) [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f) - Update `seroval` and `seroval-plugins` from 1.6.2 to 1.6.7. This picks up the typed array length guard, the `maxBase64Length` and `compactArrayBufferViews` options, and the `isStream` export. + +- [#8460](https://github.com/TanStack/router/pull/8460) [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47) - Abort reserved loader generations with no remaining owners when invalidation removes them from discovery, ensuring their public abort signals are retired. + +- [#8519](https://github.com/TanStack/router/pull/8519) [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2) - Hand native scroll restoration back to the browser on pagehide, including entries entering BFCache, and reclaim manual restoration when a cached document resumes. + +## 1.171.32 + +### Patch Changes + +- [#8363](https://github.com/TanStack/router/pull/8363) [`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4) - Detect plain objects by constructor instead of `Object.prototype.toString` dispatches in `isPlainObject`, which gates every `deepEqual` and `replaceEqualDeep` recursion step. Object literals, `JSON.parse` output and null-prototype objects are still plain; objects from another realm no longer are. Records with an own `constructor` key (for example the search params of `?constructor=foo`) fall back to a prototype check, so they keep structural sharing while class instances stay opaque. + +- [#8364](https://github.com/TanStack/router/pull/8364) [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7) - Compare and copy plain objects in `replaceEqualDeep` by their string keys only, skipping the symbol-key lookup that dominated key enumeration. Objects with non-enumerable own properties, or symbol keys on the incoming value, now pass through untouched instead of being structurally shared. + +- [#8411](https://github.com/TanStack/router/pull/8411) [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716) - Reduce structural-sharing allocations by reusing array key storage and returning incoming objects when their children need no replacements. Preserve signed zero consistently, remove stale symbol properties, and keep sparse arrays with extra keys and built-ins with an own `constructor` opaque. + + Null-prototype mode now applies only when constructing a copy; existing incoming objects can be reused with their original prototype. + +- [#8362](https://github.com/TanStack/router/pull/8362) [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa) - Allocate the `replaceEqualDeep` result only at the first difference, so structural sharing of search, params, state and loader data no longer allocates when the new value is deeply equal to the previous one. + +- [#8389](https://github.com/TanStack/router/pull/8389) [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e) - Split `replaceEqualDeep` into an equality scan and a copy phase: arrays and objects are scanned by dedicated loops up to the first difference, matching keys prove ownership without a `hasOwnProperty` lookup, and once a difference is found the result is built without any further equality bookkeeping. Deeply equal search, params, state and loader data are recognised faster and changed values are copied with less work per entry. + +## 1.171.31 + +### Patch Changes + +- [#8417](https://github.com/TanStack/router/pull/8417) [`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83) - Speed up `deepEqual`: identical array elements no longer recurse, the exact comparison keeps a single key counter, and the redundant `typeof` early exit is gone. Equal numeric arrays compare ~70% faster and record comparisons 5–12% faster in the mixed-mode workloads that Link option stabilization and active-state checks produce, with a slightly smaller bundle. Behavior, including key enumeration and getter read order, is unchanged. + +- [#8418](https://github.com/TanStack/router/pull/8418) [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387) - `deepEqual` now takes its flags as positional arguments — `deepEqual(a, b, partial?, explicitUndefined?)` — instead of an options object. The router's hot callers (Link option stabilization and active-state checks, `matchRoute`) no longer allocate an options object per comparison, and the comparator reads two booleans instead of a polymorphic object. `explicitUndefined` replaces `ignoreUndefined: false`. `deepEqual` is an internal helper; it stays exported for compatibility of two-argument calls. + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Reduce per-request SSR overhead: abort settled route matches with one shared `AbortError`-shaped reason instead of building a stack-capturing `DOMException` per match, skip `JSON.parse` for search values that cannot start JSON, wait on request signals with one listener per wait, and keep resolved server-function modules in production builds instead of re-importing them on every call. + +- [#8419](https://github.com/TanStack/router/pull/8419) [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd) - `resolvePath` (internal helper) now takes positional arguments — `resolvePath(base, to, trailingSlash?, cache?)` — so `buildLocation` and `matchRoute` no longer allocate an options object per path resolution. + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- [#8422](https://github.com/TanStack/router/pull/8422) [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a) - Parse the location once when `router.update()` changes the basepath or rewrite, collect `invalidate()` match ids in a single pass, and specialize internal basepath composition without arrays or loops. Preserve basepath case sensitivity when creating and updating the router. + + Rebuild server route trees when `caseSensitive` changes and reuse the server cache only when the route tree and case sensitivity both match. + +- [#8421](https://github.com/TanStack/router/pull/8421) [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3) - Parse masked locations without mutating shared state and simplify input rewrite handling. + +## 1.171.30 + +### Patch Changes + +- [#8321](https://github.com/TanStack/router/pull/8321) [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6) - Cache route branches and interpolated paths on their route objects, removing the fixed template limit for registered routes and reusing cached paths across server requests. Rebuild tree-dependent caches together, preserve decoder and trailing-slash isolation, and keep unregistered templates bounded. + +- [#8390](https://github.com/TanStack/router/pull/8390) [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776) - Keep the Link location cache out of server bundles: `buildLocation` only creates, reads and writes it when `isServer` is false. Render React Links on the server without the extra prop copies and the forwarded-ref hook. Link SSR rendering is 20-40% faster in the Link benchmarks and the React Start SSR request loop about 7% faster. + + React `activeProps` and `inactiveProps` now follow one precedence rule on every link, including links whose destination is blocked for using a disallowed scheme: state props override element props, `ref` and event handlers, while `href`, `disabled` and `target` stay controlled by the router. Previously a blocked link ignored a `ref` or handler from its inactive props. + + React `Link` and `useLinkProps` split router options from element props with one key set on the client and the server. Element props pass through as given: external links forward them verbatim, falsy values included, and `useLinkProps` now returns `children` for router-controlled links as it already did for external ones. + +- [#8382](https://github.com/TanStack/router/pull/8382) [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed) - `buildLocation` no longer structurally shares the built `search` and `state` with the current location. The observable `location.search` and `location.state` still preserve equal nested references across navigations, because `parseLocation` stabilizes them once a location is committed. A search whose contents equal the current search but list its keys in a different order now serializes in the requested order, so navigating to it creates a new history entry instead of being treated as the same location. A `state` object passed to `navigate` or `buildLocation` is never mutated. + +- [#8325](https://github.com/TanStack/router/pull/8325) [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274) - Reuse the already-owned raw-param snapshot during lightweight source matching instead of copying it again. + +- [#8325](https://github.com/TanStack/router/pull/8325) [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274) - Reduce transient JIT compilation memory during navigation by separating search middleware collection from recursive execution. + +- [#8252](https://github.com/TanStack/router/pull/8252) [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734) - Collect shared pathname-cache keys during interpolation instead of parsing templates twice, and share dynamic-segment handling to reduce bundle size. + +- [#8319](https://github.com/TanStack/router/pull/8319) [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa) - Simplify path interpolation into ordered segment-type blocks with shared prefix/value/suffix assembly. Preserve one-pass parsing and optional metadata collection, and reuse the public result object instead of allocating and clearing a missing-parameter callback. + +- [#8252](https://github.com/TanStack/router/pull/8252) [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734) - Reuse pathname interpolation across Links with bounded router-scoped caches. Keep parameter callbacks and navigation state independent of the cache. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Make `pathParamsAllowedCharacters` initialization-only. Configure it when creating the router; changing allowed characters requires a new router instance. Remove decoder-update bookkeeping and decoder-change checks from route-owned path caches. + +- [#8370](https://github.com/TanStack/router/pull/8370) [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5) - Stop exporting the internal `isPlainObject` and `isPlainArray` helpers. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Initialize routes directly during route-tree processing, removing the callback indirection while preserving parent-first initialization and route indexes. + +- [#8328](https://github.com/TanStack/router/pull/8328) [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5) - Reduce duplication in navigation parameter handling while preserving parameter inheritance, null-prototype dictionaries, and updater isolation. + +- [#8410](https://github.com/TanStack/router/pull/8410) [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58) - Treat `0` and `false` as provided `_splat` values when interpolating paths. Only `undefined`, `null`, and `''` now omit a splat segment, matching how other path params are stringified. + +- [#8354](https://github.com/TanStack/router/pull/8354) [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244) - Use lightweight request history for SSR and make server navigation a no-op. Use redirect() to issue HTTP redirects. Server hrefs use the same normalization as browser history to handle protocol-relative URLs and control characters. + +- [#8321](https://github.com/TanStack/router/pull/8321) [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6) - Consolidate internal path interpolation into `interpolatePath`, returning a pathname directly and collecting metadata only when requested. Update router and devtools callers without changing route parsing or interpolation caching. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Reduce route-tree initialization work by avoiding temporary path-joining arrays and duplicate ID normalization. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Reuse parsed route segments when generating paths for navigation, Links, and Devtools. Preserve interpolation metadata and refresh segments when the route tree is rebuilt, without reparsing templates for new parameter values. + +- [#8252](https://github.com/TanStack/router/pull/8252) [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734) - Reduce the bundle cost of shared Link pathname interpolation while preserving its rendering performance. Reuse one interpolation pass for pathname and optional metadata, keep the bounded cache on the router, and simplify React Link active-state and prop merging. + +- [#8385](https://github.com/TanStack/router/pull/8385) [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09) - Collect search middlewares with a counted loop so the optimized code stays valid across navigations. This removes a JIT recompilation that raised peak memory in the interrupted-navigations client memory benchmark. + +- [#8370](https://github.com/TanStack/router/pull/8370) [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5) - Reuse built locations for Links whose destination does not depend on the current location. `buildLocation` keeps the result per options object when the build never read the current location, and the React `Link` passes one stable options object per instance, so navigations resolve unchanged Links with a lookup instead of a full build. The per-route pathname interpolation cache this replaces is removed. Link `params`, `search` and `activeOptions` are compared by value on render, so inline object literals with unchanged contents keep reusing the Link's location. Pass a new object to change a destination; like any other React prop, an object mutated in place is not re-read. + +- [#8325](https://github.com/TanStack/router/pull/8325) [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274) - Cache normalized route pathnames so repeated Link destinations do not decode the same interpolation result again. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Share compact parsed route segments between matching and interpolation, preserve original parameter names, and avoid reparsing templates while building paths. Simplify route-tree traversal, reuse existing path helpers, and keep Devtools-only navigation validation out of the production formatter. Preserve dynamic match identity for standalone legacy fallback routes. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Pass route initialization indexes directly instead of wrapping each index in an options object. + +- Updated dependencies [[`8fff7fa`](https://github.com/TanStack/router/commit/8fff7fa1f2e6f061916b0bf5e0ec486b2e732f94), [`f021f6d`](https://github.com/TanStack/router/commit/f021f6d1c6dce6c9b54d70766f1d636d8fd9e184), [`ae68535`](https://github.com/TanStack/router/commit/ae68535929043607d4ee9438f8ae401f3a064862), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244)]: + - @tanstack/history@1.162.4 + +## 1.171.29 + +### Patch Changes + +- [#8313](https://github.com/TanStack/router/pull/8313) [`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725) - Avoid constructing a query serializer when search is empty or all values are undefined. + +- [#8308](https://github.com/TanStack/router/pull/8308) [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8) - Validate navigation and redirect destinations, keep ambiguous relative URLs on the current origin, and constrain prerender requests and output paths. Prevent redirect headers from appearing in serialized server function response bodies. + + Preserve native form HTTP redirects, route error handling and masks for document redirects, and per-navigation destinations for shared loader redirects. Avoid redundant origin parsing and reduce link styling and server-rendering work. Configured origins must already be normalized. + + Keep blocked-link inactive props consistent during React hydration, honor explicit redirect Location headers before checking route options, and refresh Vue link state when destinations become internal. Reuse the protocol-relative URL check while parsing redirect schemes once. + + Reduce React link bundle size by sharing pathname comparisons, state-prop selection, and element creation. + + Share normalized pathname comparisons in Solid and Vue links to reduce bundle size. + +- [#8288](https://github.com/TanStack/router/pull/8288) [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91) - Reduce cache maintenance work during navigation by indexing incoming match IDs once per commit. + +- [#8287](https://github.com/TanStack/router/pull/8287) [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9) - Use full-document navigation when an output rewrite produces a cross-origin destination, including the public URL of a route mask. + + Respect registered history blockers during document navigation, passing history locations and the requested push or replace action. + +- Updated dependencies [[`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/history@1.162.3 + +## 1.171.28 + +### Patch Changes + +- [#8222](https://github.com/TanStack/router/pull/8222) [`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889) - Make each load transaction's completion follow its current successor so a burst of back-to-back loads wakes each superseded waiter once instead of once per successor. Previously every superseded `load()` re-polled the current transaction on each later completion, which was quadratic in microtask work. + +- [#8165](https://github.com/TanStack/router/pull/8165) [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2) - Exclude structural descendants below error and not-found boundaries from route lifecycle callbacks. Preserve lifecycle membership through invalidation, hydration, background reloads, and superseded navigation publication. + +- [#8209](https://github.com/TanStack/router/pull/8209) [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f) - Preserve falsy thrown values in React and Vue error boundaries. Type React and Vue boundary error components and `onCatch` callbacks as `unknown`. Solid boundary errors remain typed as `Error`; SSR now wraps non-`Error` loader errors to match Solid’s native boundary behavior, preserving the original value in `cause`. Router state and loader `onError` values are unchanged. + + When upgrading React or Vue, narrow boundary errors (for example, with `error instanceof Error`) before reading `message` or `stack`. `ErrorComponentProps` remains available for values narrowed to a specific error type. Route `onError` types are unchanged. + +- [#8207](https://github.com/TanStack/router/pull/8207) [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce) - Fix consumer typechecking with `skipLibCheck: false` by omitting the internal beforeLoad context field from published dehydrated match declarations. + + Retain the exported `isAbsoluteUrl` declaration used by framework bindings so the package entry point does not reference a stripped symbol. + +- [#8259](https://github.com/TanStack/router/pull/8259) [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0) - Reduce Promise allocations during client navigation and static server SSR policy resolution. Skip cancellable waits for synchronous beforeLoad results while preserving navigation cancellation. + +- [#8240](https://github.com/TanStack/router/pull/8240) [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a) - Avoid quadratic resource handoff scans when navigating with many cached route matches. + +- [#8161](https://github.com/TanStack/router/pull/8161) [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96) - Retain successful not-found matches as terminal shared boundaries during client navigation, preserving route context while the destination loads. + +- [#8142](https://github.com/TanStack/router/pull/8142) [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832) - Avoid unnecessary JSON.parse calls for search parameter values that cannot begin valid JSON, while preserving custom parser behavior. + +- [#8251](https://github.com/TanStack/router/pull/8251) [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b) - Use URL.canParse for absolute URL checks in links, navigation, redirects, and build configuration. Preserve a URL constructor fallback for older browsers. + +- [#8230](https://github.com/TanStack/router/pull/8230) [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f) - Replace the internal LRU cache behind path resolution, route matching and the SSR manifest lookup with a smaller SIEVE cache whose hits no longer relink a list, and fix an eviction edge case in the old implementation. + +- [#8244](https://github.com/TanStack/router/pull/8244) [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598) - Reduce promise allocations during client navigation when loader data and route components are already available. + +- Updated dependencies [[`9035abc`](https://github.com/TanStack/router/commit/9035abc41163d83409ef582f7743a3c7be57dd93)]: + - @tanstack/history@1.162.2 + +## 1.171.27 + +### Patch Changes + +- [#8132](https://github.com/TanStack/router/pull/8132) [`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c) - Build client preload locations on demand and remove the prebuilt-location argument used by framework links. + +- [#8130](https://github.com/TanStack/router/pull/8130) [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b) - preserve context during reloads + +## 1.171.26 + +### Patch Changes + +- [#8117](https://github.com/TanStack/router/pull/8117) [`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34) - optimize buildLocation path resolution https://github.com/TanStack/router/pull/8108 + skip building search validation when disabled https://github.com/TanStack/router/pull/8112 + skip location state sharing when impossible https://github.com/TanStack/router/pull/8110 + fix cache hits for mask resolution when entry is null https://github.com/TanStack/router/pull/8111 + +## 1.171.25 + +### Patch Changes + +- [#8084](https://github.com/TanStack/router/pull/8084) [`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175) - preserve pending UI across retained routes + +- [#8092](https://github.com/TanStack/router/pull/8092) [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486) - Render route errors when redirect target construction fails and let successor transactions own navigation and HMR presentation. + +## 1.171.24 + +### Patch Changes + +- [#8071](https://github.com/TanStack/router/pull/8071) [`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2) - inline getOpenAndCloseBraces in parseSegment for byte shaving + +- [#8069](https://github.com/TanStack/router/pull/8069) [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e) - inline isFunction utility fn for byte shaving + +- [#8070](https://github.com/TanStack/router/pull/8070) [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff) - inline buildWithMatches inside buildLocation for byte shaving + +## 1.171.23 + +### Patch Changes + +- [#8054](https://github.com/TanStack/router/pull/8054) [`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90) - Reuse resolved lazy route components when revisiting code-split routes, preventing unnecessary pending UI. + +## 1.171.22 + +### Patch Changes + +- [#8039](https://github.com/TanStack/router/pull/8039) [`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13) - load-client can cache settles abandonned loader work without preload authority + +## 1.171.21 + +### Patch Changes + +- [#8019](https://github.com/TanStack/router/pull/8019) [`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05) - handle excessive parent relative links + +## 1.171.20 + +### Patch Changes + +- [#8006](https://github.com/TanStack/router/pull/8006) [`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246) - skip impossible JSON parse attempts + +- [#8010](https://github.com/TanStack/router/pull/8010) [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a) - perf: speed up structural sharing (`replaceEqualDeep`) by computing enumerable own keys with `Object.keys` + a length compare instead of `getOwnPropertyNames` followed by a `propertyIsEnumerable` call per key. This runs on every selector result on every state update when `defaultStructuralSharing` is enabled, and is ~1.3-1.5x faster on typical router state objects with identical behavior. + +## 1.171.19 + +### Patch Changes + +- [#7992](https://github.com/TanStack/router/pull/7992) [`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9) - retain mounted UI during revalidation + +## 1.171.18 + +### Patch Changes + +- [#7984](https://github.com/TanStack/router/pull/7984) [`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7) - Improve route-tree construction and matching performance by fusing static and + dynamic node creation, sorting only dynamic sibling lists that need it, and + deriving matcher depth from trie nodes. + +- [#7985](https://github.com/TanStack/router/pull/7985) [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b) - perf: compact private bundle boundaries- [#7975](https://github.com/TanStack/router/issues/7975) + +- [#7967](https://github.com/TanStack/router/pull/7967) [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c) - Preserve path params in their raw string form while matching routes so structured values returned by `params.parse` produce stable match IDs and do not reuse stale loader data. + + `RouterCore.getMatchedRoutes()` now returns `[matchedRoutes, rawParams, foundRoute]` instead of an object. + +- Updated dependencies [[`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b)]: + - @tanstack/history@1.162.1 + +## 1.171.17 + +### Patch Changes + +- [#7962](https://github.com/TanStack/router/pull/7962) [`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5) - Update Seroval dependencies to version 1.6.2. + +## 1.171.16 + +### Patch Changes + +- [#7805](https://github.com/TanStack/router/pull/7805) [`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd) - Rewrite match loading around a lane-based scheduler that tracks each navigation, preload, and background reload as an ordered unit of work. This fixes pending/redirect/retry state leaking between overlapping navigations, restores correct SSR status codes for redirects, errors, and not-found responses, and closes hydration gaps where the client re-ran work the server had already completed. + - Invalidation now retires matching active preloads so older speculative loader results cannot become fresh cache data after invalidation. + - Route `headers()` now only runs on the server, matching the documented behavior — it is no longer invoked during client-side asset projection. + - The documented default `gcTime` and `preloadGcTime` now match the existing runtime default of 5 minutes (`300_000`). + + **Removed / changed exported internals** + - `RouterState` no longer includes `loadedAt`, `isTransitioning`, `statusCode`, or `redirect`. Use `match.updatedAt` in place of `loadedAt`; subscribe to `router.state.status` / `router.state.isLoading` in place of `isTransitioning`; server response status and redirect handling are now internal to the server loader and are no longer exposed on `router.state`. + - `RouteMatch.fetchCount` has been removed, with no replacement — it was purely informational. + - `RouteMatch.status` no longer includes `'redirected'` (it remains `'pending' | 'success' | 'error' | 'notFound'`) — redirected matches are dropped from the match list instead of being rendered. + - `RouteMatch.globalNotFound` has been renamed and privatized to the internal `_notFound` field. Use `match.status === 'notFound'` instead. + - The exported React, Solid, and Vue `Match` components now accept `routeId` instead of `matchId`. + - The exported `RouterStores` adapter contract now uses route-keyed presentation stores: `matchesId` is replaced by `ids`, `matchStores` by `byRoute`, and `getRouteMatchStore()` by `getMatchStore()`. The separate `loadedAt`, `isLoading`, `isTransitioning`, `statusCode`, and `redirect` stores have been removed, along with the pending/cache stores and their setters. `StoreConfig.init` has also been removed. Read application-facing state from `router.state`; preload and cache coordination are now internal. + - Removed `RouterCore` members `getMatch()`, `updateMatch()`, `cancelMatch()`, and `cancelMatches()` — read matches from `router.state.matches` (e.g. `router.state.matches.find((m) => m.id === id)`); there is no replacement for mutating or cancelling an individual in-flight match from outside the router. + - Removed `RouterCore.hasNotFoundMatch()` — use `router.state.matches.some((m) => m.status === 'notFound')`. + - Removed `RouterCore.looseRoutesById` — use `routesById`. + - Removed `RouterCore.isPrerendering()`, `RouterCore.isViewTransitionTypesSupported`, and `RouterCore.viewTransitionPromise`, with no replacement. + - Removed `RouterCore.getParsedLocationHref()` and `RouterCore.clearExpiredCache()`, with no replacement — expired cache entries are now reconciled automatically as part of match commit. + - Removed `RouterCore.latestLoadPromise` and `RouterCore.beforeLoad()`, with no replacement. + - `RouterCore.commitLocationPromise` and `RouterCore.pendingBuiltLocation` have been replaced by the internal `_commitPromise` and `_pendingLocation` fields. + - Removed the exported `GetMatchFn` and `UpdateMatchFn` types, along with the methods they typed. + - Removed the standalone `getMatchedRoutes()` export from `@tanstack/router-core` — use the `router.getMatchedRoutes()` instance method instead. + - `RouterCore.loadRouteChunk()` no longer accepts an array of component types as its second argument. One-argument usage is unchanged; the optional second argument is now `'errorComponent'`, `'notFoundComponent'`, or `false` for internal boundary loading. + - Removed `Redirect.redirectHandled`, which was internal redirect bookkeeping. + - `MatchRoutesOpts.preload` and `MatchRoutesOpts.dest` have been removed. + - `StartTransitionFn` is now `(fn, expected) => Promise` (previously `(fn) => void`). This only affects custom framework adapters that implement `startTransition`. + ## 1.171.15 ### Patch Changes diff --git a/packages/router-core/INTERNALS.md b/packages/router-core/INTERNALS.md new file mode 100644 index 0000000000..4ef0dfa031 --- /dev/null +++ b/packages/router-core/INTERNALS.md @@ -0,0 +1,1410 @@ +# Match loading internals + +This document describes the architecture that loads route matches on the +client, on the server, and across hydration. It is for maintainers of router +core and the framework adapters. + +Match loading coordinates several asynchronous flows, but its runtime +coordination state is limited to actual writers and owned resources. Phase names +and invalid transitions belong in TypeScript whenever possible; they do not +justify a second runtime state machine. + +All `_`-prefixed fields mentioned here are internal. Their spelling and shape +may change, but the ownership rules in this document must continue to hold. + +## Vocabulary and the short version + +- A **match** is one route at one concrete set of path params, search-derived + loader dependencies, and loader/cache identity. +- A **lane** is one location plus its ordered array of matches. +- A **generation** is one concrete match result for a match ID. Several + generations can share an ID while holding different loader data or ownership; + a newer one can exist without being the one currently displayed. +- A **loader flight** is one loader invocation together with its promise and + abort controller. `router._flights` lets later consumers find the newest + same-ID flight. +- A **lease** is one match's ownership of a flight. Registry membership makes a + flight discoverable; leases keep it alive. +- **Semantic state** is the accepted lane used for reuse and lifecycle + decisions. **Presentation state** is the lane currently exposed to rendering + and selectors. +- A **cutoff** is the end of the match prefix allowed to render or contribute a + particular output. The first pending or terminal boundary normally sets it, + even though later matches remain structurally present. +- To **publish** is to replace router state that renderers or users can observe. + An **identity check** means that publication is allowed only while the exact + owner or base reference used to produce the result is still current. + +The normal client flow is: + +```text +match a private lane + -> build context and run beforeLoad parent-first + -> run eligible loaders and component readiness work + -> select one final outcome and derive assets + -> publish only if the navigation still owns the result +``` + +An ordinary foreground or preload loader success can gain an independent cache +owner while its lane is still private. This is per-match data reuse, not lane +publication; unresolved loader work remains owned only by its consumers. + +Preloads run the same work without publishing a lane. Server loading uses a +request signal instead of a client navigation owner. Hydration reconstructs the +accepted server prefix, then hands any remaining client work to the initial +client load. + +## The architectural rule + +For each mutable result, there must be one answer to each of these questions: + +1. Who may publish it? +2. Who owns the work and cancellation signal that produce it? +3. What proves that the answer is still current after an `await`? + +Do not add a flag, counter, copied deadline, or second completion promise merely +to describe an existing fact. Add runtime state only when it removes an +independent writer, resource owner, or invalid transition. + +The main authorities are: + +| Authority | What it owns | +| ---------------------------- | ------------------------------------------------------------------- | +| `_tx` | The client navigation allowed to commit and publish foreground flow | +| `_preflight` | The current client plan or asynchronous hydration reconstruction | +| `_handoff` | The temporary right to transfer one reconstructed SSR prefix | +| `_committed` | The accepted current lane and lifecycle/background identity base | +| `stores.matches` | The current match presentation exposed to renderers and users | +| `router._cache` | Off-screen loader generations preferred during same-ID planning | +| Active preload entry | Cancellation, cache clearing, and private redirect-chain ownership | +| Loader flight registry entry | The latest same-ID loader generation available to new consumers | +| Match flight lease | Ownership keeping that loader work alive | +| Pending session | One reveal/minimum-visible deadline and its current owner | +| React acknowledgement slot | The one requested publication whose render may settle a transition | +| Refresh transaction | Forced rematerialization and an optional hydration handoff | +| Request signal | Lifetime of one server request and any accepted SSR stream | +| Accepted SSR stream response | Cleanup ownership transferred from the handler to the response body | + +These authorities are related, but none is a substitute for another. In +particular, presentation is not semantic authority, registry membership is not +resource ownership, and a promise settling is not permission to publish. + +## Code map + +- `src/router.ts` matches locations, creates match objects, owns public router + state, history, cache operations, and entry points into loading. +- `src/stores.ts` reconciles route-keyed presentation stores and their ordered + aggregate. +- `src/load-client.ts` owns client planning, transactions, preloads, loader + flights, lazy route and component readiness, reduction, pending presentation, + background reloads, commits, and hydration reconstruction. +- `src/load-server.ts` runs the request-local server lane. +- `src/ssr/createRequestHandler.ts` connects request lifetime, server loading, + dehydration, redirects, rendering, and cleanup. +- `src/ssr/handlerCallback.ts`, `src/ssr/ssr-server.ts`, and + `src/ssr/transformStreamWithRouter.ts` transfer stream ownership and + coordinate serialization, injection, abort, and cleanup. + `src/ssr/hydrationScripts.ts` owns the request-local hydration script queue + and framing; `src/ssr/htmlBoundaryScanner.ts` owns the byte matchers. + See `src/ssr/STREAMING.md` for the transport contract. +- Framework `Transitioner` and `Matches` implementations acknowledge exact + publications and render only through the selected boundary. Framework + `RouterClient` and render-to-stream implementations complete hydration and + connect request abort to their renderer. + +## Semantic state and presentation state + +The rewrite deliberately separates two views of matches. + +### Semantic matches + +`_committed` is the accepted current semantic lane. It supplies lifecycle +identity and is the exact base checked before a background publication. Pending +presentation never replaces it as a planning base. + +For an individual match ID, matching first consults `router._cache` and then +falls back to `_committed`. A cached loader generation can therefore shadow the +currently displayed same-ID generation for future planning without becoming +current presentation or lifecycle authority. + +Semantic matches may own loader-flight leases. They are not mutated by losing +transactions or by pending presentation. + +### Presented matches + +`stores.matches` is the array visible to router state and framework stores. +Before `pendingMs` expires it can still contain the source presentation. Once +pending presentation is published, it contains the whole destination lane, +including descendants that are still loading. Terminal publication follows the +same membership rule: an error is retained at the throwing match, while +not-found is moved to its selected boundary, but neither removes +structurally matched descendants. The framework renderer derives its cutoff +from the first pending or terminal boundary instead of requiring core to hide +descendants. + +The render cutoff also bounds route response headers, SSR manifest assets, +dehydration, and cache exclusion during commit. Framework construction of head +and scripts uses the closely related asset cutoff. It normally stops at the +same boundary, with one selective-SSR hydration exception: a verified +`'data-only'` prefix can carry `_assetEnd`, allowing already-projected assets +from verified descendants to remain active past a pending render boundary until +the client continuation commits. A structural descendant below the relevant +cutoff remains observable in state, but it cannot contribute that output or +evict a newer cache generation merely because it is present in the lane. + +Start's static early hints are another deliberate exception. They are +speculative route-tree hints emitted before loading selects a terminal boundary, +and an already-sent 103 response cannot be retracted. + +The presentation pool is keyed by route ID, not match ID. `stores.ids` defines +active membership and order, while `stores.getMatchStore` obtains the one stable +mutable atom in `stores.byRoute` for a route. That atom contains the route's +presented match or `undefined`. An active route branch contains a route at most +once, so this shape cannot alias two visible matches. When params, search, or +loader dependencies produce a new semantic match ID for the same route, +reconciliation replaces the value in that route's existing atom. Leaving a +route tombstones that atom with `undefined`; re-entering fills the same atom +again. Route components and `useMatch({ from })` therefore keep one subscription +across match generations and A-to-B-to-A membership changes. `ids` is published +before departure tombstones so framework trees stop reading a leaving route +before its atom is cleared. The pool retains atoms for route IDs encountered +during the router's lifetime; it is not an LRU or a cache of match generations. +Semantic caches and loader flights remain keyed by match ID and must not use the +presentation pool as their authority. + +This distinction matters for user code. Once the destination is presented, a +selector can inspect every destination match and observe `isFetching` while the +renderer still shows only the valid prefix. Before that publication, same-ID +matches in the source presentation can expose updated fetching state, but a new +destination-only match is still private. + +Pending entries are flight-free snapshots. They may copy loader data and context +for presentation, but they never become a planning base and never own semantic +resources. + +### Location state + +`stores.location` is the requested location. It can advance before loading +finishes. For foreground client navigation, `stores.resolvedLocation` advances +only after the framework transition acknowledgement settles. Settlement, not a +`true` render result, is what permits navigation completion. Router `status` is +`pending` during that interval and returns to `idle` at completion. A `true` +result separately permits `onRendered` and pending minimum timing. Server +publication and hydration perform their request/initial-load handoffs directly, +as described below. + +### Canonical locations and rewrites + +Initial client and server canonicalization compares `publicHref`, the +browser-facing URL produced by the rewrite contract. Parsed semantic `href` and +rebuilt `href` are not necessarily symmetric: input and output rewrites run in +opposite directions. The client ignores a trailing-slash-only difference while +the server can redirect to the exact browser-facing canonical URL. + +## A lane and its phases + +A lane is one location plus an ordered array of work matches. Its phase is +encoded in TypeScript: + +```text +matched -> contextualized -> reduced -> projected +``` + +### Matched + +Matching establishes route order, params, validated search results, loader +dependencies, match IDs, initial status, and possible semantic reuse. It does +not run `beforeLoad` or grant publication authority. + +A match ID identifies loader/cache compatibility. It is derived from route +identity, interpolated path params, and serialized `loaderDeps`. Other search +values affect loader identity only when the route includes them in `loaderDeps`. + +Matching treats `params.parse`, `validateSearch`, and `loaderDeps` as pure +planning functions. For the same input they must return the same value without +navigating or mutating router/application state. A `loaderDeps` result and its +serialization hooks must also be side-effect-free. These callbacks may be +evaluated more than once; supporting reentrancy from them would add runtime +ownership checks to every planning step without representing a supported use. + +### Contextualized + +Contextualization walks parent to child. For each route it: + +1. computes route context from the completed parent context, +2. handles params/search validation, +3. runs the route's `beforeLoad`, when defined, and +4. merges the result before moving to the child. + +This serial order guarantees that child route context, child `beforeLoad`, and +child loader context cannot observe a partially completed parent guard. + +Route context is synchronous in the public type contract. Its own contribution +is cached on the match as `_ctx`, and match identity includes route identity, +path params, and `loaderDeps`. A same-ID cache hit may therefore reuse that +route-local result, including one produced by a completed preload. The merged +context is still rebuilt parent-first from the current parent's merged context, +the route's `_ctx`, and the current `beforeLoad` result. Reusing `_ctx` must never +reuse an older merged context or `beforeLoad` contribution. + +Server requests have fresh matches and execute route context normally. +Hydration executes each accepted route context locally, stores its `_ctx`, and +then merges transported `beforeLoad` output. Every normal client lane, +including every preload, performs its own contextualization and `beforeLoad` +chain. + +### Reduced + +On the client, eligible loaders and normal component chunks start concurrently. +On the server, loaders reduce before normal render chunks are consumed. +Reduction turns their outcomes into one terminal semantic lane and one cutoff. +No task publishes semantic or presentation state while reduction is in +progress. An eligible successful client loader may independently enter the +off-screen cache at settlement; that admission neither accepts the lane nor +selects its terminal outcome. + +### Projected + +After semantic reduction, client asset hooks derive `meta`, `links`, styles, and +scripts from the final lane. Server projection additionally derives response +headers. Projection cannot replace the selected loader/before-load result. + +Only an owner that remains current after projection may publish. + +## Client planning and the single writer + +Planning is intentionally separate from transaction installation. Lifecycle +events and route execution callbacks can synchronously reenter the router. +Planning callbacks used for params, search, and loader-key derivation are the +pure functions described above and do not create a second reentrancy boundary. + +A planning controller is installed before `onBeforeNavigate`, `onBeforeLoad`, +and matching, invalidating an older synchronous plan. The planner checks its +authority after supported reentrant callbacks and before installing a +transaction. A stale plan exits without installing a transaction or altering +semantic state. + +Once planning succeeds, the router installs one `_tx`. The transaction owns: + +- the destination and its private matches, +- one lane cancellation controller, +- `done`, the transaction-completion promise used by current transaction + waiters and by React to retain the Suspense source tree while a published + pending match is still loading, +- redirect depth for the chain currently being executed, and +- any pending session transferred to it. + +`LoadTransaction`, the lane execution options, and the pending session are +labeled TypeScript tuples. They are deliberately not runtime state machines: +the labels make each slot type-safe for maintainers, while the compact runtime +shape avoids repeating property names throughout the client loader. Changing a +slot means updating the tuple declaration and every typed consumer together; +it must not introduce a second owner or completion signal. + +Throwing `done` from a pending React match does not stop the transaction's work. +Once the lane has reduced and projected, its successful destination is +published inside the framework transition; that render acknowledgement then +allows `done` to settle. `_commitPromise` is the internal promise backing public +history/navigation completion. Current completion resolves it, and a +superseding transaction can chain it forward, but it is also not permission to +publish. These promises describe different wait relationships; `_tx` remains +the only client writer authority. + +Redirect depth transfers only through the exact `_pendingLocation` created by +`followRedirect`. It is not inherited from the previous transaction: a user +navigation that reenters during a redirect starts a fresh chain even though the +redirecting transaction is still alive. + +The latest `_tx` remains installed after it settles. Its presence is writer +identity, not a loading flag; public loading state comes from router `status` +and per-match `isFetching`. + +Installing a successor removes the predecessor's publication authority. The +predecessor must still settle and release everything it owns; cancellation is a +liveness mechanism, not a license to abandon cleanup. + +Commit and cache handoff install the accepted semantic/cache recipients before +releasing replaced resources. Releasing the last flight lease aborts a public +signal and can synchronously reenter user code, so an old generation must never +be released while it still appears to be the accepted owner. The committed lane +is also removed from the transaction's private ownership before publication. + +Every asynchronous navigation or presentation publication checks `_tx` +immediately before the write. Background publication additionally checks the +exact committed base array from which it was derived. Per-match cache admission +is not lane publication: it requires the producing lane's controller to remain +live and the cache entry captured during planning to remain the exact current +entry. Navigation lanes use their transaction controller, while preloads use +their independently owned controller. Private preload redirect continuation +uses the active preload entry as its additional authority. + +## `beforeLoad`: execution and hydration + +`beforeLoad` context is not a cache. + +Client `beforeLoad` only installs a cancellable wait for Promise results. +Synchronous context still crosses an `await` before the cancellation check: +a hook can queue a replacement navigation before its loader is planned. +Promise detection assumes ordinary Promise behavior. + +A completed client preload never stores reusable `beforeLoad` output. When its +loader data enters the route cache, the merged context is discarded; the +same-ID route-local `_ctx` may remain reusable. A later navigation rebuilds the +merged context from the current parent and `_ctx`, then reruns `beforeLoad`, even +when it reuses completed loader data. + +There is one deliberate exception: hydration. + +### Client lanes + +Every navigation and every preload rematches and runs its own serial +`beforeLoad` chain. This remains true for identical concurrent preloads and for +a navigation that targets a still-running preload. A call made with +`preload: true` is never accepted as the navigation's call with +`preload: false`; that call's context and control or terminal outcome stay +private to its speculative lane. This does not isolate the normalized outcome of +a same-ID loader flight that multiple lanes deliberately share. + +`router._preloads` has no semantic adoption role. Its controller entry owns +cancellation, invalidation, and cache clearing and proves that a standalone +preload remained active through normal settlement; successful removal authorizes +private redirect continuation. Its live lane signal is also the final authority +for cache publication, including the microtask window after a loader outcome has +fulfilled. Loader results remain independently reusable: a completed preload may +seed the match cache, and a still-running preload may donate its same-ID loader +flight after the receiving lane has run its own `beforeLoad` and made its reload +decision. + +### Hydration + +The server-resolved prefix is authoritative for the initial document. Hydration +therefore restores transported `beforeLoad` output for the accepted prefix +without rerunning it on the client. This applies to the server-rendered prefix +in selective SSR; the unresolved client suffix follows normal navigation +rules. + +Hydration is not a general `beforeLoad` cache. Its temporary handoff is valid +only for the initial client load of the same document entry and exact committed +owner; rejection, invalidation, or any later load returns to normal serial +execution. The claim also requires the same raw browser href and history-state +object. Finish-time match-ID validation proves that rematching still produced +the accepted prefix; opaque router context and route-tree objects are not +compared. That initial load may transfer the accepted hydration prefix and keep +its transported context while it completes a selective-SSR suffix. A preload +never claims this prefix. Frameworks must start the initial client load before +descendant route code can preload; invoking a preload in the gap after raw +`hydrate()` and before that load is outside the supported handoff protocol. + +## Loader data, cache entries, and flights + +Loader data is designed to be reusable. It is independent from `beforeLoad` +provenance. + +### Completed cache entries + +Successful loader-backed matches can be cached by match ID. Staleness, +invalidation, `shouldReload`, stale reload mode, and GC policy decide whether a +lane uses that data or requires a loader generation. A discoverable same-ID +flight may satisfy that requirement, including when `shouldReload` returns +`true`. + +Every eligible successful blocking loader task from a foreground navigation, +development refresh, or preload attempts cache admission immediately after loader +settlement. It does not wait for component readiness, whole-lane reduction, +projection, commit, or render acknowledgement. The cache receives a +non-terminal copy with merged context removed and an additional flight lease; +the private lane keeps its own match and lease until it commits or is discarded. +If a navigation is superseded, a settled cached generation therefore survives +the lane's lease release, while an unresolved loader has no cache owner and is +aborted when its last consumer releases it. Navigation-produced entries retain +normal navigation staleness and GC semantics rather than becoming synthetic +preloads. + +Background loader candidates remain private until their exact transaction and +committed base authorize background publication. A development refresh may +admit successful loader work while its lane is private, but refresh commit +discards every cache generation instead of preserving stale rematerialization +inputs. + +It is valid for cached loader data to have been produced under context from an +older `beforeLoad` generation. Loaders are the cache boundary; guards are not. +Likewise, a shared in-flight invocation may have started with another lane's +older context. Only a newly started loader invocation receives the current +lane's freshly built context. + +An invalid successful entry may remain in the cache as stale data and preserve +its generation identity, but it can never satisfy freshness and must reload. +Failed, canceled, loaderless, and expired generations do not become reusable +loader-cache entries. + +A private client lane can contain independently successful loader generations +when its eventual terminal outcome comes from `beforeLoad`, validation, another +route, or when a descendant is still loading as the navigation is superseded. +Settlement-time cache admission works even below the eventual render boundary +and does not preserve the private parent chain: merged context and `beforeLoad` +output are cleared. Same-ID `_ctx`, loader identity, and successful loader data +remain reusable by design. + +Hydration retry is the transported-work exception because it did not run those +client loader tasks. There, `loaderData` membership together with +`invalid === false` proves a transported successful generation even when +terminal boundary state is attached to the match. Hydration normalizes that copy +before passing it through the same cache identity and lease rules. + +The dehydrated payload omits `loaderData` both when no loader result exists and +when the accepted result is `undefined`. This deliberately keeps the HTML +payload smaller at the cost of making those states indistinguishable after +transport. Reconstruction preserves the absence and does not treat an omitted +value as reusable loader success during hydration retry. + +The cache may deliberately contain a successful generation with the same match +ID as a committed match. For example, a navigation can finish an ancestor +loader and then be superseded while a descendant is still pending, or a private +lane can produce reusable ancestor data before failing below it while an older +committed generation remains visible. Cache-first matching lets the next lane +use that newer loader generation. Its merged context and `beforeLoad` +contribution have been removed; the merged chain is rebuilt from current parents +and same-ID route-local context before `beforeLoad` reruns. + +Commit removes a cache entry when the accepted render prefix contains that ID, +or when a successful match anywhere in the committed lane contains it. A +non-success descendant below the render cutoff is only structural membership; +it must not evict a newer same-ID cache generation. + +### Same-ID in-flight work + +`router._flights` is the only registry from which a new consumer discovers +same-ID loader work. Every new loader generation registers there, whether it +was started by navigation, preload, or background refresh. A newer generation +replaces the registry entry synchronously. A flight has its own abort +controller; it does not use one consumer transaction's controller as its +lifetime. + +Two facts must remain separate: + +- registry membership means new consumers may join the flight; +- a match lease means an existing consumer keeps the flight alive. + +Registry membership normally owns no lease. A successfully settled generation +may remain discoverable while at least one semantic or cached match owns it. A +non-success outcome removes the exact current flight from the registry as it +settles; existing leases keep that outcome alive only for consumers that already +joined, while later planners start a fresh generation. Releasing the last lease +removes a successful generation only if it is still the current registry entry, +then aborts its controller. Every copied semantic match that retains a flight +must acquire a lease, and every discarded match must release one exactly once. + +There is one short exception to normal zero-lease cleanup. When one navigation +replaces another with the same match ID, the predecessor's loader flight can +reach zero leases before the successor finishes `beforeLoad` and decides whether +to reuse it. While the current transaction is visibly running `beforeLoad` for +that same-ID successor, the flight remains discoverable. The same grace period +applies if any other same-ID flight loses its final lease during that phase. +Outside this phase, merely having a current `_tx` is not enough to retain a +zero-lease flight. + +Loader planning ends the grace period synchronously. The successor either +acquires the discoverable flight or one sweep removes and aborts it. A lane with +no `beforeLoad` reaches loader planning before contextualization yields; an +asynchronous `beforeLoad` keeps the grace period visible until it settles. +Preloads neither create nor sweep this navigation-only reservation. An explicit +`shouldReload: false` declines the flight, while invalidation removes discovery +for selected IDs before starting the replacement load. No extra flag, counter, +or completion promise represents the grace period. + +Releasing a set of matches is deliberately two-phase. First every outgoing +match drops its `_flight` lease and every zero-owner generation not reserved by +the current transaction is removed from the discovery registry. Only after the +entire outgoing set is detached are the collected flight controllers aborted. +Do not interleave one flight abort with detaching later matches in the same +replacement: an abort listener can synchronously reenter, and that load must +observe every logically removed lease and registry entry as already gone. + +A successful accepted match may keep its lease after the loader promise has +settled. This keeps the loader's public `AbortSignal` alive for that semantic +generation. The signal aborts when the last active or cached owner is replaced, +unloaded, expired, or discarded; promise settlement alone does not end it. + +Loader error normalization, including route `onError`, runs once while the exact +flight still has a match lease. The terminal flight leaves the discovery +registry before normalization, so a navigation reentered by `onError` starts a +fresh generation. Releasing every match before a late rejection makes the +generation semantically discarded; abort-triggered rejection must not call user +error hooks. This is an ownership check, not a separate cancellation flag. A +loader that aborts its own flight controller while its match remains owned can +still fulfill or reject normally. + +A planned match holds only the lease for the accepted generation copied from +cache or committed state. After `beforeLoad` and `shouldReload` decide that a +loader will run, it may synchronously acquire the registry's latest different +same-ID generation. It never reacquires its own accepted generation merely to +avoid a requested reload. A blocking reload replaces the accepted lease with +the donor; a background reload keeps accepted data visible and gives the donor +lease to its private candidate. This one lookup covers work started by active +preloads, navigation, and background refresh without scanning those owners. + +Active preload flights need no special handoff. Their speculative matches keep +positive leases until the preload settles or is canceled, so another lane can +discover and acquire the flight without adopting the preload lane. + +Consumers already joined to one loader flight observe its single normalized +outcome, including error and not-found. Per-lane cancellation can stop only that +consumer's wait. A non-success flight retires from discovery at settlement, so +only lanes planned afterward retry. Redirect remains control flow and is never +cached as loader data. + +### Semantic parent chain + +`parentMatchPromise` represents the semantic parent generation, not merely the +currently displayed parent. + +This distinction is essential for mixed reload modes. If a parent is refreshing +in the background while a child reloads in blocking mode, the child borrows the +fresh parent candidate. The final lane must not combine fresh parent data with +child data derived from the stale visible parent. + +The same semantic-parent chain is used by blocking and background loader work. +Task arrays track readiness/outcomes; they are not a second parent authority. + +### Components and lazy route options + +There is no router-level component-promise cache. The browser module cache and +framework lazy-component machinery already cache loaded JavaScript. + +Lazy route loading retains only the authority needed to install lazy route +options, ignore obsolete HMR settlements, and retry failed imports. It is not a +general JavaScript-module cache. + +Lazy option installation has one route-owned promise. Success installs options +only while that promise is still the route's owner. Rejection clears the owner +so a later load can retry, and development refresh can clear ownership so an +obsolete import cannot install options afterward. + +Normal component readiness is part of route readiness, not merely an asset +prefetch side effect. Client loader and normal component work may run in +parallel, and a blocking match becomes successful only after both are ready. +When a client lane installs a `pendingComponent` from lazy options, that +component wakes pending selection once it is itself ready, without waiting for +the normal component. This does not require retaining a component promise on +the match: the route's lazy-option owner and the framework/module loader provide +the necessary work identity. + +Client and server not-found boundary searches settle lazy options on each +candidate route before testing for `notFoundComponent`. A lazy rejection while +locating the boundary does not replace an already selected not-found, but +cancellation or request abort still stops the search. The selected terminal +boundary component is then loaded best effort. + +## Outcomes and failure selection + +Internal work normalizes returned and thrown values into a small closed set: + +```text +success | error | not-found | redirect | canceled/skipped +``` + +Redirect and cancellation are control flow, not committed match statuses. +Error and not-found are terminal semantic outcomes assigned once during +reduction. + +Returned and thrown redirects/not-founds normalize identically. Only an error +invokes route `onError`; if `onError` throws, its value is normalized again and +may itself become an error, not-found, or redirect. +Client and server lanes build a route redirect while its source route still owns +the outcome. Target-construction failures therefore become that route's error, +and a successful client target travels with the redirect so navigation does not +run functional updaters twice. +Client loader flights retain the raw redirect because a flight can be shared. +Each consuming lane materializes that redirect against its own location and +policy before exposing the lane-owned task outcome to settlement and reduction. +Router cancellation and request abort bypass `onError`. Aborting the +`AbortController` exposed to a loader is not by itself proof that the router +discarded the work: a still-owned loader may fulfill or reject afterward, and +that settlement is normalized normally. On the client, zero flight leases prove +that an aborted generation was discarded. On the server, the request signal +proves request cancellation, while the already selected failure/control outcome +proves that an aborted descendant is obsolete. The client calls a discarded +non-result `canceled`, while the server calls it `skipped`; neither is a +publishable terminal state. +The transaction controller exposed to client `context` and `beforeLoad` is +router-owned; route code may observe its signal but must not abort it. A canceled +client lane has therefore already lost writer authority to a successor. +Canceled client lanes release only their private work; the transaction that +superseded them owns presentation and completion. + +The client and server use the same settlement order and renderable-ancestor +rules. + +### Serial phase + +Route context, validation, and `beforeLoad` run parent-first. The first terminal +serial outcome stops descent and wins over later loader or chunk work when the +ancestors needed to render its boundary remain usable. + +An error from the serial phase allows loaders strictly above the throwing route +to finish. A serial not-found allows work through its effective ancestor +boundary, but never past the throwing route. A serial redirect or cancellation +starts no loader work. + +### Parallel loader phase + +Eligible loaders start concurrently. The first loader error or not-found to +settle becomes the provisional failure. The choice follows promise settlement +order, not route order or boundary depth. After settlement, the required render +prefix is checked root-to-leaf. The first failed ancestor without its own accepted +`loaderData` property replaces a deeper failure because that deeper boundary is +not reachable. Locally retained loader data, including an accepted `undefined`, +keeps the ancestor renderable with stale data and preserves settlement +chronology. An `undefined` result reconstructed from SSR is intentionally absent +under the transport policy above. + +A redirect is control flow and wins even after an ancestor loader has already +failed. Reduction therefore waits for started descendant loader work to reveal +a redirect, including a descendant already refreshing in the +background. An error or not-found does not cancel already-started descendants +before this selection completes. Once all relevant work has settled, the first +such failure is used only if no redirect won. The client retains the full +structural branch and releases only work that no accepted semantic or background +candidate owns; the server may abort work below the selected boundary. + +Loader settlement does not immediately make each error or not-found terminal. +As an internal staging state, a failed attempt is reset to `status: 'success'` +and marked `invalid: true`. This lets already-started descendants settle, allows +a descendant redirect to remain control flow, and gives reduction one place to +choose the terminal failure that will be published. Reduction then installs the +selected error or not-found on its boundary. A failed ancestor without accepted +loader data replaces a deeper failure because that deeper boundary cannot +render. Every non-selected failed attempt stays invalid and must reload rather +than becoming fresh cache data. Semantic `parentMatchPromise` snapshots still +expose each loader's own outcome to its descendants. + +No error-over-not-found sort is performed. The selected not-found is moved to +its effective not-found boundary; an untargeted not-found searches eligible +ancestors, while a targeted not-found respects its target. + +A global path miss is terminal by `_notFound` even when the selected match +remains successful and has no error attached. An explicit not-found reduced to +root also attaches its error there. Both forms cap rendering and hydration and +produce a 404 response. + +For a fuzzy global miss, synchronous matching installs the best boundary visible +from eager route options. Before contextualization, client and server feed that +fallback through the same lazy-aware ancestor search used for explicit +not-found outcomes. This prevents serial hooks below the effective boundary +from running and prevents loader tasks from starting there, while retaining the +complete structural branch. The historical deepest-route-with-children fallback +still applies when no route supplies a not-found component. When `notFoundMode` +is `'root'`, the search is bypassed but the same execution cap applies at root. + +### Chunk readiness + +Normal route chunks needed before the selected cutoff are awaited. Although the +work may start concurrently, readiness outcomes are consumed root-to-leaf. The +first relevant chunk error replaces a deeper selected serial or loader failure +because that boundary is no longer reachable; a redirect from relevant +readiness remains control flow. + +The resolved boundary is retained while that selected failure remains current. +A later lazy retry in the same lane cannot expand the required prefix after its +readiness has already been consumed. +Terminal boundary-component preloading is best effort during normal loading; it +does not start a second failure-selection algorithm. + +On the client, lazy/chunk readiness starts independently of loader completion +and notifies pending selection when it settles. A `pendingComponent` installed +by lazy options can therefore become the visible boundary while an eager loader +is still unresolved. + +### Projection errors + +Client `head` and `scripts`, plus server `head`, `scripts`, and `headers`, are +decorative with respect to route control flow. They run only after semantic +reduction. Rejections are logged and swallowed; they never replace the chosen +loader/before-load outcome or trigger another boundary-selection pass. + +The implementation should stay this simple. If a proposed fix requires a new +error candidate list, ranking pass, boundary score, or convergence loop, it is +almost certainly rebuilding the discarded complex architecture. + +## Terminal commit and lifecycle + +A successful client lane remains private through projection. At commit, one +framework transition publishes semantic matches, cache changes, and route +lifecycle callbacks. + +The client order is: + +1. publish final matches/cache and run `onLeave`/`onEnter`/`onStay`, +2. emit `onLoad`, then `onBeforeRouteMount`, while the transaction is current, +3. wait for the framework transition acknowledgement to settle, +4. publish `resolvedLocation` and `idle`, +5. emit `onResolved`, and +6. emit `onRendered` only if the acknowledgement was `true` and the same + transaction is still current. + +Each reentrant callback can start another navigation. Checking that the +transaction is still current after each publication boundary suppresses stale +later events. In particular, an `onResolved` navigation suppresses the old +transaction's `onRendered`. + +Route lifecycle callbacks are invoked directly and are expected not to throw. +The coordinator does not carry a second error-handling path for callback +failures. All `onLeave` callbacks run before callbacks for retained or newly +entered routes; the relative ordering of `onEnter` and `onStay` is not a public +contract. + +Server render results are published request-locally and run the documented +route `onLeave`/`onEnter`/`onStay` callbacks against the previous server +generation after final matches have been installed. Server redirects do not +publish a render lane or run those callbacks. + +Terminal outcomes do not change route membership. Client and server state keep +the complete structurally matched branch, lifecycle compares that full branch, +and renderers derive the visible prefix from match status. Projection likewise +stops after the terminal match. SSR transport may serialize only that terminal +prefix because the client can reconstruct hidden structural descendants without +executing them. + +## Pending presentation + +Pending UI is presentation, not partial semantic commit. + +An exact successful match remains successful while `beforeLoad` or a blocking +loader revalidates it only when the same successful, non-not-found prefix is in +both the transaction's committed base and its starting presentation. +`isFetching` exposes that work without replacing its rendered UI. A cache-only +success, a different match ID, or a success hidden below a terminal boundary has +no retained presentation and remains eligible for pending UI. Explicit +force-pending invalidation already changes the committed generation to pending +and therefore overrides retention. + +The initial pending offer for a fuzzy not-found lane waits until lazy route +options resolve its boundary. This prevents a provisional ancestor boundary +from replacing the mounted presentation before ownership moves to a lazy child. + +The first unresolved boundary is the only pending candidate. Its route or the +router default must provide a pending component, and its effective `pendingMs` +must allow presentation. Core does not skip an ineligible ancestor to expose an +unrelated deeper fallback. + +A successful route without a loader still participates in chunk readiness and +projection, but is not changed back to pending merely because a descendant has +blocking work. + +When pending is offered: + +- `stores.matches` receives a flight-free snapshot of the complete destination + lane; +- the selected boundary is marked pending; +- descendants remain observable in state; and +- the renderer stops at the boundary. + +There is one pending session in `router._pending` and one absolute deadline: + +```text +reveal deadline -> exact render acknowledgement -> minimum-visible deadline +``` + +The session also remembers the pending component identity. An active client +lane loading a lazy route chunk can install a more specific `pendingComponent` +after the default fallback has already rendered. Once that pending component is +ready, core re-offers the same lane so the framework can replace the fallback +without creating another pending session or deadline. + +The reveal deadline is anchored to the transaction's lane-level `startedAt`. +Discovering lazy pending options later, advancing to another boundary, or +retrying the offer does not restart `pendingMs`. If the absolute deadline is +already past when a pending component becomes eligible, core publishes it in +the current turn instead of introducing a `setTimeout(0)` race. + +`pendingMinMs` starts only after the framework confirms that the pending +publication rendered. A superseded publication that never rendered creates no +minimum-visible obligation. + +Core considers actual non-success matches and an exact pending presentation in +route order. An earlier ineligible successor boundary therefore retires the old +clock without replacing the painted fallback, and a later occurrence of that +old boundary in the same transaction cannot resurrect its minimum. + +Hydration or a redirect can leave an already visible pending presentation +without a pending session that owns its original acknowledgement. When there is +no competing semantic boundary, core conservatively treats that presentation as +rendered and starts its minimum from the takeover time instead of delaying its +reveal again. + +A successor may take over timing only when its selected boundary has the same +match ID. It keeps the existing deadline but republishes a full snapshot from +the successor, so pending UI cannot show stale search, params, or context from +the superseded navigation. Normal route matches preserve position with their +IDs; the deprecated relocatable `notFoundRoute` is not given separate positional +session identity. Changing the selected boundary discards the old session. + +## Exact framework acknowledgement + +`startTransition` returns a promise whose boolean result has a precise meaning: + +- settlement means the framework transition can no longer block navigation + completion; +- `true` means the exact requested match publication rendered; +- `false` means core must finish without emitting `onRendered` or starting a + pending minimum based on that publication. + +Framework transition wrappers are controlled adapters. Supersession settles an +older acknowledgement as `false`; core does not retain a prior presentation or +install a compensating restoration path for wrapper failure. + +React cannot await `React.startTransition` directly. Its adapter keeps one +router-owned acknowledgement tuple, and `Matches` settles that tuple from a +layout effect. A new expected publication first settles the previous receipt as +`false`, then stores the exact offered array before the transition callback +runs. This ordering matters because publication can invoke a route lifecycle +callback that synchronously starts and publishes a successor navigation. +Installing the expectation after the callback would let the superseded +publication replace the successor's receipt. + +An already-settled router mounted into React uses the same acknowledgement slot +for its initial `onRendered` event. It therefore emits only after the exact match +tree and its descendant layout effects have committed, rather than from the +earlier history-subscription effect. + +While a receipt is pending, the aggregate match subscription selects the exact +offered array instead of reconstructing an equivalent presentation. The layout +effect acknowledges only that reference. A suspended older render can therefore +never satisfy a newer receipt merely because its IDs or statuses look the same. +No generation counter or structural signature is needed. + +Solid awaits its transition, and Vue awaits its render tick. For an +already-settled Solid mount, history subscription remains before the route tree +while a post-match notifier emits the initial `onRendered` event after +descendant mount effects. + +React assumes one provider and one router. Keeping the tuple on that router lets +the render tree and core share the exact same receipt without component-local +generation state, structural signatures, or router-swap machinery. + +Every core write passed to `startTransition` must notify the aggregate matches +store even if much of the lane is structurally reused. Suppressing the write can +strand the acknowledgement promise. + +## `isFetching` and background reloads + +`isFetching` is public presentation state. It is observable during normal +`beforeLoad`, normal loaders, and background loader refreshes. + +For a foreground navigation this means the destination match exposes its phase +once the destination lane is presented. Before pending publication, a +destination-only match remains private; a same-ID source match can be reconciled +to the active phase earlier. Background reloads operate on the already +presented lane and therefore expose their phase immediately. + +A background reload keeps successful loader data visible while a private +candidate runs. The full presented lane remains installed and the affected +match reports the active phase. Completion clears fetching state whether the +candidate publishes, fails, or is superseded. A successor may join its loader +flight, but never adopts the private candidate lane. + +Background loader and chunk work may begin and settle while the foreground +publication renders. Background reduction, projection, and publication do not +start until the foreground transition acknowledgement settles. A fast refresh +therefore cannot replace the exact generation that the framework still needs to +acknowledge. + +When background tasks exist, execution creates their settlement observer +eagerly alongside foreground reduction and retains that promise in the lane +result. `runBackground` consumes the same settlement chronology after the +foreground acknowledgement. Recreating the observer then would process work +that already settled by task attachment or iteration order and could change +which error, not-found, or descendant redirect wins. Retaining this promise +preserves the observed settlement order; it does not grant permission to publish +or define when the lane is complete. + +Background work starts from an exact committed base. Before projection it uses a +fully private lane, including clones of untouched matches, so asynchronous asset +hooks cannot mutate committed objects without a store publication. + +Final background publication requires both: + +```text +router._tx is the owner +router._committed is the exact base +``` + +If either check fails, the entire staged lane is discarded and all candidate +and clone resources are released. A successful background publication replaces +the semantic/presented lane atomically but does not change location, foreground +status, or foreground navigation lifecycle events. + +Foreground completion does not join background publication. After the +foreground acknowledgement, the refresh continues independently and may publish +before or after `resolvedLocation`, `idle`, and `onResolved`. Active work +remains publicly observable through `isFetching`; any later publication still +requires the owner/base identity check. + +An error or not-found from background work also stays private through reduction +and projection, then may atomically replace the successful base with the full +matched branch carrying its terminal boundary. Hidden descendants retain route +membership, so background publication does not synthesize leave/enter lifecycle +events. It is not published incrementally. + +Background redirects use the same control-flow and ownership rules as foreground +redirects. A losing background lane cannot redirect. + +## Invalidation, cache clearing, and development refresh + +Invalidation creates a new semantic generation and reloads through the normal +transaction path. It does not turn `stores.matches` into a planning lane. + +Filtered invalidation evaluates committed, cached, active-transaction, and +active-preload matches and collects the selected match IDs. Every committed and +cached generation with one of those IDs is made invalid. Cached matches are +already settled successes, so their data owner is marked invalid in place. +Matching active preload owners are retired first, which prevents older +speculative work from clearing that stale mark or publishing fresh cache data; +the lane signal remains the publication fence if its loader outcome already +fulfilled. The loader discovery entry is also detached before the superseding +load. Unselected preload lanes remain active. This ID-wide rule prevents a +cache-first or in-flight same-ID generation from escaping invalidation merely +because a different generation was the one passed to the filter. Route context +retains same-ID cacheability across this replacement and needs no separate +invalidation marker. + +Invalidated successful data may remain visible until pending or terminal +publication, depending on reload mode. Error/not-found generations reset through +the same loading protocol rather than becoming cache successes. + +Cache clearing first snapshots every selected cache match and active preload so +a throwing public filter changes no authority. It then prunes both authorities +and directly releases every discarded match lease. When the last lease is +discarded, cache clearing removes the discovery entry +instead of preserving the normal zero-owner navigation handoff. Only after all +leases and discovery entries are detached does it abort the collected flight and +preload-lane controllers. A public loader signal can synchronously reenter from +its abort listener; that reentrant load must observe the cleared authorities and +every removed lease as already detached. Unselected concurrent preloads keep +shared flights discoverable, and every later cache admission must still have a +live producing-lane signal and pass the per-match cache-entry identity check +captured during planning. Cache clearing does not cancel the current transaction, +so an active navigation loader that settles afterward may establish a new cache +generation. Invalidation is the API that replaces active semantic generations. + +Development refresh is deliberately aggressive about reuse. It removes all +loader flights from discovery, discards active preloads and cache entries, and +rematches with committed/cache reuse disabled so obsolete params, context, +loader data, or projected assets cannot seed the refreshed lane. Selected cache +and preload resources are detached before their controllers are aborted. + +Before publication, a failed or superseded refresh leaves the painted +presentation alone because its candidate is still private. Once published, the +refresh is the accepted semantic and presentation generation even while exact +framework acknowledgement is pending. Publication uses the ordinary commit +ownership transfer, releases the replaced generation immediately, consumes any +obsolete hydration handoff, and retains no prior cache or presentation +checkpoint. + +A rapid successor refresh rematerializes again, settles the older framework +receipt as `false`, and owns convergence and public completion through the same +`_tx` and `awaitCurrent` chain as ordinary navigation. The older transaction +releases only private background work that did not transfer. No refresh has +authority to restore a predecessor or resolve a successor's commit promise. + +## Speculative preloading + +A preload uses the same match, contextualize, reduce, and project phases as +navigation, but it never becomes `_tx` and never publishes match presentation. + +Its match/cache ownership effects are limited to: + +- joinable same-ID loader flights; and +- individual successful preload loader generations entering the loader cache as + they settle. + +A preload can also install durable lazy route options through the separate +route-chunk owner described above. That is route definition readiness, not +authority over a completed match lane or `beforeLoad` result. + +Preload lane-local matching, route context, validation, cancellation, and +`beforeLoad` outcomes do not become authority for another preload or a later +navigation. Consumers that join its same-ID loader flight nevertheless share +that flight's normalized outcome. After a normal standalone preload redirect, +the private chain continues only if that lane's controller was still present and +was successfully removed from `_preloads`; replacing an unrelated `_tx` does not +suppress it. The chain remains depth-bounded, never follows `reloadDocument`, +and never publishes presentation or history. + +The public `preloadRoute` result describes the speculative lane, not merely its +cacheable subset. An error or not-found therefore resolves with the terminal +match array while any eligible successful loader generations can still enter +the cache. Cancellation or control flow that does not yield a reusable lane can +resolve `undefined`. + +Each preload loader task uses the shared settlement-time cache admission rule: +it compares the current cache entry for its match ID with the entry captured when +that task was planned. It cannot overwrite a cache generation installed since +that plan. Admission does not wait for whole-lane success. A distinct successful +generation may coexist with an older committed same-ID generation; this changes +future planning precedence, not current presentation. A duplicate sharing the +already accepted flight is discarded. + +`preloadRoute` also works on a server router. It runs the same speculative +protocol with `preload: true`, can return matches and populate that router's +loader cache, and does not replace the request's location, committed lane, or +presentation. Normal request loading still uses the request-local server lane +and calls its hooks with `preload: false`. + +## Server loading and request lifetime + +Server loading is request-local, so it does not need the client `_tx` +coordinator. It still uses the same semantic phases, context ordering, outcome +normalization, settlement-order failure selection, semantic parent promises, +and projection behavior. + +Each server match gets the public controller passed to its callbacks. The +request signal—not the mere fact that a callback aborted that controller—is the +request-liveness authority checked across contextualization, loaders, chunk +readiness, terminal boundary readiness, and projection. A request abort cancels +the whole lane. A loader error or not-found does not abort already-started +descendants before selection, so a later descendant redirect can still win. +After selection, applying the terminal boundary aborts the hidden suffix that +the result no longer owns. Redirect aborts the whole request-local lane. + +The request signal also governs the surrounding request pipeline. The generic +handler races manifest lookup, route loading, custom dehydration, and the +handler/render callback. Start applies the same rule to entry and router +resolution, middleware, manifest work, and redirect finalization. An abort can +therefore settle the handler during every awaited phase rather than waiting for +user code that ignores its signal. + +A raced promise may still fulfill after abort. If that late value owns an SSR +stream, the race disposes it instead of allowing it to regain response or +cleanup authority. Other user promises may continue executing, but after abort +they cannot publish a response or inject SSR output. If cleanup occurs while +application dehydration is awaited, dehydration returns before starting +serialization; injection and serialization completion also ignore later work. + +A server result has one of two forms: render status plus matches, or an HTTP +redirect. Redirects short-circuit framework rendering and preserve their real +status, `Location`, and custom headers. + +Projection parity is intentional: server `head`, `scripts`, and `headers` use +the final reduced lane and loader data. As on the client, failures are logged and +swallowed. + +### Stream cleanup handoff + +Until a response is accepted, the request handler owns router SSR cleanup. A +non-stream response, redirect, or failure leaves cleanup with the handler. An +accepted SSR stream transfers that ownership to the response and is immediately +bound to the request signal, so an abort after handoff still disposes it. + +Disposal is idempotent and severs router SSR ownership before best-effort body +cancellation. This order matters because a custom or framework stream may ignore +or indefinitely delay cancellation. Replacing a stream response, resolving a +redirect from it, or stripping a HEAD body disposes the old stream under the +same request signal before accepting the replacement. + +Framework renderers connect request abort to their upstream renderer as well as +the router stream transform. Normal completion, downstream cancellation, +request abort, renderer failure, and stream lifetime timeout all converge on the +same cleanup authority; none creates a second response owner. + +Once a server lane is accepted for rendering, its match controllers are +registered with that same SSR cleanup authority. They remain live through +dehydration and response streaming so deferred loader work can finish while the +response is active, then abort when the response or stream lifetime ends. + +## Selective SSR + +SSR policy is the first parent-to-child serial step, before route context, +params/search validation handling, and `beforeLoad`: + +- `true` runs server `beforeLoad` and loaders, loads render chunks, projects + assets, and renders the component. +- `'data-only'` runs server `beforeLoad` and loaders and projects `head`, + `scripts`, and `headers`, but does not render that route component. +- `false` skips server `beforeLoad`, loaders, and component chunks. The first + `false` boundary still projects `head`, `scripts`, and `headers` for its server + shell, then projection stops before descendants that inherit `false`. Route + context and params/search validation still run, so their errors remain real + server outcomes. + +A parent restriction cannot be relaxed by a child: `false` remains false, and a +`'data-only'` parent caps a child requesting `true` at `'data-only'`. + +If a functional `ssr` option throws, the inherited/default policy is established +before calling it. The failure therefore retains the correct boundary +renderability instead of leaving `ssr` undefined. An error or not-found from +the policy still reconstructs route context for its boundary. If route context +also fails, the original policy failure keeps precedence. Redirects remain +control flow and skip route-context reconstruction. + +Shell mode resolves and dehydrates the root semantic match while the presented +server lane may include the first client-only pending boundary and its +descendants. This permits server and initial client presentation to agree. + +## Hydration handoff + +Hydration reconstructs server work; it does not run a competing hydration +loader. While reconstruction is asynchronous, its controller is `_preflight`. +Under the framework-supported startup order, `RouterClient` finishes hydration +before mounting the provider that starts the initial client load, so no client +transaction or descendant preload competes with reconstruction. Core does +not enforce that ordering as a blanket guard. A navigation can supersede hydration +by installing a new `_preflight`; a preload started directly in this gap is +unsupported rather than blocked. + +The identity of `_preflight` proves that reconstruction is still current. A +replacement installs itself before aborting the prior controller. The same +controller interrupts asynchronous application hydration and chunk work, and +every asynchronous phase checks that identity before mutating or publishing. + +Once hydration has accepted a semantic prefix and is ready to publish it, +`_preflight` is no longer the right authority: no planning operation is in +progress, but the first normal client load may still need to continue that +prefix. Hydration therefore installs `_handoff`, a temporary two-phase transfer, +and detaches its controller from `_preflight`. The handoff is the one owner that +can decide whether the initial load may continue the prefix; it is not a second +completion promise or a general cache. + +The client router is fresh when hydration begins. Application `hydrate` hooks +may restore external integration state or update router options, but must not +call router loading or preloading before reconstruction finishes. Core does not +guard those calls; this is part of the supported startup order. + +The high-level process is: + +1. install serialization adapters and application-dehydrated data, +2. match a fresh candidate lane for the browser location, +3. accept the identity-compatible serialized lane as the ordered prefix + guaranteed by the document protocol, +4. copy server loader data, `beforeLoad` context, terminal state, and effective + SSR policy into private candidates, and install each transported effective + SSR value on its route so a functional server policy is not re-evaluated, +5. start exactly the chunks required by the accepted prefix and any selected + terminal boundary concurrently, then consume their outcomes in route order + so the earliest failed position can retire its suffix without waiting for + irrelevant descendants, +6. rebuild route context parent-first, +7. project client `head` and `scripts` through the same projection + function used after a normal client load, and +8. publish accepted semantic work and the complete structural presentation. + +Hydration relies on the framework transport contract. For normal and selective +SSR, the data was produced for the exact document URL by the same route build, +and its serialized matches form an ordered prefix of the client lane. An SPA +shell uses the same prefix protocol for its root-only payload; the framework is +responsible for serving a shell that applies to the document. Core does not +serialize a second URL identity. Instead, hydration bounds reconstruction to +the local lane and validates every transported position with a compact match ID. + +A mismatch ends the accepted prefix and leaves the local suffix for normal +client loading. A longer server lane is accepted only through a local global +not-found boundary that already caps the branch; otherwise no transported +prefix is accepted. A terminal server error, not-found, or global not-found caps +client execution so omitted descendants do not run. The client still creates +those descendants as structurally matched but unexecuted matches. A loaderless +descendant may initially have `status: 'success'`, so status alone does not prove +that hydration ran its context or route hooks. Terminal hydration loads the +chunks required by the selected error/not-found boundary, but not normal +component chunks below it. Neither route context nor projection runs below the +transported boundary. +The transported terminal route remains authoritative even when its effective +SSR policy is `false` or `'data-only'`: route context or validation was still +allowed to fail on the server, so hydration must not turn that outcome into an +unresolved client-only route. Before-load and loader work remain skipped there +according to the server policy. + +Every executed context, `head`, and `scripts` hook nevertheless receives the +complete locally matched candidate lane. Hook arguments describe structural +membership; the accepted prefix describes execution authority. + +If a required chunk or route-context reconstruction fails, hydration preserves +only the successfully reconstructed committed prefix. The public presentation +still contains the complete locally matched lane, so a +terminal server boundary does not make route membership disappear while its +client reconstruction is retried. Eligible transported loader successes cross +the normal loader-cache boundary with merged context and `beforeLoad` +contribution removed. Because `resolvedLocation` remains unset, normal +initial client loading retries the failed boundary or context and finishes the +unresolved suffix. + +For a non-terminal selective-SSR handoff, the semantic committed prefix is the +complete contiguous transported prefix accepted as resolved. The first +`'data-only'` match is the presentation continuation boundary, but it does not +truncate semantic adoption: later transported successful data-only matches are +also committed and keep their server loader and `beforeLoad` results. A `false`, +pending, or otherwise unresolved match is the first semantic continuation +boundary and is not committed. Presentation can still contain the complete +candidate lane and marks its first presentation boundary pending as needed. In +particular, a shorter non-terminal server payload ending in a pending +`ssr: false` match is a valid selective-SSR handoff: hydration accepts the +resolved ancestors, presents the complete local branch, and lets the normal +initial client load execute from that client-only boundary. + +For a successfully reconstructed terminal handoff, transport remains +prefix-capped but committed and presented membership use the complete locally +matched branch. Matches below the terminal boundary remain unexecuted and +hidden; they own no transported `beforeLoad` result or loader data. This keeps +public membership and lifecycle stable without increasing the SSR payload or +loading unreachable client chunks. If reconstruction fails, only the accepted +prefix is committed as described above; the complete branch remains +presentation, not semantic reuse authority. + +Only the subsequent normal client load may transfer the whole hydration +prefix, and only while the exact committed-prefix owner, raw history-state +object, browser href, and live hydration controller remain current with no +active transaction. Core captures the raw browser href and history-state object +so a reentrant navigation from an initial lifecycle event cannot hand the old +document's work to a successor location. Finish also validates the transported +match IDs against the newly matched lane. Core does not coordinate speculative +work started between raw `hydrate()` and that load; framework adapters own the +supported ordering. + +The two-phase transfer proceeds as follows: + +1. Before public navigation events or matching, the initial client-load planner + probes the handoff without consuming it. +2. It installs its own `_preflight`, emits the events, matches a private lane, + and asks the handoff to finish the transfer. +3. Finish revalidates handoff identity, transaction absence, hydration + controller liveness, captured location identity, and the exact committed + owner. +4. On rejection, the handoff clears itself before aborting its controller, + so abort listeners cannot reenter and claim a rejected handoff. +5. On acceptance, the accepted matches replace the planner's private copies. A + successfully reconstructed terminal handoff owns the complete local branch, + even though its SSR payload was prefix-capped, so it has no local suffix to + remove. For a non-terminal handoff, the remaining suffix stays in the lane + and transfers to the hydration controller so one signal owns the + continuation. +6. The handoff remains available across synchronous reentrancy until the + current load installs `_tx`. That load installs `_tx` before clearing the + handoff; stale planners may release only their own private work. + +This ordering closes the gap between hydration publication and client +transaction installation without making the handoff an independent completion +authority. If reconstruction is superseded before publication, the `_preflight` +identity check aborts its private work. If the published handoff becomes +incompatible, its failed identity check retires the hydration controller +and starts normal client loading from a fresh preflight. + +Development refresh rematerializes instead of claiming the prefix. Its +transaction carries the existing handoff only until refreshed matches publish; +that one-way publication consumes the handoff and retires the hydration +controller before lifecycle reentrancy. A refresh superseded before publication +leaves the handoff for its rematerializing successor. + +Generic framework `RouterClient` components signal streaming hydration +completion after the hydration attempt settles, including rejection. This +finally-style handoff allows bootstrap globals to be removed once the server +stream has also ended without stranding the stream on a hydration failure. + +Each framework owns one module-level hydration promise for the document. The +SSR protocol provides one global bootstrap and one `RouterClient`; additional +client-only routers use `RouterProvider` and do not independently consume that +bootstrap. The promise deduplicates framework rendering/replay only. It replaces +neither `_preflight` reconstruction authority nor `_handoff` +continuation authority. + +## Change checklist + +The detailed sections above are the source of truth. Use this shorter checklist +to find the failure modes a change needs to test; do not duplicate the full +algorithm here. + +### Publication and reentrancy + +- Does every asynchronous write recheck its exact owner immediately before the + write: `_tx`, `_preflight`, `_handoff`, an active-preload controller, or the + request signal? +- Does a background publication check both its `_tx` and the exact `_committed` + base from which it was derived? +- If an abort, lifecycle callback, or store publication can synchronously + reenter, are replacement owners installed and discarded resources detached + before that callback can run? +- Does framework acknowledgement settlement still gate resolved/idle + completion, with only an exact rendered publication producing `true` and + enabling `onRendered` or `pendingMinMs`? + +### Matches, loaders, and cache ownership + +- Are `_committed` semantic state and `stores.matches` presentation kept + separate? Are match-ID cache compatibility and route-ID lifecycle identity + also kept separate? +- Does every normal client lane run its own `beforeLoad` chain? Hydration is + the only completed-work exception; preloads may share loader data or flights, + but never their merged context, `beforeLoad` result, or control flow. +- Is flight discovery separate from lease ownership? Does every copied owner + acquire exactly one lease and every discarded owner release it exactly once? +- Are registry entries and all discarded leases detached before any collected + controller is aborted? +- Do cache admission, invalidation, and clearing preserve the intended + generation identity, including the rule that an unexecuted descendant below a + cutoff cannot evict a newer same-ID cache entry? +- Does each child `parentMatchPromise` follow the fresh semantic parent + generation rather than the visible stale parent? + +### Outcomes and presentation + +- Do error/not-found selection, required ancestor readiness, component chunks, + and descendant redirects still reduce to one final outcome? +- Are redirects materialized while their source route owns target-construction + errors, with shared flights retaining only the raw redirect and each lane + building its own target once? +- Does cancellation require both exact signal identity and proof that the signal + is aborted, and does a canceled lane release every private background + candidate without changing presentation? +- Does pending or terminal publication retain the complete structural branch + while rendering and outputs apply their relevant cutoff, including the + selective-SSR hydration asset-prefix exception? +- Are pending snapshots flight-free, and do reveal/minimum timing remain owned + by one transferable pending session? +- Do projection failures remain logged and swallowed, and does `isFetching` + clear on every success, failure, cancellation, and supersession path? + +### Server and hydration lifetime + +- Can request abort settle every awaited server phase, and can late work no + longer publish a response or injected output? +- Does exactly one owner perform SSR cleanup, with router ownership released + before best-effort stream cancellation? +- Does hydration validate transported match IDs, execute only the accepted + prefix, retain the complete local branch, and preserve any verified + `'data-only'` asset prefix? +- Does the initial-load handoff revalidate its controller, browser history entry, + committed owner, and rematched IDs? Do framework adapters still obey the + no-preload startup gap described above? + +If a fix fails one of these checks, consolidate ownership instead of layering a +special case on top. + +## Testing changes + +Tests must assert public behavior, not the internal tuple shape, phase tag, +private promise, timer, or field name used to implement it. + +Useful assertions include: + +- rendered pending/error/not-found content and the boundary that rendered it; +- the complete public matches array and `isFetching` transitions; +- loader/before-load call counts, contexts, parent promises, and abort signals; +- navigation completion, lifecycle callbacks, and their surrounding router + events, without asserting a relative `onEnter`/`onStay` order; +- preload/cache reuse observable through user loader calls; +- HTTP status, headers, redirects, and absence of renderer invocation; +- request-abort settlement, late-stream disposal, and single stream cleanup; +- hydration output, completion on rejection, and absence of client reruns below + server terminal boundaries; +- absence of stale data/assets after supersession; and +- framework acknowledgement tied to the actual rendered destination. + +While `tx.done` suspends a pending React destination, React may retain the previous +source tree in the DOM but hide it. Pending tests should assert visible user +content, not physical absence of the old route's nodes. + +When testing a boundary, give root, parent, and child visibly distinct output. +An assertion such as `/Not Found/` or `/Error/` can pass at the wrong boundary +and is not sufficient. + +Run focused category tests while changing the loader, then affected core and +framework unit/type suites, selective-SSR E2E tests for server/hydration changes, +and the bundle-size benchmark for any client runtime change. diff --git a/packages/router-core/benchmarks/ssr-streaming/.gitignore b/packages/router-core/benchmarks/ssr-streaming/.gitignore new file mode 100644 index 0000000000..6628455c0a --- /dev/null +++ b/packages/router-core/benchmarks/ssr-streaming/.gitignore @@ -0,0 +1 @@ +/results/ diff --git a/packages/router-core/benchmarks/ssr-streaming/README.md b/packages/router-core/benchmarks/ssr-streaming/README.md new file mode 100644 index 0000000000..bda5d4ee12 --- /dev/null +++ b/packages/router-core/benchmarks/ssr-streaming/README.md @@ -0,0 +1,162 @@ +# SSR streaming benchmark + +This harness compares two Git revisions of router-core SSR streaming. Transform +runs validate byte count, SHA-256 digest, markers, selected transport API, and +lifecycle counts. Isolated transform timing includes hashing and marker scans; +warm transform timing moves those two checks into preflight requests. +Production-owner suites validate byte count, final owner state, and the 64 KiB +output chunk cap. Isolated owner timing includes hashing; warm and soak suites +use one separate digest-validating preflight per implementation. + +Generated JSON and Markdown summaries stay under `results/` and are ignored by +Git. CPU profiles default to a `*-profiles/` directory beside the configured +JSON output. `--profile-dir` overrides that location. + +## Quick start + +Compare the latest `origin/main` with `HEAD`: + +```sh +node packages/router-core/benchmarks/ssr-streaming/run.mjs \ + --origin=origin/main \ + --candidate=HEAD \ + --suite=common \ + --warmups=20 \ + --iterations=30 \ + --batch-requests=1000 \ + --output=packages/router-core/benchmarks/ssr-streaming/results/common.json +``` + +Use `--candidate=worktree` while testing an uncommitted optimization. Final +comparisons should use Git revisions so the result can be reproduced. + +Run the focused queue-mechanism benchmark with: + +```sh +pnpm --dir packages/router-core exec vitest bench \ + tests/hydrationQueue.bench.ts --run +``` + +## Suites + +| Suite | Purpose | Default measurement | +| ----------------- | ------------------------------------------------------------------------ | ------------------------------------------------- | +| `smoke` | Short raw, fast, and merge check | One isolated process per cell | +| `common` | Normal 1–64 KiB hydration payloads across React, Solid, and Vue profiles | Warm paired batches | +| `safe-points` | Many small React and Solid renderer records | Warm paired batches | +| `coalesced-close` | React script safe points inside large renderer chunks | Warm paired batches | +| `small-memory` | Small React raw, fast, and merge responses | Isolated processes with forced GC | +| `primary` | Large hydration, closing-tag, renderer-record, and backlog stress | Isolated processes with forced GC | +| `source` | Large flat and rope router sources | Isolated processes and direct `encodeInto` probes | +| `strings` | Large flat and rope renderer string records | Warm paired batches | +| `owner` | Production hydration owner and maximum legal backlogs | Isolated processes with forced GC | +| `owner-warm` | Production hydration owner latency | Warm paired batches | +| `owner-soak` | Production hydration owner retention after repeated requests | Post-return forced-GC checkpoints | + +Filter cells with comma-separated `--scenario` and `--mode` values. Isolated +suites also accept `--implementation` and `--runs`. Warm suites accept +`--warmups`, `--iterations`, and `--batch-requests`. + +The `coalesced-close` suite keeps hydration waiting until renderer EOF. Its +1 KiB and 64 KiB filler follows a script in one chunk, so returning at that +script can repeat the document-close search over the remaining bytes. It also +covers a close in the next chunk and a late-script control with little content +left to rescan. The filler contains complete HTML elements. An empty final +input record prevents source prefetch from finishing hydration before the +coalesced content drains. These cases measure repeated scanning within one +chunk; `safe-points` continues to measure separate small renderer records. + +The `owner-warm` suite requires both revisions to contain +`packages/router-core/src/ssr/hydrationScripts.ts`. Older `origin/main` +revisions do not contain this file. After the owner exists in a committed +baseline, use `--origin=HEAD --candidate=worktree` for later changes. + +During the initial owner introduction, run an isolated worktree-only cell: + +```sh +node packages/router-core/benchmarks/ssr-streaming/run.mjs \ + --candidate=worktree \ + --suite=owner \ + --implementation=worktree \ + --scenario=hydration-owner-16x1k \ + --runs=1 +``` + +For example: + +```sh +node packages/router-core/benchmarks/ssr-streaming/run.mjs \ + --origin=HEAD \ + --candidate=worktree \ + --suite=common \ + --scenario=hydration-32k \ + --warmups=30 \ + --iterations=50 \ + --batch-requests=2000 \ + --output=packages/router-core/benchmarks/ssr-streaming/results/candidate.json +``` + +## What the numbers mean + +Warm suites load both implementations into one Node process. They alternate which +implementation runs first for every request pair and at every batch boundary. +The warm-up count is per implementation: each warm-up iteration runs one +request against both revisions. Timed samples are complete request batches. + +For isolated transform cells, `elapsedMs` includes incremental hashing and +marker validation. For warm transform cells, it measures a byte-counted drain +after validated warm-up requests. `wallElapsedMs` also includes synthetic +request setup and lifecycle checks. Merge cells include source creation by the +fake producer. + +Isolated suites start a new Node process for each cell. Memory values are +sampled high-water deltas above a forced-GC baseline, not exact allocation +peaks and not proof that a leak is absent. + +Treat changes below 1% as inconclusive unless several independent processes +repeat the result. In soak output, heap, external, and ArrayBuffer checkpoints +describe retained JavaScript-visible memory after forced GC. RSS is allocator +high-water behavior and is not, by itself, evidence of a leak. Use unit and +integration tests for backpressure, cancellation, abort, timeout, Unicode, and +split-boundary correctness. The throughput harness does not replace those +tests. + +## Scope and limits + +- Normal transform suites use `Uint8Array` renderer records. The `strings` + suite isolates Node renderer string records. +- React uses the `script-close` safe point, Solid uses `record-end`, and Vue + uses only the universal router boundary, document close, and EOF points. +- The fixed boundary suffix lets old and new implementations consume identical + bytes and matches the production transport. +- The worker supplies the legacy `origin/main` transport and the current + hydration-output transport so the intended baseline and candidate can share + one fixture. It does not preserve intermediate private transport fields or + benchmark the complete production hydration producer. +- The `owner` suites call the production hydration owner directly. They do not + include the transform or a framework renderer. +- CPU results describe this Node and machine. They do not establish browser or + Cloudflare Worker performance. + +## Reproducibility + +The runner materializes the complete tracked `packages/router-core/src` tree +for both inputs before it builds. With `--candidate=worktree`, it first copies +one immutable worktree snapshot so later edits cannot change the measured +artifact. Results record available commit IDs, both source-tree hashes, bundle +hashes, platform details, and a hash of the measured source pair. Child +processes and bundles use `NODE_ENV=production`. + +Before publishing a conclusion: + +1. Use clean Git revision names for both sides. +2. Run the same harness revision for both implementations. +3. Verify matching output bytes and digests. +4. Repeat latency comparisons in fresh processes when the expected change is + small. +5. Run memory and correctness tests before retaining an optimization. + +For attribution only, `--cpu-prof=true` writes profiles into a sibling +`*-profiles/` directory by default. Use `--profile-dir=...` to choose another +new or empty directory. Profiles also contain fixture and validation work, so +use them as hints rather than standalone proof. diff --git a/packages/router-core/benchmarks/ssr-streaming/run.mjs b/packages/router-core/benchmarks/ssr-streaming/run.mjs new file mode 100644 index 0000000000..2d1f2245c2 --- /dev/null +++ b/packages/router-core/benchmarks/ssr-streaming/run.mjs @@ -0,0 +1,860 @@ +import { execFileSync, spawnSync } from 'node:child_process' +import { + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + readdirSync, + rmSync, + writeFileSync, +} from 'node:fs' +import { arch, cpus, platform, tmpdir } from 'node:os' +import { dirname, join, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import { createHash } from 'node:crypto' +import { build } from 'esbuild' + +const here = dirname(fileURLToPath(import.meta.url)) +const repo = resolve(here, '../../../..') +const dependencyNodePaths = [resolve(repo, 'packages/router-core/node_modules')] +const args = Object.fromEntries( + process.argv.slice(2).map((arg) => { + const [name, value = 'true'] = arg.replace(/^--/, '').split('=', 2) + return [name, value] + }), +) +const knownArgs = new Set([ + 'suite', + 'origin', + 'candidate', + 'runs', + 'output', + 'keep-artifacts', + 'cpu-prof', + 'profile-dir', + 'scenario', + 'mode', + 'implementation', + 'warmups', + 'iterations', + 'batch-requests', +]) +for (const name of Object.keys(args)) { + if (!knownArgs.has(name)) { + throw new Error(`Unknown benchmark option: --${name}`) + } +} +const suite = args.suite ?? 'primary' +const suites = new Set([ + 'common', + 'safe-points', + 'coalesced-close', + 'small-memory', + 'smoke', + 'source', + 'strings', + 'owner', + 'owner-warm', + 'owner-soak', + 'primary', +]) +if (!suites.has(suite)) { + throw new Error(`Unknown benchmark suite: ${suite}`) +} +const isWarmSuite = + suite === 'common' || + suite === 'safe-points' || + suite === 'coalesced-close' || + suite === 'strings' || + suite === 'owner-warm' +const selectedImplementations = isWarmSuite + ? [] + : ['origin', 'worktree'].filter((implementation) => { + if (!args.implementation || args.implementation === 'all') { + return true + } + return args.implementation.split(',').includes(implementation) + }) +const unsupportedSuiteOption = ( + isWarmSuite + ? ['runs', 'implementation'] + : ['warmups', 'iterations', 'batch-requests'] +).find((name) => args[name] !== undefined) +if (unsupportedSuiteOption) { + throw new Error( + `--${unsupportedSuiteOption} is not supported by the ${suite} suite`, + ) +} +if ( + args['cpu-prof'] !== undefined && + !['true', 'false'].includes(args['cpu-prof']) +) { + throw new Error('--cpu-prof must be true or false') +} +const cpuProfiled = args['cpu-prof'] === 'true' +if (args['profile-dir'] !== undefined && !cpuProfiled) { + throw new Error('--profile-dir requires --cpu-prof=true') +} +const originRef = args.origin ?? 'origin/main' +const candidateRef = args.candidate ?? 'HEAD' +const originSha = execFileSync('git', ['rev-parse', `${originRef}^{commit}`], { + cwd: repo, + encoding: 'utf8', +}).trim() +const candidateSha = + candidateRef === 'worktree' + ? undefined + : execFileSync('git', ['rev-parse', `${candidateRef}^{commit}`], { + cwd: repo, + encoding: 'utf8', + }).trim() +const headSha = execFileSync('git', ['rev-parse', 'HEAD^{commit}'], { + cwd: repo, + encoding: 'utf8', +}).trim() +const runs = Number(args.runs ?? (suite === 'smoke' ? 1 : 3)) +const outputPath = resolve( + repo, + args.output ?? + `packages/router-core/benchmarks/ssr-streaming/results/${suite}.json`, +) +if (!outputPath.endsWith('.json')) { + throw new Error('Benchmark output must end in .json') +} +if (!Number.isInteger(runs) || runs < 1) { + throw new Error('--runs must be an integer greater than zero') +} +const keepArtifacts = args['keep-artifacts'] + ? resolve(repo, args['keep-artifacts']) + : undefined +if ( + keepArtifacts && + existsSync(keepArtifacts) && + readdirSync(keepArtifacts).length +) { + throw new Error('--keep-artifacts must name a new or empty directory') +} +const temp = keepArtifacts ?? mkdtempSync(join(tmpdir(), 'tsr-ssr-streaming-')) +mkdirSync(temp, { recursive: true }) +function cleanupTemporaryArtifacts() { + if (!keepArtifacts) { + rmSync(temp, { recursive: true, force: true }) + } +} +// Some setup and child-failure paths exit before the main try/finally can +// unwind. Register cleanup as soon as the temporary directory exists. +process.once('exit', cleanupTemporaryArtifacts) +const profileDir = cpuProfiled + ? resolve( + repo, + args['profile-dir'] ?? outputPath.replace(/\.json$/, '-profiles'), + ) + : undefined +if (profileDir) { + if (existsSync(profileDir) && readdirSync(profileDir).length) { + throw new Error( + `${args['profile-dir'] === undefined ? 'Default profile directory' : '--profile-dir'} must name a new or empty directory`, + ) + } + mkdirSync(profileDir, { recursive: true }) +} +const childEnvironment = { ...process.env, NODE_ENV: 'production' } + +function sourcePathsAt(ref) { + const output = execFileSync( + 'git', + ['ls-tree', '-r', '--name-only', ref, '--', 'packages/router-core/src'], + { cwd: repo, encoding: 'utf8' }, + ).trim() + return output ? output.split('\n') : [] +} + +function worktreeSourcePaths() { + const output = execFileSync( + 'git', + [ + 'ls-files', + '--cached', + '--others', + '--exclude-standard', + '--', + 'packages/router-core/src', + ], + { cwd: repo, encoding: 'utf8' }, + ).trim() + return output + ? output + .split('\n') + .filter((repositoryPath) => existsSync(resolve(repo, repositoryPath))) + .sort() + : [] +} + +function materializeSourceSnapshot(ref, sourceRoot, repositoryPaths) { + for (const repositoryPath of repositoryPaths) { + const target = join( + sourceRoot, + repositoryPath.slice('packages/router-core/src/'.length), + ) + mkdirSync(dirname(target), { recursive: true }) + writeFileSync( + target, + execFileSync('git', ['show', `${ref}:${repositoryPath}`], { cwd: repo }), + ) + } +} + +function materializeWorktreeSnapshot(sourceRoot, repositoryPaths) { + for (const repositoryPath of repositoryPaths) { + const target = join( + sourceRoot, + repositoryPath.slice('packages/router-core/src/'.length), + ) + mkdirSync(dirname(target), { recursive: true }) + writeFileSync(target, readFileSync(resolve(repo, repositoryPath))) + } +} + +function sourceSnapshotSha256(sourceRoot, repositoryPaths) { + const hash = createHash('sha256') + for (const repositoryPath of repositoryPaths) { + hash.update(repositoryPath) + hash.update('\0') + hash.update( + readFileSync( + join( + sourceRoot, + repositoryPath.slice('packages/router-core/src/'.length), + ), + ), + ) + hash.update('\0') + } + return hash.digest('hex') +} + +const originSourceRoot = join(temp, 'origin/packages/router-core/src') +const candidateSourceRoot = join(temp, 'worktree/packages/router-core/src') +const originSourcePaths = sourcePathsAt(originSha) +const candidateSourcePaths = + candidateRef === 'worktree' + ? worktreeSourcePaths() + : sourcePathsAt(candidateSha) +if (suite.startsWith('owner')) { + const ownerSourcePath = 'packages/router-core/src/ssr/hydrationScripts.ts' + const missingImplementations = [] + const requiredImplementations = isWarmSuite + ? ['origin', 'worktree'] + : selectedImplementations + if ( + requiredImplementations.includes('origin') && + !originSourcePaths.includes(ownerSourcePath) + ) { + missingImplementations.push(`origin (${originRef})`) + } + if ( + requiredImplementations.includes('worktree') && + !candidateSourcePaths.includes(ownerSourcePath) + ) { + missingImplementations.push(`candidate (${candidateRef})`) + } + if (missingImplementations.length > 0) { + throw new Error( + `The ${suite} suite requires hydrationScripts.ts in the selected revision(s). ` + + `Missing from ${missingImplementations.join(' and ')}.`, + ) + } +} +materializeSourceSnapshot(originSha, originSourceRoot, originSourcePaths) +if (candidateRef === 'worktree') { + materializeWorktreeSnapshot(candidateSourceRoot, candidateSourcePaths) +} else { + materializeSourceSnapshot( + candidateSha, + candidateSourceRoot, + candidateSourcePaths, + ) +} +const originSourceSha256 = sourceSnapshotSha256( + originSourceRoot, + originSourcePaths, +) +const candidateSourceSha256 = sourceSnapshotSha256( + candidateSourceRoot, + candidateSourcePaths, +) +const measuredSourcePairSha256 = createHash('sha256') + .update(originSourceSha256) + .update('\0') + .update(candidateSourceSha256) + .digest('hex') +const transformSources = { + origin: readFileSync( + join(originSourceRoot, 'ssr/transformStreamWithRouter.ts'), + 'utf8', + ), + worktree: readFileSync( + join(candidateSourceRoot, 'ssr/transformStreamWithRouter.ts'), + 'utf8', + ), +} +const hasHistoricalBufferGuards = { + origin: transformSources.origin.includes( + 'SSR router HTML exceeded maximum buffer', + ), + worktree: transformSources.worktree.includes( + 'SSR router HTML exceeded maximum buffer', + ), +} +const transformExportNames = { + origin: transformSources.origin.includes( + 'export function transformStreamWithRouter(', + ) + ? 'transformStreamWithRouter' + : 'transformReadableStreamWithRouter', + worktree: transformSources.worktree.includes( + 'export function transformStreamWithRouter(', + ) + ? 'transformStreamWithRouter' + : 'transformReadableStreamWithRouter', +} + +// The worktree transform imports protocol constants from hydrationScripts. +// Its producer is not used by this benchmark worker, so the Vite-only script +// string can stay empty in the benchmark bundle. +const scriptStringPlugin = { + name: 'script-string', + setup(build) { + build.onResolve({ filter: /\?script-string$/ }, (args) => ({ + path: args.path, + namespace: 'script-string', + })) + build.onLoad({ filter: /.*/, namespace: 'script-string' }, () => ({ + contents: 'export default ""', + loader: 'js', + })) + }, +} + +async function bundle(implementation) { + const sourceRoot = + implementation === 'origin' ? originSourceRoot : candidateSourceRoot + const entry = join(temp, `${implementation}-entry.ts`) + writeFileSync( + entry, + suite === 'owner' || suite === 'owner-soak' + ? `import { runHydrationOwner, runHydrationOwnerSoak } from ${JSON.stringify(resolve(here, 'worker.ts'))}\n` + + `import { createHydrationScripts } from ${JSON.stringify(join(sourceRoot, 'ssr/hydrationScripts.ts'))}\n` + + `const values = Object.fromEntries(process.argv.slice(2).map((value) => value.replace(/^--/, '').split('=', 2)))\n` + + `${suite === 'owner-soak' ? 'runHydrationOwnerSoak' : 'runHydrationOwner'}(createHydrationScripts, ${JSON.stringify(implementation)}, values.scenario)\n` + : `import { run, runProbe } from ${JSON.stringify(resolve(here, 'worker.ts'))}\n` + + `import { ${transformExportNames[implementation]} as transform } from ${JSON.stringify(join(sourceRoot, 'ssr/transformStreamWithRouter.ts'))}\n` + + `const values = Object.fromEntries(process.argv.slice(2).map((value) => value.replace(/^--/, '').split('=', 2)))\n` + + `if (values.probe) { runProbe(values.shape, Number(values.size), values.strategy) } else { await run(transform, ${JSON.stringify(implementation)}, values.scenario, values.mode) }\n`, + ) + const outfile = join(temp, `${implementation}.mjs`) + await build({ + entryPoints: [entry], + outfile, + bundle: true, + platform: 'node', + format: 'esm', + target: 'node20', + logLevel: 'silent', + nodePaths: dependencyNodePaths, + plugins: [scriptStringPlugin], + define: { 'process.env.NODE_ENV': '"production"' }, + }) + return outfile +} + +async function bundleWarmComparison() { + const entry = join(temp, 'warm-comparison-entry.ts') + writeFileSync( + entry, + suite === 'owner-warm' + ? `import { runWarmHydrationOwnerComparison } from ${JSON.stringify(resolve(here, 'worker.ts'))}\n` + + `import { createHydrationScripts as origin } from ${JSON.stringify(join(originSourceRoot, 'ssr/hydrationScripts.ts'))}\n` + + `import { createHydrationScripts as worktree } from ${JSON.stringify(join(candidateSourceRoot, 'ssr/hydrationScripts.ts'))}\n` + + `const values = Object.fromEntries(process.argv.slice(2).map((value) => value.replace(/^--/, '').split('=', 2)))\n` + + `const result = runWarmHydrationOwnerComparison({ origin, worktree }, values.scenarios.split(','), Number(values.warmups), Number(values.iterations), Number(values.batchRequests))\n` + + `process.stdout.write(JSON.stringify(result) + '\\n')\n` + : `import { runWarmComparison } from ${JSON.stringify(resolve(here, 'worker.ts'))}\n` + + `import { ${transformExportNames.origin} as origin } from ${JSON.stringify(join(originSourceRoot, 'ssr/transformStreamWithRouter.ts'))}\n` + + `import { ${transformExportNames.worktree} as worktree } from ${JSON.stringify(join(candidateSourceRoot, 'ssr/transformStreamWithRouter.ts'))}\n` + + `const values = Object.fromEntries(process.argv.slice(2).map((value) => value.replace(/^--/, '').split('=', 2)))\n` + + `const result = await runWarmComparison({ origin, worktree }, values.scenarios.split(','), values.modes.split(','), Number(values.warmups), Number(values.iterations), Number(values.batchRequests))\n` + + `process.stdout.write(JSON.stringify(result) + '\\n')\n`, + ) + const outfile = join(temp, 'warm-comparison.mjs') + await build({ + entryPoints: [entry], + outfile, + bundle: true, + platform: 'node', + format: 'esm', + target: 'node20', + logLevel: 'silent', + nodePaths: dependencyNodePaths, + plugins: [scriptStringPlugin], + define: { 'process.env.NODE_ENV': '"production"' }, + }) + return outfile +} + +function tasksForSuite() { + if (suite === 'common') { + return [ + 'hydration-1k', + 'hydration-4k', + 'hydration-16k', + 'hydration-32k', + 'hydration-64k', + 'hydration-solid-32k', + 'hydration-vue-32k', + ] + } + if (suite === 'safe-points') { + return ['react-patches-64-records', 'solid-patches-64-records'] + } + if (suite === 'coalesced-close') { + return [ + 'react-coalesced-early-script-1k', + 'react-coalesced-early-script-64k', + 'react-coalesced-next-close-64k', + 'react-coalesced-late-script-64k', + ] + } + if (suite === 'small-memory') { + return ['hydration-1k', 'hydration-4k'] + } + if (suite === 'smoke') { + return ['closing-heavy-17m'] + } + if (suite === 'source') { + return [ + 'router-string-flat-1m', + 'router-string-flat-4m', + 'router-string-flat-17m', + 'router-string-flat-32m', + 'router-string-rope-1m', + 'router-string-rope-4m', + 'router-string-rope-17m', + 'router-string-rope-32m', + ] + } + if (suite === 'strings') { + return [ + 'application-string-flat-1m', + 'application-string-flat-4m', + 'application-string-flat-17m', + 'application-string-rope-1m', + 'application-string-rope-4m', + 'application-string-rope-17m', + ] + } + if (suite === 'owner' || suite === 'owner-warm') { + return [ + 'hydration-owner-1x1k', + 'hydration-owner-16x1k', + 'hydration-owner-400x40k', + 'hydration-owner-4095x4k', + ] + } + if (suite === 'owner-soak') { + return ['hydration-owner-16x1k', 'hydration-owner-4095x4k'] + } + return [ + 'hydration-32k', + 'hydration-17m', + 'router-records-15m', + 'closing-heavy-17m', + 'react18-patches-17m', + 'react19-patches-17m', + ] +} + +function writeSummary(results, path, warmComparison) { + const provenance = [ + `Origin: ${originRef} (${originSha})`, + `Candidate: ${candidateRef} (${candidateSha ?? `worktree snapshot ${candidateSourceSha256}`})`, + `Node: ${process.version}; NODE_ENV=production`, + ] + if (warmComparison) { + const lines = [ + '# Warm SSR streaming benchmark results', + '', + ...provenance, + `Requests per timed batch: ${warmComparison.batchRequests}`, + '', + '| baseline | scenario | framework | safe point | mode | baseline mean us/request | candidate mean us/request | aggregate change | paired geometric mean | paired median | paired p10 | paired p90 | wall aggregate |', + '| --- | --- | --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |', + ] + for (const comparison of warmComparison.comparisons) { + const baseline = results.find( + (value) => + value.scenario === comparison.scenario && + value.framework === comparison.framework && + value.rendererSafePoint === comparison.rendererSafePoint && + value.mode === comparison.mode && + value.implementation === comparison.baseline && + value.comparisonBaseline === comparison.baseline, + ) + const worktree = results.find( + (value) => + value.scenario === comparison.scenario && + value.framework === comparison.framework && + value.rendererSafePoint === comparison.rendererSafePoint && + value.mode === comparison.mode && + value.implementation === 'worktree' && + value.comparisonBaseline === comparison.baseline, + ) + if (!baseline || !worktree) { + throw new Error( + `Missing warm result row for ${comparison.scenario}/${comparison.framework}/${comparison.rendererSafePoint ?? '-'}/${comparison.mode}/${comparison.baseline}`, + ) + } + lines.push( + `| ${comparison.baseline} | ${comparison.scenario} | ${comparison.framework} | ${comparison.rendererSafePoint ?? '-'} | ${comparison.mode} | ${(baseline.statistics.elapsedMs.mean * 1000).toFixed(2)} | ${(worktree.statistics.elapsedMs.mean * 1000).toFixed(2)} | ${comparison.aggregateElapsedPercent.toFixed(1)}% | ${comparison.pairedElapsedPercent.geometricMean.toFixed(1)}% | ${comparison.pairedElapsedPercent.median.toFixed(1)}% | ${comparison.pairedElapsedPercent.p10.toFixed(1)}% | ${comparison.pairedElapsedPercent.p90.toFixed(1)}% | ${comparison.aggregateWallElapsedPercent.toFixed(1)}% |`, + ) + } + writeFileSync(path, `${lines.join('\n')}\n`) + return + } + + const lines = [ + '# SSR streaming benchmark results', + '', + ...provenance, + '', + '| implementation | run | scenario | framework | safe point | mode | TTFB ms | first router ms | MiB/s | heap peak MiB | external peak MiB | max chunk | records HWM |', + '| --- | ---: | --- | --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |', + ] + const soakRows = [] + for (const value of results) { + if (value.outcome === 'expected-error') { + lines.push( + `| ${value.implementation} | ${value.run ?? '-'} | ${value.scenario} | ${value.framework} | ${value.rendererSafePoint ?? '-'} | ${value.mode} | - | - | expected guard | - | - | - | - |`, + ) + continue + } + if (value.implementation === 'v8-probe') { + for (const pass of value.passes) { + lines.push( + `| v8-probe | ${pass.pass} | ${value.scenario} | - | - | ${value.mode} | - | - | ${pass.throughputMiBPerSecond.toFixed(1)} | ${(pass.memoryPeakBytes.heapUsed / 1048576).toFixed(1)} | ${(pass.memoryPeakBytes.external / 1048576).toFixed(1)} | ${value.outputChunkBytes} | 0 |`, + ) + } + continue + } + if (value.mode === 'owner-soak') { + soakRows.push(value) + continue + } + lines.push( + `| ${value.implementation} | ${value.run ?? '-'} | ${value.scenario} | ${value.framework} | ${value.rendererSafePoint ?? '-'} | ${value.mode} | ${value.ttfbMs?.toFixed(2) ?? '-'} | ${value.firstRouterScriptMs?.toFixed(2) ?? '-'} | ${value.throughputMiBPerSecond.toFixed(1)} | ${(value.memoryPeakBytes.heapUsed / 1048576).toFixed(1)} | ${(value.memoryPeakBytes.external / 1048576).toFixed(1)} | ${value.maxOutputChunkBytes} | ${value.sourceRecordHighWater} |`, + ) + } + if (soakRows.length > 0) { + lines.push( + '', + '## Post-GC retention soak', + '', + '| implementation | run | scenario | requests | MiB/s including checkpoint GC | retained heap HWM MiB | retained external HWM MiB | retained ArrayBuffer HWM MiB |', + '| --- | ---: | --- | ---: | ---: | ---: | ---: | ---: |', + ) + for (const value of soakRows) { + lines.push( + `| ${value.implementation} | ${value.run ?? '-'} | ${value.scenario} | ${value.requests} | ${value.throughputIncludingGcMiBPerSecond.toFixed(1)} | ${(value.retainedHighWaterBytes.heapUsed / 1048576).toFixed(1)} | ${(value.retainedHighWaterBytes.external / 1048576).toFixed(1)} | ${(value.retainedHighWaterBytes.arrayBuffers / 1048576).toFixed(1)} |`, + ) + } + } + writeFileSync(path, `${lines.join('\n')}\n`) +} + +try { + const bundles = {} + for (const implementation of selectedImplementations) { + bundles[implementation] = await bundle(implementation) + } + const scenarios = tasksForSuite().filter( + (scenario) => !args.scenario || args.scenario.split(',').includes(scenario), + ) + const supportedModes = + suite === 'owner' || suite === 'owner-warm' || suite === 'owner-soak' + ? ['owner'] + : suite === 'source' || + suite === 'strings' || + suite === 'safe-points' || + suite === 'coalesced-close' + ? ['merge'] + : isWarmSuite + ? ['fast', 'merge'] + : ['raw', 'fast', 'merge'] + const modes = supportedModes.filter( + (mode) => !args.mode || args.mode.split(',').includes(mode), + ) + const implementations = selectedImplementations + const results = [] + const artifactPaths = { ...bundles } + let warmComparison + if ( + scenarios.length === 0 || + modes.length === 0 || + (!isWarmSuite && implementations.length === 0) + ) { + throw new Error('Benchmark filters selected no cells') + } + if (isWarmSuite) { + const warmBundle = await bundleWarmComparison() + artifactPaths['warm-comparison'] = warmBundle + const focusedSafePoints = + suite === 'safe-points' || suite === 'coalesced-close' + const warmups = Number(args.warmups ?? (focusedSafePoints ? 20 : 50)) + const iterations = Number(args.iterations ?? (focusedSafePoints ? 20 : 50)) + const batchRequests = Number( + args['batch-requests'] ?? (focusedSafePoints ? 250 : 1000), + ) + if ( + scenarios.length === 0 || + !Number.isInteger(warmups) || + warmups < 0 || + !Number.isInteger(iterations) || + iterations < 1 || + !Number.isInteger(batchRequests) || + batchRequests < 1 + ) { + throw new Error('Invalid warm-suite scenario or iteration count') + } + const child = spawnSync( + process.execPath, + [ + '--expose-gc', + ...(profileDir + ? [ + '--cpu-prof', + `--cpu-prof-dir=${profileDir}`, + `--cpu-prof-name=warm-${suite}.cpuprofile`, + ] + : []), + warmBundle, + `--scenarios=${scenarios.join(',')}`, + `--modes=${modes.join(',')}`, + `--warmups=${warmups}`, + `--iterations=${iterations}`, + `--batchRequests=${batchRequests}`, + ], + { + cwd: repo, + encoding: 'utf8', + maxBuffer: 10 * 1024 * 1024, + env: childEnvironment, + }, + ) + if (child.status !== 0) { + process.stderr.write(child.stderr) + process.stderr.write(child.stdout) + process.exit(child.status ?? 1) + } + warmComparison = JSON.parse(child.stdout.trim()) + if (warmComparison.comparisons.length === 0) { + throw new Error('Benchmark filters selected no warm comparison cells') + } + results.push(...warmComparison.results) + for (const comparison of warmComparison.comparisons) { + process.stdout.write( + `${comparison.baseline}->candidate ${comparison.scenario} ${comparison.framework} ${comparison.rendererSafePoint ?? 'no-extra-safe-point'} ${comparison.mode}: aggregate ${comparison.aggregateElapsedPercent.toFixed(1)}%, paired geometric mean ${comparison.pairedElapsedPercent.geometricMean.toFixed(1)}%\n`, + ) + } + } + for (const scenario of scenarios) { + const framework = + scenario.startsWith('hydration-solid-') || scenario.startsWith('solid-') + ? 'solid' + : scenario.startsWith('hydration-vue-') + ? 'vue' + : 'react' + const rendererSafePoint = + framework === 'react' + ? 'script-close' + : framework === 'solid' + ? 'record-end' + : undefined + for (const mode of modes) { + for (let run = 1; run <= runs; run++) { + const orders = [ + ['origin', 'worktree'], + ['worktree', 'origin'], + ] + const implementationOrder = orders[(run - 1) % orders.length].filter( + (implementation) => implementations.includes(implementation), + ) + for (const implementation of implementationOrder) { + const profileArgs = profileDir + ? [ + '--cpu-prof', + `--cpu-prof-dir=${profileDir}`, + `--cpu-prof-name=${implementation}-${scenario}-${mode}-${run}.cpuprofile`, + ] + : [] + const child = spawnSync( + process.execPath, + [ + '--expose-gc', + ...profileArgs, + bundles[implementation], + `--scenario=${scenario}`, + `--mode=${mode}`, + ], + { + cwd: repo, + encoding: 'utf8', + maxBuffer: 10 * 1024 * 1024, + env: childEnvironment, + }, + ) + if (child.status !== 0) { + const expectedHistoricalLimit = + mode !== 'merge' || !hasHistoricalBufferGuards[implementation] + ? undefined + : scenario === 'react18-patches-17m' + ? 'SSR stream tail exceeded maximum buffer' + : scenario === 'hydration-17m' || + /^router-string-(flat|rope)-(17|32)m$/.test(scenario) + ? 'SSR router HTML exceeded maximum buffer' + : undefined + const diagnostic = `${child.stderr}\n${child.stdout}` + if ( + expectedHistoricalLimit && + diagnostic.includes(expectedHistoricalLimit) + ) { + results.push({ + implementation, + scenario, + framework, + rendererSafePoint, + mode, + outcome: 'expected-error', + error: expectedHistoricalLimit, + run, + }) + process.stdout.write( + `${implementation} ${scenario} ${mode} ${run}/${runs}: expected historical buffer guard\n`, + ) + continue + } + process.stderr.write(child.stderr) + process.stderr.write(child.stdout) + process.exit(child.status ?? 1) + } + const value = JSON.parse(child.stdout.trim()) + value.run = run + results.push(value) + const throughput = + value.throughputMiBPerSecond ?? + value.throughputIncludingGcMiBPerSecond + process.stdout.write( + `${implementation} ${scenario} ${mode} ${run}/${runs}: ${throughput.toFixed(1)} MiB/s\n`, + ) + } + } + } + } + if (suite === 'source' && !args.scenario && !args.mode) { + for (const shape of ['flat', 'rope']) { + for (const size of [1, 4, 17, 32]) { + for (const strategy of ['suffix', 'window']) { + const profileArgs = profileDir + ? [ + '--cpu-prof', + `--cpu-prof-dir=${profileDir}`, + `--cpu-prof-name=probe-${shape}-${size}m-${strategy}.cpuprofile`, + ] + : [] + const child = spawnSync( + process.execPath, + [ + '--expose-gc', + ...profileArgs, + bundles.worktree ?? bundles.origin, + '--probe=true', + `--shape=${shape}`, + `--size=${size}`, + `--strategy=${strategy}`, + ], + { + cwd: repo, + encoding: 'utf8', + maxBuffer: 10 * 1024 * 1024, + env: childEnvironment, + }, + ) + if (child.status !== 0) { + process.stderr.write(child.stderr) + process.stderr.write(child.stdout) + process.exit(child.status ?? 1) + } + results.push(JSON.parse(child.stdout.trim())) + } + } + } + } + mkdirSync(dirname(outputPath), { recursive: true }) + writeFileSync( + outputPath, + `${JSON.stringify( + { + generatedAt: new Date().toISOString(), + node: process.version, + nodeEnv: 'production', + cpuProfiled, + platform: { os: platform(), arch: arch(), cpu: cpus()[0]?.model }, + originRef, + originSha, + originSourceSha256, + candidateRef, + candidateSha, + headSha, + candidateSourceSha256, + benchmarkInput: + suite === 'strings' + ? 'renderer string records' + : suite.startsWith('owner') + ? 'production hydration owner' + : 'Uint8Array renderer records', + measuredSourcePairSha256, + artifactSha256: Object.fromEntries( + Object.entries(artifactPaths) + .map(([name, path]) => [ + name, + createHash('sha256').update(readFileSync(path)).digest('hex'), + ]) + .concat( + profileDir + ? readdirSync(profileDir) + .filter((name) => name.endsWith('.cpuprofile')) + .sort() + .map((name) => [ + `profile:${name}`, + createHash('sha256') + .update(readFileSync(join(profileDir, name))) + .digest('hex'), + ]) + : [], + ), + ), + suite, + runs: isWarmSuite ? undefined : runs, + warmComparison, + results: isWarmSuite ? undefined : results, + }, + null, + 2, + )}\n`, + ) + const summaryPath = outputPath.replace(/\.json$/, '.md') + writeSummary(results, summaryPath, warmComparison) + process.stdout.write(`Raw results: ${outputPath}\nSummary: ${summaryPath}\n`) +} finally { + cleanupTemporaryArtifacts() + process.removeListener('exit', cleanupTemporaryArtifacts) +} diff --git a/packages/router-core/benchmarks/ssr-streaming/worker.ts b/packages/router-core/benchmarks/ssr-streaming/worker.ts new file mode 100644 index 0000000000..5a12fe2920 --- /dev/null +++ b/packages/router-core/benchmarks/ssr-streaming/worker.ts @@ -0,0 +1,2254 @@ +import { createHash } from 'node:crypto' +import { ReadableStream } from 'node:stream/web' +import { performance } from 'node:perf_hooks' + +const MiB = 1024 * 1024 +// Shared legacy-compatible input: origin finds the ID, while the current +// transform finds the exact boundary suffix. Both benchmark the same bytes. +const BARRIER = + '' +const SHELL_PREFIX = '
done
' +const PREFIX = `${SHELL_PREFIX}${BARRIER}` +const SUFFIX = '' +const SCRIPT_OPEN = '' +const REACT_PATCH_PREFIX = '' +const REACT_PATCH_BYTES = 32 * 1024 +const REACT_PATCH = + REACT_PATCH_PREFIX + + 'x'.repeat( + REACT_PATCH_BYTES - REACT_PATCH_PREFIX.length - REACT_PATCH_SUFFIX.length, + ) + + REACT_PATCH_SUFFIX +const SMALL_REACT_PATCH = + '' +const SMALL_SOLID_RECORD = '' +const COALESCED_PATCH = '' +const COALESCED_LAST_PATCH = '' +const COALESCED_FILLER = '
ordinary text
' +// Mirrors of `src/ssr/hydrationScripts.ts` limits and states. The worker +// also runs against a baseline worktree, so it cannot import them; keep these +// in step with MAX_HYDRATION_OUTPUT_CHUNK_BYTES, MAX_DIRECT_CODE_UNITS, +// MIN_OUTPUT_BYTES, and HydrationScriptOutputState. +const OUTPUT_BYTES = 64 * 1024 +const FILL_BYTES = 64 * 1024 +const DIRECT_HYDRATION_CODE_UNITS = 16 * 1024 +const MIN_HYDRATION_OUTPUT_BYTES = 256 + +const HydrationOutputState = { + Waiting: 0, + Ready: 1, + Active: 2, + Done: 3, + Failed: 4, +} as const +type HydrationOutputState = + (typeof HydrationOutputState)[keyof typeof HydrationOutputState] +const HydrationRecordPhase = { + Opening: 0, + Source: 1, + Closing: 2, +} as const +type HydrationRecordPhase = + (typeof HydrationRecordPhase)[keyof typeof HydrationRecordPhase] +const hydrationEncoder = new TextEncoder() + +type Mode = 'raw' | 'fast' | 'merge' +type Shape = 'flat' | 'rope' +type Framework = 'react' | 'solid' | 'vue' +type RendererSafePoint = 'script-close' | 'record-end' +type BaselineImplementation = 'origin' +type AppStreamValue = Uint8Array | string +type Transform = ( + router: any, + stream: ReadableStream, + options?: { rendererSafePoint?: RendererSafePoint }, +) => ReadableStream + +type Memory = { + heapUsed: number + external: number + arrayBuffers: number + rss: number +} + +type ScenarioMetadata = { + name: string + framework: Framework + rendererSafePoint?: RendererSafePoint +} + +type Scenario = + | (ScenarioMetadata & { + kind: 'hydration' + records: number + recordBytes: number + shape: Shape + }) + | (ScenarioMetadata & { + kind: 'closing' + bytes: number + framework: 'react' + rendererSafePoint: 'script-close' + }) + | (ScenarioMetadata & { + kind: 'renderer-records' + record: string + records: number + closeBeforeRecords: boolean + routerRecordBytes: number + framework: 'react' | 'solid' + rendererSafePoint: RendererSafePoint + }) + | (ScenarioMetadata & { + kind: 'coalesced-close' + bytes: number + scriptAtEnd: boolean + closeInNextChunk: boolean + framework: 'react' + rendererSafePoint: 'script-close' + }) + | (ScenarioMetadata & { + kind: 'application-string' + bytes: number + shape: Shape + routerRecordBytes: number + framework: 'react' + rendererSafePoint: 'script-close' + }) + +function parseScenario(name: string): Scenario { + const coalescedCloseMatch = + /^react-coalesced-(early-script|next-close|late-script)-(1|64)k$/.exec(name) + if (coalescedCloseMatch) { + return { + kind: 'coalesced-close', + name, + bytes: Number(coalescedCloseMatch[2]) * 1024, + scriptAtEnd: coalescedCloseMatch[1] === 'late-script', + closeInNextChunk: coalescedCloseMatch[1] === 'next-close', + framework: 'react', + rendererSafePoint: 'script-close', + } + } + const commonHydrationMatch = + /^hydration(?:(?:-(solid|vue))?)-(1|4|16|32|64)k$/.exec(name) + if (commonHydrationMatch) { + const framework = + (commonHydrationMatch[1] as Framework | undefined) ?? 'react' + return { + kind: 'hydration', + name, + records: 1, + recordBytes: Number(commonHydrationMatch[2]) * 1024, + shape: 'flat', + framework, + rendererSafePoint: + framework === 'react' + ? 'script-close' + : framework === 'solid' + ? 'record-end' + : undefined, + } + } + if (name === 'hydration-17m') { + return { + kind: 'hydration', + name, + records: 1, + recordBytes: 17 * MiB, + shape: 'flat', + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'router-records-15m') { + return { + kind: 'hydration', + name, + records: 480, + recordBytes: 32 * 1024, + shape: 'flat', + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'closing-heavy-17m') { + return { + kind: 'closing', + name, + bytes: 17 * MiB, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'react18-patches-17m') { + return { + kind: 'renderer-records', + name, + record: REACT_PATCH, + records: (17 * MiB) / REACT_PATCH_BYTES, + closeBeforeRecords: true, + routerRecordBytes: 32 * 1024, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'react19-patches-17m') { + return { + kind: 'renderer-records', + name, + record: REACT_PATCH, + records: (17 * MiB) / REACT_PATCH_BYTES, + closeBeforeRecords: false, + routerRecordBytes: 32 * 1024, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'react-patches-64-records') { + return { + kind: 'renderer-records', + name, + record: SMALL_REACT_PATCH, + records: 64, + closeBeforeRecords: false, + routerRecordBytes: 1024, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + if (name === 'solid-patches-64-records') { + return { + kind: 'renderer-records', + name, + record: SMALL_SOLID_RECORD, + records: 64, + closeBeforeRecords: false, + routerRecordBytes: 1024, + framework: 'solid', + rendererSafePoint: 'record-end', + } + } + const applicationStringMatch = + /^application-string-(flat|rope)-(1|4|17)m$/.exec(name) + if (applicationStringMatch) { + return { + kind: 'application-string', + name, + bytes: Number(applicationStringMatch[2]) * MiB, + shape: applicationStringMatch[1] as Shape, + routerRecordBytes: 1024, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + const routerMatch = /^(router-string)-(flat|rope)-(1|4|17|32)m$/.exec(name) + if (routerMatch) { + return { + kind: 'hydration', + name, + records: 1, + recordBytes: Number(routerMatch[3]) * MiB, + shape: routerMatch[2] as Shape, + framework: 'react', + rendererSafePoint: 'script-close', + } + } + throw new Error(`Unknown benchmark scenario: ${name}`) +} + +function forceGc() { + if (typeof globalThis.gc !== 'function') { + throw new Error('The benchmark worker requires node --expose-gc') + } + globalThis.gc() + globalThis.gc() +} + +function memory(): Memory { + const value = process.memoryUsage() + return { + heapUsed: value.heapUsed, + external: value.external, + arrayBuffers: value.arrayBuffers, + rss: value.rss, + } +} + +function delta(value: Memory, baseline: Memory): Memory { + return { + heapUsed: value.heapUsed - baseline.heapUsed, + external: value.external - baseline.external, + arrayBuffers: value.arrayBuffers - baseline.arrayBuffers, + rss: value.rss - baseline.rss, + } +} + +function maxMemory(target: Memory, value: Memory) { + target.heapUsed = Math.max(target.heapUsed, value.heapUsed) + target.external = Math.max(target.external, value.external) + target.arrayBuffers = Math.max(target.arrayBuffers, value.arrayBuffers) + target.rss = Math.max(target.rss, value.rss) +} + +function marker(index: number) { + return `r${index.toString(36).padStart(6, '0')}:` +} + +function fillCode(index: number) { + return 97 + (index % 20) +} + +function createSource(bytes: number, index: number, shape: Shape) { + const recordMarker = marker(index) + const remaining = bytes - recordMarker.length + if (remaining < 0) { + throw new Error('Source record is smaller than its marker') + } + if (shape === 'flat') { + const source = Buffer.allocUnsafe(bytes) + source.fill(fillCode(index)) + source.write(recordMarker, 0, 'ascii') + return source.toString('latin1') + } + const piece = String.fromCharCode(fillCode(index)).repeat(4096) + let source = recordMarker + let left = remaining + while (left > 0) { + source += left >= piece.length ? piece : piece.slice(0, left) + left -= Math.min(left, piece.length) + } + return source +} + +function updateRepeated( + hash: ReturnType, + code: number, + bytes: number, +) { + const buffer = Buffer.allocUnsafe(Math.min(FILL_BYTES, bytes || 1)).fill(code) + let left = bytes + while (left > 0) { + const length = Math.min(left, buffer.length) + hash.update(buffer.subarray(0, length)) + left -= length + } +} + +function updateSource( + hash: ReturnType, + bytes: number, + index: number, +) { + const recordMarker = marker(index) + hash.update(recordMarker) + updateRepeated(hash, fillCode(index), bytes - recordMarker.length) +} + +type RouterSource = { + records: number + recordBytes: number + shape: Shape +} + +function getRouterSource(scenario: Scenario): RouterSource | undefined { + if (scenario.kind === 'hydration') { + return { + records: scenario.records, + recordBytes: scenario.recordBytes, + shape: scenario.shape, + } + } + if (scenario.kind === 'renderer-records') { + return { + records: 1, + recordBytes: scenario.routerRecordBytes, + shape: 'flat', + } + } + if (scenario.kind === 'application-string') { + return { + records: 1, + recordBytes: scenario.routerRecordBytes, + shape: 'flat', + } + } + return undefined +} + +function expected(scenario: Scenario, mode: Mode) { + const hash = createHash('sha256') + let bytes = 0 + const add = (value: string) => { + hash.update(value) + bytes += Buffer.byteLength(value) + } + const addRouterRecord = (recordBytes: number, index: number) => { + add(SCRIPT_OPEN) + updateSource(hash, recordBytes, index) + bytes += recordBytes + add(SCRIPT_CLOSE) + } + const addRouterSources = () => { + const source = getRouterSource(scenario) + if (!source) { + return + } + for (let index = 0; index < source.records; index++) { + addRouterRecord(source.recordBytes, index) + } + } + const addRendererRecords = (record: string, records: number) => { + for (let index = 0; index < records; index++) { + add(record) + } + } + + if (scenario.kind === 'coalesced-close') { + add(PREFIX) + if (!scenario.scriptAtEnd) { + add(COALESCED_PATCH) + } + add(createCoalescedFiller(scenario.bytes)) + if (scenario.scriptAtEnd) { + add(COALESCED_PATCH) + } + if (mode !== 'merge') { + add(SUFFIX) + } + add(COALESCED_LAST_PATCH) + if (mode === 'merge') { + add(SUFFIX) + } + } else if (scenario.kind === 'closing') { + add(SHELL_PREFIX) + const pattern = '
x
' + const repetitions = Math.floor(scenario.bytes / pattern.length) + const remainder = scenario.bytes % pattern.length + for (let index = 0; index < repetitions; index++) { + add(pattern) + } + add(pattern.slice(0, remainder)) + add(BARRIER) + add(SUFFIX) + } else if (scenario.kind === 'hydration') { + if (mode === 'merge') { + add(PREFIX) + addRouterSources() + } else { + add(SHELL_PREFIX) + addRouterSources() + add(BARRIER) + } + add(SUFFIX) + } else if (scenario.kind === 'renderer-records') { + if (mode === 'merge') { + add(PREFIX) + addRendererRecords(scenario.record, scenario.records) + addRouterSources() + add(SUFFIX) + } else { + add(SHELL_PREFIX) + addRouterSources() + add(BARRIER) + if (scenario.closeBeforeRecords) { + add(SUFFIX) + } + addRendererRecords(scenario.record, scenario.records) + if (!scenario.closeBeforeRecords) { + add(SUFFIX) + } + } + } else { + if (mode === 'merge') { + add(PREFIX) + addRouterSources() + } else { + add(SHELL_PREFIX) + addRouterSources() + add(BARRIER) + } + updateRepeated(hash, 'x'.charCodeAt(0), scenario.bytes) + bytes += scenario.bytes + add(SUFFIX) + } + return { bytes, digest: hash.digest('hex') } +} + +const expectedOutputCache = new Map>() + +function getExpectedOutput(scenario: Scenario, mode: Mode) { + const key = `${scenario.name}:${mode}` + let value = expectedOutputCache.get(key) + if (!value) { + value = expected(scenario, mode) + expectedOutputCache.set(key, value) + } + return value +} + +function* repeatedPatternBytes(pattern: string, bytes: number) { + const chunk = pattern.repeat(Math.floor(FILL_BYTES / pattern.length)) + let left = bytes + while (left > 0) { + const value = chunk.slice(0, Math.min(left, chunk.length)) + yield Buffer.from(value) + left -= value.length + } +} + +function* repeatedCompletePatternBytes( + pattern: string, + bytes: number, + maxChunkBytes = FILL_BYTES, +) { + let repetitions = Math.floor(bytes / pattern.length) + const repetitionsPerChunk = Math.max( + 1, + Math.floor(maxChunkBytes / pattern.length), + ) + const fullChunk = pattern.repeat(repetitionsPerChunk) + while (repetitions > 0) { + const count = Math.min(repetitions, repetitionsPerChunk) + yield Buffer.from( + count === repetitionsPerChunk ? fullChunk : pattern.repeat(count), + ) + repetitions -= count + } +} + +function* routerScriptBytes(source: RouterSource): Generator { + for (let index = 0; index < source.records; index++) { + yield Buffer.from(SCRIPT_OPEN + marker(index)) + let left = source.recordBytes - marker(index).length + while (left > 0) { + const length = Math.min(left, FILL_BYTES) + yield Buffer.alloc(length, fillCode(index)) + left -= length + } + yield Buffer.from(SCRIPT_CLOSE) + } +} + +function* integratedBytes(scenario: Scenario): Generator { + if (scenario.kind === 'coalesced-close') { + yield* coalescedCloseApplicationBytes(scenario) + return + } + if (scenario.kind === 'closing') { + yield Buffer.from(SHELL_PREFIX) + yield* repeatedPatternBytes('
x
', scenario.bytes) + yield Buffer.from(BARRIER) + yield Buffer.from(SUFFIX) + return + } + + yield Buffer.from(SHELL_PREFIX) + const source = getRouterSource(scenario) + if (source) { + yield* routerScriptBytes(source) + } + yield Buffer.from(BARRIER) + + if (scenario.kind === 'hydration') { + yield Buffer.from(SUFFIX) + } else if (scenario.kind === 'renderer-records') { + if (scenario.closeBeforeRecords) { + yield Buffer.from(SUFFIX) + } + yield* repeatedCompletePatternBytes( + scenario.record, + scenario.record.length * scenario.records, + scenario.record.length, + ) + if (!scenario.closeBeforeRecords) { + yield Buffer.from(SUFFIX) + } + } else { + yield Buffer.alloc(scenario.bytes, 'x'.charCodeAt(0)) + yield Buffer.from(SUFFIX) + } +} + +function createCoalescedFiller(bytes: number) { + return ( + COALESCED_FILLER.repeat(Math.floor(bytes / COALESCED_FILLER.length)) + + 'x'.repeat(bytes % COALESCED_FILLER.length) + ) +} + +function* coalescedCloseApplicationBytes( + scenario: Extract, +) { + const filler = createCoalescedFiller(scenario.bytes) + const content = + PREFIX + + (scenario.scriptAtEnd ? filler + COALESCED_PATCH : COALESCED_PATCH + filler) + const close = SUFFIX + COALESCED_LAST_PATCH + yield Buffer.from(content + (scenario.closeInNextChunk ? '' : close)) + if (scenario.closeInNextChunk) { + yield Buffer.from(close) + } + // Keep hydration Waiting while the coalesced bytes drain. Without this + // record, source prefetch can report EOF before the transform scans them. + yield new Uint8Array(0) +} + +function* rendererRecordApplicationBytes( + scenario: Extract, +) { + yield Buffer.from(PREFIX) + if (scenario.closeBeforeRecords) { + yield Buffer.from(SUFFIX) + } + yield* repeatedCompletePatternBytes( + scenario.record, + scenario.record.length * scenario.records, + scenario.record.length, + ) + if (!scenario.closeBeforeRecords) { + yield Buffer.from(SUFFIX) + } + // This empty record lets the transform consume all renderer bytes before + // the source reports EOF and starts the independent router producer. + yield new Uint8Array(0) +} + +function streamFromIterator( + iterator: Iterator, + onEof?: () => void, + beforeEof?: Promise, + onBeforeEof?: () => void, +) { + return new ReadableStream({ + async pull(controller) { + const next = iterator.next() + if (next.done) { + onBeforeEof?.() + await beforeEof + onEof?.() + controller.close() + } else { + controller.enqueue(next.value) + } + }, + }) +} + +function createApplicationString( + scenario: Extract, +) { + if (scenario.shape === 'flat') { + const value = Buffer.allocUnsafe( + PREFIX.length + scenario.bytes + SUFFIX.length, + ) + value.write(PREFIX, 0, 'ascii') + value.fill('x'.charCodeAt(0), PREFIX.length, PREFIX.length + scenario.bytes) + value.write(SUFFIX, PREFIX.length + scenario.bytes, 'ascii') + return value.toString('latin1') + } + const piece = 'x'.repeat(4096) + let value = PREFIX + let left = scenario.bytes + while (left > 0) { + value += left >= piece.length ? piece : piece.slice(0, left) + left -= Math.min(left, piece.length) + } + return value + SUFFIX +} + +function makeRouter(serializationFinished: boolean) { + let finished = serializationFinished + let streamFastPathReserved = false + let cleanupCount = 0 + let renderFinishedCount = 0 + let reserveCalls = 0 + let scriptSubscriptions = 0 + let htmlSubscriptions = 0 + let bufferedHtmlReads = 0 + let fastPathGrants = 0 + let hydrationOutputClaims = 0 + let hydrationOutputSubscriptions = 0 + let hydrationOutputPulls = 0 + const scriptListeners = new Set<(parts: ReadonlyArray) => void>() + const htmlListeners = new Set<(html: string) => void>() + const finishedListeners = new Set<() => void>() + const pendingScripts: Array = [] + const bufferedHtml: Array = [] + const hydrationSources: Array = [] + let hydrationSourceHead = 0 + let hydrationSource: string | undefined + let hydrationSegment = '' + let hydrationSegmentOffset = 0 + let hydrationPhase: HydrationRecordPhase = HydrationRecordPhase.Opening + let hydrationOutputCapacity = MIN_HYDRATION_OUTPUT_BYTES + let hydrationState: HydrationOutputState = HydrationOutputState.Waiting + let hydrationError: unknown + let hydrationListener: (() => void) | undefined + let hydrationOutput: + | { + readonly state: number + readonly error: unknown + pullChunk(): Uint8Array + subscribe(onChange: () => void): () => void + } + | undefined + let liftBarrier!: () => void + const barrier = new Promise((resolve) => { + liftBarrier = resolve + }) + + function hydrationQueueIsEmpty() { + return hydrationSourceHead === hydrationSources.length + } + + function refreshHydrationState(notify = true) { + const next = hydrationSource + ? HydrationOutputState.Active + : !hydrationQueueIsEmpty() + ? HydrationOutputState.Ready + : finished + ? HydrationOutputState.Done + : HydrationOutputState.Waiting + if (hydrationState !== next) { + hydrationState = next + if (notify) { + hydrationListener?.() + } + } + } + + function releaseHydrationSource() { + hydrationSources[hydrationSourceHead++] = undefined + if (hydrationQueueIsEmpty()) { + hydrationSources.length = 0 + hydrationSourceHead = 0 + } + hydrationSource = undefined + hydrationSegment = '' + hydrationSegmentOffset = 0 + hydrationPhase = HydrationRecordPhase.Opening + refreshHydrationState(false) + } + + function startHydrationSource(codeUnits: number) { + hydrationSource = hydrationSources[hydrationSourceHead]! + hydrationPhase = HydrationRecordPhase.Opening + hydrationSegment = SCRIPT_OPEN + hydrationSegmentOffset = 0 + hydrationOutputCapacity = Math.max( + MIN_HYDRATION_OUTPUT_BYTES, + Math.min(OUTPUT_BYTES, codeUnits), + ) + hydrationState = HydrationOutputState.Active + } + + function advanceHydrationSegment() { + if (hydrationPhase === HydrationRecordPhase.Opening) { + hydrationPhase = HydrationRecordPhase.Source + hydrationSegment = hydrationSource! + hydrationSegmentOffset = 0 + } else if (hydrationPhase === HydrationRecordPhase.Source) { + hydrationPhase = HydrationRecordPhase.Closing + hydrationSegment = SCRIPT_CLOSE + hydrationSegmentOffset = 0 + } else { + releaseHydrationSource() + } + } + + function pullHydrationChunk() { + hydrationOutputPulls++ + if ( + hydrationState !== HydrationOutputState.Ready && + hydrationState !== HydrationOutputState.Active + ) { + throw new Error('Benchmark hydration output is not ready') + } + + try { + if (hydrationState === HydrationOutputState.Ready) { + const source = hydrationSources[hydrationSourceHead]! + const codeUnits = + SCRIPT_OPEN.length + source.length + SCRIPT_CLOSE.length + if (codeUnits <= DIRECT_HYDRATION_CODE_UNITS) { + const bytes = hydrationEncoder.encode( + SCRIPT_OPEN + source + SCRIPT_CLOSE, + ) + hydrationSource = source + releaseHydrationSource() + return bytes + } + startHydrationSource(codeUnits) + } + + const bytes = new Uint8Array(hydrationOutputCapacity) + let outputOffset = 0 + while (hydrationSource) { + if (hydrationSegmentOffset === hydrationSegment.length) { + advanceHydrationSegment() + } else if (outputOffset === bytes.length) { + break + } else { + const target = + outputOffset === 0 ? bytes : bytes.subarray(outputOffset) + const result = hydrationEncoder.encodeInto( + hydrationSegment.slice(hydrationSegmentOffset), + target, + ) + if (result.read === 0) { + if (outputOffset === 0) { + throw new Error('Benchmark hydration encoder made no progress') + } + break + } + hydrationSegmentOffset += result.read + outputOffset += result.written + } + } + if (outputOffset === 0) { + throw new Error('Benchmark hydration record produced no output') + } + return outputOffset === bytes.length + ? bytes + : bytes.subarray(0, outputOffset) + } catch (error) { + hydrationError = error + hydrationState = HydrationOutputState.Failed + hydrationListener?.() + throw error + } + } + + function reserveFastPath(output?: typeof hydrationOutput) { + reserveCalls++ + if ( + !finished || + streamFastPathReserved || + pendingScripts.length > 0 || + hydrationSource !== undefined || + !hydrationQueueIsEmpty() || + (hydrationOutput ? output !== hydrationOutput : output !== undefined) + ) { + return false + } + streamFastPathReserved = true + fastPathGrants++ + return true + } + + function claimOutput() { + hydrationOutputClaims++ + if (hydrationOutput) { + throw new Error('Benchmark hydration output already has a consumer') + } + hydrationOutput = { + get state() { + return hydrationState + }, + get error() { + return hydrationError + }, + pullChunk: pullHydrationChunk, + subscribe(onChange: () => void) { + hydrationOutputSubscriptions++ + if (hydrationListener) { + throw new Error('Benchmark hydration output already has a subscriber') + } + hydrationListener = onChange + return () => { + if (hydrationListener === onChange) { + hydrationListener = undefined + } + } + }, + } + refreshHydrationState(false) + return hydrationOutput + } + + const hydrationScripts = { + reserveFastPath, + claimOutput, + liftBarrier, + // The worktree transform skips barrier scanning until the initial take. + // The synthetic fixture renders the boundary in its input, so report the + // take as already done. + isInitialTaken: () => true, + // The worktree transform arms the serialization deadline through the + // transport; the fixture manages its own timing. + startSerializationTimeout: (_timeoutMs: number) => {}, + } + + const serverSsr = { + hydrationScripts, + isSerializationFinished: () => finished, + // Keep the old transport shape so this one fixture can run origin and the + // candidate baseline against the same synthetic request. + reserveStreamFastPath: reserveFastPath, + claimHydrationScriptOutput: claimOutput, + onScriptBatch(listener: (parts: ReadonlyArray) => void) { + scriptSubscriptions++ + scriptListeners.add(listener) + if (pendingScripts.length > 0) { + const parts = pendingScripts.splice(0) + listener(parts) + } + return () => scriptListeners.delete(listener) + }, + onInjectedHtml(listener: (html: string) => void) { + htmlSubscriptions++ + htmlListeners.add(listener) + return () => htmlListeners.delete(listener) + }, + takeBufferedHtml() { + bufferedHtmlReads++ + return bufferedHtml.shift() + }, + onSerializationFinished(listener: () => void) { + finishedListeners.add(listener) + return () => finishedListeners.delete(listener) + }, + setRenderFinished() { + renderFinishedCount++ + liftBarrier() + }, + liftScriptBarrier: liftBarrier, + // The worktree transform registers a cleanup listener to tear down + // promptly on external cleanup. The fixture drives termination itself, + // so registration is accepted and ignored. + onCleanup(_listener: () => void) {}, + cleanup() { + cleanupCount++ + scriptListeners.clear() + htmlListeners.clear() + finishedListeners.clear() + pendingScripts.length = 0 + bufferedHtml.length = 0 + hydrationSources.length = 0 + hydrationSourceHead = 0 + hydrationSource = undefined + hydrationSegment = '' + hydrationSegmentOffset = 0 + hydrationPhase = HydrationRecordPhase.Opening + hydrationOutputCapacity = MIN_HYDRATION_OUTPUT_BYTES + hydrationListener = undefined + hydrationOutput = undefined + hydrationError = undefined + hydrationState = HydrationOutputState.Done + }, + } + return { + router: { options: {}, serverSsr }, + emit(source: string) { + if (hydrationOutput) { + hydrationSources.push(source) + refreshHydrationState() + } else if (scriptListeners.size > 0) { + for (const listener of scriptListeners) { + listener([source]) + } + } else { + pendingScripts.push(source) + } + if (htmlListeners.size > 0) { + const html = SCRIPT_OPEN + source + SCRIPT_CLOSE + bufferedHtml.push(html) + for (const listener of htmlListeners) { + listener(html) + } + if (bufferedHtml[0] === html) { + bufferedHtml.shift() + } + } + }, + finish() { + finished = true + refreshHydrationState() + for (const listener of finishedListeners) { + listener() + } + }, + barrier, + counts: () => ({ + cleanupCount, + renderFinishedCount, + reserveCalls, + fastPathGrants, + scriptSubscriptions, + htmlSubscriptions, + bufferedHtmlReads, + hydrationOutputClaims, + hydrationOutputSubscriptions, + hydrationOutputPulls, + }), + } +} + +function createInput( + scenario: Scenario, + mode: Mode, + onEof: () => void, + beforeEof?: Promise, + onBeforeEof?: () => void, +) { + if (mode === 'merge' && scenario.kind === 'application-string') { + return streamFromIterator( + [createApplicationString(scenario)][Symbol.iterator](), + onEof, + beforeEof, + onBeforeEof, + ) + } + if (mode === 'merge' && scenario.kind === 'hydration') { + return streamFromIterator( + [Buffer.from(PREFIX), Buffer.from(SUFFIX)][Symbol.iterator](), + onEof, + beforeEof, + onBeforeEof, + ) + } + if (mode === 'merge' && scenario.kind === 'renderer-records') { + return streamFromIterator( + rendererRecordApplicationBytes(scenario), + onEof, + beforeEof, + onBeforeEof, + ) + } + return streamFromIterator( + integratedBytes(scenario), + onEof, + beforeEof, + onBeforeEof, + ) +} + +function findNeedle(chunk: Uint8Array, needle: Buffer, tail: Buffer) { + const value = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + let count = 0 + + if (tail.length > 0 && value.length > 0) { + const headLength = Math.min(value.length, needle.length - 1) + const boundary = Buffer.allocUnsafe(tail.length + headLength) + boundary.set(tail) + boundary.set(value.subarray(0, headLength), tail.length) + let offset = 0 + for (;;) { + const found = boundary.indexOf(needle, offset) + if (found === -1) { + break + } + if (found < tail.length && found + needle.length > tail.length) { + count++ + } + offset = found + 1 + } + } + + let offset = 0 + for (;;) { + const found = value.indexOf(needle, offset) + if (found === -1) { + break + } + count++ + offset = found + 1 + } + + const keep = Math.min(needle.length - 1, tail.length + value.length) + let nextTail: Buffer + if (keep === 0) { + nextTail = Buffer.alloc(0) + } else if (value.length >= keep) { + nextTail = Buffer.from(value.subarray(value.length - keep)) + } else { + nextTail = Buffer.allocUnsafe(keep) + const tailBytes = keep - value.length + nextTail.set(tail.subarray(tail.length - tailBytes)) + nextTail.set(value, tailBytes) + } + return { + count, + tail: nextTail, + } +} + +export async function run( + transform: Transform, + implementation: string, + scenarioName: string, + mode: Mode, + writeResult = true, + measureMemory = true, + validateOutput = true, +) { + const scenario = parseScenario(scenarioName) + const expectedOutput = getExpectedOutput(scenario, mode) + const routerSource = getRouterSource(scenario) + const containsRouterScripts = routerSource !== undefined + const hasLateScripts = mode === 'merge' && containsRouterScripts + const fake = makeRouter(mode !== 'merge') + let resolveProducerComplete!: () => void + const producerComplete = new Promise((resolve) => { + resolveProducerComplete = resolve + }) + if (!hasLateScripts) { + resolveProducerComplete() + } + let resolveAppContentConsumed!: () => void + const appContentConsumed = new Promise((resolve) => { + resolveAppContentConsumed = resolve + }) + if (scenario.kind !== 'renderer-records' || mode !== 'merge') { + resolveAppContentConsumed() + } + let startedAt = 0 + let rendererEofMs: number | null = null + const input = createInput( + scenario, + mode, + () => { + rendererEofMs = performance.now() - startedAt + if (mode === 'merge' && !hasLateScripts) { + fake.finish() + } + }, + hasLateScripts ? producerComplete : undefined, + resolveAppContentConsumed, + ) + if (measureMemory) { + forceGc() + } + const baseline = measureMemory ? memory() : undefined + const peak: Memory = { heapUsed: 0, external: 0, arrayBuffers: 0, rss: 0 } + const sample = () => { + if (!measureMemory) { + return + } + const value = delta(memory(), baseline!) + maxMemory(peak, value) + } + + startedAt = performance.now() + const output = + mode === 'raw' + ? (input as ReadableStream) + : transform( + fake.router, + input, + scenario.rendererSafePoint + ? { rendererSafePoint: scenario.rendererSafePoint } + : {}, + ) + + let sourceProducerMs = 0 + let producerFinishedMs: number | null = null + let outstandingSourceRecords = 0 + let outstandingSourceCodeUnits = 0 + let sourceRecordHighWater = 0 + let sourceCodeUnitHighWater = 0 + const producer = hasLateScripts + ? (async () => { + await fake.barrier + await appContentConsumed + const sourceStartedAt = performance.now() + for (let index = 0; index < routerSource!.records; index++) { + const source = createSource( + routerSource!.recordBytes, + index, + routerSource!.shape, + ) + outstandingSourceRecords++ + outstandingSourceCodeUnits += source.length + sourceRecordHighWater = Math.max( + sourceRecordHighWater, + outstandingSourceRecords, + ) + sourceCodeUnitHighWater = Math.max( + sourceCodeUnitHighWater, + outstandingSourceCodeUnits, + ) + fake.emit(source) + if (index % 16 === 15) { + await new Promise((resolve) => setImmediate(resolve)) + } + } + fake.finish() + sourceProducerMs = performance.now() - sourceStartedAt + producerFinishedMs = performance.now() - startedAt + sample() + resolveProducerComplete() + })() + : Promise.resolve() + + const reader = output.getReader() + const hash = validateOutput ? createHash('sha256') : undefined + const firstScriptNeedle = Buffer.from(marker(0)) + const completedScriptNeedle = Buffer.from(SCRIPT_CLOSE) + let firstScriptTail: Buffer = Buffer.alloc(0) + let completedScriptTail: Buffer = Buffer.alloc(0) + let firstRouterScriptMs: number | null = null + let bytes = 0 + let chunks = 0 + let maxOutputChunkBytes = 0 + let ttfbMs: number | null = null + for (;;) { + const result = await reader.read() + if (result.done) { + break + } + const now = performance.now() + if (ttfbMs === null) { + ttfbMs = now - startedAt + } + const value = result.value + bytes += value.byteLength + chunks++ + maxOutputChunkBytes = Math.max(maxOutputChunkBytes, value.byteLength) + hash?.update(value) + if ( + validateOutput && + containsRouterScripts && + firstRouterScriptMs === null + ) { + const match = findNeedle(value, firstScriptNeedle, firstScriptTail) + firstScriptTail = match.tail + if (match.count > 0) { + firstRouterScriptMs = now - startedAt + } + } + if (validateOutput && hasLateScripts) { + const completed = findNeedle( + value, + completedScriptNeedle, + completedScriptTail, + ) + completedScriptTail = completed.tail + if (completed.count > 0) { + outstandingSourceRecords -= completed.count + outstandingSourceCodeUnits -= + completed.count * routerSource!.recordBytes + } + } + if (chunks % 16 === 0) { + sample() + } + } + await producer + sample() + const elapsedMs = performance.now() - startedAt + const digest = hash?.digest('hex') ?? expectedOutput.digest + const memoryBeforeFinalGc = measureMemory ? memory() : undefined + if (measureMemory) { + maxMemory(peak, delta(memoryBeforeFinalGc!, baseline!)) + forceGc() + } + const finalMemory = measureMemory ? memory() : undefined + const counts = fake.counts() + let selectedApi: + | 'none' + | 'hydration-output' + | 'script-batch' + | 'injected-html' + | 'buffered-html' = 'none' + if ( + bytes !== expectedOutput.bytes || + (validateOutput && digest !== expectedOutput.digest) + ) { + throw new Error( + `Output validation failed: ${bytes}/${digest} !== ${expectedOutput.bytes}/${expectedOutput.digest}`, + ) + } + if (validateOutput && hasLateScripts && outstandingSourceRecords !== 0) { + throw new Error( + `Only ${routerSource!.records - outstandingSourceRecords} router records completed`, + ) + } + if (validateOutput && containsRouterScripts && firstRouterScriptMs === null) { + throw new Error('The output did not contain the first router script') + } + if ( + validateOutput && + hasLateScripts && + scenario.kind === 'hydration' && + (firstRouterScriptMs === null || + rendererEofMs === null || + firstRouterScriptMs >= rendererEofMs) + ) { + throw new Error( + `Router source did not start before renderer EOF: ${firstRouterScriptMs}/${rendererEofMs}`, + ) + } + if ( + validateOutput && + hasLateScripts && + (producerFinishedMs === null || + rendererEofMs === null || + producerFinishedMs > rendererEofMs) + ) { + throw new Error( + `Router producer finished after renderer EOF: ${producerFinishedMs}/${rendererEofMs}`, + ) + } + if ( + mode !== 'raw' && + (counts.cleanupCount < 1 || counts.renderFinishedCount !== 1) + ) { + throw new Error(`Invalid lifecycle counts: ${JSON.stringify(counts)}`) + } + if ( + mode === 'fast' && + (counts.reserveCalls !== 1 || + counts.fastPathGrants !== 1 || + counts.hydrationOutputClaims !== 0 || + counts.hydrationOutputSubscriptions !== 0 || + counts.hydrationOutputPulls !== 0) + ) { + throw new Error( + `Fast path was not selected exactly once: ${JSON.stringify(counts)}`, + ) + } + if (mode === 'merge') { + const mergeApi = + counts.hydrationOutputClaims === 1 && + counts.hydrationOutputSubscriptions === 1 && + counts.scriptSubscriptions === 0 && + counts.htmlSubscriptions === 0 + ? 'hydration-output' + : counts.hydrationOutputClaims === 0 && + counts.scriptSubscriptions === 1 && + counts.htmlSubscriptions === 0 + ? 'script-batch' + : counts.hydrationOutputClaims === 0 && + counts.scriptSubscriptions === 0 && + counts.htmlSubscriptions === 1 + ? counts.bufferedHtmlReads > 0 + ? 'buffered-html' + : 'injected-html' + : undefined + if (!mergeApi || counts.reserveCalls < 1) { + throw new Error( + `Merge path/API assertion failed: ${JSON.stringify(counts)}`, + ) + } + selectedApi = mergeApi + } + const dynamicPassThroughSelected = + mode === 'merge' && counts.fastPathGrants === 1 + const result = { + implementation, + scenario: scenario.name, + framework: scenario.framework, + rendererSafePoint: scenario.rendererSafePoint, + mode, + memoryMeasured: measureMemory, + selectedApi, + dynamicPassThroughSelected, + outputBytes: bytes, + outputSha256: digest, + chunks, + maxOutputChunkBytes, + ttfbMs, + firstRouterScriptMs, + producerFinishedMs, + rendererEofMs, + elapsedMs, + throughputMiBPerSecond: bytes / MiB / (elapsedMs / 1000), + sourceProducerMs, + sourceRecordHighWater, + sourceCodeUnitHighWater, + memoryBaselineBytes: baseline, + memoryPeakBytes: measureMemory ? peak : undefined, + memoryBeforeFinalGcBytes: memoryBeforeFinalGc, + memoryBeforeFinalGcDeltaBytes: measureMemory + ? delta(memoryBeforeFinalGc!, baseline!) + : undefined, + memoryAfterFinalGcBytes: finalMemory, + memoryAfterFinalGcDeltaBytes: measureMemory + ? delta(finalMemory!, baseline!) + : undefined, + resourceUsage: measureMemory ? process.resourceUsage() : undefined, + lifecycle: counts, + } + if (writeResult) { + process.stdout.write(`${JSON.stringify(result)}\n`) + } + return result +} + +type NumericSummary = { + mean: number + median: number + p10: number + p90: number + min: number + max: number +} + +function summarizeNumbers(values: Array): NumericSummary { + const sorted = values.slice().sort((a, b) => a - b) + const at = (fraction: number) => + sorted[Math.floor((sorted.length - 1) * fraction)]! + const middle = Math.floor(sorted.length / 2) + const median = + sorted.length % 2 === 0 + ? (sorted[middle - 1]! + sorted[middle]!) / 2 + : sorted[middle]! + return { + mean: values.reduce((sum, value) => sum + value, 0) / values.length, + median, + p10: at(0.1), + p90: at(0.9), + min: sorted[0]!, + max: sorted[sorted.length - 1]!, + } +} + +type MeasuredRun = Awaited> + +type WarmBatch = { + requests: number + elapsedMs: number + wallElapsedMs: number + ttfbMs: number + outputBytes: number + outputSha256: string + chunks: number + maxOutputChunkBytes: number + sourceRecordHighWater: number + dynamicPassThroughRequests: number +} + +type WarmBatchAccumulator = Omit< + WarmBatch, + 'outputBytes' | 'outputSha256' | 'chunks' +> & { + first?: MeasuredRun +} + +function createWarmBatchAccumulator(requests: number): WarmBatchAccumulator { + return { + requests, + elapsedMs: 0, + wallElapsedMs: 0, + ttfbMs: 0, + maxOutputChunkBytes: 0, + sourceRecordHighWater: 0, + dynamicPassThroughRequests: 0, + } +} + +function recordWarmRun( + batch: WarmBatchAccumulator, + row: MeasuredRun, + wallElapsedMs: number, +) { + batch.first ??= row + batch.elapsedMs += row.elapsedMs + batch.wallElapsedMs += wallElapsedMs + batch.ttfbMs += row.ttfbMs! + batch.maxOutputChunkBytes = Math.max( + batch.maxOutputChunkBytes, + row.maxOutputChunkBytes, + ) + batch.sourceRecordHighWater = Math.max( + batch.sourceRecordHighWater, + row.sourceRecordHighWater, + ) + if (row.dynamicPassThroughSelected) { + batch.dynamicPassThroughRequests++ + } +} + +function finishWarmBatch(batch: WarmBatchAccumulator): WarmBatch { + const { first, ...totals } = batch + if (!first) { + throw new Error('A warm benchmark batch did not run any requests') + } + return { + ...totals, + outputBytes: first.outputBytes, + outputSha256: first.outputSha256, + chunks: first.chunks, + } +} + +async function runWarmPair( + baselineName: BaselineImplementation, + baselineTransform: Transform, + worktreeTransform: Transform, + scenario: Scenario, + mode: Mode, + requests: number, + startWith: 'baseline' | 'worktree', +) { + const batches = { + baseline: createWarmBatchAccumulator(requests), + worktree: createWarmBatchAccumulator(requests), + } + + for (let index = 0; index < requests; index++) { + const baselineFirst = (index & 1) === (startWith === 'baseline' ? 0 : 1) + let implementation: 'baseline' | 'worktree' = baselineFirst + ? 'baseline' + : 'worktree' + for (let position = 0; position < 2; position++) { + const wallStartedAt = performance.now() + const row = await run( + implementation === 'baseline' ? baselineTransform : worktreeTransform, + implementation === 'baseline' ? baselineName : 'worktree', + scenario.name, + mode, + false, + false, + false, + ) + recordWarmRun( + batches[implementation], + row, + performance.now() - wallStartedAt, + ) + implementation = implementation === 'baseline' ? 'worktree' : 'baseline' + } + } + + return { + baseline: finishWarmBatch(batches.baseline), + worktree: finishWarmBatch(batches.worktree), + } +} + +function summarizeWarmBatches( + implementation: string, + scenario: Scenario, + mode: Mode, + rows: Array, +) { + const batchRequests = rows[0]!.requests + const elapsedMs = summarizeNumbers( + rows.map((row) => row.elapsedMs / row.requests), + ) + const batchElapsedMs = summarizeNumbers(rows.map((row) => row.elapsedMs)) + const batchWallElapsedMs = summarizeNumbers( + rows.map((row) => row.wallElapsedMs), + ) + const ttfbMs = summarizeNumbers(rows.map((row) => row.ttfbMs / row.requests)) + const throughputMiBPerSecond = summarizeNumbers( + rows.map( + (row) => (row.outputBytes * row.requests) / MiB / (row.elapsedMs / 1000), + ), + ) + const dynamicPassThroughRequests = rows.reduce( + (total, row) => total + row.dynamicPassThroughRequests, + 0, + ) + return { + implementation, + scenario: scenario.name, + framework: scenario.framework, + rendererSafePoint: scenario.rendererSafePoint, + mode, + measurement: 'warm', + memoryMeasured: false, + iterations: rows.length, + batchRequests, + measuredRequests: rows.length * batchRequests, + dynamicPassThroughRequests, + dynamicPassThroughRate: + dynamicPassThroughRequests / (rows.length * batchRequests), + outputBytes: rows[0]!.outputBytes, + outputSha256: rows[0]!.outputSha256, + chunks: rows[0]!.chunks, + maxOutputChunkBytes: Math.max( + ...rows.map((row) => row.maxOutputChunkBytes), + ), + ttfbMs: ttfbMs.median, + elapsedMs: elapsedMs.median, + throughputMiBPerSecond: throughputMiBPerSecond.median, + sourceRecordHighWater: Math.max( + ...rows.map((row) => row.sourceRecordHighWater), + ), + statistics: { + elapsedMs, + batchElapsedMs, + batchWallElapsedMs, + ttfbMs, + throughputMiBPerSecond, + }, + } +} + +function summarizePercentRatios(values: Array) { + const logs = summarizeNumbers(values.map((value) => Math.log(value))) + const toPercent = (value: number) => (Math.exp(value) - 1) * 100 + return { + geometricMean: toPercent(logs.mean), + median: toPercent(logs.median), + p10: toPercent(logs.p10), + p90: toPercent(logs.p90), + min: toPercent(logs.min), + max: toPercent(logs.max), + } +} + +async function measureWarmComparison( + baselineName: BaselineImplementation, + baselineTransform: Transform, + worktreeTransform: Transform, + scenarioNames: Array, + requestedModes: Array, + warmups: number, + iterations: number, + batchRequests: number, +) { + const results = [] + const comparisons = [] + + for (const scenarioName of scenarioNames) { + const scenario = parseScenario(scenarioName) + const availableModes: Array = + scenario.kind === 'application-string' || + scenario.kind === 'coalesced-close' + ? ['merge'] + : scenario.kind !== 'renderer-records' && scenario.framework === 'react' + ? ['fast', 'merge'] + : ['merge'] + const modes = availableModes.filter((mode) => requestedModes.includes(mode)) + for (const mode of modes) { + await run( + baselineTransform, + baselineName, + scenario.name, + mode, + false, + false, + true, + ) + await run( + worktreeTransform, + 'worktree', + scenario.name, + mode, + false, + false, + true, + ) + forceGc() + for (let index = 0; index < warmups; index++) { + const order: Array<'baseline' | 'worktree'> = + index % 2 === 0 ? ['baseline', 'worktree'] : ['worktree', 'baseline'] + for (const implementation of order) { + await run( + implementation === 'baseline' + ? baselineTransform + : worktreeTransform, + implementation === 'baseline' ? baselineName : 'worktree', + scenario.name, + mode, + false, + false, + ) + } + } + + const rows: Record<'baseline' | 'worktree', Array> = { + baseline: [], + worktree: [], + } + const elapsedRatios: Array = [] + const wallElapsedRatios: Array = [] + for (let index = 0; index < iterations; index++) { + const pair = await runWarmPair( + baselineName, + baselineTransform, + worktreeTransform, + scenario, + mode, + batchRequests, + index % 2 === 0 ? 'baseline' : 'worktree', + ) + rows.baseline.push(pair.baseline) + rows.worktree.push(pair.worktree) + elapsedRatios.push(pair.worktree.elapsedMs / pair.baseline.elapsedMs) + wallElapsedRatios.push( + pair.worktree.wallElapsedMs / pair.baseline.wallElapsedMs, + ) + } + + const baseline = summarizeWarmBatches( + baselineName, + scenario, + mode, + rows.baseline, + ) + const worktree = summarizeWarmBatches( + 'worktree', + scenario, + mode, + rows.worktree, + ) + const baselineElapsedTotal = rows.baseline.reduce( + (total, row) => total + row.elapsedMs, + 0, + ) + const worktreeElapsedTotal = rows.worktree.reduce( + (total, row) => total + row.elapsedMs, + 0, + ) + const baselineWallTotal = rows.baseline.reduce( + (total, row) => total + row.wallElapsedMs, + 0, + ) + const worktreeWallTotal = rows.worktree.reduce( + (total, row) => total + row.wallElapsedMs, + 0, + ) + results.push( + { ...baseline, comparisonBaseline: baselineName }, + { ...worktree, comparisonBaseline: baselineName }, + ) + comparisons.push({ + baseline: baselineName, + scenario: scenario.name, + framework: scenario.framework, + rendererSafePoint: scenario.rendererSafePoint, + mode, + pairedElapsedPercent: summarizePercentRatios(elapsedRatios), + pairedWallElapsedPercent: summarizePercentRatios(wallElapsedRatios), + aggregateElapsedPercent: + (worktreeElapsedTotal / baselineElapsedTotal - 1) * 100, + aggregateWallElapsedPercent: + (worktreeWallTotal / baselineWallTotal - 1) * 100, + elapsedMedianPercent: + (worktree.statistics.elapsedMs.median / + baseline.statistics.elapsedMs.median - + 1) * + 100, + samples: rows.baseline.map((baselineRow, index) => ({ + baselineElapsedMs: baselineRow.elapsedMs, + candidateElapsedMs: rows.worktree[index]!.elapsedMs, + baselineWallElapsedMs: baselineRow.wallElapsedMs, + candidateWallElapsedMs: rows.worktree[index]!.wallElapsedMs, + elapsedRatio: elapsedRatios[index]!, + wallElapsedRatio: wallElapsedRatios[index]!, + })), + }) + } + } + + return { + warmups, + iterations, + batchRequests, + measuredRequestsPerImplementation: iterations * batchRequests, + scenarios: scenarioNames, + order: `${baselineName}/worktree order alternates for every request and reverses at each batch start`, + validation: + 'SHA-256 and marker checks in untimed preflight/warm-up requests; timed requests retain byte, lifecycle, and API checks', + source: + 'fresh renderer bytes for fast mode and one fresh router source string for merge mode', + memory: 'not measured in the warm latency loop', + garbageCollection: + 'forced once before warm-up; natural GC remains enabled for all measured batches', + results, + comparisons, + } +} + +export function runWarmComparison( + transforms: Record<'origin' | 'worktree', Transform>, + scenarioNames: Array, + requestedModes: Array, + warmups: number, + iterations: number, + batchRequests: number, +) { + return measureWarmComparison( + 'origin', + transforms.origin, + transforms.worktree, + scenarioNames, + requestedModes, + warmups, + iterations, + batchRequests, + ) +} + +function safeWindowEnd(value: string, start: number, wantedEnd: number) { + const end = Math.min(wantedEnd, value.length) + if (end <= start || end >= value.length) { + return end + } + const previous = value.charCodeAt(end - 1) + const next = value.charCodeAt(end) + return previous >= 0xd800 && + previous <= 0xdbff && + next >= 0xdc00 && + next <= 0xdfff + ? end - 1 + : end +} + +export function runProbe( + shape: Shape, + sizeMiB: number, + strategy: 'suffix' | 'window', +) { + const bytes = sizeMiB * MiB + const source = createSource(bytes, 0, shape) + const expectedHash = createHash('sha256') + updateSource(expectedHash, bytes, 0) + const expectedDigest = expectedHash.digest('hex') + forceGc() + const baseline = memory() + const encoder = new TextEncoder() + const passes = [] + for (let pass = 1; pass <= 2; pass++) { + const hash = createHash('sha256') + const peak: Memory = { heapUsed: 0, external: 0, arrayBuffers: 0, rss: 0 } + let offset = 0 + let chunks = 0 + const startedAt = performance.now() + while (offset < source.length) { + const output = new Uint8Array(OUTPUT_BYTES) + const input = + strategy === 'suffix' + ? source.slice(offset) + : source.slice( + offset, + safeWindowEnd(source, offset, offset + OUTPUT_BYTES), + ) + const encoded = encoder.encodeInto(input, output) + if (encoded.read === 0) { + throw new Error('Probe encoder made no progress') + } + offset += encoded.read + hash.update(output.subarray(0, encoded.written)) + chunks++ + if (chunks % 16 === 0) { + maxMemory(peak, delta(memory(), baseline)) + } + } + const elapsedMs = performance.now() - startedAt + const digest = hash.digest('hex') + if (digest !== expectedDigest || offset !== source.length) { + throw new Error('Source-window probe validation failed') + } + maxMemory(peak, delta(memory(), baseline)) + forceGc() + const afterGc = delta(memory(), baseline) + passes.push({ + pass, + elapsedMs, + throughputMiBPerSecond: bytes / MiB / (elapsedMs / 1000), + chunks, + memoryPeakBytes: peak, + memoryAfterGcBytes: afterGc, + }) + } + process.stdout.write( + `${JSON.stringify({ + implementation: 'v8-probe', + scenario: `encode-${shape}-${sizeMiB}m`, + mode: strategy, + sourceReadyBaselineBytes: baseline, + outputBytes: bytes, + outputChunkBytes: OUTPUT_BYTES, + outputSha256: expectedDigest, + passes, + })}\n`, + ) +} + +type HydrationOwner = { + takeInitialHydrationScriptTags(): unknown + claimOutput(): { + state: number + pullChunk(): Uint8Array + } + liftBarrier(): void + pushSource(source: string): void + finish(): void + cleanup(): void +} + +type CreateHydrationOwner = ( + nonce: string | undefined, + initialSources: ReadonlyArray, +) => HydrationOwner + +type HydrationOwnerExpected = { + records: number + recordBytes: number + bytes: number + digest: string +} + +const hydrationOwnerExpectedCache = new Map() + +function getHydrationOwnerExpected(scenarioName: string) { + const cached = hydrationOwnerExpectedCache.get(scenarioName) + if (cached) { + return cached + } + const match = /^hydration-owner-(\d+)x(\d+)k$/.exec(scenarioName) + if (!match) { + throw new Error(`Unknown hydration-owner scenario: ${scenarioName}`) + } + const records = Number(match[1]) + const recordBytes = Number(match[2]) * 1024 + const hash = createHash('sha256') + let bytes = 0 + const addExpected = (value: string) => { + hash.update(value) + bytes += Buffer.byteLength(value) + } + let partIndex = 0 + while (partIndex <= records) { + const batchStart = partIndex + let codeUnits = SCRIPT_OPEN.length + SCRIPT_CLOSE.length - 1 + while (partIndex <= records) { + const partLength = + partIndex === records ? '$_TSR.e()'.length : recordBytes + const nextCodeUnits = codeUnits + 1 + partLength + if (partIndex > batchStart && nextCodeUnits > OUTPUT_BYTES) { + break + } + codeUnits = nextCodeUnits + partIndex++ + if (codeUnits > OUTPUT_BYTES) { + break + } + } + addExpected(SCRIPT_OPEN) + for (let index = batchStart; index < partIndex; index++) { + if (index > batchStart) { + addExpected(';') + } + if (index === records) { + addExpected('$_TSR.e()') + } else { + updateSource(hash, recordBytes, index) + bytes += recordBytes + } + } + addExpected(SCRIPT_CLOSE) + } + const expected = { + records, + recordBytes, + bytes, + digest: hash.digest('hex'), + } + hydrationOwnerExpectedCache.set(scenarioName, expected) + return expected +} + +function measureHydrationOwner( + createHydrationOwner: CreateHydrationOwner, + implementation: string, + scenarioName: string, + measureMemory: boolean, + validateOutput = true, +) { + const expected = getHydrationOwnerExpected(scenarioName) + if (measureMemory) { + forceGc() + } + const baseline = measureMemory ? memory() : undefined + const peak: Memory = { heapUsed: 0, external: 0, arrayBuffers: 0, rss: 0 } + const sample = () => { + if (measureMemory) { + maxMemory(peak, delta(memory(), baseline!)) + } + } + const owner = createHydrationOwner(undefined, []) + owner.takeInitialHydrationScriptTags() + const output = owner.claimOutput() + owner.liftBarrier() + for (let index = 0; index < expected.records; index++) { + owner.pushSource(createSource(expected.recordBytes, index, 'flat')) + } + owner.finish() + sample() + const hash = validateOutput ? createHash('sha256') : undefined + let bytes = 0 + let chunks = 0 + let maxOutputChunkBytes = 0 + const startedAt = performance.now() + while ( + output.state === HydrationOutputState.Ready || + output.state === HydrationOutputState.Active + ) { + const chunk = output.pullChunk() + hash?.update(chunk) + bytes += chunk.byteLength + chunks++ + maxOutputChunkBytes = Math.max(maxOutputChunkBytes, chunk.byteLength) + if (measureMemory && (chunks & 15) === 0) { + sample() + } + } + const elapsedMs = performance.now() - startedAt + if (measureMemory) { + sample() + } + const digest = hash?.digest('hex') ?? expected.digest + if ( + output.state !== HydrationOutputState.Done || + bytes !== expected.bytes || + (validateOutput && digest !== expected.digest) || + maxOutputChunkBytes > OUTPUT_BYTES + ) { + throw new Error( + `Hydration-owner validation failed: ${output.state}/${bytes}/${digest}/${maxOutputChunkBytes}`, + ) + } + owner.cleanup() + return { + implementation, + scenario: scenarioName, + framework: 'router-core', + mode: 'owner', + outputBytes: bytes, + outputSha256: digest, + chunks, + maxOutputChunkBytes, + elapsedMs, + throughputMiBPerSecond: bytes / MiB / (elapsedMs / 1000), + memoryPeakBytes: measureMemory ? peak : undefined, + sourceRecordHighWater: expected.records + 1, + } +} + +export function runHydrationOwner( + createHydrationOwner: CreateHydrationOwner, + implementation: string, + scenarioName: string, +) { + process.stdout.write( + `${JSON.stringify( + measureHydrationOwner( + createHydrationOwner, + implementation, + scenarioName, + true, + ), + )}\n`, + ) +} + +export function runHydrationOwnerSoak( + createHydrationOwner: CreateHydrationOwner, + implementation: string, + scenarioName: string, +) { + const expected = getHydrationOwnerExpected(scenarioName) + const requestsPerBlock = expected.records > 1000 ? 5 : 500 + const blocks = 10 + measureHydrationOwner( + createHydrationOwner, + implementation, + scenarioName, + false, + true, + ) + for (let index = 0; index < Math.min(100, requestsPerBlock); index++) { + measureHydrationOwner( + createHydrationOwner, + implementation, + scenarioName, + false, + false, + ) + } + forceGc() + const baseline = memory() + const highWater: Memory = { + heapUsed: 0, + external: 0, + arrayBuffers: 0, + rss: 0, + } + const checkpoints = [] + const startedAt = performance.now() + for (let block = 1; block <= blocks; block++) { + for (let request = 0; request < requestsPerBlock; request++) { + measureHydrationOwner( + createHydrationOwner, + implementation, + scenarioName, + false, + false, + ) + } + forceGc() + const retained = delta(memory(), baseline) + maxMemory(highWater, retained) + checkpoints.push({ block, requests: block * requestsPerBlock, retained }) + } + const elapsedMs = performance.now() - startedAt + const finalRetained = checkpoints.at(-1)!.retained + process.stdout.write( + `${JSON.stringify({ + implementation, + scenario: scenarioName, + framework: 'router-core', + mode: 'owner-soak', + requests: blocks * requestsPerBlock, + aggregateOutputBytes: expected.bytes * blocks * requestsPerBlock, + validatedPerRequestOutputSha256: expected.digest, + elapsedIncludingGcMs: elapsedMs, + throughputIncludingGcMiBPerSecond: + (expected.bytes * blocks * requestsPerBlock) / MiB / (elapsedMs / 1000), + retainedHighWaterBytes: highWater, + retainedAfterFinalGcBytes: finalRetained, + retentionCheckpoints: checkpoints, + sourceRecordHighWater: expected.records + 1, + })}\n`, + ) +} + +export function runWarmHydrationOwnerComparison( + factories: Record<'origin' | 'worktree', CreateHydrationOwner>, + scenarioNames: Array, + warmups: number, + iterations: number, + batchRequests: number, +) { + const results = [] + const comparisons = [] + for (const scenarioName of scenarioNames) { + measureHydrationOwner(factories.origin, 'origin', scenarioName, false, true) + measureHydrationOwner( + factories.worktree, + 'worktree', + scenarioName, + false, + true, + ) + forceGc() + for (let index = 0; index < warmups; index++) { + const first = index % 2 === 0 ? 'origin' : 'worktree' + const second = first === 'origin' ? 'worktree' : 'origin' + measureHydrationOwner(factories[first], first, scenarioName, false, false) + measureHydrationOwner( + factories[second], + second, + scenarioName, + false, + false, + ) + } + const elapsed: Record<'origin' | 'worktree', Array> = { + origin: [], + worktree: [], + } + const wall: Record<'origin' | 'worktree', Array> = { + origin: [], + worktree: [], + } + const samples = [] + const firstResult: Partial< + Record<'origin' | 'worktree', ReturnType> + > = {} + for (let iteration = 0; iteration < iterations; iteration++) { + const totals = { + origin: { elapsed: 0, wall: 0 }, + worktree: { elapsed: 0, wall: 0 }, + } + for (let request = 0; request < batchRequests; request++) { + const originFirst = (request & 1) === (iteration & 1) + const order: Array<'origin' | 'worktree'> = originFirst + ? ['origin', 'worktree'] + : ['worktree', 'origin'] + for (const implementation of order) { + const startedAt = performance.now() + const row = measureHydrationOwner( + factories[implementation], + implementation, + scenarioName, + false, + false, + ) + firstResult[implementation] ??= row + totals[implementation].wall += performance.now() - startedAt + totals[implementation].elapsed += row.elapsedMs + } + } + elapsed.origin.push(totals.origin.elapsed / batchRequests) + elapsed.worktree.push(totals.worktree.elapsed / batchRequests) + wall.origin.push(totals.origin.wall / batchRequests) + wall.worktree.push(totals.worktree.wall / batchRequests) + samples.push({ + baselineElapsedMs: totals.origin.elapsed, + candidateElapsedMs: totals.worktree.elapsed, + baselineWallElapsedMs: totals.origin.wall, + candidateWallElapsedMs: totals.worktree.wall, + elapsedRatio: totals.worktree.elapsed / totals.origin.elapsed, + wallElapsedRatio: totals.worktree.wall / totals.origin.wall, + }) + } + const originElapsed = summarizeNumbers(elapsed.origin) + const worktreeElapsed = summarizeNumbers(elapsed.worktree) + for (const implementation of ['origin', 'worktree'] as const) { + const statistics = summarizeNumbers(elapsed[implementation]) + results.push({ + ...firstResult[implementation], + implementation, + measurement: 'warm', + memoryMeasured: false, + iterations, + batchRequests, + measuredRequests: iterations * batchRequests, + elapsedMs: statistics.median, + throughputMiBPerSecond: + firstResult[implementation]!.outputBytes / + MiB / + (statistics.median / 1000), + statistics: { elapsedMs: statistics }, + comparisonBaseline: 'origin', + }) + } + comparisons.push({ + baseline: 'origin', + scenario: scenarioName, + framework: 'router-core', + mode: 'owner', + pairedElapsedPercent: summarizePercentRatios( + samples.map((sample) => sample.elapsedRatio), + ), + pairedWallElapsedPercent: summarizePercentRatios( + samples.map((sample) => sample.wallElapsedRatio), + ), + aggregateElapsedPercent: + (worktreeElapsed.mean / originElapsed.mean - 1) * 100, + aggregateWallElapsedPercent: + (summarizeNumbers(wall.worktree).mean / + summarizeNumbers(wall.origin).mean - + 1) * + 100, + elapsedMedianPercent: + (worktreeElapsed.median / originElapsed.median - 1) * 100, + samples, + }) + } + return { + warmups, + iterations, + batchRequests, + measuredRequestsPerImplementation: iterations * batchRequests, + scenarios: scenarioNames, + order: 'origin/worktree order alternates for every request and batch', + validation: + 'SHA-256 in one untimed preflight per implementation; timed requests retain byte, state, and output-limit checks', + memory: 'not measured in the warm latency loop', + garbageCollection: 'forced once before each scenario warm-up', + results, + comparisons, + } +} diff --git a/packages/router-core/package.json b/packages/router-core/package.json index 7686ddedac..ed2b794278 100644 --- a/packages/router-core/package.json +++ b/packages/router-core/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/router-core", - "version": "1.171.15", + "version": "1.171.39", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -22,12 +22,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch", @@ -68,16 +68,6 @@ "default": "./dist/cjs/ssr/client.cjs" } }, - "./native-navigation": { - "import": { - "types": "./dist/esm/nativeNavigation.d.ts", - "default": "./dist/esm/nativeNavigation.js" - }, - "require": { - "types": "./dist/cjs/nativeNavigation.d.cts", - "default": "./dist/cjs/nativeNavigation.cjs" - } - }, "./isServer": { "development": { "import": { @@ -194,13 +184,19 @@ "dependencies": { "@tanstack/history": "workspace:*", "cookie-es": "^3.0.0", - "seroval": "^1.5.4", - "seroval-plugins": "^1.5.4" + "seroval": "^1.6.7", + "seroval-plugins": "^1.6.7" }, "devDependencies": { - "@tanstack/store": "^0.9.3", + "@tanstack/store": "^0.11.2", "@types/node": "25.0.9", "esbuild": "^0.27.4", - "vite": "*" + "vite": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" } } diff --git a/packages/router-core/skills/router-core/SKILL.md b/packages/router-core/skills/router-core/SKILL.md index de11b17d28..cadb832037 100644 --- a/packages/router-core/skills/router-core/SKILL.md +++ b/packages/router-core/skills/router-core/SKILL.md @@ -5,9 +5,10 @@ description: >- createRouter, createRoute, createRootRoute, createRootRouteWithContext, addChildren, Register type declaration, route matching, route sorting, file naming conventions. Entry point for all router skills. -type: core -library: tanstack-router -library_version: '1.166.2' +metadata: + type: core + library: tanstack-router + library_version: '1.171.15' --- # TanStack Router Core @@ -18,6 +19,8 @@ TanStack Router is a type-safe router for React and Solid with built-in SWR cach > **CRITICAL**: TanStack Router is CLIENT-FIRST. Loaders run on the client by default, NOT server-only like Remix/Next.js. Do not confuse TanStack Router APIs with Next.js or React Router. +Use this entry skill to choose one primary sub-skill. Do not load the full catalog. Load a second sub-skill only when the task crosses a real boundary, such as an authenticated loader that needs both `auth-and-guards` and `data-loading`. + ## Sub-Skills | Task | Sub-Skill | @@ -66,6 +69,22 @@ Need server-side rendering? → router-core/ssr ``` +## Cross-Cutting Completion Checks + +For route refactors: + +1. Rename or move the route file; do not hand-edit the generated `createFileRoute` path. +2. Regenerate `routeTree.gen.ts` with the configured Router plugin or CLI. +3. Update links, redirects, `from` narrowing, params, and tests that reference the old route. +4. Run type tests and a production build. A typecheck alone does not prove route generation or bundling works. + +For response schema changes: + +1. Update the source model and shared validation schema. +2. Update the server function or API serializer so the field exists at runtime. +3. Update loader and component consumers without casts. +4. Assert the actual response payload in a unit or integration test. Typechecking cannot catch a serializer that omits the new field. + ## Minimal Working Example ```tsx @@ -136,4 +155,4 @@ The plugin auto-generates this string. If you rename a route file, the plugin up ## Version Note -This skill targets `@tanstack/router-core` v1.166.2 and `@tanstack/react-router` v1.166.2. APIs are stable. Splat routes use `$` (not `*`); the `*` compat alias will be removed in v2. +This skill targets `@tanstack/router-core` v1.171.15. Splat routes use `$` (not `*`); the `*` compat alias will be removed in v2. diff --git a/packages/router-core/skills/router-core/auth-and-guards/SKILL.md b/packages/router-core/skills/router-core/auth-and-guards/SKILL.md index 94d0090d78..4d1a6a3b6e 100644 --- a/packages/router-core/skills/router-core/auth-and-guards/SKILL.md +++ b/packages/router-core/skills/router-core/auth-and-guards/SKILL.md @@ -1,17 +1,17 @@ --- -name: router-core/auth-and-guards +name: auth-and-guards description: >- Route protection with beforeLoad, redirect()/throw redirect(), isRedirect helper, authenticated layout routes (_authenticated), non-redirect auth (inline login), RBAC with roles and permissions, auth provider integration (Auth0, Clerk, Supabase), router context for auth state. -type: sub-skill -library: tanstack-router -library_version: '1.166.2' +metadata: + type: sub-skill + library: tanstack-router + library_version: '1.171.15' requires: - router-core - - router-core/data-loading sources: - TanStack/router:docs/router/guide/authenticated-routes.md - TanStack/router:docs/router/how-to/setup-authentication.md @@ -21,7 +21,7 @@ sources: # Auth and Guards -> **This skill covers the routing side of auth.** Route guards are UX and navigation control; the data/API boundary still belongs in the server function, server route, or API endpoint that reads or mutates private data. For the **server-side primitives** — session cookies (`HttpOnly`/`Secure`/`SameSite`), `useSession`-style helpers, OAuth `state` + PKCE, password-reset enumeration defense, CSRF, rate limiting — see [start-core/auth-server-primitives](../../../../start-client-core/skills/start-core/auth-server-primitives/SKILL.md). +> **This skill covers the routing side of auth.** Route guards are UX and navigation control; the data/API boundary still belongs in the server function, server route, or API endpoint that reads or mutates private data. For the **server-side primitives** — session cookies (`HttpOnly`/`Secure`/`SameSite`), external session helpers, OAuth `state` + PKCE, password-reset enumeration defense, CSRF, rate limiting — see `@tanstack/start-client-core#start-core/auth-server-primitives`. > > **CRITICAL**: A route guard (`beforeLoad`) does NOT protect a `createServerFn` declared on that route. Server functions are API endpoints reachable independently of the route that calls them. See "Route guards do not protect server functions" below. @@ -377,7 +377,7 @@ export const Route = createFileRoute('/_authenticated')({ ### CRITICAL: Route guards do not protect server functions -A `beforeLoad` redirect protects the **route's UI**, not the **server functions** declared on it. `createServerFn` produces an RPC endpoint reachable by direct POST regardless of which route renders the calling UI. An attacker doesn't have to load `/_authenticated/orders` — they can curl the RPC endpoint directly. +A `beforeLoad` redirect protects the **route's UI**, not the **server functions** declared on it. `createServerFn` produces an RPC endpoint reachable directly with its declared HTTP method regardless of which route renders the calling UI. An attacker doesn't have to load `/_authenticated/orders` — they can call this GET RPC endpoint directly. ```tsx // WRONG — handler has no auth check; the route guard doesn't help @@ -408,7 +408,11 @@ const getMyOrders = createServerFn({ method: 'GET' }) }) ``` -Rule of thumb: every `createServerFn`, server route, or API endpoint that touches user data needs `authMiddleware` (or an equivalent in-handler check). The route guard is for the page experience; the endpoint guard is for the data. See [start-core/auth-server-primitives](../../../../start-client-core/skills/start-core/auth-server-primitives/SKILL.md) for the full session/middleware pattern. +Rule of thumb: every `createServerFn`, server route, or API endpoint that touches user data needs `authMiddleware` (or an equivalent in-handler check). The route guard is for the page experience; the endpoint guard is for the data. See `@tanstack/start-client-core#start-core/auth-server-primitives` for the full session/middleware pattern. + +### CRITICAL: The anonymous destination can still disclose protected data + +Protect the entire anonymous response, not only the API call. A public login or unauthorized page still leaks data if its title, copy, search params, or serialized loader state names the protected user, tenant, record, or resource. Test a direct anonymous request and follow redirects. Assert that the handler rejects before reading private data, no protected loader runs, the final HTML and serialized state contain no protected identity, and the redirect contains only a sanitized relative return URL. ### HIGH: Auth check in component instead of beforeLoad @@ -435,8 +439,6 @@ export const Route = createFileRoute('/_authenticated/dashboard')({ }) ``` -`beforeLoad` runs before any component rendering and before the loader. It completely prevents the flash. - ### HIGH: Not re-throwing redirects in try/catch `redirect()` works by throwing. If `beforeLoad` has a try/catch, the redirect gets swallowed: @@ -490,8 +492,6 @@ export const Route = createFileRoute('/_authenticated')({ Place protected routes as children of the `_authenticated` layout route. Public routes (login, home, etc.) live outside it. ---- - ## Cross-References - See also: **router-core/data-loading/SKILL.md** — `beforeLoad` runs before `loader`; auth context flows into loader via route context diff --git a/packages/router-core/skills/router-core/code-splitting/SKILL.md b/packages/router-core/skills/router-core/code-splitting/SKILL.md index 8d1ba4e7a5..aac9098121 100644 --- a/packages/router-core/skills/router-core/code-splitting/SKILL.md +++ b/packages/router-core/skills/router-core/code-splitting/SKILL.md @@ -1,13 +1,14 @@ --- -name: router-core/code-splitting +name: code-splitting description: >- Automatic code splitting (autoCodeSplitting), .lazy.tsx convention, createLazyFileRoute, createLazyRoute, lazyRouteComponent, getRouteApi for typed hooks in split files, codeSplitGroupings per-route override, splitBehavior programmatic config, critical vs non-critical properties. -type: sub-skill -library: tanstack-router -library_version: '1.166.2' +metadata: + type: sub-skill + library: tanstack-router + library_version: '1.171.15' requires: - router-core sources: diff --git a/packages/router-core/skills/router-core/data-loading/SKILL.md b/packages/router-core/skills/router-core/data-loading/SKILL.md index 59a71a0cca..6a4364ff1f 100644 --- a/packages/router-core/skills/router-core/data-loading/SKILL.md +++ b/packages/router-core/skills/router-core/data-loading/SKILL.md @@ -1,14 +1,15 @@ --- -name: router-core/data-loading +name: data-loading description: >- Route loader option, loaderDeps for cache keys, staleTime/gcTime/ defaultPreloadStaleTime SWR caching, pendingComponent/pendingMs/ pendingMinMs, errorComponent/onError/onCatch, beforeLoad, router context and createRootRouteWithContext DI pattern, router.invalidate, Await component, deferred data loading with unawaited promises. -type: sub-skill -library: tanstack-router -library_version: '1.166.2' +metadata: + type: sub-skill + library: tanstack-router + library_version: '1.171.15' requires: - router-core sources: @@ -216,13 +217,29 @@ Route-level context via `beforeLoad`: ```tsx export const Route = createFileRoute('/posts')({ - beforeLoad: () => ({ - fetchPosts: () => fetch('/api/posts').then((r) => r.json()), + beforeLoad: ({ context }) => ({ + fetchPosts: context.fetchPosts, }), loader: ({ context: { fetchPosts } }) => fetchPosts(), }) ``` +Keep the implementation SSR-safe when the router is used by TanStack Start. A relative `fetch('/api/posts')` works in a browser event handler, but Node and many server runtimes require an absolute URL during SSR. For app-internal data in Start, call a server function from the loader: + +```tsx +import { createServerFn } from '@tanstack/react-start' + +const getPosts = createServerFn({ method: 'GET' }).handler(() => { + return db.posts.findMany() +}) + +export const Route = createFileRoute('/posts')({ + loader: () => getPosts(), +}) +``` + +Use a server route plus an origin-derived absolute URL only when the HTTP boundary itself is required. Do not hard-code the production origin. + ### Deferred Data Loading Return unawaited promises from the loader for non-critical data. Use the `Await` component to render them: @@ -276,19 +293,17 @@ function AddPostButton() { const router = useRouter() const handleAdd = async () => { - await fetch('/api/posts', { method: 'POST', body: '...' }) - router.invalidate() + await createPost({ title: 'New post' }) + await router.invalidate({ sync: true }) } return } ``` -For synchronous invalidation (wait until loaders finish): +Use `await router.invalidate({ sync: true })` when the next step requires refreshed loader data. -```tsx -await router.invalidate({ sync: true }) -``` +Treat the mutation and invalidation as one workflow. The mutation must persist before invalidation starts, and the loader must read from the same authoritative store. Verify create, update, and delete through the rendered route, including a fresh reload; local component state can hide a stale loader or non-persistent write. ### Error Handling @@ -361,16 +376,13 @@ export const Route = createFileRoute('/posts')({ }, }) -// CORRECT — loaders run in the browser, use fetch or API calls +// CORRECT for an SPA — use a client-safe API helper export const Route = createFileRoute('/posts')({ - loader: async () => { - const res = await fetch('/api/posts') - return res.json() - }, + loader: () => fetchPosts(), }) ``` -Do NOT put database queries, filesystem access, or server-only code in loaders unless you are using TanStack Start server functions. +Do NOT put database queries, filesystem access, or server-only code directly in loaders. In TanStack Start, put that work in a server function and call the function from the loader. Do not use a relative `fetch('/api/...')` in an SSR loader. ### MEDIUM: Not understanding staleTime default is 0 diff --git a/packages/router-core/skills/router-core/navigation/SKILL.md b/packages/router-core/skills/router-core/navigation/SKILL.md index 0e09ddbcec..ba1f0fd2e6 100644 --- a/packages/router-core/skills/router-core/navigation/SKILL.md +++ b/packages/router-core/skills/router-core/navigation/SKILL.md @@ -1,14 +1,15 @@ --- -name: router-core/navigation +name: navigation description: >- Link component, useNavigate, Navigate component, router.navigate, ToOptions/NavigateOptions/LinkOptions, from/to relative navigation, activeOptions/activeProps, preloading (intent/viewport/render), preloadDelay, navigation blocking (useBlocker, Block), createLink, linkOptions helper, scroll restoration, MatchRoute. -type: sub-skill -library: tanstack-router -library_version: '1.166.2' +metadata: + type: sub-skill + library: tanstack-router + library_version: '1.171.15' requires: - router-core sources: diff --git a/packages/router-core/skills/router-core/not-found-and-errors/SKILL.md b/packages/router-core/skills/router-core/not-found-and-errors/SKILL.md index b4fde048f8..45b231f41e 100644 --- a/packages/router-core/skills/router-core/not-found-and-errors/SKILL.md +++ b/packages/router-core/skills/router-core/not-found-and-errors/SKILL.md @@ -1,13 +1,14 @@ --- -name: router-core/not-found-and-errors +name: not-found-and-errors description: >- notFound() function, notFoundComponent, defaultNotFoundComponent, notFoundMode (fuzzy/root), errorComponent, CatchBoundary, CatchNotFound, isNotFound, NotFoundRoute (deprecated), route masking (mask option, createRouteMask, unmaskOnReload). -type: sub-skill -library: tanstack-router -library_version: '1.166.2' +metadata: + type: sub-skill + library: tanstack-router + library_version: '1.171.15' requires: - router-core sources: @@ -168,15 +169,15 @@ export const Route = createFileRoute('/posts/$postId')({ function PostErrorComponent({ error, }: { - error: Error - info: { componentStack: string } + error: unknown + info?: { componentStack: string } reset: () => void }) { const router = useRouter() return (
-

Error: {error.message}

+

Error: {error instanceof Error ? error.message : String(error)}

} // CORRECT — invalidate re-runs loaders and resets the error boundary -function ErrorFallback({ error }: { error: Error; reset: () => void }) { +function ErrorFallback({ error }: { error: unknown; reset: () => void }) { const router = useRouter() return (
`) - upstream.close() - finishSerialization() + const reader = output.getReader() + const patchPrefix = + '' + + upstream.push(`${SCRIPT_BARRIER_HTML}${patchPrefix}`) + expect(Buffer.from((await reader.read()).value!).toString()).toBe( + SCRIPT_BARRIER_HTML, + ) + expect(Buffer.from((await reader.read()).value!).toString()).toBe( + patchPrefix.slice(0, -1), + ) + + const parts = ['streamed()'] + emitScriptBatch(parts) + upstream.push(`${patchSuffix}${DOCUMENT_CLOSE}`) + upstream.close() + finishSerialization() + + let remaining = '' + for (;;) { + const { done, value } = await reader.read() + if (done) { + break + } + remaining += Buffer.from(value).toString() } + + expect(remaining).toBe( + `<${patchSuffix}${renderScriptBatch(parts)}${DOCUMENT_CLOSE}`, + ) }) - test('long text without closing tags partially flushes and keeps bounded leftover', async () => { - const { router, finishSerialization } = makeRouter() + test('places a router batch after a script-terminated patch and before its final close', async () => { + const { router, emitScriptBatch, cleanupCalls, finishSerialization } = + makeRouter() const upstream = makeManualUpstream() - const out = transformStreamWithRouter(router as any, upstream.stream as any) - const reader = (out as any).getReader() - const text = 'x'.repeat(MAX_LEFTOVER_CHARS + 32) + const output = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + { + rendererSafePoint: 'script-close', + }, + ) + const reader = output.getReader() + const shell = + `` + + `

loading

${SCRIPT_BARRIER_HTML}` + + '' + const rendererPatch = + '' + + '' - upstream.push(text) + upstream.push(shell) + const shellChunks = [await reader.read(), await reader.read()] + expect( + Buffer.concat( + shellChunks.map((chunk) => Buffer.from(chunk.value!)), + ).toString(), + ).toBe(shell) - const first = await reader.read() - expect(first.done).toBe(false) - const firstText = Buffer.from(first.value).toString('utf8') - expect(firstText).toBe('x'.repeat(32)) + upstream.push(rendererPatch) + const patchChunk = await reader.read() + expect(Buffer.from(patchChunk.value!).toString()).toBe(rendererPatch) + const routerParts = ['routerPayload()'] + emitScriptBatch(routerParts) + finishSerialization() + const routerChunk = await reader.read() + expect(Buffer.from(routerChunk.value!).toString()).toBe( + renderScriptBatch(routerParts), + ) + + upstream.push(DOCUMENT_CLOSE) + upstream.close() + + const closeChunk = await reader.read() + expect(Buffer.from(closeChunk.value!).toString()).toBe(DOCUMENT_CLOSE) + expect((await reader.read()).done).toBe(true) + expect(cleanupCalls.count).toBe(1) + }) + + test.each(['one byte chunk', 'byte chunks', 'one string record'] as const)( + 'relocates the document close after script safe points in %s', + async (input) => { + const { router, finishSerialization, cleanupCalls } = makeRouter() + const upstream = createControlledStream() + const output = transformReadableStreamWithRouter( + router as any, + upstream.stream, + { rendererSafePoint: 'script-close' }, + ) + const reader = output.getReader() + const patch = '' + const prefix = SCRIPT_BARRIER_HTML + patch + const filler = 'x'.repeat( + MAX_HYDRATION_OUTPUT_CHUNK_BYTES - prefix.length, + ) + const afterClose = '' + const first = prefix + filler + const last = DOCUMENT_CLOSE + afterClose + const encoder = new TextEncoder() + + if (input === 'one string record') { + upstream.controller.enqueue(first + last) + } else if (input === 'byte chunks') { + upstream.controller.enqueue(encoder.encode(first)) + upstream.controller.enqueue(encoder.encode(last)) + } else { + upstream.controller.enqueue(encoder.encode(first + last)) + } + upstream.controller.close() + + expect(Buffer.from((await reader.read()).value!).toString()).toBe( + SCRIPT_BARRIER_HTML, + ) + // Keep hydration waiting until a script safe point has interrupted the + // document-close search. The byte/string variants then advance chunks. + expect(Buffer.from((await reader.read()).value!).toString()).toBe(patch) + finishSerialization() + reader.releaseLock() + + await expect(readAll(output)).resolves.toBe( + filler + afterClose + DOCUMENT_CLOSE, + ) + expect(cleanupCalls.count).toBe(1) + }, + ) + + test.each( + ['', ''].flatMap((prefix) => + internalSplitOffsets(prefix + DOCUMENT_CLOSE).map((splitAt) => ({ + prefix, + splitAt, + })), + ), + )( + 'relocates the structural document close after "$prefix" split at byte $splitAt', + async ({ prefix, splitAt }) => { + const { router, finishSerialization } = makeRouter() + const upstream = makeManualUpstream() + const output = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + { rendererSafePoint: 'script-close' }, + ) + const shell = `${SCRIPT_BARRIER_HTML}` + const patch = '' + const beforeClose = `${shell}${patch}
app
` + const afterClose = '' + const close = prefix + DOCUMENT_CLOSE + + upstream.push(beforeClose + close.slice(0, splitAt)) + upstream.push(close.slice(splitAt) + afterClose) + upstream.close() + const reader = output.getReader() + expect(Buffer.from((await reader.read()).value!).toString()).toBe(shell) + expect(Buffer.from((await reader.read()).value!).toString()).toBe(patch) + finishSerialization() + reader.releaseLock() + + await expect(readAll(output)).resolves.toBe( + '
app
' + prefix + afterClose + DOCUMENT_CLOSE, + ) + }, + ) + + test('reconstructs one emoji split across upstream UTF-8 byte chunks', async () => { + const { router, finishSerialization } = makeRouter() + const upstream = createControlledStream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const encoder = new TextEncoder() + const emoji = encoder.encode('😀') + const html = `

😀

${SCRIPT_BARRIER_HTML}` + + upstream.controller.enqueue(encoder.encode('

')) + upstream.controller.enqueue(emoji.slice(0, 2)) + upstream.controller.enqueue(emoji.slice(2)) + upstream.controller.enqueue( + encoder.encode(`

${SCRIPT_BARRIER_HTML}`), + ) + upstream.controller.close() + finishSerialization() + + await expect(readAll(out)).resolves.toBe(html) + }) + + test('does not interleave application bytes while an opaque record is active', async () => { + const { router, emitHydrationRecord, finishSerialization } = makeRouter() + const upstream = makeManualUpstream() + const output = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = output.getReader() + const record = 'R'.repeat(MAX_HYDRATION_OUTPUT_CHUNK_BYTES * 2 + 1) + const patch = '' + + upstream.push(`${SCRIPT_BARRIER_HTML}`) + expect(Buffer.from((await reader.read()).value!).toString()).toBe( + `${SCRIPT_BARRIER_HTML}`, + ) + + emitHydrationRecord(record) + upstream.push(patch + DOCUMENT_CLOSE) upstream.close() finishSerialization() let rest = '' for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } + rest += Buffer.from(value).toString() + } + + expect(rest).toBe(record + patch + DOCUMENT_CLOSE) + }) + + test('drains an active opaque record after prefetched renderer EOF', async () => { + const setRenderFinished = vi.fn() + const startSerializationTimeout = vi.fn() + const { router, emitHydrationRecord, finishSerialization } = makeRouter({ + setRenderFinished, + startSerializationTimeout, + }) + const upstream = makeManualUpstream() + const output = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = output.getReader() + const record = 'R'.repeat(MAX_HYDRATION_OUTPUT_CHUNK_BYTES + 1) + + upstream.push(SCRIPT_BARRIER_HTML) + expect(Buffer.from((await reader.read()).value!).toString()).toBe( + SCRIPT_BARRIER_HTML, + ) + emitHydrationRecord(record) + finishSerialization() + upstream.close() + await flush() + + expect(startSerializationTimeout).toHaveBeenCalledOnce() + expect(startSerializationTimeout).toHaveBeenCalledWith(60_000) + expect(setRenderFinished).toHaveBeenCalledOnce() + + const first = await reader.read() + expect(first.done).toBe(false) + + let received = Buffer.from(first.value!).toString() + for (;;) { + const { done, value } = await reader.read() + if (done) { + break + } + received += Buffer.from(value).toString() + } + expect(received).toBe(record) + }) + + test('draining a large source does not read more app chunks per transport slice', async () => { + const { router, emitScriptBatch } = makeRouter() + const encoder = new TextEncoder() + let produced = 0 + const appStream = new ReadableStream({ + pull(controller) { + produced++ + controller.enqueue( + encoder.encode( + produced === 1 + ? `
app
${SCRIPT_BARRIER_HTML}` + : `

app-${produced}

`, + ), + ) + }, + }) + const out = transformReadableStreamWithRouter( + router as any, + appStream as any, + ) + emitScriptBatch([createIssuePayload()]) + const reader = out.getReader() + + const first = await reader.read() + expect(first.done).toBe(false) + await flush() + const producedBeforeRouterDrain = produced + + for (let index = 0; index < 8; index++) { + const next = await reader.read() + expect(next.done).toBe(false) + } + await flush() + + expect(produced).toBe(producedBeforeRouterDrain) + await reader.cancel() + }) + + test('a prefetched upstream error immediately stops an active large-source drain', async () => { + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const { router, emitScriptBatch, cleanupCalls } = makeRouter() + const upstream = makeManualUpstream() + const onAbort = vi.fn() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + { onAbort }, + ) + const reader = out.getReader() + const upstreamError = new Error('renderer-failed') + + emitScriptBatch([createIssuePayload()]) + upstream.push(`${SCRIPT_BARRIER_HTML}`) + expect((await reader.read()).done).toBe(false) + expect((await reader.read()).done).toBe(false) + + upstream.error(upstreamError) + await flush() + + expect(cleanupCalls.count).toBe(1) + expect(onAbort).toHaveBeenCalledOnce() + expect(onAbort).toHaveBeenCalledWith(upstreamError) + await expect(reader.read()).rejects.toBe(upstreamError) + } finally { + errorSpy.mockRestore() + } + }) + + test('cancellation tears down an active large-source drain', async () => { + const { router, emitScriptBatch, cleanupCalls } = makeRouter() + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = out.getReader() + + emitScriptBatch([createIssuePayload()]) + upstream.push(`
app
${SCRIPT_BARRIER_HTML}`) + + expect((await reader.read()).done).toBe(false) + expect((await reader.read()).done).toBe(false) + expect(cleanupCalls.count).toBe(0) + + await reader.cancel('consumer-gone') + + expect(upstream.cancelled.value).toBe(true) + expect(cleanupCalls.count).toBe(1) + }) + + test('lifetime timeout errors an active large-source drain', async () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + vi.useFakeTimers() + try { + const { router, emitScriptBatch, cleanupCalls } = makeRouter() + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + { + lifetimeMs: 10, + }, + ) + const reader = out.getReader() + + emitScriptBatch([createIssuePayload()]) + upstream.push(`
app
${SCRIPT_BARRIER_HTML}`) + + expect((await reader.read()).done).toBe(false) + expect((await reader.read()).done).toBe(false) + + await vi.advanceTimersByTimeAsync(15) + + await expect(reader.read()).rejects.toThrow('Stream lifetime exceeded') + expect(upstream.cancelled.value).toBe(true) + expect(upstream.cancelled.reason).toEqual( + new Error('Stream lifetime exceeded'), + ) + expect(cleanupCalls.count).toBe(1) + expect(warnSpy).toHaveBeenCalledOnce() + } finally { + vi.useRealTimers() + warnSpy.mockRestore() + } + }) + + test('forwards a large application byte chunk unchanged', async () => { + const { router, finishSerialization } = makeRouter() + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = (out as any).getReader() + const text = '😀a'.repeat(50_000) + + upstream.push(text) + + const first = await reader.read() + expect(first.done).toBe(false) + const firstText = Buffer.from(first.value).toString('utf8') + expect(firstText).toBe(text) + + upstream.push(SCRIPT_BARRIER_HTML) + upstream.close() + finishSerialization() + + let rest = '' + for (;;) { + const { done, value } = await reader.read() + if (done) { + break + } rest += Buffer.from(value).toString('utf8') } - expect(firstText + rest).toBe(text) + expect(firstText + rest).toBe(text + SCRIPT_BARRIER_HTML) }) - test('takeBufferedHtml throwing errors stream and runs cleanup once', async () => { - const { router, cleanupCalls } = makeRouter({ - takeBufferedHtml: () => { - throw new Error('take-buffered-html-boom') - }, - }) + test('forwards an incomplete document close and drains pending router scripts', async () => { + const { router, emitScriptBatch, finishSerialization, cleanupCalls } = + makeRouter() const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = out.getReader() - const out = transformStreamWithRouter(router as any, upstream.stream as any) + upstream.push(`${SCRIPT_BARRIER_HTML}${SCRIPT_BARRIER_HTML}`, + ) - await expect(readAll(out as any)).rejects.toThrow('take-buffered-html-boom') + const pendingRead = reader.read() + await flush() + emitScriptBatch(['pending()']) + finishSerialization() + upstream.close() + + expect(Buffer.from((await pendingRead).value!).toString()).toBe( + 'pending();document.currentScript.remove()', + ) expect(cleanupCalls.count).toBe(1) }) test('downstream backpressure delays close; no chunks are lost', async () => { - // Consumer reads slowly: we verify all router-injected scripts AND the - // tail closing tags arrive before the stream ends, even though - // tryFinish() requests close while writes are still queued. - const { router, injectHtml, finishSerialization } = makeRouter() + // Consumer reads slowly: all router scripts and relocated closing tags + // must arrive before the stream ends. + const { router, emitScriptBatch, finishSerialization } = makeRouter() const upstream = makeManualUpstream() - const out = transformStreamWithRouter(router as any, upstream.stream as any) + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) - upstream.push('
a
') - // Queue many injected chunks while app is still rendering. - for (let i = 0; i < 50; i++) injectHtml(``) + upstream.push(`
a
${SCRIPT_BARRIER_HTML}`) + // Queue many script batches while app is still rendering. + for (let i = 0; i < 50; i++) { + emitScriptBatch([`S${i}`]) + } upstream.push('') upstream.close() finishSerialization() @@ -890,32 +2283,137 @@ describe('transformStreamWithRouter — cleanup side-effects', () => { expect(full).toContain('
a
') expect(full).toContain('') for (let i = 0; i < 50; i++) { - expect(full).toContain(``) + expect(full).toContain(renderScriptBatch([`S${i}`])) } // All scripts must appear before . - expect(full.indexOf('')).toBeLessThan( + expect(full.indexOf(renderScriptBatch(['S49']))).toBeLessThan( full.indexOf(''), ) }) }) -describe('transformStreamWithRouter — injected HTML ordering', () => { - test('router-injected HTML interleaves at scanner safe points, not mid-tag', async () => { - const { router, injectHtml, finishSerialization } = makeRouter() +describe('transformReadableStreamWithRouter — hydration output ordering', () => { + test('does not scan or lift the barrier before the initial script take', async () => { + let taken = false + const { router, emitScriptBatch, finishSerialization } = makeRouter({ + isInitialTaken: () => taken, + }) + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const reader = out.getReader() + const injected = 'late()' + const rendered = renderScriptBatch([injected]) + const decoder = new TextDecoder() + + // A Ready record plus barrier-lookalike bytes rendered before + // ran (initial take pending) must pass through without lifting. + emitScriptBatch([injected]) + upstream.push(`${SCRIPT_BARRIER_HTML}`) + const first = await reader.read() + expect(first.done).toBe(false) + expect(decoder.decode(first.value)).toBe( + `${SCRIPT_BARRIER_HTML}`, + ) + + // After the take, the real boundary lifts the barrier and the queued + // record is injected after it. + taken = true + upstream.push(`
x
${SCRIPT_BARRIER_HTML}${DOCUMENT_CLOSE}`) + upstream.close() + finishSerialization() + + let rest = '' + for (;;) { + const result = await reader.read() + if (result.done) { + break + } + rest += decoder.decode(result.value, { stream: true }) + } + const barrierEnd = + rest.indexOf(SCRIPT_BARRIER_HTML) + SCRIPT_BARRIER_HTML.length + expect(rest.indexOf(SCRIPT_BARRIER_HTML)).toBeGreaterThanOrEqual(0) + expect(rest.indexOf(rendered)).toBeGreaterThanOrEqual(barrierEnd) + expect(rest.endsWith(DOCUMENT_CLOSE)).toBe(true) + }) + + test('does not interpret close-looking bytes before the router boundary', async () => { + const { router, emitScriptBatch, finishSerialization } = makeRouter() + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + const injected = 'pending()' + const rendered = renderScriptBatch([injected]) + const inlineScript = '' + + emitScriptBatch([injected]) + upstream.push( + `${inlineScript}
x
${SCRIPT_BARRIER_HTML}`, + ) + upstream.close() + finishSerialization() + + const full = await readAll(out as any) + expect(full).toContain(inlineScript) + expect(full.indexOf(rendered)).toBeGreaterThan(full.indexOf('')) + expect(full.indexOf(rendered)).toBeLessThan(full.lastIndexOf('')) + }) + + test('keeps queued script batches ordered when lifting the barrier emits synchronously', async () => { + const beforeLift = 'beforeLift()' + const duringLift = 'duringLift()' + const duringLiftEmitter: { + current?: (html: string) => void + } = {} + const { router, emitScriptBatch, finishSerialization } = makeRouter({ + liftBarrier: () => { + duringLiftEmitter.current!(duringLift) + }, + }) + duringLiftEmitter.current = (script) => emitScriptBatch([script]) + const upstream = makeManualUpstream() + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) + + emitScriptBatch([beforeLift]) + upstream.push(`${SCRIPT_BARRIER_HTML}`) + upstream.close() + finishSerialization() + + const full = await readAll(out as any) + expect(full.indexOf(renderScriptBatch([beforeLift]))).toBeGreaterThan( + full.indexOf(SCRIPT_BARRIER_HTML), + ) + expect(full.indexOf(renderScriptBatch([beforeLift]))).toBeLessThan( + full.indexOf(renderScriptBatch([duringLift])), + ) + expect(full.indexOf(renderScriptBatch([duringLift]))).toBeLessThan( + full.indexOf(''), + ) + }) + + test('drains queued batches after the exact boundary and before the close', async () => { + const { router, emitScriptBatch, finishSerialization } = makeRouter() const upstream = makeManualUpstream() - const out = transformStreamWithRouter(router as any, upstream.stream as any) + const out = transformReadableStreamWithRouter( + router as any, + upstream.stream as any, + ) - // App emits a chunk ending in a complete closing tag so the scanner - // can release content + flush pending router HTML at a safe boundary. - upstream.push('
app
') - // Injected during render — must be buffered, not enqueued ahead of - // pending app content, and not split across closing tags. - injectHtml('') - injectHtml('') + upstream.push(`
app
${SCRIPT_BARRIER_HTML}`) + // Router parts must not move ahead of pending application bytes. + emitScriptBatch(['X']) + emitScriptBatch(['Y']) - // Tail chunk: end of body. Triggers pendingClosingTags capture and - // flushPendingRouterHtml before the tail is emitted on tryFinish. + // The structural close is held until all router scripts finish. upstream.push('') upstream.close() finishSerialization() @@ -924,12 +2422,12 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { // Order: app div → scripts → body close. expect(full).toContain('
app
') - expect(full).toContain('') - expect(full).toContain('') + expect(full).toContain(renderScriptBatch(['X'])) + expect(full).toContain(renderScriptBatch(['Y'])) expect(full.indexOf('
app
')).toBeLessThan( - full.indexOf(''), + full.indexOf(renderScriptBatch(['X'])), ) - expect(full.indexOf('')).toBeLessThan( + expect(full.indexOf(renderScriptBatch(['Y']))).toBeLessThan( full.indexOf(''), ) }) @@ -950,7 +2448,9 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const out = transformReadableStreamWithRouter( router as any, upstream as any, - { onAbort: () => aborts++ }, + { + onAbort: () => aborts++, + }, ) const reader = (out as any).getReader() @@ -965,7 +2465,9 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { }) test('onAbort: NOT called on natural successful completion', async () => { - const { router, finishSerialization } = makeRouter() + const { router, finishSerialization } = makeRouter({ + reserveFastPath: () => true, + }) const upstream = new ReadableStream({ start(controller) { @@ -978,23 +2480,249 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const out = transformReadableStreamWithRouter( router as any, upstream as any, - { onAbort: () => aborts++ }, + { + onAbort: () => aborts++, + }, ) - // tryFinish gates on serialization-finished; signal it AFTER transform - // has subscribed to the event. finishSerialization() // Drain to completion. const reader = (out as any).getReader() - while (true) { + for (;;) { const { done } = await reader.read() - if (done) break + if (done) { + break + } } expect(aborts).toBe(0) }) + test('readable wrapper accepts string chunks', async () => { + const { router } = makeRouter({ reserveFastPath: () => true }) + const source = 'string record' + const upstream = new ReadableStream({ + start(controller) { + controller.enqueue(source) + controller.close() + }, + }) + + const out = transformReadableStreamWithRouter(router as any, upstream) + + await expect(readAll(out)).resolves.toBe(source) + }) + + test('pipeable byte-0 pass-through encodes string records independently', async () => { + const { router } = makeRouter({ + reserveFastPath: () => true, + }) + const highSurrogate = String.fromCharCode(0xd83d) + const lowSurrogate = String.fromCharCode(0xde00) + const records = [ + '', + highSurrogate, + lowSurrogate, + '', + ] + const upstream = Readable.from(records) + const out = transformPipeableStreamWithRouter(router as any, upstream) + const actual = await readAllPipeableBytes(out) + const expected = Buffer.concat(records.map((record) => Buffer.from(record))) + + expect(actual).toEqual(expected) + expect(actual.includes(Buffer.from('😀'))).toBe(false) + }) + + test('pipeable byte-0 pass-through bounds one large string record', async () => { + const { router, cleanupCalls } = makeRouter({ + reserveFastPath: () => true, + }) + const source = makeLargeStringRecord('', '') + const upstream = Readable.from([source]) + const out = transformPipeableStreamWithRouter(router as any, upstream) + const chunks = await readAllPipeableChunks(out) + const actual = Buffer.concat(chunks) + + expect(source.indexOf('😀')).toBe(MAX_HYDRATION_OUTPUT_CHUNK_BYTES - 1) + expect(actual).toEqual(Buffer.from(source)) + expect( + Math.max(...chunks.map((chunk) => chunk.byteLength)), + ).toBeLessThanOrEqual(MAX_HYDRATION_OUTPUT_CHUNK_BYTES) + expect(cleanupCalls.count).toBe(1) + }) + + test('pipeable pass-through handles an encoding set during the first read', async () => { + const { router } = makeRouter({ + reserveFastPath: () => true, + }) + const source = 'français' + const upstream = new Readable({ + read() { + this.setEncoding('utf8') + this.push(Buffer.from(source)) + this.push(null) + }, + }) + + const out = transformPipeableStreamWithRouter(router as any, upstream) + const actual = await readAllPipeableBytes(out) + + expect(actual).toEqual(Buffer.from(source)) + }) + + test('pipeable merge path encodes string records independently', async () => { + const { router, emitScriptBatch, finishSerialization } = makeRouter() + const highSurrogate = String.fromCharCode(0xd83d) + const lowSurrogate = String.fromCharCode(0xde00) + const prefix = `${SCRIPT_BARRIER_HTML}` + const records = [prefix, highSurrogate, lowSurrogate, DOCUMENT_CLOSE] + const upstream = Readable.from(records) + const out = transformPipeableStreamWithRouter(router as any, upstream) + const parts = ['streamed()'] + + emitScriptBatch(parts) + finishSerialization() + + const actual = await readAllPipeableBytes(out) + const expected = Buffer.concat( + [ + prefix, + renderScriptBatch(parts), + highSurrogate, + lowSurrogate, + DOCUMENT_CLOSE, + ].map((record) => Buffer.from(record)), + ) + + expect(actual).toEqual(expected) + expect(actual.includes(Buffer.from('😀'))).toBe(false) + }) + + test('pipeable merge path bounds one large string record', async () => { + const { router, cleanupCalls, emitScriptBatch, finishSerialization } = + makeRouter() + const source = makeLargeStringRecord( + '
', + `
${SCRIPT_BARRIER_HTML}${DOCUMENT_CLOSE}`, + ) + const parts = ['streamed()'] + const routerScript = renderScriptBatch(parts) + const expected = + source.slice(0, -DOCUMENT_CLOSE.length) + routerScript + DOCUMENT_CLOSE + const upstream = Readable.from([source]) + const out = transformPipeableStreamWithRouter(router as any, upstream) + + emitScriptBatch(parts) + finishSerialization() + + const chunks = await readAllPipeableChunks(out) + const actual = Buffer.concat(chunks) + + expect(source.indexOf('😀')).toBe(MAX_HYDRATION_OUTPUT_CHUNK_BYTES - 1) + expect(actual).toEqual(Buffer.from(expected)) + expect(actual.indexOf(Buffer.from(routerScript))).toBeGreaterThan( + actual.indexOf(Buffer.from(SCRIPT_BARRIER_HTML)), + ) + expect(actual.indexOf(Buffer.from(routerScript))).toBeLessThan( + actual.lastIndexOf(Buffer.from(DOCUMENT_CLOSE)), + ) + expect( + Math.max(...chunks.map((chunk) => chunk.byteLength)), + ).toBeLessThanOrEqual(MAX_HYDRATION_OUTPUT_CHUNK_BYTES) + expect(cleanupCalls.count).toBe(1) + }) + + test('record-end does not split one large Node string record', async () => { + const { router, emitScriptBatch, finishSerialization, cleanupCalls } = + makeRouter() + const prefix = `${SCRIPT_BARRIER_HTML}` + const largeRecord = 'x'.repeat(MAX_HYDRATION_OUTPUT_CHUNK_BYTES * 2) + const parts = ['streamed()'] + const routerScript = renderScriptBatch(parts) + const upstream = Readable.from([prefix, largeRecord, DOCUMENT_CLOSE]) + const out = transformPipeableStreamWithRouter(router as any, upstream, { + rendererSafePoint: 'record-end', + }) + const iterator = out[Symbol.asyncIterator]() + const chunks = [Buffer.from((await iterator.next()).value)] + + chunks.push(Buffer.from((await iterator.next()).value)) + expect(chunks[0]).toEqual(Buffer.from(prefix)) + expect(chunks[1]).toEqual( + Buffer.alloc(MAX_HYDRATION_OUTPUT_CHUNK_BYTES, 'x'), + ) + + emitScriptBatch(parts) + finishSerialization() + + for (;;) { + const { done, value } = await iterator.next() + if (done) { + break + } + chunks.push(Buffer.from(value)) + } + + const actual = Buffer.concat(chunks) + const expected = Buffer.from( + prefix + largeRecord + routerScript + DOCUMENT_CLOSE, + ) + + expect(actual).toEqual(expected) + expect(actual.indexOf(Buffer.from(routerScript))).toBe( + Buffer.byteLength(prefix + largeRecord), + ) + expect(cleanupCalls.count).toBe(1) + }) + + test('cancelling a large Node string drain tears down once', async () => { + const { router, cleanupCalls } = makeRouter({ + reserveFastPath: () => true, + }) + const source = makeLargeStringRecord('', '') + let upstreamCancellations = 0 + let pushed = false + const upstream = new Readable({ + objectMode: true, + read() { + if (!pushed) { + pushed = true + this.push(source) + } + }, + destroy(_error, callback) { + upstreamCancellations++ + callback() + }, + }) + const upstreamClosed = new Promise((resolve) => { + upstream.once('close', resolve) + }) + const onAbort = vi.fn() + const out = transformReadableStreamWithRouter( + router as any, + Readable.toWeb(upstream) as any, + { + onAbort, + }, + ) + const reader = out.getReader() + const first = await reader.read() + + expect(first.value!.byteLength).toBe(MAX_HYDRATION_OUTPUT_CHUNK_BYTES - 1) + + const reason = new Error('consumer stopped') + await reader.cancel(reason) + await upstreamClosed + await flush() + + expect(upstreamCancellations).toBe(1) + expect(onAbort).toHaveBeenCalledOnce() + expect(cleanupCalls.count).toBe(1) + }) + test('onAbort: fires when pipeable wrapper consumer destroys', async () => { const { router, finishSerialization } = makeRouter() finishSerialization() @@ -1021,12 +2749,13 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { expect(aborts).toBe(1) // Cleanup: destroy upstream so we don't leak. - if (!pass.destroyed) pass.destroy() + if (!pass.destroyed) { + pass.destroy() + } }) test('onAbort: lifetime timeout triggers abort exactly once', async () => { vi.useFakeTimers() - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) try { const { router, finishSerialization } = makeRouter() @@ -1044,19 +2773,24 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const out = transformReadableStreamWithRouter( router as any, upstream as any, - { onAbort: () => aborts++, lifetimeMs: 1000 }, + { + onAbort: () => aborts++, + lifetimeMs: 1000, + }, ) - // Start reading (which may reject when stream is errored) + // Start reading before the lifetime watchdog errors the stream. const reader = (out as any).getReader() - const readP = reader.read().catch(() => undefined) + const readP = reader.read() + const readError = expect(readP).rejects.toThrow( + 'Stream lifetime exceeded', + ) await vi.advanceTimersByTimeAsync(1500) - await readP + await readError expect(aborts).toBe(1) } finally { - errorSpy.mockRestore() warnSpy.mockRestore() vi.useRealTimers() } @@ -1079,17 +2813,23 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const out = transformReadableStreamWithRouter( router as any, upstream as any, - { onAbort: () => aborts++, timeoutMs: 10 }, + { + onAbort: () => aborts++, + timeoutMs: 10, + }, ) const reader = (out as any).getReader() - const readP = reader.read().catch(() => undefined) + const readP = reader.read() + const readError = expect(readP).rejects.toThrow( + 'Stream lifetime exceeded', + ) await vi.advanceTimersByTimeAsync(15) expect(aborts).toBe(0) await vi.advanceTimersByTimeAsync(6) - await readP + await readError expect(aborts).toBe(1) } finally { errorSpy.mockRestore() @@ -1102,10 +2842,10 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const { router, finishSerialization } = makeRouter() finishSerialization() - // Simulate the Vue sync-setup-throw recovery path: a TransformStream is + // Simulate a synchronous producer setup failure: a TransformStream is // handed to the router transform, and the producer never writes before - // aborting the writable side. The router transform's readable must - // resolve (with done or an error) rather than wait for lifetimeMs. + // aborting the writable side. The router transform's readable must resolve + // (with done or an error) rather than wait for lifetimeMs. const ts = new TransformStream() const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) try { @@ -1113,7 +2853,9 @@ describe('transformStreamWithRouter — injected HTML ordering', () => { const out = transformReadableStreamWithRouter( router as any, ts.readable as any, - { onAbort: () => aborts++ }, + { + onAbort: () => aborts++, + }, ) void ts.writable.abort(new Error('setup-throw')).catch(() => {}) diff --git a/packages/router-core/tests/url-standard.test.ts b/packages/router-core/tests/url-standard.test.ts new file mode 100644 index 0000000000..4be6c0dfd6 --- /dev/null +++ b/packages/router-core/tests/url-standard.test.ts @@ -0,0 +1,96 @@ +import { createHash } from 'node:crypto' +import { readFileSync } from 'node:fs' +import { URL as NodeURL } from 'node:url' +import { describe, expect, it } from 'vitest' +import { + DEFAULT_PROTOCOL_ALLOWLIST, + getUrlScheme, + isDangerousProtocol, +} from '../src/utils' + +type UrlFixture = { + input: string + protocol?: string +} + +const sources = [ + { + file: 'urltestdata.json', + sha256: 'b8767904d25029a46e0d297e1320ded3a733322f489caa5a482c886fb11e9238', + }, + { + file: 'urltestdata-javascript-only.json', + sha256: '74eaf2f3b8246b1fe44c388e3ecf8eb8442e01f229418b634acecb9595caddfa', + }, +] +const allowlists = [ + { name: 'default', protocols: new Set(DEFAULT_PROTOCOL_ALLOWLIST) }, + { name: 'empty', protocols: new Set() }, + { + name: 'custom', + protocols: new Set([ + 'https:', + 'javascript:', + 'non-special:', + 'intent:', + 'a1234567890-+.:', + ]), + }, +] + +// These WPT inputs have a protocol-relative prefix but no valid HTTP(S) host. +const malformedProtocolRelative = new Set(['//', '///', '////', '//C|/foo/bar']) + +function getNativeScheme(input: string): string | undefined { + const colon = input.indexOf(':') + if (colon === -1) { + return undefined + } + + // A valid replacement body lets URL recognize the scheme even when the + // original host or port is invalid. No base is supplied, so relative prefixes fail. + try { + return new NodeURL(`${input.slice(0, colon + 1)}//example.com`).protocol + } catch { + return undefined + } +} + +describe.each(sources)('WPT $file', ({ file, sha256 }) => { + const contents = readFileSync( + new NodeURL(`./fixtures/wpt-url/${file}`, import.meta.url), + 'utf8', + ) + // JSON.parse preserves the unpaired surrogates in the JavaScript-only file. + const entries = JSON.parse(contents) as Array + const cases = entries.flatMap((fixture, index) => + typeof fixture === 'string' ? [] : [{ ...fixture, index }], + ) + + it('preserves the complete pinned upstream file', () => { + expect(createHash('sha256').update(contents).digest('hex')).toBe(sha256) + }) + + it.each(cases)('case $index: $input', ({ input, protocol }) => { + const scheme = getNativeScheme(input) + if (scheme !== undefined && protocol !== undefined) { + expect(scheme).toBe(protocol) + } + expect(getUrlScheme(input)).toBe(scheme) + + // Ordinary relative paths inherit the two different base hosts; a + // protocol-relative input supplies its own host, producing the same hostname. + const protocolRelative = + scheme === undefined && + (malformedProtocolRelative.has(input) || + new NodeURL(input, 'https://one.example/').hostname === + new NodeURL(input, 'https://two.example/').hostname) + + for (const { name, protocols } of allowlists) { + // The allowlist and blanket protocol-relative rejection are Router policy. + const blocked = + protocolRelative || (scheme !== undefined && !protocols.has(scheme)) + expect(isDangerousProtocol(input, protocols), name).toBe(blocked) + } + }) +}) diff --git a/packages/router-core/tests/utils.test.ts b/packages/router-core/tests/utils.test.ts index fff911df37..baeb751e8f 100644 --- a/packages/router-core/tests/utils.test.ts +++ b/packages/router-core/tests/utils.test.ts @@ -4,11 +4,235 @@ import { deepEqual, encodePathLikeUrl, escapeHtml, + hasOwn, isPlainArray, + isPlainObject, + nullReplaceEqualDeep, replaceEqualDeep, } from '../src/utils' +import { decode } from '../src/qss' describe('replaceEqualDeep', () => { + it('reuses the next object when its children need no replacements', () => { + const shared = Object.freeze({ id: 1 }) + const prev = Object.freeze({ shared, page: 1 }) + const next = Object.freeze({ shared, page: 2 }) + + expect(replaceEqualDeep(prev, next)).toBe(next) + }) + + it('reuses a changed null-prototype search record', () => { + const prev = decode('page=1&sort=newest') + const next = decode('page=2&sort=newest') + + expect(nullReplaceEqualDeep(prev, next)).toBe(next) + }) + + it('reuses a changed ordinary object in null-prototype mode', () => { + const prev = decode('page=1&sort=newest') + const next = { page: '2', sort: 'newest' } + const result = nullReplaceEqualDeep(prev, next) + + expect(result).toBe(next) + expect(Object.getPrototypeOf(result)).toBe(Object.prototype) + }) + + it('returns the previous signed zero when strict equality matches', () => { + expect(replaceEqualDeep(-0, 0)).toBe(-0) + expect(replaceEqualDeep(0, -0)).toBe(0) + }) + + it.each([false, true])( + 'uses the same signed-zero sharing rule for every child (nullProto=%s)', + (nullProto) => { + const prev = { first: -0, changed: 1, last: -0 } + const next = { first: 0, changed: 2, last: 0 } + const result = replaceEqualDeep(prev, next, nullProto) + expect(result).not.toBe(next) + expect(Object.getPrototypeOf(result)).toBe( + nullProto ? null : Object.prototype, + ) + expect(result.first).toBe(-0) + expect(result.changed).toBe(2) + expect(result.last).toBe(-0) + expect(replaceEqualDeep([-0, 1, -0], [0, 2, 0], nullProto)).toStrictEqual( + [-0, 2, -0], + ) + }, + ) + + // Known unsupported edge case for ordinary object copies. + it.skip('copies an own __proto__ property as data in the incoming key order', () => { + const prev = JSON.parse('{"first":1,"__proto__":{"shared":1},"last":1}') + const next = JSON.parse('{"first":2,"__proto__":{"shared":1},"last":1}') + const result = replaceEqualDeep(prev, next) + expect(Object.getPrototypeOf(result)).toBe(Object.prototype) + expect(hasOwn.call(result, '__proto__')).toBe(true) + expect(result.__proto__).toBe(prev.__proto__) + expect(Object.keys(result)).toEqual(Object.keys(next)) + expect(result).toStrictEqual(next) + }) + + it.skip.each([undefined, { shared: 1 }])( + 'preserves a newly added own __proto__ property with value %j', + (value) => { + const prev = { first: 1, last: 1 } + const next = { first: 1, ['__proto__']: value, last: 1 } + const result = replaceEqualDeep(prev, next) + expect(Object.getPrototypeOf(result)).toBe(Object.prototype) + expect(hasOwn.call(result, '__proto__')).toBe(true) + expect(result.__proto__).toBe(value) + expect(Object.keys(result)).toEqual(Object.keys(next)) + expect(result).toStrictEqual(next) + }, + ) + + it('shares children without changing recursively frozen inputs', () => { + const prev = Object.freeze({ + items: Object.freeze([ + Object.freeze({ id: 1 }), + Object.freeze({ id: 2 }), + ]), + page: 1, + }) + const next = Object.freeze({ + items: Object.freeze([ + Object.freeze({ id: 1 }), + Object.freeze({ id: 3 }), + ]), + page: 2, + }) + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.items[0]).toBe(prev.items[0]) + expect(next.items[0]).not.toBe(prev.items[0]) + expect(prev.items[1]?.id).toBe(2) + expect(next.items[1]?.id).toBe(3) + }) + + it('preserves special numbers and explicit undefined in changed frozen arrays', () => { + const prev = Object.freeze([-0, NaN, Infinity, 2 ** 40, 1.5, undefined, 1]) + const next = Object.freeze([0, NaN, Infinity, 2 ** 40, 1.5, undefined, 2]) + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual([ + -0, + NaN, + Infinity, + 2 ** 40, + 1.5, + undefined, + 2, + ]) + expect(hasOwn.call(result, 5)).toBe(true) + expect(next[0]).toBe(0) + expect(prev[6]).toBe(1) + }) + + it('ignores auxiliary array metadata without using its constructor or iterator', () => { + const fail = () => { + throw new Error('array metadata must not be invoked') + } + const decorate = (values: Array) => + Object.freeze( + Object.defineProperties(values, { + metadata: { value: 'ignored' }, + constructor: { value: { [Symbol.species]: fail } }, + [Symbol.iterator]: { value: fail }, + }), + ) + const child = Object.freeze({ id: 1 }) + const prev = decorate([child, 1]) + const equal = decorate([{ id: 1 }, 1]) + const next = decorate([{ id: 1 }, 2]) + + expect(replaceEqualDeep(prev, equal)).toBe(prev) + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual([child, 2]) + expect(result[0]).toBe(child) + expect(Object.keys(result)).toEqual(['0', '1']) + expect(Object.getOwnPropertySymbols(result)).toEqual([]) + expect(prev[1]).toBe(1) + expect(next[0]).not.toBe(child) + }) + + it.each(['prev', 'next'])( + 'preserves incoming values with a non-enumerable array index on %s', + (side) => { + const prev = [{ id: 1 }, 1] + const next = [{ id: 1 }, 2] + Object.defineProperty(side === 'prev' ? prev : next, '1', { + enumerable: false, + }) + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(Object.getOwnPropertyDescriptor(result, '1')?.enumerable).toBe( + Object.getOwnPropertyDescriptor(next, '1')?.enumerable, + ) + }, + ) + + it('does not consider separate NaN children strictly equal', () => { + const prev = { value: NaN } + const next = { value: NaN } + const result = replaceEqualDeep(prev, next) + expect(result).not.toBe(prev) + expect(result).toStrictEqual(next) + }) + + it.each([0, 1, 8, 16])( + 'resolves deeply equal children after %i identical array entries', + (length) => { + const prefix = Array.from({ length }, (_, index) => index) + const shared = { child: { value: 1 } } + const prev = [...prefix, shared, { version: 1 }] + const equal = [...prefix, { child: { value: 1 } }, { version: 1 }] + expect(replaceEqualDeep(prev, equal)).toBe(prev) + + const next = [...prefix, { child: { value: 1 } }, { version: 2 }] + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect(result).not.toBe(next) + expect(result[length]).toBe(shared) + }, + ) + + it('bounds recursion for cyclic records', () => { + const prev: any = { value: 1 } + const next: any = { value: 2 } + prev.self = prev + next.self = next + const result = replaceEqualDeep(prev, next) + expect(result.value).toBe(2) + expect(result.self).toBe(next) + }) + + it.each([0, 1])( + 'bounds recursion for cyclic arrays with %s preceding values', + (index) => { + const prev: Array = index ? [1] : [] + const next: Array = index ? [2] : [] + prev.push(prev) + next.push(next) + const result = replaceEqualDeep(prev, next) + let tail = result + for (let i = 0; i < 1000 && tail !== next; i++) { + tail = tail[index] + } + expect(tail).toBe(next) + if (index) { + expect(result[0]).toBe(2) + } + expect(prev[index]).toBe(prev) + expect(next[index]).toBe(next) + }, + ) + + it('preserves identity even when the recursion budget is exhausted', () => { + const value = [{ id: 1 }] + expect(replaceEqualDeep(value, value, false, 10_000)).toBe(value) + }) + it('should return the same object if the input objects are equal', () => { const obj = { a: 1, b: 2 } const result = replaceEqualDeep(obj, obj) @@ -37,20 +261,20 @@ describe('replaceEqualDeep', () => { }) describe('symbol properties', () => { - it('should look at symbol properties in the object comparison', () => { + it('passes objects with differing symbol values through untouched', () => { const propertyKey = Symbol('property') const obj1 = { a: 1, [propertyKey]: 2 } const obj2 = { a: 1, [propertyKey]: 3 } const result = replaceEqualDeep(obj1, obj2) - expect(result).toStrictEqual(obj2) + expect(result).toBe(obj2) }) - it('should copy over symbol properties when creating a new object', () => { + it('never copies an object with symbol properties partially', () => { const propertyKey = Symbol('property') const obj1 = { a: 1, [propertyKey]: 2 } const obj2 = { a: 3, [propertyKey]: 2 } const result = replaceEqualDeep(obj1, obj2) - expect(result).toStrictEqual(obj2) + expect(result).toBe(obj2) }) }) @@ -134,7 +358,6 @@ describe('replaceEqualDeep', () => { const result = replaceEqualDeep(prev, next) expect(result).toEqual(next) expect(result).not.toBe(prev) - expect(result).not.toBe(next) }) it('should return a copy when the previous value is a different array superset', () => { @@ -143,7 +366,6 @@ describe('replaceEqualDeep', () => { const result = replaceEqualDeep(prev, next) expect(result).toEqual(next) expect(result).not.toBe(prev) - expect(result).not.toBe(next) }) it('should return the previous value when the next value is an equal empty array', () => { @@ -184,7 +406,6 @@ describe('replaceEqualDeep', () => { expect(result).not.toBe(next) expect(result[0]).toBe(prev[0]) expect(result[1]).toBe(prev[1]) - expect(result[2]).not.toBe(next[2]) expect(result[2].b.b).toBe(next[2].b.b) expect(result[3]).toBe(prev[3]) }) @@ -252,6 +473,35 @@ describe('replaceEqualDeep', () => { expect(result).toBe(next) }) + // A hole and an extra key cancel out in `Object.keys(array).length`, so the + // key count alone would admit such an array and the copy would drop the key + // and fill the hole. + describe('non-dense arrays', () => { + it('passes a sparse array with an extra key through untouched', () => { + const next = Object.assign([1, ,], { extra: 'x' }) as Array + expect(Object.keys(next)).toHaveLength(next.length) + expect(replaceEqualDeep([1, 3], next)).toBe(next) + expect(replaceEqualDeep([1, undefined], next)).toBe(next) + }) + + it('does not reuse a sparse previous array with a compensating extra key', () => { + const prev = Object.assign([1, ,], { extra: 'old' }) + const next = [1, undefined] + expect(Object.keys(prev)).toHaveLength(prev.length) + expect(replaceEqualDeep(prev, next)).toBe(next) + }) + + it('still shares dense arrays', () => { + const prev = [1, 2, undefined] + expect(replaceEqualDeep(prev, [1, 2, undefined])).toBe(prev) + expect(replaceEqualDeep(prev, [1, 3, undefined])).toStrictEqual([ + 1, + 3, + undefined, + ]) + }) + }) + it('should replace all parent objects if some nested value changes', () => { const prev = { todo: { id: '1', meta: { createdAt: 0 }, state: { done: false } }, @@ -269,7 +519,6 @@ describe('replaceEqualDeep', () => { expect(result.todo).not.toBe(next.todo) expect(result.todo.id).toBe(next.todo.id) expect(result.todo.meta).toBe(prev.todo.meta) - expect(result.todo.state).not.toBe(next.todo.state) expect(result.todo.state.done).toBe(next.todo.state.done) expect(result.otherTodo).toBe(prev.otherTodo) }) @@ -297,7 +546,6 @@ describe('replaceEqualDeep', () => { expect(result.todos[0]).not.toBe(next.todos[0]) expect(result.todos[0]?.id).toBe(next.todos[0]?.id) expect(result.todos[0]?.meta).toBe(prev.todos[0]?.meta) - expect(result.todos[0]?.state).not.toBe(next.todos[0]?.state) expect(result.todos[0]?.state.done).toBe(next.todos[0]?.state.done) expect(result.todos[1]).toBe(prev.todos[1]) }) @@ -345,6 +593,447 @@ describe('replaceEqualDeep', () => { next.foo = 'baz' expect(replaceEqualDeep(current, next)).toEqual(next) }) + + describe('sharing children in changed containers', () => { + it('keeps earlier equal entries, including explicit undefined, when a later key differs', () => { + const prev = { a: { x: 1 }, b: undefined, c: 1 } + const next = { a: { x: 1 }, b: undefined, c: 2 } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect(result).not.toBe(next) + expect(result.a).toBe(prev.a) + expect('b' in result).toBe(true) + }) + + it('includes keys that only exist in next before the first difference', () => { + const prev: Record = { a: 1 } + const next = { b: undefined, a: 2 } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect('b' in result).toBe(true) + }) + + it('keeps the key order of next', () => { + const prev = { a: 1, b: 2, c: 3 } + expect(Object.keys(replaceEqualDeep(prev, { c: 3, b: 2, a: 9 }))).toEqual( + ['c', 'b', 'a'], + ) + expect(Object.keys(replaceEqualDeep(prev, { b: 9, a: 1, c: 3 }))).toEqual( + ['b', 'a', 'c'], + ) + }) + + it('copies when only the key sets differ', () => { + const prev = { a: 1, b: 2 } + const next = { a: 1 } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + }) + + it('returns a longer array when next appends an explicit undefined', () => { + const prev = [1] + const next = [1, undefined] + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).toHaveLength(2) + expect(result).not.toBe(prev) + }) + + it('shares equal array entries before and after the first difference', () => { + const prev = [{ a: 1 }, { b: 1 }, { c: 1 }] + const next = [{ a: 1 }, { b: 2 }, { c: 1 }] + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result[0]).toBe(prev[0]) + expect(result[1]).not.toBe(prev[1]) + expect(result[2]).toBe(prev[2]) + }) + }) + + describe('changed keys and recursive sharing', () => { + it('copies an empty array after a nonempty array', () => { + const prev = [1] + const result = replaceEqualDeep(prev, []) + expect(result).toStrictEqual([]) + expect(result).not.toBe(prev) + }) + + it('appends multiple explicit undefined array entries', () => { + const result = replaceEqualDeep([1], [1, undefined, undefined]) + expect(result).toStrictEqual([1, undefined, undefined]) + expect(hasOwn.call(result, 1)).toBe(true) + expect(hasOwn.call(result, 2)).toBe(true) + }) + it('returns prev for equal objects whose keys are ordered differently', () => { + const prev = { a: 1, b: { x: 1 }, c: 3 } + const next = { c: 3, a: 1, b: { x: 1 } } + expect(replaceEqualDeep(prev, next)).toBe(prev) + }) + + it('copies when a reordered next has a key that prev lacks', () => { + const prev: Record = { a: 1, b: 2 } + const next = { b: 2, c: undefined } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect('c' in result).toBe(true) + expect('a' in result).toBe(false) + }) + + it('includes keys that only exist in next after the first difference', () => { + const prev: Record = { a: 1, b: 2, d: 4 } + const next = { a: 9, b: 2, c: undefined } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect('c' in result).toBe(true) + expect('d' in result).toBe(false) + }) + + it('shares equal children that come after the first difference', () => { + const prev = { a: 1, b: { x: 1 }, c: [1, 2], d: 'same' } + const next = { a: 2, b: { x: 1 }, c: [1, 2], d: 'same' } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.b).toBe(prev.b) + expect(result.c).toBe(prev.c) + }) + + it('recurses into changed children that come after the first difference', () => { + const prev = { a: 1, b: { x: 1, y: { z: 1 } } } + const next = { a: 2, b: { x: 2, y: { z: 1 } } } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.b).not.toBe(prev.b) + expect(result.b).not.toBe(next.b) + expect(result.b.y).toBe(prev.b.y) + }) + + it('takes the next value when an entry changes between object and primitive', () => { + const prev = { a: { x: 1 }, b: null, c: 's', d: [1], e: 0 } + const next = { a: null, b: { x: 1 }, c: {}, d: 's', e: [1] } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.b).toBe(next.b) + expect(result.c).toBe(next.c) + expect(result.e).toBe(next.e) + }) + + it('takes the next value when a later entry changes between object and primitive', () => { + const prev = { k: 0, a: { x: 1 }, b: undefined, c: [1] } + const next = { k: 1, a: undefined, b: { x: 1 }, c: 's' } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.b).toBe(next.b) + }) + + it('copies a shorter next array, sharing its equal prefix', () => { + const prev = [{ a: 1 }, { b: 1 }, { c: 1 }] + const next = [{ a: 1 }, { b: 1 }] + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect(result).not.toBe(next) + expect(result[0]).toBe(prev[0]) + expect(result[1]).toBe(prev[1]) + }) + + it('copies a longer next array, sharing the equal prefix', () => { + const prev = [{ a: 1 }] + const next = [{ a: 1 }, { b: 1 }] + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result[0]).toBe(prev[0]) + expect(result[1]).toBe(next[1]) + }) + + it('copies a next object whose entries all match a larger prev', () => { + const prev = { a: { x: 1 }, b: 2 } + const next = { a: { x: 1 } } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect(result).not.toBe(next) + expect(result.a).toBe(prev.a) + }) + + it('handles a change in the last entry of a long array', () => { + const prev = Array.from({ length: 1024 }, (_, index) => ({ index })) + const next = prev.map((item, index) => + index === 1023 ? { index: -1 } : item, + ) + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result).not.toBe(prev) + expect(result[0]).toBe(prev[0]) + expect(result[1022]).toBe(prev[1022]) + expect(result[1023]).not.toBe(prev[1023]) + expect(result[1023]).toStrictEqual(next[1023]) + }) + + it('stops sharing beyond the depth limit', () => { + const nest = (depth: number) => { + let value: any = { leaf: true } + for (let i = 0; i < depth; i++) { + value = { child: value } + } + return value + } + const prev = nest(510) + const next = nest(510) + const result = replaceEqualDeep(prev, next) + expect(result).not.toBe(prev) + expect(result).toStrictEqual(next) + }) + }) +}) + +describe('nullReplaceEqualDeep', () => { + it('keeps a shared array prefix and reuses unchanged child results', () => { + const shared = { id: 1 } + const prev = [shared, { id: 2 }] + const next = [shared, { id: 3 }] + const result = nullReplaceEqualDeep(prev, next) + expect(Array.isArray(result)).toBe(true) + expect(result[0]).toBe(shared) + expect(Object.getPrototypeOf(result[0])).toBe(Object.prototype) + expect(result[1]).toBe(next[1]) + expect(Object.getPrototypeOf(result[1])).toBe(Object.prototype) + }) + + it('creates null-prototype copies on the first difference', () => { + const prev = { a: { x: 1 }, b: 2 } + const result = nullReplaceEqualDeep(prev, { a: { x: 1 }, b: 3 }) + expect(Object.getPrototypeOf(result)).toBeNull() + expect(result.a).toBe(prev.a) + expect(result.b).toBe(3) + }) + + it('creates null-prototype copies when only the key sets differ', () => { + const prev = { a: { x: 1 } } + const result = nullReplaceEqualDeep(prev, { a: { x: 1 }, b: undefined }) + expect(Object.getPrototypeOf(result)).toBeNull() + expect(result.a).toBe(prev.a) + expect('b' in result).toBe(true) + }) + + it('reuses a changed child when only the root needs a null-prototype copy', () => { + const prev = { shared: { x: 1 }, changed: { y: 1 } } + const next = { shared: { x: 1 }, changed: { y: 2 } } + const result = nullReplaceEqualDeep(prev, next) + expect(Object.getPrototypeOf(result)).toBeNull() + expect(result.changed).toBe(next.changed) + expect(result.shared).toBe(prev.shared) + }) + + it('creates null-prototype copies at every level that needs replacements', () => { + const prev = { outer: { shared: { id: 1 }, page: 1 } } + const next = { outer: { shared: { id: 1 }, page: 2 } } + const result = nullReplaceEqualDeep(prev, next) + expect(Object.getPrototypeOf(result)).toBeNull() + expect(Object.getPrototypeOf(result.outer)).toBeNull() + expect(result.outer.shared).toBe(prev.outer.shared) + expect(result.outer.page).toBe(2) + expect(prev).toStrictEqual({ outer: { shared: { id: 1 }, page: 1 } }) + expect(next).toStrictEqual({ outer: { shared: { id: 1 }, page: 2 } }) + }) + + it('stores an own __proto__ key instead of changing the prototype', () => { + const prev = { name: 'Bob', shared: { id: 1 } } + const next = JSON.parse( + '{"__proto__":{"isAdmin":true},"name":"Alice","shared":{"id":1}}', + ) + const result = nullReplaceEqualDeep(prev, next) + expect(result.shared).toBe(prev.shared) + expect(Object.getPrototypeOf(result)).toBeNull() + expect(hasOwn.call(result, '__proto__')).toBe(true) + expect(result['__proto__']).toEqual({ isAdmin: true }) + expect(result.name).toBe('Alice') + expect(({} as any).isAdmin).toBeUndefined() + }) + + it('returns prev when a plain next equals a null-prototype prev', () => { + const prev = Object.assign(Object.create(null), { a: 1, b: { c: 2 } }) + expect(nullReplaceEqualDeep(prev, { a: 1, b: { c: 2 } })).toBe(prev) + }) +}) + +describe('isPlainObject', () => { + it.each([ + [ + 'null-prototype record', + Object.assign(Object.create(null), { inherited: 1 }), + ], + ['null constructor', { constructor: null }], + ['undefined constructor', { constructor: undefined }], + ])('shares records inheriting from a %s', (_name, proto) => { + const prev = Object.assign(Object.create(proto), { + child: { id: 1 }, + page: 1, + }) + const equal = Object.assign(Object.create(proto), { + child: { id: 1 }, + page: 1, + }) + const next = Object.assign(Object.create(proto), { + child: { id: 1 }, + page: 2, + }) + + expect(isPlainObject(prev)).toBe(true) + expect(deepEqual(prev, equal)).toBe(true) + expect(replaceEqualDeep(prev, equal)).toBe(prev) + const result = replaceEqualDeep(prev, next) + expect(result.child).toBe(prev.child) + expect(result.page).toBe(2) + expect(Object.keys(result)).toEqual(['child', 'page']) + }) + + it.each([ + ['object literal', {}], + ['object literal with keys', { a: 1 }], + ['Object.create(null)', Object.create(null)], + ['object inheriting from a literal', Object.create({ inherited: 1 })], + ['JSON.parse result', JSON.parse('{"a":1}')], + ['frozen literal', Object.freeze({ a: 1 })], + ['new Object()', new Object()], + ['literal with an own constructor key', { constructor: 'foo' }], + [ + 'null-prototype object with an own constructor key', + Object.assign(Object.create(null), { constructor: 'foo' }), + ], + ['decoded search with a constructor key', decode('constructor=foo&page=1')], + ])('returns true for %s', (_name, value) => { + expect(isPlainObject(value)).toBe(true) + }) + + class Foo { + a = 1 + } + + it.each([ + ['null', null], + ['undefined', undefined], + ['number', 1], + ['string', 'a'], + ['boolean', true], + ['symbol', Symbol('s')], + ['function', () => {}], + ['empty array', []], + ['array', [1]], + ['Map', new Map()], + ['Set', new Set()], + ['Date', new Date()], + ['RegExp', /x/], + ['Promise', Promise.resolve()], + ['class instance', new Foo()], + ['Object.create(class prototype)', Object.create(Foo.prototype)], + [ + 'class instance with an own constructor key', + Object.assign(new Foo(), { constructor: 'foo' }), + ], + ])('returns false for %s', (_name, value) => { + expect(isPlainObject(value)).toBe(false) + }) + + it.each([ + ['string', 'foo'], + ['number', 1], + ['boolean', false], + ['null', null], + ['undefined', undefined], + ['array', ['a', 'b']], + ['object', { nested: 1 }], + ])('stays plain with a %s-valued constructor key', (_name, value) => { + expect(isPlainObject({ constructor: value })).toBe(true) + expect( + isPlainObject(Object.assign(Object.create(null), { constructor: value })), + ).toBe(true) + }) + + it.each([ + ['literal', Object.prototype], + ['null-prototype', null], + ])( + 'treats a constructor key as data in %s search records', + (_name, proto) => { + const makeSearch = (constructor: string) => + Object.assign(Object.create(proto), { + constructor, + filters: { status: 'open' }, + }) + const share = proto === null ? nullReplaceEqualDeep : replaceEqualDeep + + const prev = makeSearch('foo') + const equal = makeSearch('foo') + const changed = makeSearch('bar') + + expect(isPlainObject(prev)).toBe(true) + expect(deepEqual(prev, equal)).toBe(true) + expect(share(prev, equal)).toBe(prev) + + expect(deepEqual(prev, changed)).toBe(false) + const result = share(prev, changed) + expect(result).not.toBe(prev) + expect(result.constructor).toBe('bar') + expect(result.filters).toBe(prev.filters) + expect(Object.getPrototypeOf(result)).toBe(proto) + }, + ) + + it('shares decoded search records that carry a constructor key', () => { + const prev = decode('constructor=foo&page=1') + expect(prev.constructor).toBe('foo') + + expect(nullReplaceEqualDeep(prev, decode('constructor=foo&page=1'))).toBe( + prev, + ) + expect(deepEqual(prev, decode('page=1&constructor=foo'))).toBe(true) + + const changed = nullReplaceEqualDeep(prev, decode('constructor=bar&page=1')) + expect(changed).not.toBe(prev) + expect(changed.constructor).toBe('bar') + expect(changed.page).toBe(1) + + const repeated = decode('constructor=a&constructor=b') + expect(repeated.constructor).toStrictEqual(['a', 'b']) + expect(deepEqual(repeated, decode('constructor=a&constructor=b'))).toBe( + true, + ) + }) + + it('keeps class instances opaque for structural sharing and equality', () => { + const prev = new Foo() + const next = new Foo() + expect(replaceEqualDeep(prev, next)).toBe(next) + expect(deepEqual(prev, next)).toBe(false) + expect(deepEqual({ foo: prev }, { foo: prev })).toBe(true) + }) + + it.each([null, undefined])( + 'keeps built-ins opaque with an own constructor valued %s', + (constructor) => { + for (const [prev, next] of [ + [new Date(0), new Date(1)], + [new Map([['value', 0]]), new Map([['value', 1]])], + [/before/, /after/], + ]) { + Object.assign(prev!, { constructor }) + Object.assign(next!, { constructor }) + expect(isPlainObject(prev)).toBe(false) + expect(deepEqual(prev, next)).toBe(false) + expect(replaceEqualDeep(prev, next)).toBe(next) + } + }, + ) + + it('treats null-prototype and literal objects alike', () => { + const nullProto = Object.assign(Object.create(null), { a: 1 }) + expect(deepEqual(nullProto, { a: 1 })).toBe(true) + expect(deepEqual({ a: 1 }, nullProto)).toBe(true) + expect(replaceEqualDeep(nullProto, { a: 1 })).toBe(nullProto) + }) }) describe('isPlainArray', () => { @@ -362,43 +1051,43 @@ describe('deepEqual', () => { it('should return `true` for equal objects', () => { const a = { a: { b: 'b' }, c: 'c', d: [{ d: 'd ' }] } const b = { a: { b: 'b' }, c: 'c', d: [{ d: 'd ' }] } - expect(deepEqual(a, b, { partial })).toEqual(true) - expect(deepEqual(b, a, { partial })).toEqual(true) + expect(deepEqual(a, b, partial)).toEqual(true) + expect(deepEqual(b, a, partial)).toEqual(true) }) it('should return `false` for non equal objects', () => { const a = { a: { b: 'b' }, c: 'c' } const b = { a: { b: 'c' }, c: 'c' } - expect(deepEqual(a, b, { partial })).toEqual(false) - expect(deepEqual(b, a, { partial })).toEqual(false) + expect(deepEqual(a, b, partial)).toEqual(false) + expect(deepEqual(b, a, partial)).toEqual(false) }) it('should return `true` for equal objects and ignore `undefined` properties', () => { const a = { a: 'a', b: undefined, c: 'c' } const b = { a: 'a', c: 'c' } - expect(deepEqual(a, b, { partial })).toEqual(true) - expect(deepEqual(b, a, { partial })).toEqual(true) + expect(deepEqual(a, b, partial)).toEqual(true) + expect(deepEqual(b, a, partial)).toEqual(true) }) it('should return `true` for equal objects and ignore `undefined` nested properties', () => { const a = { a: { b: 'b', x: undefined }, c: 'c' } const b = { a: { b: 'b' }, c: 'c', d: undefined } - expect(deepEqual(a, b, { partial })).toEqual(true) - expect(deepEqual(b, a, { partial })).toEqual(true) + expect(deepEqual(a, b, partial)).toEqual(true) + expect(deepEqual(b, a, partial)).toEqual(true) }) it('should return `true` for equal arrays and ignore `undefined` object properties', () => { const a = { a: { b: 'b' }, c: undefined } const b = { a: { b: 'b' } } - expect(deepEqual([a], [b], { partial })).toEqual(true) - expect(deepEqual([b], [a], { partial })).toEqual(true) + expect(deepEqual([a], [b], partial)).toEqual(true) + expect(deepEqual([b], [a], partial)).toEqual(true) }) it('should return `true` for equal arrays and ignore nested `undefined` object properties', () => { const a = { a: { b: 'b', x: undefined }, c: 'c' } const b = { a: { b: 'b' }, c: 'c' } - expect(deepEqual([a], [b], { partial })).toEqual(true) - expect(deepEqual([b], [a], { partial })).toEqual(true) + expect(deepEqual([a], [b], partial)).toEqual(true) + expect(deepEqual([b], [a], partial)).toEqual(true) }) }) @@ -409,15 +1098,15 @@ describe('deepEqual', () => { it('should return `false` for objects', () => { const a = { a: { b: 'b', x: undefined }, c: 'c' } const b = { a: { b: 'b' }, c: 'c', d: undefined } - expect(deepEqual(a, b, { partial, ignoreUndefined })).toEqual(false) - expect(deepEqual(b, a, { partial, ignoreUndefined })).toEqual(false) + expect(deepEqual(a, b, partial, !ignoreUndefined)).toEqual(false) + expect(deepEqual(b, a, partial, !ignoreUndefined)).toEqual(false) }) it('should return `false` for arrays', () => { const a = { a: { b: 'b', x: undefined }, c: 'c' } const b = { a: { b: 'b' }, c: 'c' } - expect(deepEqual([a], [b], { partial, ignoreUndefined })).toEqual(false) - expect(deepEqual([b], [a], { partial, ignoreUndefined })).toEqual(false) + expect(deepEqual([a], [b], partial, !ignoreUndefined)).toEqual(false) + expect(deepEqual([b], [a], partial, !ignoreUndefined)).toEqual(false) }) }) describe('partial = true', () => { @@ -425,15 +1114,15 @@ describe('deepEqual', () => { it('should return `true` for objects', () => { const a = { a: { b: 'b' }, c: 'c' } const b = { a: { b: 'b' }, c: 'c', d: undefined } - expect(deepEqual(a, b, { partial, ignoreUndefined })).toEqual(true) - expect(deepEqual(b, a, { partial, ignoreUndefined })).toEqual(true) + expect(deepEqual(a, b, partial, !ignoreUndefined)).toEqual(true) + expect(deepEqual(b, a, partial, !ignoreUndefined)).toEqual(true) }) it('should return `true` for arrays', () => { const a = { a: { b: 'b', x: undefined }, c: 'c' } const b = { a: { b: 'b' }, c: 'c' } - expect(deepEqual([a], [b], { partial, ignoreUndefined })).toEqual(true) - expect(deepEqual([b], [a], { partial, ignoreUndefined })).toEqual(true) + expect(deepEqual([a], [b], partial, !ignoreUndefined)).toEqual(true) + expect(deepEqual([b], [a], partial, !ignoreUndefined)).toEqual(true) }) }) }) @@ -442,15 +1131,15 @@ describe('deepEqual', () => { it('correctly compares partially equal objects', () => { const a = { a: { b: 'b' }, c: 'c', d: [{ d: 'd ' }] } const b = { a: { b: 'b' }, c: 'c' } - expect(deepEqual(a, b, { partial: true })).toEqual(true) - expect(deepEqual(b, a, { partial: true })).toEqual(false) + expect(deepEqual(a, b, true)).toEqual(true) + expect(deepEqual(b, a, true)).toEqual(false) }) it('correctly compares partially equal objects and ignores `undefined` object properties', () => { const a = { a: { b: 'b' }, c: 'c', d: [{ d: 'd ' }], e: undefined } const b = { a: { b: 'b' }, c: 'c', d: undefined } - expect(deepEqual(a, b, { partial: true })).toEqual(true) - expect(deepEqual(b, a, { partial: true })).toEqual(false) + expect(deepEqual(a, b, true)).toEqual(true) + expect(deepEqual(b, a, true)).toEqual(false) }) }) @@ -487,7 +1176,7 @@ describe('deepEqual', () => { Object.prototype.x = 'x' const a = { a: 1 } const b = { a: 1 } - expect(deepEqual(a, b, { ignoreUndefined: false })).toEqual(true) + expect(deepEqual(a, b, false, true)).toEqual(true) }, ) @@ -506,7 +1195,7 @@ describe('decodePath', () => { 'https://mozilla.org/?x=%25%D1%88%D0%B5%5C%D0%BB%D0%BB%D1%8B%2F' const expectedResult = 'https://mozilla.org/?x=%25ше%5Cллы%2F' - const result = decodePath(stringToCheck).path + const result = decodePath(stringToCheck) expect(result).toBe(expectedResult) }) @@ -514,34 +1203,34 @@ describe('decodePath', () => { it('should handle malformed percent-encodings gracefully', () => { const stringToCheck = 'path%ZZ%D1%88test%5C%C3%A9' // Malformed sequences should remain as-is, valid ones decoded - const result = decodePath(stringToCheck).path + const result = decodePath(stringToCheck) expect(result).toBe(`path%ZZ%D1%88test%5Cé`) }) it('should return empty string unchanged', () => { - expect(decodePath('').path).toBe('') + expect(decodePath('')).toBe('') }) it('should return strings without encoding unchanged', () => { const stringToCheck = 'plain-text-path' - expect(decodePath(stringToCheck).path).toBe(stringToCheck) + expect(decodePath(stringToCheck)).toBe(stringToCheck) }) it('should handle consecutive ignored characters', () => { const stringToCheck = 'test%25%25end' const expectedResult = 'test%25%25end' - expect(decodePath(stringToCheck).path).toBe(expectedResult) + expect(decodePath(stringToCheck)).toBe(expectedResult) }) it('should handle multiple ignored items of the same type with varying case', () => { const stringToCheck = '/params-ps/named/foo%2Fabc/c%2Fh' const expectedResult = '/params-ps/named/foo%2Fabc/c%2Fh' - expect(decodePath(stringToCheck).path).toBe(expectedResult) + expect(decodePath(stringToCheck)).toBe(expectedResult) const stringToCheckWithLowerCase = '/params-ps/named/foo%2Fabc/c%5C%2f%5cAh' const expectedResultWithLowerCase = '/params-ps/named/foo%2Fabc/c%5C%2f%5cAh' - expect(decodePath(stringToCheckWithLowerCase).path).toBe( + expect(decodePath(stringToCheckWithLowerCase)).toBe( expectedResultWithLowerCase, ) }) @@ -551,102 +1240,77 @@ describe('decodePath', () => { // %0d stays encoded — no decoding, no stripping, no path mismatch // Output is uppercase hex per RFC 3986 const result = decodePath('/%0d/google.com/') - expect(result.path).toBe('/%0D/google.com/') - expect(result.path).not.toMatch(/^\/\//) - expect(result.handledProtocolRelativeURL).toBe(false) + expect(result).toBe('/%0D/google.com/') + expect(result).not.toMatch(/^\/\//) }) it('should keep LF (%0a) encoded to prevent open redirect', () => { const result = decodePath('/%0a/evil.com/') - expect(result.path).toBe('/%0A/evil.com/') - expect(result.path).not.toMatch(/^\/\//) - expect(result.handledProtocolRelativeURL).toBe(false) + expect(result).toBe('/%0A/evil.com/') + expect(result).not.toMatch(/^\/\//) }) it('should keep CRLF (%0d%0a) encoded to prevent open redirect', () => { const result = decodePath('/%0d%0a/evil.com/') - expect(result.path).toBe('/%0D%0A/evil.com/') - expect(result.path).not.toMatch(/^\/\//) - expect(result.handledProtocolRelativeURL).toBe(false) + expect(result).toBe('/%0D%0A/evil.com/') + expect(result).not.toMatch(/^\/\//) }) it('should keep multiple control characters encoded', () => { const result = decodePath('/%0d%0d%0d/evil.com/') - expect(result.path).toBe('/%0D%0D%0D/evil.com/') - expect(result.path).not.toMatch(/^\/\//) - expect(result.handledProtocolRelativeURL).toBe(false) + expect(result).toBe('/%0D%0D%0D/evil.com/') + expect(result).not.toMatch(/^\/\//) }) it('should keep null bytes encoded', () => { const result = decodePath('/%00/test/') - expect(result.path).toBe('/%00/test/') - expect(result.handledProtocolRelativeURL).toBe(false) - }) - - it('should collapse leading double slashes to prevent protocol-relative URLs', () => { - // Direct // input should still be collapsed as defense-in-depth - const result = decodePath('//evil.com/path') - const url = new URL(result.path, 'http://localhost:3000') - expect(url.origin).toBe('http://localhost:3000') - expect(result.handledProtocolRelativeURL).toBe(true) + expect(result).toBe('/%00/test/') }) it('should handle normal paths unchanged', () => { - expect(decodePath('/users/profile/').path).toBe('/users/profile/') - expect(decodePath('/users/profile/').handledProtocolRelativeURL).toBe( - false, - ) - expect(decodePath('/api/v1/data').path).toBe('/api/v1/data') - expect(decodePath('/api/v1/data').handledProtocolRelativeURL).toBe(false) - }) - - it('should handle double slash only input', () => { - // Direct // input should also be collapsed - const result = decodePath('//') - expect(result.path).toBe('/') - expect(result.handledProtocolRelativeURL).toBe(true) + expect(decodePath('/users/profile/')).toBe('/users/profile/') + expect(decodePath('/api/v1/data')).toBe('/api/v1/data') }) }) describe('WHATWG path percent-encode set preserved', () => { it('should keep curly braces encoded', () => { const result = decodePath('/%7B%7Bapp_name%7D%7D/Makefile') - expect(result.path).toBe('/%7B%7Bapp_name%7D%7D/Makefile') + expect(result).toBe('/%7B%7Bapp_name%7D%7D/Makefile') }) it('should keep angle brackets encoded', () => { - expect(decodePath('/%3Ctest%3E').path).toBe('/%3Ctest%3E') + expect(decodePath('/%3Ctest%3E')).toBe('/%3Ctest%3E') }) it('should keep double quotes encoded', () => { - expect(decodePath('/foo%22bar').path).toBe('/foo%22bar') + expect(decodePath('/foo%22bar')).toBe('/foo%22bar') }) it('should keep backticks encoded', () => { - expect(decodePath('/back%60tick').path).toBe('/back%60tick') + expect(decodePath('/back%60tick')).toBe('/back%60tick') }) it('should decode space (handled by encodePathLikeUrl for outgoing URLs)', () => { - expect(decodePath('/file%20name').path).toBe('/file name') + expect(decodePath('/file%20name')).toBe('/file name') }) it('should still decode safe characters', () => { // Regular letters/unicode should still be decoded - expect(decodePath('/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B').path).toBe('/шеллы') + expect(decodePath('/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B')).toBe('/шеллы') }) }) }) /** - * Tests for getEnumerableOwnKeys behavior (internal function). - * Tested indirectly through replaceEqualDeep since getEnumerableOwnKeys is not exported. + * Tests for the key handling of replaceEqualDeep. * - * getEnumerableOwnKeys should: - * 1. Return array of all enumerable own keys (strings + symbols) - * 2. Return false if any property is non-enumerable - * 3. Handle objects with no symbols efficiently (optimization target) + * Plain objects are compared and copied by their enumerable own string keys. + * Objects with symbol keys (checked on `next`) or non-enumerable keys are opaque: + * `next` passes through untouched, so no data is dropped and no stale object is + * reused (Apollo's preloadQuery refs carry symbol keys, see #4237). */ -describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { +describe('key handling (via replaceEqualDeep)', () => { describe('plain objects with string keys only', () => { it('should handle empty objects', () => { const prev = {} @@ -717,24 +1381,24 @@ describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { }) }) - describe('objects with symbol keys', () => { - it('should handle objects with single symbol key', () => { + describe('objects with symbol keys pass through untouched', () => { + it('returns next for a single symbol key', () => { const sym = Symbol('test') const prev = { [sym]: 1 } const next = { [sym]: 1 } - expect(replaceEqualDeep(prev, next)).toBe(prev) + expect(replaceEqualDeep(prev, next)).toBe(next) }) - it('should handle objects with multiple symbol keys', () => { + it('returns next for multiple symbol keys', () => { const sym1 = Symbol('a') const sym2 = Symbol('b') const sym3 = Symbol('c') const prev = { [sym1]: 1, [sym2]: 2, [sym3]: 3 } const next = { [sym1]: 1, [sym2]: 2, [sym3]: 3 } - expect(replaceEqualDeep(prev, next)).toBe(prev) + expect(replaceEqualDeep(prev, next)).toBe(next) }) - it('should detect differences in symbol values', () => { + it('keeps differing symbol values', () => { const sym = Symbol('test') const prev = { [sym]: 1 } const next = { [sym]: 2 } @@ -743,23 +1407,100 @@ describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { expect(result[sym]).toBe(2) }) - it('should handle global symbols', () => { + it('returns next for global symbols', () => { const sym = Symbol.for('global.test.key') const prev = { [sym]: 'value' } const next = { [sym]: 'value' } - expect(replaceEqualDeep(prev, next)).toBe(prev) + expect(replaceEqualDeep(prev, next)).toBe(next) + }) + + it('does not share a symbol-keyed prev when next has no symbols', () => { + const sym = Symbol('test') + const prev = { a: 1, [sym]: 1 } + const next = { a: 1 } + expect(replaceEqualDeep(prev, next)).toBe(next) + }) + + it('removes a previous non-enumerable symbol', () => { + const sym = Symbol('hidden') + const prev = Object.defineProperty({ a: 1 }, sym, { value: 'old' }) + const next = { a: 1 } + expect(replaceEqualDeep(prev, next)).toBe(next) + }) + + it.each(['first', 'last'])( + 'removes nested symbols in the %s entry', + (position) => { + const sym = Symbol('metadata') + const removed = { a: 1, [sym]: 'old' } + const shared = { b: 2 } + const prev = + position === 'first' + ? { removed, shared, changed: 0 } + : { changed: 0, shared, removed } + const next = + position === 'first' + ? { removed: { a: 1 }, shared: { b: 2 }, changed: 1 } + : { changed: 1, shared: { b: 2 }, removed: { a: 1 } } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(result.removed).toBe(next.removed) + expect(result.shared).toBe(shared) + }, + ) + + it('removes symbols by reusing a null-prototype next object', () => { + const sym = Symbol('metadata') + const prev = Object.assign(Object.create(null), { a: 1, [sym]: 'old' }) + const next = Object.assign(Object.create(null), { a: 1 }) + expect(nullReplaceEqualDeep(prev, next)).toBe(next) + }) + + it('preserves incoming values when previous symbols exist in null-prototype mode', () => { + const sym = Symbol('metadata') + const prev = { child: { a: 1 }, page: 1, [sym]: 'old' } + const next = { child: { a: 1 }, page: 2 } + const result = nullReplaceEqualDeep(prev, next) + expect({ ...result }).toStrictEqual(next) + expect(Object.getOwnPropertySymbols(result)).toEqual([]) + expect(result.page).toBe(2) + }) + + it('keeps an opaque next object unchanged in null-prototype mode', () => { + const next = { child: { a: 1 }, [Symbol('metadata')]: 'kept' } + const result = nullReplaceEqualDeep({ child: { a: 1 } }, next) + expect(result).toBe(next) + expect(Object.getPrototypeOf(result)).toBe(Object.prototype) + }) + + it('preserves incoming values when previous symbols accompany changed string keys', () => { + const sym = Symbol('metadata') + const prev = { changed: 0, child: { a: 1 }, [sym]: 'old' } + const next = { changed: 1, child: { a: 1 } } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(prev[sym]).toBe('old') + }) + + it('preserves incoming values when previous symbols accompany removed string keys', () => { + const sym = Symbol('metadata') + const prev = { removed: 0, child: { a: 1 }, [sym]: 'old' } + const next = { child: { a: 1 } } + const result = replaceEqualDeep(prev, next) + expect(result).toStrictEqual(next) + expect(prev[sym]).toBe('old') }) }) describe('objects with mixed string and symbol keys', () => { - it('should handle objects with both string and symbol keys', () => { + it('returns next when both string and symbol keys are present', () => { const sym = Symbol('test') const prev = { a: 1, b: 2, [sym]: 3 } const next = { a: 1, b: 2, [sym]: 3 } - expect(replaceEqualDeep(prev, next)).toBe(prev) + expect(replaceEqualDeep(prev, next)).toBe(next) }) - it('should detect differences in string keys when symbols present', () => { + it('keeps string differences when symbols present', () => { const sym = Symbol('test') const prev = { a: 1, b: 2, [sym]: 3 } const next = { a: 1, b: 99, [sym]: 3 } @@ -769,7 +1510,7 @@ describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { expect(result[sym]).toBe(3) }) - it('should detect differences in symbol keys when strings present', () => { + it('keeps symbol differences when strings present', () => { const sym = Symbol('test') const prev = { a: 1, b: 2, [sym]: 3 } const next = { a: 1, b: 2, [sym]: 99 } @@ -779,11 +1520,20 @@ describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { expect(result[sym]).toBe(99) }) - it('should handle complex nested objects with symbols', () => { + it('shares plain siblings around a nested symbol-keyed object', () => { const sym = Symbol('nested') - const prev = { outer: { inner: 1, [sym]: { deep: 'value' } } } - const next = { outer: { inner: 1, [sym]: { deep: 'value' } } } - expect(replaceEqualDeep(prev, next)).toBe(prev) + const prev = { + outer: { inner: 1, [sym]: { deep: 'value' } }, + plain: { x: 1 }, + } + const next = { + outer: { inner: 1, [sym]: { deep: 'value' } }, + plain: { x: 1 }, + } + const result = replaceEqualDeep(prev, next) + expect(result).not.toBe(prev) + expect(result.outer).toBe(next.outer) + expect(result.plain).toBe(prev.plain) }) }) @@ -950,6 +1700,53 @@ describe('getEnumerableOwnKeys behavior (via replaceEqualDeep)', () => { ] expect(replaceEqualDeep(prev, next)).toBe(prev) }) + + it('preserves identity of unchanged nested subtrees when one leaf changes', () => { + const prev = { + search: { q: 'hello', f: 'live' }, + params: { username: 'elonmusk', tweetId: '123' }, + loaderData: { + user: { id: '44196397', name: 'Elon' }, + tabs: ['a', 'b'], + }, + } + const next = { + search: { q: 'hello', f: 'live' }, + params: { username: 'elonmusk', tweetId: '123' }, + loaderData: { + user: { id: '44196397', name: 'Musk' }, + tabs: ['a', 'b'], + }, + } + const result = replaceEqualDeep(prev, next) + // user.name changed -> top object is new, but every unchanged subtree + // (including the array) keeps its previous reference for cheap memo checks. + expect(result).not.toBe(prev) + expect(result.search).toBe(prev.search) + expect(result.params).toBe(prev.params) + expect(result.loaderData.tabs).toBe(prev.loaderData.tabs) + expect(result.loaderData.user).not.toBe(prev.loaderData.user) + expect(result.loaderData.user.name).toBe('Musk') + }) + + it('bails to next for a nested object carrying a non-enumerable prop', () => { + const prevInner: Record = { a: 1 } + Object.defineProperty(prevInner, 'hidden', { + value: 2, + enumerable: false, + }) + const nextInner: Record = { a: 1 } + Object.defineProperty(nextInner, 'hidden', { + value: 2, + enumerable: false, + }) + const prev = { shared: { x: 1 }, inner: prevInner } + const next = { shared: { x: 1 }, inner: nextInner } + const result = replaceEqualDeep(prev, next) + // inner is not clone-friendly -> returns nextInner; sibling subtree shared. + expect(result.inner).toBe(nextInner) + expect(result.shared).toBe(prev.shared) + }) }) }) diff --git a/packages/router-core/tsconfig.json b/packages/router-core/tsconfig.json index faf64b9382..34cb3c4dc9 100644 --- a/packages/router-core/tsconfig.json +++ b/packages/router-core/tsconfig.json @@ -6,5 +6,11 @@ "@tanstack/router-core/isServer": ["./src/isServer/development.ts"] } }, - "include": ["src", "vite.config.ts", "tests", "vite-minify-plugin.ts"] + "include": [ + "src", + "vite.config.ts", + "tests", + "vite-minify-plugin.ts", + "benchmarks/ssr-streaming/worker.ts" + ] } diff --git a/packages/router-core/vite.config.ts b/packages/router-core/vite.config.ts index 3d5722ffeb..97859dda97 100644 --- a/packages/router-core/vite.config.ts +++ b/packages/router-core/vite.config.ts @@ -44,7 +44,6 @@ export default mergeConfig( './src/index.ts', './src/ssr/client.ts', './src/ssr/server.ts', - './src/nativeNavigation.ts', './src/scroll-restoration-script/client.ts', './src/scroll-restoration-script/server.ts', './src/isServer/server.ts', diff --git a/packages/router-devtools-core/CHANGELOG.md b/packages/router-devtools-core/CHANGELOG.md index 485adc437f..63eb2961dd 100644 --- a/packages/router-devtools-core/CHANGELOG.md +++ b/packages/router-devtools-core/CHANGELOG.md @@ -1,5 +1,57 @@ # @tanstack/router-devtools-core +## 1.168.3 + +### Patch Changes + +- [#8888](https://github.com/TanStack/router/pull/8888) [`bbf9b75`](https://github.com/TanStack/router/commit/bbf9b75808d8eee497a6dd1663f0cf08426512e0) - Fix broken styling of the embedded `TanStackRouterDevtoolsPanel` (including inside shadow DOM) by giving the devtools size tokens a `1rem` fallback when `--tsrd-font-size` is not set. + +## 1.168.2 + +### Patch Changes + +- [#8321](https://github.com/TanStack/router/pull/8321) [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6) - Consolidate internal path interpolation into `interpolatePath`, returning a pathname directly and collecting metadata only when requested. Update router and devtools callers without changing route parsing or interpolation caching. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Reuse parsed route segments when generating paths for navigation, Links, and Devtools. Preserve interpolation metadata and refresh segments when the route tree is rebuilt, without reparsing templates for new parameter values. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Share compact parsed route segments between matching and interpolation, preserve original parameter names, and avoid reparsing templates while building paths. Simplify route-tree traversal, reuse existing path helpers, and keep Devtools-only navigation validation out of the production formatter. Preserve dynamic match identity for standalone legacy fallback routes. + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + +## 1.168.1 + +### Patch Changes + +- [#7805](https://github.com/TanStack/router/pull/7805) [`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd) - Rewrite match loading around a lane-based scheduler that tracks each navigation, preload, and background reload as an ordered unit of work. This fixes pending/redirect/retry state leaking between overlapping navigations, restores correct SSR status codes for redirects, errors, and not-found responses, and closes hydration gaps where the client re-ran work the server had already completed. + - Invalidation now retires matching active preloads so older speculative loader results cannot become fresh cache data after invalidation. + - Route `headers()` now only runs on the server, matching the documented behavior — it is no longer invoked during client-side asset projection. + - The documented default `gcTime` and `preloadGcTime` now match the existing runtime default of 5 minutes (`300_000`). + + **Removed / changed exported internals** + - `RouterState` no longer includes `loadedAt`, `isTransitioning`, `statusCode`, or `redirect`. Use `match.updatedAt` in place of `loadedAt`; subscribe to `router.state.status` / `router.state.isLoading` in place of `isTransitioning`; server response status and redirect handling are now internal to the server loader and are no longer exposed on `router.state`. + - `RouteMatch.fetchCount` has been removed, with no replacement — it was purely informational. + - `RouteMatch.status` no longer includes `'redirected'` (it remains `'pending' | 'success' | 'error' | 'notFound'`) — redirected matches are dropped from the match list instead of being rendered. + - `RouteMatch.globalNotFound` has been renamed and privatized to the internal `_notFound` field. Use `match.status === 'notFound'` instead. + - The exported React, Solid, and Vue `Match` components now accept `routeId` instead of `matchId`. + - The exported `RouterStores` adapter contract now uses route-keyed presentation stores: `matchesId` is replaced by `ids`, `matchStores` by `byRoute`, and `getRouteMatchStore()` by `getMatchStore()`. The separate `loadedAt`, `isLoading`, `isTransitioning`, `statusCode`, and `redirect` stores have been removed, along with the pending/cache stores and their setters. `StoreConfig.init` has also been removed. Read application-facing state from `router.state`; preload and cache coordination are now internal. + - Removed `RouterCore` members `getMatch()`, `updateMatch()`, `cancelMatch()`, and `cancelMatches()` — read matches from `router.state.matches` (e.g. `router.state.matches.find((m) => m.id === id)`); there is no replacement for mutating or cancelling an individual in-flight match from outside the router. + - Removed `RouterCore.hasNotFoundMatch()` — use `router.state.matches.some((m) => m.status === 'notFound')`. + - Removed `RouterCore.looseRoutesById` — use `routesById`. + - Removed `RouterCore.isPrerendering()`, `RouterCore.isViewTransitionTypesSupported`, and `RouterCore.viewTransitionPromise`, with no replacement. + - Removed `RouterCore.getParsedLocationHref()` and `RouterCore.clearExpiredCache()`, with no replacement — expired cache entries are now reconciled automatically as part of match commit. + - Removed `RouterCore.latestLoadPromise` and `RouterCore.beforeLoad()`, with no replacement. + - `RouterCore.commitLocationPromise` and `RouterCore.pendingBuiltLocation` have been replaced by the internal `_commitPromise` and `_pendingLocation` fields. + - Removed the exported `GetMatchFn` and `UpdateMatchFn` types, along with the methods they typed. + - Removed the standalone `getMatchedRoutes()` export from `@tanstack/router-core` — use the `router.getMatchedRoutes()` instance method instead. + - `RouterCore.loadRouteChunk()` no longer accepts an array of component types as its second argument. One-argument usage is unchanged; the optional second argument is now `'errorComponent'`, `'notFoundComponent'`, or `false` for internal boundary loading. + - Removed `Redirect.redirectHandled`, which was internal redirect bookkeeping. + - `MatchRoutesOpts.preload` and `MatchRoutesOpts.dest` have been removed. + - `StartTransitionFn` is now `(fn, expected) => Promise` (previously `(fn) => void`). This only affects custom framework adapters that implement `startTransition`. + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + ## 1.168.0 ### Minor Changes diff --git a/packages/router-devtools-core/package.json b/packages/router-devtools-core/package.json index f717cd1f2c..24db637cc7 100644 --- a/packages/router-devtools-core/package.json +++ b/packages/router-devtools-core/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/router-devtools-core", - "version": "1.168.0", + "version": "1.168.3", "description": "Modern and scalable routing for Web applications", "author": "Tanner Linsley", "license": "MIT", @@ -25,14 +25,15 @@ ], "scripts": { "clean": "rimraf ./dist && rimraf ./coverage", - "test:eslint": "eslint ./src", + "test:eslint": "eslint ./src ./tests", + "test:unit": "vitest", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -66,9 +67,16 @@ "goober": "^2.1.16" }, "devDependencies": { - "solid-js": "^1.9.10", + "@testing-library/jest-dom": "catalog:", + "solid-js": "catalog:", "vite": "*", - "vite-plugin-solid": "^2.11.10" + "vite-plugin-solid": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "@tanstack/router-core": "workspace:^", diff --git a/packages/router-devtools-core/src/AgeTicker.tsx b/packages/router-devtools-core/src/AgeTicker.tsx index 27d179fda1..5a615be54f 100644 --- a/packages/router-devtools-core/src/AgeTicker.tsx +++ b/packages/router-devtools-core/src/AgeTicker.tsx @@ -1,6 +1,6 @@ import { clsx as cx } from 'clsx' import { useStyles } from './useStyles' -import type { AnyRouteMatch, AnyRouter } from '@tanstack/router-core' +import type { AnyRoute, AnyRouteMatch, AnyRouter } from '@tanstack/router-core' import type { Accessor } from 'solid-js' function formatTime(ms: number) { @@ -35,7 +35,9 @@ export function AgeTicker({ return null } - const route = router().looseRoutesById[match.routeId]! + const route = (router().routesById as Record)[ + match.routeId + ]! if (!route.options.loader) { return null @@ -45,7 +47,7 @@ export function AgeTicker({ const staleTime = route.options.staleTime ?? router().options.defaultStaleTime ?? 0 const gcTime = - route.options.gcTime ?? router().options.defaultGcTime ?? 30 * 60 * 1000 + route.options.gcTime ?? router().options.defaultGcTime ?? 300_000 return (
staleTime))}> diff --git a/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx b/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx index 79566656b0..7efcaffca2 100644 --- a/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx +++ b/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx @@ -1,6 +1,8 @@ import { clsx as cx } from 'clsx' import { + getRouteSegments, hasKeys, + hasMissingPathParams, interpolatePath, rootRouteId, trimPath, @@ -179,19 +181,19 @@ function RouteComp({ // flatten all params in the router state, into a single object const allParams = Object.assign({}, ...matches().map((m) => m.params)) - // interpolatePath is used by router-core to generate the `to` - // path for the navigate function in the router - const interpolated = interpolatePath({ - path: route.fullPath, - params: allParams, - decoder: router().pathParamsDecoder, - }) + const segments = getRouteSegments(route) + const pathname = segments + ? interpolatePath( + route.fullPath, + segments, + allParams, + router().pathParamsDecoder, + ) + : route.fullPath - // only if `interpolated` is not missing params, return the path since this - // means that all the params are present for a successful navigation - return !interpolated.isMissingParams - ? interpolated.interpolatedPath - : undefined + return segments && hasMissingPathParams(segments, allParams) + ? undefined + : pathname }) return ( @@ -282,46 +284,40 @@ export const BaseTanStackRouterDevtoolsPanel = const [history, setHistory] = createSignal>([]) const [hasHistoryOverflowed, setHasHistoryOverflowed] = createSignal(false) - let pendingMatches: Accessor> - let cachedMatches: Accessor> - // subscribable implementation - if ('subscribe' in router().stores.pendingMatches) { - const [_pendingMatches, setPending] = createSignal>( - [], - ) - pendingMatches = _pendingMatches - - const [_cachedMatches, setCached] = createSignal>([]) - cachedMatches = _cachedMatches - - type Subscribe = (fn: () => void) => { unsubscribe: () => void } - createEffect(() => { - const pendingMatchesStore = router().stores.pendingMatches - setPending(pendingMatchesStore.get()) - const subscription = ( - (pendingMatchesStore as any).subscribe as Subscribe - )(() => { - setPending(pendingMatchesStore.get()) - }) - onCleanup(() => subscription.unsubscribe()) - }) - - createEffect(() => { - const cachedMatchesStore = router().stores.cachedMatches - setCached(cachedMatchesStore.get()) - const subscription = ( - (cachedMatchesStore as any).subscribe as Subscribe - )(() => { - setCached(cachedMatchesStore.get()) - }) - onCleanup(() => subscription.unsubscribe()) - }) - } - // signal implementation - else { - pendingMatches = () => router().stores.pendingMatches.get() - cachedMatches = () => router().stores.cachedMatches.get() + const pendingMatches = () => { + const matches = routerState().matches + return matches.some((match: AnyRouteMatch) => match.status === 'pending') + ? matches + : [] } + let cache = router()._cache + let cacheMatches = [...cache.values()] + const [cachedMatches, setCachedMatches] = createSignal(cacheMatches) + + createEffect(() => { + const refreshCache = () => { + const next = router()._cache + let valuesChanged = next.size !== cacheMatches.length + if (!valuesChanged) { + let index = 0 + for (const match of next.values()) { + if (match !== cacheMatches[index++]) { + valuesChanged = true + break + } + } + } + + if (next !== cache || valuesChanged) { + cache = next + cacheMatches = [...next.values()] + setCachedMatches(cacheMatches) + } + } + refreshCache() + const interval = setInterval(refreshCache, 500) + onCleanup(() => clearInterval(interval)) + }) createEffect(() => { const matches = routerState().matches @@ -392,7 +388,6 @@ export const BaseTanStackRouterDevtoolsPanel = 'stores', 'basepath', 'subscribers', - 'latestLoadPromise', '_scroll', 'tempLocationKey', 'latestLocation', @@ -719,7 +714,9 @@ export const BaseTanStackRouterDevtoolsPanel =
State:
- {pendingMatches().find((d) => d.id === activeMatch()?.id) + {pendingMatches().find( + (d: AnyRouteMatch) => d.id === activeMatch()?.id, + ) ? 'Pending' : routerState().matches.find( (d: any) => d.id === activeMatch()?.id, diff --git a/packages/router-devtools-core/src/tokens.ts b/packages/router-devtools-core/src/tokens.ts index 9d247cf184..97ed9e4cd9 100644 --- a/packages/router-devtools-core/src/tokens.ts +++ b/packages/router-devtools-core/src/tokens.ts @@ -161,37 +161,37 @@ export const tokens = { }, font: { size: { - '2xs': 'calc(var(--tsrd-font-size) * 0.625)', - xs: 'calc(var(--tsrd-font-size) * 0.75)', - sm: 'calc(var(--tsrd-font-size) * 0.875)', - md: 'var(--tsrd-font-size)', - lg: 'calc(var(--tsrd-font-size) * 1.125)', - xl: 'calc(var(--tsrd-font-size) * 1.25)', - '2xl': 'calc(var(--tsrd-font-size) * 1.5)', - '3xl': 'calc(var(--tsrd-font-size) * 1.875)', - '4xl': 'calc(var(--tsrd-font-size) * 2.25)', - '5xl': 'calc(var(--tsrd-font-size) * 3)', - '6xl': 'calc(var(--tsrd-font-size) * 3.75)', - '7xl': 'calc(var(--tsrd-font-size) * 4.5)', - '8xl': 'calc(var(--tsrd-font-size) * 6)', - '9xl': 'calc(var(--tsrd-font-size) * 8)', + '2xs': 'calc(var(--tsrd-font-size, 1rem) * 0.625)', + xs: 'calc(var(--tsrd-font-size, 1rem) * 0.75)', + sm: 'calc(var(--tsrd-font-size, 1rem) * 0.875)', + md: 'var(--tsrd-font-size, 1rem)', + lg: 'calc(var(--tsrd-font-size, 1rem) * 1.125)', + xl: 'calc(var(--tsrd-font-size, 1rem) * 1.25)', + '2xl': 'calc(var(--tsrd-font-size, 1rem) * 1.5)', + '3xl': 'calc(var(--tsrd-font-size, 1rem) * 1.875)', + '4xl': 'calc(var(--tsrd-font-size, 1rem) * 2.25)', + '5xl': 'calc(var(--tsrd-font-size, 1rem) * 3)', + '6xl': 'calc(var(--tsrd-font-size, 1rem) * 3.75)', + '7xl': 'calc(var(--tsrd-font-size, 1rem) * 4.5)', + '8xl': 'calc(var(--tsrd-font-size, 1rem) * 6)', + '9xl': 'calc(var(--tsrd-font-size, 1rem) * 8)', }, lineHeight: { - '3xs': 'calc(var(--tsrd-font-size) * 0.75)', - '2xs': 'calc(var(--tsrd-font-size) * 0.875)', - xs: 'calc(var(--tsrd-font-size) * 1)', - sm: 'calc(var(--tsrd-font-size) * 1.25)', - md: 'calc(var(--tsrd-font-size) * 1.5)', - lg: 'calc(var(--tsrd-font-size) * 1.75)', - xl: 'calc(var(--tsrd-font-size) * 2)', - '2xl': 'calc(var(--tsrd-font-size) * 2.25)', - '3xl': 'calc(var(--tsrd-font-size) * 2.5)', - '4xl': 'calc(var(--tsrd-font-size) * 2.75)', - '5xl': 'calc(var(--tsrd-font-size) * 3)', - '6xl': 'calc(var(--tsrd-font-size) * 3.25)', - '7xl': 'calc(var(--tsrd-font-size) * 3.5)', - '8xl': 'calc(var(--tsrd-font-size) * 3.75)', - '9xl': 'calc(var(--tsrd-font-size) * 4)', + '3xs': 'calc(var(--tsrd-font-size, 1rem) * 0.75)', + '2xs': 'calc(var(--tsrd-font-size, 1rem) * 0.875)', + xs: 'calc(var(--tsrd-font-size, 1rem) * 1)', + sm: 'calc(var(--tsrd-font-size, 1rem) * 1.25)', + md: 'calc(var(--tsrd-font-size, 1rem) * 1.5)', + lg: 'calc(var(--tsrd-font-size, 1rem) * 1.75)', + xl: 'calc(var(--tsrd-font-size, 1rem) * 2)', + '2xl': 'calc(var(--tsrd-font-size, 1rem) * 2.25)', + '3xl': 'calc(var(--tsrd-font-size, 1rem) * 2.5)', + '4xl': 'calc(var(--tsrd-font-size, 1rem) * 2.75)', + '5xl': 'calc(var(--tsrd-font-size, 1rem) * 3)', + '6xl': 'calc(var(--tsrd-font-size, 1rem) * 3.25)', + '7xl': 'calc(var(--tsrd-font-size, 1rem) * 3.5)', + '8xl': 'calc(var(--tsrd-font-size, 1rem) * 3.75)', + '9xl': 'calc(var(--tsrd-font-size, 1rem) * 4)', }, weight: { thin: '100', @@ -220,55 +220,55 @@ export const tokens = { border: { radius: { none: '0px', - xs: 'calc(var(--tsrd-font-size) * 0.125)', - sm: 'calc(var(--tsrd-font-size) * 0.25)', - md: 'calc(var(--tsrd-font-size) * 0.375)', - lg: 'calc(var(--tsrd-font-size) * 0.5)', - xl: 'calc(var(--tsrd-font-size) * 0.75)', - '2xl': 'calc(var(--tsrd-font-size) * 1)', - '3xl': 'calc(var(--tsrd-font-size) * 1.5)', + xs: 'calc(var(--tsrd-font-size, 1rem) * 0.125)', + sm: 'calc(var(--tsrd-font-size, 1rem) * 0.25)', + md: 'calc(var(--tsrd-font-size, 1rem) * 0.375)', + lg: 'calc(var(--tsrd-font-size, 1rem) * 0.5)', + xl: 'calc(var(--tsrd-font-size, 1rem) * 0.75)', + '2xl': 'calc(var(--tsrd-font-size, 1rem) * 1)', + '3xl': 'calc(var(--tsrd-font-size, 1rem) * 1.5)', full: '9999px', }, }, size: { 0: '0px', - 0.25: 'calc(var(--tsrd-font-size) * 0.0625)', - 0.5: 'calc(var(--tsrd-font-size) * 0.125)', - 1: 'calc(var(--tsrd-font-size) * 0.25)', - 1.5: 'calc(var(--tsrd-font-size) * 0.375)', - 2: 'calc(var(--tsrd-font-size) * 0.5)', - 2.5: 'calc(var(--tsrd-font-size) * 0.625)', - 3: 'calc(var(--tsrd-font-size) * 0.75)', - 3.5: 'calc(var(--tsrd-font-size) * 0.875)', - 4: 'calc(var(--tsrd-font-size) * 1)', - 4.5: 'calc(var(--tsrd-font-size) * 1.125)', - 5: 'calc(var(--tsrd-font-size) * 1.25)', - 5.5: 'calc(var(--tsrd-font-size) * 1.375)', - 6: 'calc(var(--tsrd-font-size) * 1.5)', - 6.5: 'calc(var(--tsrd-font-size) * 1.625)', - 7: 'calc(var(--tsrd-font-size) * 1.75)', - 8: 'calc(var(--tsrd-font-size) * 2)', - 9: 'calc(var(--tsrd-font-size) * 2.25)', - 10: 'calc(var(--tsrd-font-size) * 2.5)', - 11: 'calc(var(--tsrd-font-size) * 2.75)', - 12: 'calc(var(--tsrd-font-size) * 3)', - 14: 'calc(var(--tsrd-font-size) * 3.5)', - 16: 'calc(var(--tsrd-font-size) * 4)', - 20: 'calc(var(--tsrd-font-size) * 5)', - 24: 'calc(var(--tsrd-font-size) * 6)', - 28: 'calc(var(--tsrd-font-size) * 7)', - 32: 'calc(var(--tsrd-font-size) * 8)', - 36: 'calc(var(--tsrd-font-size) * 9)', - 40: 'calc(var(--tsrd-font-size) * 10)', - 44: 'calc(var(--tsrd-font-size) * 11)', - 48: 'calc(var(--tsrd-font-size) * 12)', - 52: 'calc(var(--tsrd-font-size) * 13)', - 56: 'calc(var(--tsrd-font-size) * 14)', - 60: 'calc(var(--tsrd-font-size) * 15)', - 64: 'calc(var(--tsrd-font-size) * 16)', - 72: 'calc(var(--tsrd-font-size) * 18)', - 80: 'calc(var(--tsrd-font-size) * 20)', - 96: 'calc(var(--tsrd-font-size) * 24)', + 0.25: 'calc(var(--tsrd-font-size, 1rem) * 0.0625)', + 0.5: 'calc(var(--tsrd-font-size, 1rem) * 0.125)', + 1: 'calc(var(--tsrd-font-size, 1rem) * 0.25)', + 1.5: 'calc(var(--tsrd-font-size, 1rem) * 0.375)', + 2: 'calc(var(--tsrd-font-size, 1rem) * 0.5)', + 2.5: 'calc(var(--tsrd-font-size, 1rem) * 0.625)', + 3: 'calc(var(--tsrd-font-size, 1rem) * 0.75)', + 3.5: 'calc(var(--tsrd-font-size, 1rem) * 0.875)', + 4: 'calc(var(--tsrd-font-size, 1rem) * 1)', + 4.5: 'calc(var(--tsrd-font-size, 1rem) * 1.125)', + 5: 'calc(var(--tsrd-font-size, 1rem) * 1.25)', + 5.5: 'calc(var(--tsrd-font-size, 1rem) * 1.375)', + 6: 'calc(var(--tsrd-font-size, 1rem) * 1.5)', + 6.5: 'calc(var(--tsrd-font-size, 1rem) * 1.625)', + 7: 'calc(var(--tsrd-font-size, 1rem) * 1.75)', + 8: 'calc(var(--tsrd-font-size, 1rem) * 2)', + 9: 'calc(var(--tsrd-font-size, 1rem) * 2.25)', + 10: 'calc(var(--tsrd-font-size, 1rem) * 2.5)', + 11: 'calc(var(--tsrd-font-size, 1rem) * 2.75)', + 12: 'calc(var(--tsrd-font-size, 1rem) * 3)', + 14: 'calc(var(--tsrd-font-size, 1rem) * 3.5)', + 16: 'calc(var(--tsrd-font-size, 1rem) * 4)', + 20: 'calc(var(--tsrd-font-size, 1rem) * 5)', + 24: 'calc(var(--tsrd-font-size, 1rem) * 6)', + 28: 'calc(var(--tsrd-font-size, 1rem) * 7)', + 32: 'calc(var(--tsrd-font-size, 1rem) * 8)', + 36: 'calc(var(--tsrd-font-size, 1rem) * 9)', + 40: 'calc(var(--tsrd-font-size, 1rem) * 10)', + 44: 'calc(var(--tsrd-font-size, 1rem) * 11)', + 48: 'calc(var(--tsrd-font-size, 1rem) * 12)', + 52: 'calc(var(--tsrd-font-size, 1rem) * 13)', + 56: 'calc(var(--tsrd-font-size, 1rem) * 14)', + 60: 'calc(var(--tsrd-font-size, 1rem) * 15)', + 64: 'calc(var(--tsrd-font-size, 1rem) * 16)', + 72: 'calc(var(--tsrd-font-size, 1rem) * 18)', + 80: 'calc(var(--tsrd-font-size, 1rem) * 20)', + 96: 'calc(var(--tsrd-font-size, 1rem) * 24)', }, shadow: { xs: (_: string = 'rgb(0 0 0 / 0.1)') => diff --git a/packages/router-devtools-core/src/useStyles.tsx b/packages/router-devtools-core/src/useStyles.tsx index 5524ed0ae8..32908c524d 100644 --- a/packages/router-devtools-core/src/useStyles.tsx +++ b/packages/router-devtools-core/src/useStyles.tsx @@ -428,7 +428,7 @@ const stylesFactory = (shadowDOMTarget?: ShadowRoot) => { line-height: ${tokens.font.lineHeight.sm}; `, matchStatus: ( - status: 'pending' | 'success' | 'error' | 'notFound' | 'redirected', + status: 'pending' | 'success' | 'error' | 'notFound', isFetching: false | 'beforeLoad' | 'loader', ) => { const colorMap = { @@ -436,7 +436,6 @@ const stylesFactory = (shadowDOMTarget?: ShadowRoot) => { success: 'green', error: 'red', notFound: 'purple', - redirected: 'gray', } as const const color = diff --git a/packages/router-devtools-core/src/utils.tsx b/packages/router-devtools-core/src/utils.tsx index c14bfd80be..962cdaf0f3 100644 --- a/packages/router-devtools-core/src/utils.tsx +++ b/packages/router-devtools-core/src/utils.tsx @@ -25,7 +25,6 @@ export function getStatusColor(match: AnyRouteMatch) { success: 'green', error: 'red', notFound: 'purple', - redirected: 'gray', } as const return match.isFetching && match.status === 'success' diff --git a/packages/router-devtools-core/tests/cache-replacement.test.ts b/packages/router-devtools-core/tests/cache-replacement.test.ts new file mode 100644 index 0000000000..e44e1cce53 --- /dev/null +++ b/packages/router-devtools-core/tests/cache-replacement.test.ts @@ -0,0 +1,105 @@ +import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest' +import { TanStackRouterDevtoolsPanelCore } from '../src/TanStackRouterDevtoolsPanelCore' +import type { AnyRouteMatch, AnyRouter } from '@tanstack/router-core' + +function createCachedMatch(loaderData: string): AnyRouteMatch { + return { + id: 'cached-match', + routeId: '/cached', + pathname: '/cached', + params: {}, + search: {}, + status: 'success', + isFetching: false, + updatedAt: Date.now(), + loaderData, + } as AnyRouteMatch +} + +describe('cached matches', () => { + let panel: TanStackRouterDevtoolsPanelCore | undefined + + // Warm Vite's lazy transform of the panel chunk outside any test so its + // cost never counts against a test's timeout budget on slow CI runners. + beforeAll(async () => { + await import('../src/BaseTanStackRouterDevtoolsPanel') + }, 30_000) + + afterEach(() => { + panel?.unmount() + panel = undefined + document.body.innerHTML = '' + try { + window.localStorage.clear() + } catch {} + vi.useRealTimers() + }) + + it('uses the default gc time and refreshes replaced cache entries', async () => { + vi.useFakeTimers() + + const route = { + id: '/cached', + path: 'cached', + fullPath: '/cached', + rank: 0, + children: [], + options: { loader: () => undefined }, + } + const routeTree = { + id: '__root__', + path: '/', + fullPath: '/', + rank: 0, + children: [route], + options: {}, + } + const cache = new Map([['cached-match', createCachedMatch('old data')]]) + const router = { + _cache: cache, + routeTree, + routesById: { + __root__: routeTree, + '/cached': route, + }, + options: {}, + navigate: vi.fn(), + } as unknown as AnyRouter + const routerState = { + location: { + href: '/', + pathname: '/', + search: {}, + searchStr: '', + hash: '', + }, + matches: [], + } + const container = document.createElement('div') + document.body.append(container) + + panel = new TanStackRouterDevtoolsPanelCore({ router, routerState }) + panel.mount(container) + + await vi.waitFor(() => { + expect( + container.querySelector( + '[aria-label="Open match details for cached-match"]', + ), + ).not.toBeNull() + }) + expect(container.textContent).toContain('5min') + + const cachedMatch = container.querySelector( + '[aria-label="Open match details for cached-match"]', + ) as HTMLElement + cachedMatch.click() + expect(container.textContent).toContain('old data') + + cache.set('cached-match', createCachedMatch('new data')) + await vi.advanceTimersByTimeAsync(500) + + expect(container.textContent).toContain('new data') + expect(container.textContent).not.toContain('old data') + }, 10_000) +}) diff --git a/packages/router-devtools-core/tests/interpolation-navigation.test.ts b/packages/router-devtools-core/tests/interpolation-navigation.test.ts new file mode 100644 index 0000000000..d756d1d5a2 --- /dev/null +++ b/packages/router-devtools-core/tests/interpolation-navigation.test.ts @@ -0,0 +1,90 @@ +import { beforeAll, expect, test, vi } from 'vitest' +import { + BaseRootRoute, + BaseRoute, + RouterCore, + createNonReactiveMutableStore, + createNonReactiveReadonlyStore, +} from '@tanstack/router-core' +import { TanStackRouterDevtoolsPanelCore } from '../src/TanStackRouterDevtoolsPanelCore' + +beforeAll(async () => { + await import('../src/BaseTanStackRouterDevtoolsPanel') +}, 30_000) + +test('offers navigation only when required and splat params are available', async () => { + const root = new BaseRootRoute({}) + const routeTree = root.addChildren( + ['/users/$id', '/posts/{-$category}', '/files/$'].map( + (path) => new BaseRoute({ getParentRoute: () => root, path }), + ), + ) + const router = new RouterCore({ routeTree, isServer: false }, () => ({ + createMutableStore: createNonReactiveMutableStore, + createReadonlyStore: createNonReactiveReadonlyStore, + batch: (fn) => fn(), + })) + const navigate = vi.spyOn(router, 'navigate').mockResolvedValue() + const initialState = router.state + const panel = new TanStackRouterDevtoolsPanelCore({ + router, + routerState: initialState, + }) + const container = document.createElement('div') + document.body.append(container) + panel.mount(container) + + try { + await vi.waitFor(() => { + expect( + container.querySelector('[title="Navigate to /posts"]'), + ).not.toBeNull() + }) + expect(container.querySelector('[title^="Navigate to /users/"]')).toBeNull() + expect(container.querySelector('[title^="Navigate to /files"]')).toBeNull() + + panel.setRouterState({ + ...initialState, + matches: router.matchRoutes('/users/item%20one', {}), + }) + await vi.waitFor(() => { + expect( + container.querySelector('[title="Navigate to /users/item%20one"]'), + ).not.toBeNull() + }) + container + .querySelector( + '[title="Navigate to /users/item%20one"]', + )! + .click() + expect(navigate).toHaveBeenCalledWith({ + to: '/users/item%20one', + params: undefined, + search: undefined, + }) + + panel.setRouterState({ + ...initialState, + matches: router.matchRoutes('/files/docs/guide', {}), + }) + await vi.waitFor(() => { + expect( + container.querySelector('[title="Navigate to /files/docs/guide"]'), + ).not.toBeNull() + }) + expect(container.querySelector('[title^="Navigate to /users/"]')).toBeNull() + + panel.setRouterState(initialState) + await vi.waitFor(() => { + expect( + container.querySelector('[title^="Navigate to /files"]'), + ).toBeNull() + }) + } finally { + panel.unmount() + router.history.destroy() + navigate.mockRestore() + container.remove() + window.localStorage.clear() + } +}, 30_000) diff --git a/packages/router-devtools-core/tsconfig.json b/packages/router-devtools-core/tsconfig.json index 1b802b64d1..e24672b5de 100644 --- a/packages/router-devtools-core/tsconfig.json +++ b/packages/router-devtools-core/tsconfig.json @@ -4,5 +4,5 @@ "jsx": "preserve", "jsxImportSource": "solid-js" }, - "include": ["src", "vite.config.ts"] + "include": ["src", "tests", "vite.config.ts"] } diff --git a/packages/router-devtools-core/vite.config.ts b/packages/router-devtools-core/vite.config.ts index 53da7f8839..b14dd2bdf5 100644 --- a/packages/router-devtools-core/vite.config.ts +++ b/packages/router-devtools-core/vite.config.ts @@ -1,9 +1,23 @@ import { defineConfig, mergeConfig } from 'vitest/config' import { tanstackViteConfig } from '@tanstack/vite-config' import solid from 'vite-plugin-solid' +import packageJson from './package.json' const config = defineConfig({ plugins: [solid()], + test: { + name: packageJson.name, + dir: './tests', + watch: false, + environment: 'jsdom', + typecheck: { enabled: true }, + setupFiles: [], + server: { + deps: { + inline: [/solid-js/], + }, + }, + }, }) const merged = mergeConfig( diff --git a/packages/router-devtools/CHANGELOG.md b/packages/router-devtools/CHANGELOG.md index 38a9a2be35..201d972d6c 100644 --- a/packages/router-devtools/CHANGELOG.md +++ b/packages/router-devtools/CHANGELOG.md @@ -1,5 +1,28 @@ # @tanstack/router-devtools +## 1.167.3 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-router-devtools@1.167.3 + +## 1.167.2 + +### Patch Changes + +- Updated dependencies [[`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5)]: + - @tanstack/react-router@1.170.36 + - @tanstack/react-router-devtools@1.167.2 + +## 1.167.1 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/react-router@1.170.19 + - @tanstack/react-router-devtools@1.167.1 + ## 1.167.0 ### Minor Changes diff --git a/packages/router-devtools/package.json b/packages/router-devtools/package.json index b6a2a3d437..4158b280d7 100644 --- a/packages/router-devtools/package.json +++ b/packages/router-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/router-devtools", - "version": "1.167.0", + "version": "1.167.3", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -65,10 +65,19 @@ "@tanstack/react-router-devtools": "workspace:*" }, "devDependencies": { - "@vitejs/plugin-react": "^4.3.4", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "vite": "*" + "@vitejs/plugin-react": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", + "vite": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@eslint-react/eslint-plugin": "catalog:", + "eslint-plugin-react-hooks": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "@tanstack/react-router": "workspace:^", diff --git a/packages/router-generator/AGENTS.md b/packages/router-generator/AGENTS.md new file mode 100644 index 0000000000..1cc70bf370 --- /dev/null +++ b/packages/router-generator/AGENTS.md @@ -0,0 +1,6 @@ +# Route generator + +- Preserve the existing `safeFileWrite` path: temporary-file rename, modification-time conflict retry, and post-rename stat. Keep unchanged-write suppression and main/shadow cache rotation; these protect concurrent edits, avoid watcher loops, and discard deleted routes. +- Run the complete `test:unit` target after generator changes. Its runtime phase generates fixture route trees before typechecking their consumers; `test:types` excludes the generator fixtures. +- Add generation cases under `tests/generator//`. Read [`tests/generator.test.ts`](tests/generator.test.ts) for per-case configuration and preprocessing. Change route inputs/configuration or templates, then regenerate route trees and expected snapshots through the test harness. +- `preprocess()` recreates selected route files for `file-modification*` and `custom-scaffolding`. Edit their templates/configuration/preprocessing when changing those inputs; edits to recreated files are overwritten. diff --git a/packages/router-generator/CHANGELOG.md b/packages/router-generator/CHANGELOG.md index 64189e0fe8..a37550d255 100644 --- a/packages/router-generator/CHANGELOG.md +++ b/packages/router-generator/CHANGELOG.md @@ -1,5 +1,198 @@ # @tanstack/router-generator +## 1.168.0 + +### Minor Changes + +- [#8855](https://github.com/TanStack/router/pull/8855) [`446ce1b`](https://github.com/TanStack/router/commit/446ce1b30650d85f1fc78f2d1ee42712e40b75c6) - Require Node `^20.19.0 || >=22.12.0` (was `>=20.19`), so the CommonJS builds can load ESM-only dependencies through `require(esm)`. Node 21 and Node 22.0–22.11 do not enable it by default, so they are no longer supported. + +### Patch Changes + +- [#8857](https://github.com/TanStack/router/pull/8857) [`ad5b3b7`](https://github.com/TanStack/router/commit/ad5b3b7a0990eed7351d672ea6695d341108e0d6) - A pathless layout inside a route group (`routes/(group)/_layout.tsx`) or a route group's own layout (`routes/(group)/route.tsx`) is typed with the full path `'/'` in `FileRoutesByPath`, like the router gives it at runtime, instead of `''`. When no index route claims `/`, the layout also appears under `'/'` in `FileRoutesByFullPath` and `FileRoutesByTo`, as a pathless layout outside a group already does. + +- Updated dependencies [[`446ce1b`](https://github.com/TanStack/router/commit/446ce1b30650d85f1fc78f2d1ee42712e40b75c6), [`ff157f0`](https://github.com/TanStack/router/commit/ff157f0079982e90d62be7fdeecfb77e4fdcec69)]: + - @tanstack/router-utils@1.163.0 + +## 1.167.46 + +### Patch Changes + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + +## 1.167.45 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + +## 1.167.44 + +### Patch Changes + +- Updated dependencies [[`923d98b`](https://github.com/TanStack/router/commit/923d98b18b6cd90b6219591e20e86115dc61048e)]: + - @tanstack/router-utils@1.162.4 + +## 1.167.43 + +### Patch Changes + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + +## 1.167.42 + +### Patch Changes + +- [#8664](https://github.com/TanStack/router/pull/8664) [`57bd1a9`](https://github.com/TanStack/router/commit/57bd1a92f9839af5bf773c3b36d039569fb1a41e) - Avoid overwriting a route file with the scaffold template when an in-place save finishes while the generator is reading the file. + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + +## 1.167.41 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/router-core@1.171.35 + +## 1.167.40 + +### Patch Changes + +- Updated dependencies [[`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/router-core@1.171.34 + +## 1.167.39 + +### Patch Changes + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/router-core@1.171.33 + +## 1.167.38 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + +## 1.167.37 + +### Patch Changes + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + +## 1.167.36 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + +## 1.167.35 + +### Patch Changes + +- [#8300](https://github.com/TanStack/router/pull/8300) [`49bcd4d`](https://github.com/TanStack/router/commit/49bcd4db743dba4a783d5533a42a0f97a5721292) - Refresh compatible build and runtime dependencies. + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`49bcd4d`](https://github.com/TanStack/router/commit/49bcd4db743dba4a783d5533a42a0f97a5721292), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/router-utils@1.162.3 + +## 1.167.34 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + +## 1.167.33 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + +## 1.167.32 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + +## 1.167.31 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + +## 1.167.30 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + +## 1.167.29 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/router-core@1.171.23 + +## 1.167.28 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13)]: + - @tanstack/router-core@1.171.22 + +## 1.167.27 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + +## 1.167.26 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + +## 1.167.25 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + +## 1.167.24 + +### Patch Changes + +- Updated dependencies [[`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/router-core@1.171.18 + +## 1.167.23 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + +## 1.167.22 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + ## 1.167.21 ### Patch Changes diff --git a/packages/router-generator/package.json b/packages/router-generator/package.json index 49cb783772..e62e105068 100644 --- a/packages/router-generator/package.json +++ b/packages/router-generator/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/router-generator", - "version": "1.167.21", + "version": "1.168.0", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -28,12 +28,12 @@ "clean:snapshots": "rimraf **/*snapshot* --glob", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts60": "tsc -p tsconfig.legacy.json", + "test:types:ts60": "tsc6 -p tsconfig.legacy.json", + "test:types:ts70": "tsc -p tsconfig.legacy.json", "test:unit": "vitest --typecheck false && vitest run --typecheck.only", "test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -62,21 +62,39 @@ "src" ], "engines": { - "node": ">=20.19" + "node": "^20.19.0 || >=22.12.0" }, "dependencies": { - "@babel/types": "^7.28.5", + "@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.5.0", - "zod": "^4.4.3" + "prettier": "^3.9.6", + "zod": "catalog:" }, "devDependencies": { "@tanstack/react-router": "workspace:*", "@types/node": ">=20", - "vite": "*" + "@types/react": "catalog:", + "react": "catalog:", + "vite": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" + }, + "nx": { + "targets": { + "test:unit": { + "outputs": [ + "...", + "{projectRoot}/tests/generator/*/routeTree.gen.{ts,js}", + "{projectRoot}/tests/generator/file-modification/routes/*/*.tsx" + ] + } + } } } diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts index e8cd170e40..91f87dadda 100644 --- a/packages/router-generator/src/generator.ts +++ b/packages/router-generator/src/generator.ts @@ -1146,6 +1146,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved strategy: { type: 'mtime', expectedMtimeMs: updatedCacheEntry.mtimeMs, + expectedContent: existingRouteFile.fileContent, }, }) updatedCacheEntry.mtimeMs = stats.mtimeMs @@ -1206,6 +1207,9 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved | { type: 'mtime' expectedMtimeMs: bigint + // An in-place save can truncate and rewrite a file within one mtime + // tick, so user-authored files also compare the content. + expectedContent?: string } | { type: 'new-file' @@ -1215,13 +1219,8 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved await this.fs.writeFile(tmpPath, opts.newContent) if (opts.strategy.type === 'mtime') { + const { expectedMtimeMs, expectedContent } = opts.strategy const beforeStat = await this.fs.stat(opts.filePath) - if (beforeStat.mtimeMs !== opts.strategy.expectedMtimeMs) { - throw rerun({ - msg: `File ${opts.filePath} was modified by another process during processing.`, - event: { type: 'update', path: opts.filePath }, - }) - } const newFileState = await this.fs.stat(tmpPath) if (newFileState.mode !== beforeStat.mode) { await this.fs.chmod(tmpPath, beforeStat.mode) @@ -1247,6 +1246,25 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved } } } + // Check right before the rename so that changes made while the + // temporary file was prepared are not overwritten. + let changed: boolean + if (expectedContent === undefined) { + const current = await this.fs.stat(opts.filePath) + changed = current.mtimeMs !== expectedMtimeMs + } else { + const current = await this.fs.readFile(opts.filePath) + changed = + current === 'file-not-existing' || + current.stat.mtimeMs !== expectedMtimeMs || + current.fileContent !== expectedContent + } + if (changed) { + throw rerun({ + msg: `File ${opts.filePath} was modified by another process during processing.`, + event: { type: 'update', path: opts.filePath }, + }) + } } else { if (await checkFileExists(opts.filePath)) { throw rerun({ @@ -1370,6 +1388,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved strategy: { type: 'mtime', expectedMtimeMs: rootNodeFile.stat.mtimeMs, + expectedContent: rootNodeFile.fileContent, }, }) updatedCacheEntry.fileContent = rootRouteContent diff --git a/packages/router-generator/src/utils.ts b/packages/router-generator/src/utils.ts index 747980aa7b..a3bb4b746c 100644 --- a/packages/router-generator/src/utils.ts +++ b/packages/router-generator/src/utils.ts @@ -924,9 +924,10 @@ const inferPath = (routeNode: RouteNode): string => { } /** - * Infers the full path for use by TS + * The full path with groups and pathless segments removed. A route group's + * layout (e.g. `/(group)/_layout`) strips down to `''`. */ -export const inferFullPath = (routeNode: RouteNode): string => { +const stripFullPath = (routeNode: RouteNode): string => { const fullPath = removeGroups( removeLayoutSegmentsAndUnderscoresWithEscape( routeNode.routePath, @@ -949,6 +950,13 @@ export const inferFullPath = (routeNode: RouteNode): string => { return fullPath.replace(/\/$/, '') } +/** + * Infers the full path for use by TS + */ +export const inferFullPath = (routeNode: RouteNode): string => + // A route group's layout has the router's full path `/` + stripFullPath(routeNode) || '/' + const shouldPreferIndexRoute = ( current: RouteNode, existing: RouteNode, @@ -1112,8 +1120,12 @@ Conflicting files: \n ${emptyPathRoutes throw new Error(errorMessage) } + // A route group's layout keeps its stripped path `''` here, so one without + // child routes yet doesn't conflict with the index route. A childless + // `_auth.tsx` does: the route tree lists the index route first, and the + // router would then match `/` to the layout const routes = _routes.map((d) => { - const inferredFullPath = inferFullPath(d) + const inferredFullPath = stripFullPath(d) return { ...d, inferredFullPath } }) diff --git a/packages/router-generator/tests/childless-pathless-layout.test.ts b/packages/router-generator/tests/childless-pathless-layout.test.ts new file mode 100644 index 0000000000..caef9449bf --- /dev/null +++ b/packages/router-generator/tests/childless-pathless-layout.test.ts @@ -0,0 +1,107 @@ +import fs from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import { afterEach, describe, expect, it, test } from 'vitest' + +import { Generator, getConfig } from '../src' + +let tempDir: string | undefined + +afterEach(async () => { + if (tempDir) { + await fs.rm(tempDir, { recursive: true, force: true }) + tempDir = undefined + } +}) + +function routeSource(id: string) { + if (id === '__root__') { + return `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +` + } + return `import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('${id}')() +` +} + +async function generate(files: Record) { + tempDir = await fs.mkdtemp( + path.join(os.tmpdir(), 'tsr-generator-childless-layout-'), + ) + const routesDirectory = path.join(tempDir, 'routes') + for (const [file, id] of Object.entries(files)) { + const filePath = path.join(routesDirectory, file) + await fs.mkdir(path.dirname(filePath), { recursive: true }) + await fs.writeFile(filePath, routeSource(id)) + } + const generatedRouteTree = path.join(tempDir, 'routeTree.gen.ts') + const generator = new Generator({ + config: getConfig( + { + disableLogging: true, + routesDirectory, + generatedRouteTree, + tmpDir: path.join(tempDir, 'tmp'), + }, + tempDir, + ), + root: tempDir, + }) + await generator.run() + return fs.readFile(generatedRouteTree, 'utf-8') +} + +// A route group's layout without child routes yet next to the index route +// generates, as before route-group layouts were typed with the full path `/`. +describe('a route-group layout without child routes yet next to the index route', () => { + it.each([ + { file: '(group)/_layout.tsx', id: '/(group)/_layout' }, + { file: '(marketing)/route.tsx', id: '/(marketing)' }, + ])('$file is added to the route tree', async ({ file, id }) => { + const routeTree = await generate({ + '__root.tsx': '__root__', + 'index.tsx': '/', + [file]: id, + }) + + expect(routeTree).toContain(`'${id}': typeof`) + }) +}) + +// The route tree lists the index route first, and the router then matches +// `/` to a pathless layout without child routes instead of the index route. +// The generator refuses that pair rather than hide the index route. +test('a pathless layout without child routes yet conflicts with the index route', async () => { + await expect( + generate({ + '__root.tsx': '__root__', + 'index.tsx': '/', + '_auth.tsx': '/_auth', + }), + ).rejects.toThrow( + 'Conflicting configuration paths were found for the following routes: "/", "/".', + ) +}) + +// A pathless layout whose parent directory has no route file of its own +// (`foo/_layout.tsx` without `foo.tsx`) carries that directory's path, so it +// matches `/foo` like any other route there. +describe('a layout without child routes yet that adds a path', () => { + it.each([ + { file: '(group)/foo.tsx', id: '/(group)/foo' }, + { file: 'foo_.tsx', id: '/foo_' }, + ])('conflicts with $file at the same full path', async ({ file, id }) => { + await expect( + generate({ + '__root.tsx': '__root__', + 'foo/_layout.tsx': '/foo/_layout', + [file]: id, + }), + ).rejects.toThrow( + 'Conflicting configuration paths were found for the following routes: "/foo", "/foo".', + ) + }) +}) diff --git a/packages/router-generator/tests/concurrent-write.test.ts b/packages/router-generator/tests/concurrent-write.test.ts new file mode 100644 index 0000000000..6550ad562d --- /dev/null +++ b/packages/router-generator/tests/concurrent-write.test.ts @@ -0,0 +1,148 @@ +import fs from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' + +import { Generator, getConfig } from '../src' + +const rootRouteSource = `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +` + +const postsRouteSource = `import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/posts')({ + component: () => 'posts', +}) +` + +const savedPostsRouteSource = postsRouteSource.replace("'posts'", "'saved'") + +let tempDir: string | undefined + +afterEach(async () => { + if (tempDir) { + await fs.rm(tempDir, { recursive: true, force: true }) + tempDir = undefined + } +}) + +async function readFileWithStat(filePath: string) { + try { + const fileHandle = await fs.open(filePath, 'r') + const stat = await fileHandle.stat({ bigint: true }) + const fileContent = (await fileHandle.readFile()).toString() + await fileHandle.close() + return { stat, fileContent } + } catch (e: any) { + if (e?.code === 'ENOENT') { + return 'file-not-existing' as const + } + throw e + } +} + +describe('generator with concurrent in-place saves', () => { + it.each(['route file read', 'temporary file stat'] as const)( + 'does not scaffold over a route file whose in-place save completes during the %s', + async (completeSaveDuring) => { + tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'tsr-generator-race-')) + const routesDirectory = path.join(tempDir, 'routes') + const tmpDir = path.join(tempDir, 'tmp') + const postsRoutePath = path.join(routesDirectory, 'posts.tsx') + await fs.mkdir(routesDirectory) + await fs.writeFile( + path.join(routesDirectory, '__root.tsx'), + rootRouteSource, + ) + await fs.writeFile(postsRoutePath, postsRouteSource) + + let saveRacesNextRead = false + let completeSave: (() => Promise) | undefined + + const generator = new Generator({ + config: getConfig( + { + disableLogging: true, + routesDirectory, + generatedRouteTree: path.join(tempDir, 'routeTree.gen.ts'), + tmpDir, + }, + tempDir, + ), + root: tempDir, + fs: { + rename: (oldPath, newPath) => fs.rename(oldPath, newPath), + writeFile: (filePath, content) => fs.writeFile(filePath, content), + readFile: async (filePath) => { + // The generator passes route paths with forward slashes, also on + // Windows. + if ( + !saveRacesNextRead || + path.resolve(filePath) !== postsRoutePath + ) { + return readFileWithStat(filePath) + } + saveRacesNextRead = false + + // An editor saving in place truncates the file before writing the + // new content, so the generator can observe an empty route file. + await fs.truncate(postsRoutePath) + const result = await readFileWithStat(postsRoutePath) + if (result === 'file-not-existing') { + throw new Error('expected the route file to exist') + } + + // The save then completes within the same timestamp tick, which is + // common for filesystems with coarse mtime granularity. + completeSave = async () => { + completeSave = undefined + await fs.writeFile(postsRoutePath, savedPostsRouteSource) + const truncatedAt = new Date(Number(result.stat.mtimeMs)) + await fs.utimes(postsRoutePath, truncatedAt, truncatedAt) + } + if (completeSaveDuring === 'route file read') { + await completeSave() + } + + return result + }, + stat: async (filePath) => { + if (completeSave && path.resolve(filePath).startsWith(tmpDir)) { + await completeSave() + } + const stat = await fs.stat(filePath, { bigint: true }) + return { + mtimeMs: stat.mtimeMs, + mode: Number(stat.mode), + uid: Number(stat.uid), + gid: Number(stat.gid), + } + }, + chmod: (filePath, mode) => fs.chmod(filePath, mode), + chown: (filePath, uid, gid) => fs.chown(filePath, uid, gid), + }, + }) + + await generator.run() + + // A first save makes the generator process the route file again, and the + // next save races with that read. + await fs.writeFile( + postsRoutePath, + postsRouteSource.replace("'posts'", "'edited'"), + ) + const editedAt = new Date(Date.now() + 10_000) + await fs.utimes(postsRoutePath, editedAt, editedAt) + saveRacesNextRead = true + await generator.run({ type: 'update', path: postsRoutePath }) + + expect(saveRacesNextRead).toBe(false) + expect(completeSave).toBeUndefined() + await expect(fs.readFile(postsRoutePath, 'utf8')).resolves.toBe( + savedPostsRouteSource, + ) + }, + ) +}) diff --git a/packages/router-generator/tests/generator/escaped-custom-tokens/routeTree.snapshot.ts b/packages/router-generator/tests/generator/escaped-custom-tokens/routeTree.snapshot.ts index e7902c671c..69b6a09946 100644 --- a/packages/router-generator/tests/generator/escaped-custom-tokens/routeTree.snapshot.ts +++ b/packages/router-generator/tests/generator/escaped-custom-tokens/routeTree.snapshot.ts @@ -71,12 +71,7 @@ export interface FileRouteTypes { fileRoutesByTo: FileRoutesByTo to: '/' | '/blog' | '/_1nd3x' | '/nested/_1nd3x' | '/posts/_r0ut3_' id: - | '__root__' - | '/' - | '/blog' - | '/_1nd3x' - | '/nested/_1nd3x' - | '/posts/_r0ut3_' + '__root__' | '/' | '/blog' | '/_1nd3x' | '/nested/_1nd3x' | '/posts/_r0ut3_' fileRoutesById: FileRoutesById } export interface RootRouteChildren { diff --git a/packages/router-generator/tests/generator/flat-route-group/routeTree.snapshot.ts b/packages/router-generator/tests/generator/flat-route-group/routeTree.snapshot.ts index ca3cf2f2b7..542a64a174 100644 --- a/packages/router-generator/tests/generator/flat-route-group/routeTree.snapshot.ts +++ b/packages/router-generator/tests/generator/flat-route-group/routeTree.snapshot.ts @@ -59,16 +59,10 @@ export interface FileRoutesById { export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: - | '/app' - | '/app/compras' - | '/app/compras/ordenes' - | '/app/compras/divisiones' + '/app' | '/app/compras' | '/app/compras/ordenes' | '/app/compras/divisiones' fileRoutesByTo: FileRoutesByTo to: - | '/app' - | '/app/compras' - | '/app/compras/ordenes' - | '/app/compras/divisiones' + '/app' | '/app/compras' | '/app/compras/ordenes' | '/app/compras/divisiones' id: | '__root__' | '/app' diff --git a/packages/router-generator/tests/generator/nested-route-groups-with-layouts-before-physical/routeTree.snapshot.ts b/packages/router-generator/tests/generator/nested-route-groups-with-layouts-before-physical/routeTree.snapshot.ts index 8f2741b206..bda946f97b 100644 --- a/packages/router-generator/tests/generator/nested-route-groups-with-layouts-before-physical/routeTree.snapshot.ts +++ b/packages/router-generator/tests/generator/nested-route-groups-with-layouts-before-physical/routeTree.snapshot.ts @@ -51,16 +51,16 @@ const groupCLayoutCIndexRoute = groupCLayoutCIndexRouteImport.update({ } as any) export interface FileRoutesByFullPath { + '/': typeof groupCLayoutCIndexRoute '/login': typeof groupALayoutALoginRoute '/signup': typeof groupALayoutASignupRoute '/dashboard': typeof groupBLayoutBDashboardRoute - '/': typeof groupCLayoutCIndexRoute } export interface FileRoutesByTo { + '/': typeof groupCLayoutCIndexRoute '/login': typeof groupALayoutALoginRoute '/signup': typeof groupALayoutASignupRoute '/dashboard': typeof groupBLayoutBDashboardRoute - '/': typeof groupCLayoutCIndexRoute } export interface FileRoutesById { __root__: typeof rootRouteImport @@ -74,9 +74,9 @@ export interface FileRoutesById { } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/login' | '/signup' | '/dashboard' | '/' + fullPaths: '/' | '/login' | '/signup' | '/dashboard' fileRoutesByTo: FileRoutesByTo - to: '/login' | '/signup' | '/dashboard' | '/' + to: '/' | '/login' | '/signup' | '/dashboard' id: | '__root__' | '/(group-a)/_layout-a' @@ -99,21 +99,21 @@ declare module '@tanstack/react-router' { '/(group-a)/_layout-a': { id: '/(group-a)/_layout-a' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupALayoutARouteImport parentRoute: typeof rootRouteImport } '/(group-b)/_layout-b': { id: '/(group-b)/_layout-b' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupBLayoutBRouteImport parentRoute: typeof rootRouteImport } '/(group-c)/_layout-c': { id: '/(group-c)/_layout-c' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof groupCLayoutCRouteImport parentRoute: typeof rootRouteImport } diff --git a/packages/router-generator/tests/generator/route-groups/routeTree.snapshot.ts b/packages/router-generator/tests/generator/route-groups/routeTree.snapshot.ts index e76c675d2c..d3ffbba9e2 100644 --- a/packages/router-generator/tests/generator/route-groups/routeTree.snapshot.ts +++ b/packages/router-generator/tests/generator/route-groups/routeTree.snapshot.ts @@ -76,6 +76,7 @@ const fooAsdfbarLayoutXyzLazyRoute = fooAsdfbarLayoutXyzLazyRouteImport ) export interface FileRoutesByFullPath { + '/': typeof barBarRouteWithChildren '/hello': typeof barBarHelloRoute '/asdf': typeof fooAsdfanotherGroupLayoutRouteWithChildren '/asdf/$id': typeof fooAsdfbarIdRoute @@ -85,6 +86,7 @@ export interface FileRoutesByFullPath { '/asdf/xyz': typeof fooAsdfbarLayoutXyzLazyRoute } export interface FileRoutesByTo { + '/': typeof barBarRouteWithChildren '/hello': typeof barBarHelloRoute '/asdf': typeof fooAsdfanotherGroupLayoutRouteWithChildren '/asdf/$id': typeof fooAsdfbarIdRoute @@ -108,6 +110,7 @@ export interface FileRoutesById { export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: + | '/' | '/hello' | '/asdf' | '/asdf/$id' @@ -117,6 +120,7 @@ export interface FileRouteTypes { | '/asdf/xyz' fileRoutesByTo: FileRoutesByTo to: + | '/' | '/hello' | '/asdf' | '/asdf/$id' @@ -151,7 +155,7 @@ declare module '@tanstack/react-router' { '/(bar)/_bar': { id: '/(bar)/_bar' path: '' - fullPath: '' + fullPath: '/' preLoaderRoute: typeof barBarRouteImport parentRoute: typeof rootRouteImport } diff --git a/packages/router-generator/tests/generator/virtual-nested-layouts-with-virtual-route/routeTree.snapshot.ts b/packages/router-generator/tests/generator/virtual-nested-layouts-with-virtual-route/routeTree.snapshot.ts index 7268f402ae..f4970bd003 100644 --- a/packages/router-generator/tests/generator/virtual-nested-layouts-with-virtual-route/routeTree.snapshot.ts +++ b/packages/router-generator/tests/generator/virtual-nested-layouts-with-virtual-route/routeTree.snapshot.ts @@ -60,9 +60,7 @@ export interface FileRoutesById { export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: - | '/' - | '/route-without-file/layout-a' - | '/route-without-file/layout-b' + '/' | '/route-without-file/layout-a' | '/route-without-file/layout-b' fileRoutesByTo: FileRoutesByTo to: '/' | '/route-without-file/layout-a' | '/route-without-file/layout-b' id: diff --git a/packages/router-generator/tests/transform.test.ts b/packages/router-generator/tests/transform.test.ts index 8a53f3278e..2267599c15 100644 --- a/packages/router-generator/tests/transform.test.ts +++ b/packages/router-generator/tests/transform.test.ts @@ -13,7 +13,48 @@ function makeNode( } } +function transformToNewRoute(source: string, node = makeNode()) { + return transform({ + source, + ctx: { target: 'react', routeId: '/new', lazy: false }, + node, + }) +} + describe('transform', () => { + it('reads and rewrites the route constructor, id and options through parentheses', () => { + const node = makeNode() + const result = transformToNewRoute( + [ + "import { createLazyFileRoute } from '@tanstack/react-router'", + "export const Route = (createLazyFileRoute)(('/old'))(({ component: Page, server: {} }))", + ].join('\n'), + node, + ) + + expect(result).toEqual({ + result: 'modified', + output: [ + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = (createFileRoute)(('/new'))(({ component: Page, server: {} }))", + ].join('\n'), + }) + expect(node.createFileRouteProps).toEqual(new Set(['component', 'server'])) + }) + + it('updates parenthesized route calls without changing their surrounding source', () => { + const result = transform({ + source: + "import { createFileRoute } from '@tanstack/react-router'; export const Route = ((createFileRoute('/old'))({}));", + ctx: { target: 'react', routeId: '/new', lazy: false }, + node: makeNode(), + }) + expect(result.result).toBe('modified') + if (result.result === 'modified') { + expect(result.output).toContain("((createFileRoute('/new'))({}))") + } + }) + it('does not treat root route exports as missing Route exports', async () => { const result = await transform({ source: [ @@ -522,4 +563,95 @@ describe('transform', () => { ) expect(result.output).not.toContain('createLazyFileRoute') }) + + // The recorded option keys drive prerendering and server-only route pruning. + it('records identifier and string-literal option keys, not computed or spread ones', () => { + const node = makeNode() + const result = transformToNewRoute( + [ + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = createFileRoute('/new')({ 'component': Page, [key]: load, ...rest, server: {} })", + ].join('\n'), + node, + ) + + expect(result).toEqual({ result: 'not-modified' }) + expect(node.createFileRouteProps).toEqual(new Set(['component', 'server'])) + }) +}) + +// The generator writes its output back over the user's route file, so every +// byte outside the route id and the router import must survive unchanged. +describe('transform preserves the rest of the route file', () => { + it('edits the right spans after a BOM and astral characters', () => { + const result = transformToNewRoute( + [ + '\uFEFF// 😀', + "import { createLazyFileRoute } from '@tanstack/react-router'", + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = createFileRoute(/* 🚀 */ '/old')({})", + ].join('\n'), + ) + + expect(result).toEqual({ + result: 'modified', + output: [ + '\uFEFF// 😀', + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = createFileRoute(/* 🚀 */ '/new')({})", + ].join('\n'), + }) + }) + + it.each([ + { + name: 'a default import', + imports: "import Router from '@tanstack/react-router'", + expected: + "import Router, { createFileRoute } from '@tanstack/react-router'", + }, + { + name: 'an aliased import of the constructor', + imports: + "import { createFileRoute as cfr } from '@tanstack/react-router'", + expected: + "import { createFileRoute as cfr, createFileRoute } from '@tanstack/react-router'", + }, + { + // The constructor goes into the named import, never the namespace one. + name: 'a namespace import', + imports: [ + "import * as Router from '@tanstack/react-router'", + "import { Link } from '@tanstack/react-router'", + ].join('\n'), + expected: [ + "import * as Router from '@tanstack/react-router'", + "import { Link, createFileRoute } from '@tanstack/react-router'", + ].join('\n'), + }, + ])('adds the missing constructor next to $name', ({ imports, expected }) => { + const route = "export const Route = createFileRoute('/old')({})" + + expect(transformToNewRoute(`${imports}\n${route}`)).toEqual({ + result: 'modified', + output: `${expected}\n${route.replace('/old', '/new')}`, + }) + }) + + it('updates only the Route declarator of a multi-declarator export', () => { + const result = transformToNewRoute( + [ + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = createFileRoute('/old')({}), path = '/old'", + ].join('\n'), + ) + + expect(result).toEqual({ + result: 'modified', + output: [ + "import { createFileRoute } from '@tanstack/react-router'", + "export const Route = createFileRoute('/new')({}), path = '/old'", + ].join('\n'), + }) + }) }) diff --git a/packages/router-plugin/AGENTS.md b/packages/router-plugin/AGENTS.md new file mode 100644 index 0000000000..e954110819 --- /dev/null +++ b/packages/router-plugin/AGENTS.md @@ -0,0 +1,7 @@ +# Router bundler plugin + +- Preserve one initialization of shared module state across reference and split chunks. Shared extraction includes transitive dependencies and whole destructured declarations; never extract `Route` or bindings that depend on it. The invariant suite in `tests/code-splitter.test.ts` covers these contracts. +- `handleRouteUpdate` is stringified and injected into app modules. Keep runtime dependencies inside the function or explicitly emit them; extracting a helper to plugin module scope breaks the generated function. `tests/handle-route-update.test.ts` executes that emitted code. +- Route HMR rebuilds indexes, clears `resolvePathCache`, replaces lazy-chunk ownership, and refreshes active routes while preserving Fast Refresh component identities. Keep these steps coordinated when adding derived state. +- For code-splitting changes, add inputs under `tests/code-splitter/test-files//`. Regenerate and review reference, virtual, and shared snapshots for every grouping in [`tests/code-splitter.test.ts`](tests/code-splitter.test.ts). +- Check [`tests/constants.ts`](tests/constants.ts) for framework coverage: the snapshot matrix currently covers React and Solid only. Validate affected Vue behavior in Vue router e2e apps. diff --git a/packages/router-plugin/CHANGELOG.md b/packages/router-plugin/CHANGELOG.md index ba440a0ff0..5b18ae7e6a 100644 --- a/packages/router-plugin/CHANGELOG.md +++ b/packages/router-plugin/CHANGELOG.md @@ -1,5 +1,264 @@ # @tanstack/router-plugin +## 1.169.0 + +### Minor Changes + +- [#8855](https://github.com/TanStack/router/pull/8855) [`446ce1b`](https://github.com/TanStack/router/commit/446ce1b30650d85f1fc78f2d1ee42712e40b75c6) - Require Node `^20.19.0 || >=22.12.0` (was `>=20.19`), so the CommonJS builds can load ESM-only dependencies through `require(esm)`. Node 21 and Node 22.0–22.11 do not enable it by default, so they are no longer supported. + +- [#8851](https://github.com/TanStack/router/pull/8851) [`d250819`](https://github.com/TanStack/router/commit/d25081952dd04a5f5a44db7c8df5cbbf50fad054) - Require Vite 6 or later: the `vite` peer range is now `>=6.0.0`. Vite 5 is no longer supported. + +### Patch Changes + +- [`1ba19a0`](https://github.com/TanStack/router/commit/1ba19a04456983ee0f8adffd038b6b1194441e15) - fix: webpack and Rspack production builds no longer put the code splitter's "will not be code-split" warning, with the route file's absolute path, into the client bundle when the build process's `NODE_ENV` isn't `production`. The bundler's mode decides, and a config without `mode` counts as production, as it does for webpack and Rspack. The warning still prints in the build output. + +- [#8852](https://github.com/TanStack/router/pull/8852) [`94f36c4`](https://github.com/TanStack/router/commit/94f36c4a9ecf3062b326a8eb772e73b00c0644d9) - The esbuild plugin now throws when `autoCodeSplitting` is enabled, and `TanStackRouterCodeSplitterEsbuild` throws, instead of silently bundling every route without splitting. Route generation with esbuild is unchanged. + +- [#8856](https://github.com/TanStack/router/pull/8856) [`533ca27`](https://github.com/TanStack/router/commit/533ca2704452f36c5fef5c5fe084554d9b5db1ab) - Remove the undocumented `plugin.hmr.style` option and the `HmrOptions` type. Each bundler entry now picks its own HMR runtime: the webpack and Rspack entries already forced `'webpack'`, and on Vite, `'webpack'` broke route HMR. + +- [#8853](https://github.com/TanStack/router/pull/8853) [`13b6256`](https://github.com/TanStack/router/commit/13b625683030ea4ab359495ecda570e05e472587) - Remove internal code-splitter APIs: the `codeSplittingOptions.compilerPlugins` option, and the root-entry exports `unpluginRouterCodeSplitterFactory`, `getObjectPropertyKeyName`, `CodeSplitCompilerPlugin`, `ReferenceRouteCompilerPlugin`, `ReferenceRouteCompilerPluginContext` and `VirtualRouteSplitNodeCompilerPluginContext`. + +- [#8860](https://github.com/TanStack/router/pull/8860) [`b5e2ac9`](https://github.com/TanStack/router/commit/b5e2ac9c4cee4c5c6f464adc6cfddcddf6c84171) - Source maps of split routes now point at the route file. On webpack and Rspack (including Rsbuild), a split component or shared code mapped to the wrong line, because unplugin's loader dropped the router plugin's map; `unplugin` now requires `^3.5.0`, which keeps it. The maps of split and shared modules also name the route file itself instead of its `?tsr-split` / `?tsr-shared` module id, so debuggers bind breakpoints set in the route file. + +- [#8870](https://github.com/TanStack/router/pull/8870) [`f420d4a`](https://github.com/TanStack/router/commit/f420d4a6dacfaa81d306b7bbc9af8f1010d1a1bc) - Vite route HMR now writes `import.meta.hot.accept(` out instead of calling it through a `hot` alias. Vite only treats a module as a hot boundary when the call is spelled out, so an edit of a route file no framework plugin accepts (a `.ts` route file, or an app without `@vitejs/plugin-react`) reloaded the page instead of updating the route in place. With React HMR, a route file that declares its own top-level `hot` binding no longer fails to compile with `Duplicate declaration "hot"`. + +- Updated dependencies [[`446ce1b`](https://github.com/TanStack/router/commit/446ce1b30650d85f1fc78f2d1ee42712e40b75c6), [`ad5b3b7`](https://github.com/TanStack/router/commit/ad5b3b7a0990eed7351d672ea6695d341108e0d6), [`ff157f0`](https://github.com/TanStack/router/commit/ff157f0079982e90d62be7fdeecfb77e4fdcec69)]: + - @tanstack/router-generator@1.168.0 + - @tanstack/router-utils@1.163.0 + +## 1.168.48 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +- [#8737](https://github.com/TanStack/router/pull/8737) [`647cb73`](https://github.com/TanStack/router/commit/647cb737a5622813d276d6042766692ca5ae67ed) - Remove the `enableRouteGeneration` option. Route generation now always runs, so `autoCodeSplitting` always has the route metadata it needs. + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c), [`689a7c5`](https://github.com/TanStack/router/commit/689a7c5419de68bce0aaaef72b9a36f115ea1398)]: + - @tanstack/react-router@1.170.46 + - @tanstack/router-core@1.171.39 + - @tanstack/router-generator@1.167.46 + +## 1.168.47 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + - @tanstack/react-router@1.170.45 + - @tanstack/router-generator@1.167.45 + +## 1.168.46 + +### Patch Changes + +- Updated dependencies [[`923d98b`](https://github.com/TanStack/router/commit/923d98b18b6cd90b6219591e20e86115dc61048e)]: + - @tanstack/router-utils@1.162.4 + - @tanstack/router-generator@1.167.44 + +## 1.168.45 + +### Patch Changes + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + - @tanstack/react-router@1.170.44 + - @tanstack/router-generator@1.167.43 + +## 1.168.44 + +### Patch Changes + +- [#8655](https://github.com/TanStack/router/pull/8655) [`e66da18`](https://github.com/TanStack/router/commit/e66da18266859ab49e20a7b8c858232449ee5290) - Remove redundant string excludes from the reference code-splitter transform filter to avoid unnecessary glob compilation in unplugin bundler adapters. + +- Updated dependencies [[`57bd1a9`](https://github.com/TanStack/router/commit/57bd1a92f9839af5bf773c3b36d039569fb1a41e), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-generator@1.167.42 + - @tanstack/router-core@1.171.36 + - @tanstack/react-router@1.170.43 + +## 1.168.43 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`2413cc0`](https://github.com/TanStack/router/commit/2413cc009826fba4f97b166a35a8a50a4a8fe4bb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/router-core@1.171.35 + - @tanstack/react-router@1.170.42 + - @tanstack/router-generator@1.167.41 + +## 1.168.42 + +### Patch Changes + +- Updated dependencies [[`60b8ad1`](https://github.com/TanStack/router/commit/60b8ad1ad00812bf966a8eeee6be238c37ddad74), [`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949), [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb), [`ff66a03`](https://github.com/TanStack/router/commit/ff66a03df4816f44a48a4a37189fc4021b1c8480), [`863c8a7`](https://github.com/TanStack/router/commit/863c8a736b96746c56278a16c50554356f5523d1)]: + - @tanstack/react-router@1.170.41 + - @tanstack/router-core@1.171.34 + - @tanstack/router-generator@1.167.40 + +## 1.168.41 + +### Patch Changes + +- Updated dependencies [[`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676), [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/react-router@1.170.40 + - @tanstack/router-core@1.171.33 + - @tanstack/router-generator@1.167.39 + +## 1.168.40 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + - @tanstack/react-router@1.170.38 + - @tanstack/router-generator@1.167.38 + +## 1.168.39 + +### Patch Changes + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`8e164d2`](https://github.com/TanStack/router/commit/8e164d28f9e9eb1a7301109230d7ece9817492a8), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + - @tanstack/react-router@1.170.37 + - @tanstack/router-generator@1.167.37 + +## 1.168.38 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`6387d58`](https://github.com/TanStack/router/commit/6387d581eabc6e6a3acc87a0bc924e5a38d9c8b2), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/react-router@1.170.36 + - @tanstack/router-generator@1.167.36 + +## 1.168.37 + +### Patch Changes + +- [#8300](https://github.com/TanStack/router/pull/8300) [`49bcd4d`](https://github.com/TanStack/router/commit/49bcd4db743dba4a783d5533a42a0f97a5721292) - Refresh compatible build and runtime dependencies. + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`aee42c6`](https://github.com/TanStack/router/commit/aee42c6b641d8e919bfed9e0f04bb1b72092f3a6), [`49bcd4d`](https://github.com/TanStack/router/commit/49bcd4db743dba4a783d5533a42a0f97a5721292), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9aec5a7`](https://github.com/TanStack/router/commit/9aec5a7012c47e83ec23bb4763494b72a5e68bfc), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/react-router@1.170.34 + - @tanstack/router-generator@1.167.35 + - @tanstack/router-utils@1.162.3 + +## 1.168.36 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`cf166d1`](https://github.com/TanStack/router/commit/cf166d160e6397007a979bfc7065b45ff69ea543), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/react-router@1.170.33 + - @tanstack/router-generator@1.167.34 + +## 1.168.35 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + - @tanstack/react-router@1.170.32 + - @tanstack/router-generator@1.167.33 + +## 1.168.34 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + - @tanstack/react-router@1.170.31 + - @tanstack/router-generator@1.167.32 + +## 1.168.33 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486), [`f75cada`](https://github.com/TanStack/router/commit/f75cada01707e51fb9650dd301bc04f8b2265a2a)]: + - @tanstack/react-router@1.170.30 + - @tanstack/router-core@1.171.25 + - @tanstack/router-generator@1.167.31 + +## 1.168.32 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + - @tanstack/react-router@1.170.29 + - @tanstack/router-generator@1.167.30 + +## 1.168.31 + +### Patch Changes + +- Updated dependencies [[`0c25a7b`](https://github.com/TanStack/router/commit/0c25a7b43b5331ee6ebf94d50e9793002783adab), [`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/react-router@1.170.28 + - @tanstack/router-core@1.171.23 + - @tanstack/router-generator@1.167.29 + +## 1.168.30 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13), [`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3), [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1), [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e)]: + - @tanstack/router-core@1.171.22 + - @tanstack/react-router@1.170.26 + - @tanstack/router-generator@1.167.28 + +## 1.168.29 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + - @tanstack/react-router@1.170.25 + - @tanstack/router-generator@1.167.27 + +## 1.168.28 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + - @tanstack/react-router@1.170.24 + - @tanstack/router-generator@1.167.26 + +## 1.168.27 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/react-router@1.170.22 + - @tanstack/router-core@1.171.19 + - @tanstack/router-generator@1.167.25 + +## 1.168.26 + +### Patch Changes + +- Updated dependencies [[`697ebb6`](https://github.com/TanStack/router/commit/697ebb6ddbd433d052b6b4707938a5c595865d58), [`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf), [`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/react-router@1.170.21 + - @tanstack/router-core@1.171.18 + - @tanstack/router-generator@1.167.24 + +## 1.168.25 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + - @tanstack/react-router@1.170.20 + - @tanstack/router-generator@1.167.23 + +## 1.168.24 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/react-router@1.170.19 + - @tanstack/router-generator@1.167.22 + ## 1.168.23 ### Patch Changes diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json index dfefe55a45..b681bb61a2 100644 --- a/packages/router-plugin/package.json +++ b/packages/router-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/router-plugin", - "version": "1.168.23", + "version": "1.169.0", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -31,12 +31,12 @@ "test:unit:dev": "vitest --watch", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -114,28 +114,41 @@ "!skills/_artifacts" ], "engines": { - "node": ">=20.19" + "node": "^20.19.0 || >=22.12.0" }, "dependencies": { - "@babel/core": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.5", + "@babel/core": "catalog:", + "@babel/template": "^7.29.7", + "@babel/types": "catalog:", "@tanstack/router-core": "workspace:*", "@tanstack/router-generator": "workspace:*", "@tanstack/router-utils": "workspace:*", - "chokidar": "^5.0.0", - "unplugin": "^3.0.0", - "zod": "^4.4.3" + "chokidar": "catalog:", + "unplugin": "^3.5.0", + "zod": "catalog:" }, "devDependencies": { + "@rsbuild/core": "catalog:", "@types/babel__core": "^7.20.5", "@types/babel__template": "^7.4.4", - "@types/node": ">=20" + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "prettier": "^3.9.6", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:", + "webpack": "^5.104.1" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "workspace:^", - "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", + "vite": ">=6.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, diff --git a/packages/router-plugin/skills/_artifacts/domain_map.yaml b/packages/router-plugin/skills/_artifacts/domain_map.yaml index 8ce9e31f4d..dd83f2c913 100644 --- a/packages/router-plugin/skills/_artifacts/domain_map.yaml +++ b/packages/router-plugin/skills/_artifacts/domain_map.yaml @@ -1,12 +1,12 @@ # domain_map.yaml # Library: @tanstack/router-plugin -# Version: 1.166.2 +# Version: 1.168.23 # Date: 2026-03-08 # Status: reviewed library: name: '@tanstack/router-plugin' - version: '1.166.2' + version: '1.168.23' repository: 'https://github.com/TanStack/router' description: >- Bundler plugin for route generation and automatic code splitting. @@ -59,4 +59,12 @@ skills: priority: MEDIUM status: active + - mistake: 'Editing routeTree.gen.ts instead of regenerating' + mechanism: >- + Manual changes are overwritten and can put source routes, generated + types, and runtime routing out of sync. Fix source or config and + regenerate the tree. + priority: HIGH + status: active + gaps: [] diff --git a/packages/router-plugin/skills/_artifacts/skill_spec.md b/packages/router-plugin/skills/_artifacts/skill_spec.md index 4d4881232f..586ee34ade 100644 --- a/packages/router-plugin/skills/_artifacts/skill_spec.md +++ b/packages/router-plugin/skills/_artifacts/skill_spec.md @@ -12,13 +12,14 @@ Bundler plugin for route generation and automatic code splitting. Supports Vite, | Skill | Type | Domain | What it covers | Failure modes | | ------------- | ---- | ------------------- | -------------------------------------------------------------- | ------------- | -| router-plugin | core | bundler-integration | Vite/Webpack/Rspack/esbuild plugins, route gen, code splitting | 2 | +| router-plugin | core | bundler-integration | Vite/Webpack/Rspack/esbuild plugins, route gen, code splitting | 3 | ## Failure Mode Inventory -### router-plugin (2 failure modes) +### router-plugin (3 failure modes) -| # | Mistake | Priority | Source | -| --- | ---------------------------------------------------- | -------- | ----------- | -| 1 | Using wrong plugin export for bundler | HIGH | source/docs | -| 2 | Misconfiguring routesDirectory or generatedRouteTree | MEDIUM | source/docs | +| # | Mistake | Priority | Source | +| --- | ---------------------------------------------------- | -------- | ----------------- | +| 1 | Using wrong plugin export for bundler | HIGH | source/docs | +| 2 | Misconfiguring routesDirectory or generatedRouteTree | MEDIUM | source/docs | +| 3 | Editing routeTree.gen.ts instead of regenerating | HIGH | consistency audit | diff --git a/packages/router-plugin/skills/_artifacts/skill_tree.yaml b/packages/router-plugin/skills/_artifacts/skill_tree.yaml index eccd302d0f..a313cc8a4e 100644 --- a/packages/router-plugin/skills/_artifacts/skill_tree.yaml +++ b/packages/router-plugin/skills/_artifacts/skill_tree.yaml @@ -1,6 +1,6 @@ library: name: '@tanstack/router-plugin' - version: '1.166.2' + version: '1.168.23' repository: 'https://github.com/TanStack/router' description: >- Bundler plugin for route generation and automatic code splitting. diff --git a/packages/router-plugin/skills/router-plugin/SKILL.md b/packages/router-plugin/skills/router-plugin/SKILL.md index b3ba5db5a3..5353b7e8c0 100644 --- a/packages/router-plugin/skills/router-plugin/SKILL.md +++ b/packages/router-plugin/skills/router-plugin/SKILL.md @@ -5,9 +5,10 @@ description: >- code splitting. Supports Vite, Webpack, Rspack, and esbuild. Configures autoCodeSplitting, routesDirectory, target framework, and code split groupings. -type: core -library: tanstack-router -library_version: '1.166.2' +metadata: + type: core + library: tanstack-router + library_version: '1.168.23' sources: - TanStack/router:packages/router-plugin/src - TanStack/router:docs/router/routing/file-based-routing.md @@ -90,23 +91,23 @@ esbuild.build({ plugins: [ tanstackRouter({ target: 'react', - autoCodeSplitting: true, }), ], }) ``` +> Automatic code splitting is not available with esbuild: the plugin throws when `autoCodeSplitting` is `true`. Use manual code splitting (`.lazy.tsx` files) or another bundler to split routes. + ## Configuration Options ### Core Options -| Option | Type | Default | Description | -| ----------------------- | ----------------------------- | -------------------------- | ------------------------------------------ | -| `target` | `'react' \| 'solid' \| 'vue'` | `'react'` | Target framework | -| `routesDirectory` | `string` | `'./src/routes'` | Directory containing route files | -| `generatedRouteTree` | `string` | `'./src/routeTree.gen.ts'` | Path for generated route tree | -| `autoCodeSplitting` | `boolean` | `undefined` | Enable automatic code splitting | -| `enableRouteGeneration` | `boolean` | `true` | Set to `false` to disable route generation | +| Option | Type | Default | Description | +| -------------------- | ----------------------------- | -------------------------- | -------------------------------- | +| `target` | `'react' \| 'solid' \| 'vue'` | `'react'` | Target framework | +| `routesDirectory` | `string` | `'./src/routes'` | Directory containing route files | +| `generatedRouteTree` | `string` | `'./src/routeTree.gen.ts'` | Path for generated route tree | +| `autoCodeSplitting` | `boolean` | `undefined` | Enable automatic code splitting | ### File Convention Options @@ -170,6 +171,18 @@ The composed plugin assembles up to 3 sub-plugins: 2. **Code Splitter** (when `autoCodeSplitting: true`) — Splits route files into lazy-loaded chunks using virtual modules 3. **HMR** (dev mode, when code splitter is off) — Hot-reloads route changes without full refresh +## Route Refactor Workflow + +When moving, renaming, adding, or deleting file routes: + +1. Change the source files under `routesDirectory`. Keep the exported route identifier named `Route`. +2. Let the bundler plugin regenerate the tree, or run `pnpm exec tsr generate` when the project uses the CLI. +3. Inspect the generated diff for the expected route IDs, parents, paths, and imports. Never repair `routeTree.gen.ts` by hand. +4. Update links, redirects, `from` narrowing, params, preload calls, and tests that reference the old route. +5. Run route-generation tests, type tests, and a production build. A passing editor typecheck does not prove the plugin generated or split the new route correctly. + +Commit `routeTree.gen.ts`; it is generated source used by the application at runtime. + ## Individual Plugin Exports For advanced use, each sub-plugin is exported separately from the Vite entry: @@ -227,7 +240,11 @@ function AboutPage() { } ``` +### 4. HIGH: Editing the generated route tree + +Changes to `routeTree.gen.ts` are overwritten and can leave source routes, generated types, and runtime routing out of sync. Fix route filenames or plugin configuration, regenerate, and verify the generated diff instead. + ## Cross-References -- [router-core/code-splitting](../../../router-core/skills/router-core/code-splitting/SKILL.md) — manual code splitting concepts -- [virtual-file-routes](../../../virtual-file-routes/skills/virtual-file-routes/SKILL.md) — programmatic route trees +- `@tanstack/router-core#router-core/code-splitting` — manual code splitting concepts +- `@tanstack/virtual-file-routes#virtual-file-routes` — programmatic route trees diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts index 89cdae41ad..0cd783a58a 100644 --- a/packages/router-plugin/src/core/code-splitter/compilers.ts +++ b/packages/router-plugin/src/core/code-splitter/compilers.ts @@ -364,6 +364,7 @@ function removeSharedDeclarations(ast: t.File, sharedBindings: Set) { export function compileCodeSplitReferenceRoute( opts: ParseAstOptions & CompileCodeSplitReferenceRouteOptions & { + isProduction?: boolean compilerPlugins?: Array }, ): GeneratorResult | null { @@ -847,8 +848,9 @@ export function compileCodeSplitReferenceRoute( ) console.warn(warningMessage) - // append this warning to the file using a template - if (process.env.NODE_ENV !== 'production') { + // Development builds log it in the page too. The bundler's mode decides, + // not the build process's NODE_ENV, which webpack never sets. + if (!opts.isProduction) { const warningTemplate = template.statement( `console.warn(${JSON.stringify(warningMessage)})`, )() @@ -1285,7 +1287,8 @@ export function compileCodeSplitVirtualRoute( const result = generateFromAst(ast, { sourceMaps: true, - sourceFileName: opts.filename, + // Name the route file, not this module's `?tsr-*` id. + sourceFileName: removeSplitSearchParamFromFilename(opts.filename), filename: opts.filename, }) @@ -1376,7 +1379,8 @@ export function compileCodeSplitSharedRoute( const result = generateFromAst(ast, { sourceMaps: true, - sourceFileName: opts.filename, + // Name the route file, not this module's `?tsr-*` id. + sourceFileName: removeSplitSearchParamFromFilename(opts.filename), filename: opts.filename, }) diff --git a/packages/router-plugin/src/core/code-splitter/plugins.ts b/packages/router-plugin/src/core/code-splitter/plugins.ts index 1e8ada32b5..94444c1aec 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins.ts @@ -1,6 +1,7 @@ import type babel from '@babel/core' import type * as t from '@babel/types' -import type { Config, DeletableNodes, HmrStyle } from '../config' +import type { Config, DeletableNodes } from '../config' +import type { HmrStyle } from '../hmr' import type { CodeSplitGroupings } from '../constants' import type { SplitNodeMeta } from './types' diff --git a/packages/router-plugin/src/core/code-splitter/plugins/framework-plugins.ts b/packages/router-plugin/src/core/code-splitter/plugins/framework-plugins.ts index a0351ad210..cf4b150807 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins/framework-plugins.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins/framework-plugins.ts @@ -2,7 +2,8 @@ import { createReactRefreshIgnoredRouteExportsPlugin } from './react-refresh-ign import { createReactRefreshRouteComponentsPlugin } from './react-refresh-route-components' import { createReactStableHmrSplitRouteComponentsPlugin } from './react-stable-hmr-split-route-components' import type { CodeSplitCompilerPlugin } from '../plugins' -import type { Config, HmrStyle } from '../../config' +import type { Config } from '../../config' +import type { HmrStyle } from '../../hmr' export function getFrameworkHmrCompilerPlugins(opts: { targetFramework: Config['target'] 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 cc2be62034..f951d863b3 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 @@ -5,9 +5,8 @@ import type { ReferenceRouteCompilerPlugin } from '../plugins' const buildReactRefreshIgnoredRouteExportsStatements = template.statements( ` -const hot = import.meta.hot -if (hot && typeof window !== 'undefined') { - hot.data ??= {} +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map() const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports 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 99448f452a..f67a189f40 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,7 +1,7 @@ import * as template from '@babel/template' import * as t from '@babel/types' import { getUniqueProgramIdentifier } from '../../utils' -import type { HmrStyle } from '../../config' +import type { HmrStyle } from '../../hmr' import type { ReferenceRouteCompilerPlugin } from '../plugins' function capitalizeIdentifier(str: string) { diff --git a/packages/router-plugin/src/core/config.ts b/packages/router-plugin/src/core/config.ts index 17c0dd08da..6c11241a01 100644 --- a/packages/router-plugin/src/core/config.ts +++ b/packages/router-plugin/src/core/config.ts @@ -9,7 +9,6 @@ import type { RouteIds, } from '@tanstack/router-core' import type { CodeSplitGroupings } from './constants' -import type { CodeSplitCompilerPlugin } from './code-splitter/plugins' export const splitGroupingsSchema = z .array( @@ -71,25 +70,6 @@ export type CodeSplittingOptions = { * @default true */ addHmr?: boolean - - /** - * Internal compiler plugins used by framework integrations. - * @internal - */ - compilerPlugins?: Array -} - -export type HmrStyle = 'vite' | 'webpack' - -export type HmrOptions = { - /** - * Selects the HMR runtime style to emit code for. - * - `'vite'` (default): ESM `import.meta.hot` with Vite accept-callback semantics. - * - `'webpack'`: `import.meta.webpackHot` with webpack / Rspack `module.hot` re-execution semantics. - * - * Bundler-specific plugin entries (e.g. `rspack.ts`, `webpack.ts`) set this explicitly. - */ - style?: HmrStyle } const codeSplittingOptionsSchema = z.object({ @@ -109,7 +89,6 @@ type FileRouteKeys = keyof (Parameters< export type DeletableNodes = FileRouteKeys | (string & {}) export const configSchema = generatorConfigSchema.extend({ - enableRouteGeneration: z.boolean().optional(), codeSplittingOptions: z .custom((v) => { return codeSplittingOptionsSchema.parse(v) @@ -117,11 +96,6 @@ export const configSchema = generatorConfigSchema.extend({ .optional(), plugin: z .object({ - hmr: z - .object({ - style: z.enum(['vite', 'webpack']).optional(), - }) - .optional(), vite: z .object({ environmentName: z.string().optional(), diff --git a/packages/router-plugin/src/core/hmr/handle-route-update.ts b/packages/router-plugin/src/core/hmr/handle-route-update.ts index c0325b06e9..23b51d2432 100644 --- a/packages/router-plugin/src/core/hmr/handle-route-update.ts +++ b/packages/router-plugin/src/core/hmr/handle-route-update.ts @@ -1,15 +1,9 @@ -import type { - AnyRoute, - AnyRouteMatch, - AnyRouter, - RouterWritableStore, -} from '@tanstack/router-core' +import type { AnyRoute, AnyRouter } from '@tanstack/router-core' type AnyRouteWithPrivateProps = AnyRoute & { options: Record parentRoute: AnyRoute - _componentsPromise?: Promise - _lazyPromise?: Promise + _lazy?: Promise | true update: (options: Record) => unknown _path: string _id: string @@ -17,37 +11,19 @@ type AnyRouteWithPrivateProps = AnyRoute & { _to: string } -type AnyRouterWithPrivateMaps = AnyRouter & { +type AnyRouterWithPrivateState = AnyRouter & { routesById: Record buildRouteTree: () => Parameters[0] setRoutes: AnyRouter['setRoutes'] - stores: AnyRouter['stores'] & { - cachedMatchStores: Map< - string, - Pick, 'get' | 'set'> - > - pendingMatchStores: Map< - string, - Pick, 'get' | 'set'> - > - matchStores: Map< - string, - Pick, 'get' | 'set'> - > - } -} - -type AnyRouteMatchWithPrivateProps = AnyRouteMatch & { - __beforeLoadContext?: unknown - __routeContext?: Record - context?: Record + _refreshRoute?: () => Promise + _replaceRouteChunk: (route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void } function handleRouteUpdate( routeId: string, newRoute: AnyRouteWithPrivateProps, ) { - const router = window.__TSR_ROUTER__ as AnyRouterWithPrivateMaps + const router = window.__TSR_ROUTER__ as AnyRouterWithPrivateState const oldRoute = router.routesById[routeId] as | AnyRouteWithPrivateProps | undefined @@ -66,14 +42,6 @@ function handleRouteUpdate( } }) - const removedKeys = new Set() - Object.keys(oldRoute.options).forEach((key) => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key) - delete oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = @@ -106,60 +74,12 @@ function handleRouteUpdate( oldRoute.options = nextOptions oldRoute.update(nextOptions) - oldRoute._componentsPromise = undefined - oldRoute._lazyPromise = undefined + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) router.setRoutes(router.buildRouteTree()) syncHotRouteExport(oldRoute) router.resolvePathCache.clear() - - const filter = (m: AnyRouteMatch) => m.routeId === oldRoute.id - const activeMatch = router.stores.matches.get().find(filter) - const pendingMatch = router.stores.pendingMatches.get().find(filter) - const cachedMatches = router.stores.cachedMatches.get().filter(filter) - - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - // Clear stale match data for removed route options BEFORE invalidating. - // Without this, router.invalidate() -> matchRoutes() reuses the existing - // match from the store (via ...existingMatch spread) and the stale - // loaderData / __beforeLoadContext survives the reload cycle. - // - // We must update the store directly (not via router.updateMatch) because - // updateMatch wraps in startTransition which may defer the state update, - // and we need the clear to be visible before invalidate reads the store. - if (removedKeys.has('loader') || removedKeys.has('beforeLoad')) { - const matchIds = [ - activeMatch?.id, - pendingMatch?.id, - ...cachedMatches.map((match) => match.id), - ].filter(Boolean) as Array - router.batch(() => { - for (const matchId of matchIds) { - const store = - router.stores.pendingMatchStores.get(matchId) || - router.stores.matchStores.get(matchId) || - router.stores.cachedMatchStores.get(matchId) - if (store) { - store.set((prev) => { - const next: AnyRouteMatchWithPrivateProps = { ...prev } - - if (removedKeys.has('loader')) { - next.loaderData = undefined - } - if (removedKeys.has('beforeLoad')) { - next.__beforeLoadContext = undefined - next.context = rebuildMatchContextWithoutBeforeLoad(next) - } - - return next - }) - } - } - }) - } - - router.invalidate({ filter, sync: true }) - } + void router._refreshRoute?.() function syncHotRouteExport(liveRoute: AnyRouteWithPrivateProps) { // routeTree.gen.ts mutates the original module export with generated @@ -172,66 +92,6 @@ function handleRouteUpdate( newRoute._fullPath = liveRoute._fullPath newRoute._to = liveRoute._to } - - function getStoreMatch(matchId: string) { - return ( - router.stores.pendingMatchStores.get(matchId)?.get() || - router.stores.matchStores.get(matchId)?.get() || - router.stores.cachedMatchStores.get(matchId)?.get() - ) - } - - function getMatchList(matchId: string) { - const pendingMatches = router.stores.pendingMatches.get() - if (pendingMatches.some((match) => match.id === matchId)) { - return pendingMatches - } - - const activeMatches = router.stores.matches.get() - if (activeMatches.some((match) => match.id === matchId)) { - return activeMatches - } - - const cachedMatches = router.stores.cachedMatches.get() - if (cachedMatches.some((match) => match.id === matchId)) { - return cachedMatches - } - - return [] - } - - function getParentMatch(match: AnyRouteMatch) { - const matchList = getMatchList(match.id) - const matchIndex = matchList.findIndex((item) => item.id === match.id) - - if (matchIndex <= 0) { - return undefined - } - - const parentMatch = matchList[matchIndex - 1]! - return getStoreMatch(parentMatch.id) || parentMatch - } - - function rebuildMatchContextWithoutBeforeLoad( - match: AnyRouteMatchWithPrivateProps, - ) { - const parentMatch = getParentMatch(match) - const getParentContext = ( - router as unknown as { - getParentContext?: ( - parentMatch?: AnyRouteMatch, - ) => Record | undefined - } - ).getParentContext - const parentContext = getParentContext - ? getParentContext.call(router, parentMatch) - : (parentMatch?.context ?? router.options.context) - - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}), - } - } } const handleRouteUpdateStr = handleRouteUpdate.toString() diff --git a/packages/router-plugin/src/core/hmr/index.ts b/packages/router-plugin/src/core/hmr/index.ts index 4e60f015a1..b3c8545851 100644 --- a/packages/router-plugin/src/core/hmr/index.ts +++ b/packages/router-plugin/src/core/hmr/index.ts @@ -1,5 +1,5 @@ export { createRouteHmrStatement } from './select-adapter' -export type { CreateRouteHmrStatementOpts } from './select-adapter' +export type { CreateRouteHmrStatementOpts, HmrStyle } from './select-adapter' export { createViteHmrStatement } from './vite-adapter' export { createWebpackHmrStatement } from './webpack-adapter' export { getHandleRouteUpdateCode } from './handle-route-update' diff --git a/packages/router-plugin/src/core/hmr/select-adapter.ts b/packages/router-plugin/src/core/hmr/select-adapter.ts index 60395a1534..5ad2646970 100644 --- a/packages/router-plugin/src/core/hmr/select-adapter.ts +++ b/packages/router-plugin/src/core/hmr/select-adapter.ts @@ -1,8 +1,16 @@ import { createViteHmrStatement } from './vite-adapter' import { createWebpackHmrStatement } from './webpack-adapter' -import type { Config, HmrStyle } from '../config' +import type { Config } from '../config' import type * as t from '@babel/types' +/** + * The HMR runtime to emit code for: + * - `'vite'`: ESM `import.meta.hot` with Vite accept-callback semantics. + * - `'webpack'`: `import.meta.webpackHot` with webpack / Rspack `module.hot` + * re-execution semantics. + */ +export type HmrStyle = 'vite' | 'webpack' + export type CreateRouteHmrStatementOpts = { hmrStyle: HmrStyle targetFramework: Config['target'] @@ -10,9 +18,9 @@ export type CreateRouteHmrStatementOpts = { } /** - * Dispatches to the configured HMR adapter. `hmrStyle` is set explicitly by - * the bundler-specific plugin entry (e.g. `rspack.ts` → `'webpack'`), so there - * is no runtime inference based on config string shapes. + * Dispatches to the HMR adapter of the bundler the plugin runs in. `hmrStyle` + * comes from the bundler-specific plugin entry (e.g. `rspack.ts` → + * `'webpack'`), not from user config. */ export function createRouteHmrStatement( stableRouteOptionKeys: Array, diff --git a/packages/router-plugin/src/core/hmr/vite-adapter.ts b/packages/router-plugin/src/core/hmr/vite-adapter.ts index ba8d42a80a..5357c45acf 100644 --- a/packages/router-plugin/src/core/hmr/vite-adapter.ts +++ b/packages/router-plugin/src/core/hmr/vite-adapter.ts @@ -4,7 +4,9 @@ import type * as t from '@babel/types' /** * Emits HMR accept code for Vite / native ESM HMR: `import.meta.hot.accept` - * with a callback that receives the freshly re-imported module. + * with a callback that receives the freshly re-imported module. Vite makes the + * module a hot boundary only when the code spells `import.meta.hot.accept(` + * out, so the call must not go through an alias. * * `targetFramework` is currently unused — Vite's framework-specific fast-refresh * plugins handle component body patching via their own accept boundaries — but @@ -26,8 +28,7 @@ export function createViteHmrStatement( template.statement( ` if (import.meta.hot) { - const hot = import.meta.hot - const hotData = hot.data ??= {} + const hotData = import.meta.hot.data ??= {} const handleRouteUpdate = ${handleRouteUpdateCode} const initialRouteId = ${routeIdFallback} ?? hotData['tsr-route-id'] if (initialRouteId) { @@ -41,7 +42,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route) hotData['tsr-route-update-handled'] = Route } - hot.accept((newModule) => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? ${routeIdFallback} if (routeId) { 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 f1f75d4f3c..ecc7607d59 100644 --- a/packages/router-plugin/src/core/router-code-splitter-plugin.ts +++ b/packages/router-plugin/src/core/router-code-splitter-plugin.ts @@ -17,7 +17,6 @@ import { getFrameworkHmrCompilerPlugins } from './code-splitter/plugins/framewor import { defaultCodeSplitGroupings, splitRouteIdentNodes, - tsrShared, tsrSplit, } from './constants' import { debug, normalizePath, routeFactoryCallCodeFilter } from './utils' @@ -25,7 +24,8 @@ import { createRouterPluginContext } from './router-plugin-context' import type { CodeSplitGroupings, SplitRouteIdentNodes } from './constants' import type { GetRoutesByFileMapResultValue } from '@tanstack/router-generator' import type { CodeSplitCompilerPlugin } from './code-splitter/plugins' -import type { Config, HmrStyle } from './config' +import type { Config } from './config' +import type { HmrStyle } from './hmr' import type { RouterPluginContext } from './router-plugin-context' import type { UnpluginFactory, @@ -81,11 +81,11 @@ const TRANSFORMATION_PLUGINS_BY_FRAMEWORK: Record< export function createRouterCodeSplitterPlugin( options: Partial Config)> | undefined = {}, routerPluginContext: RouterPluginContext, + hmrStyle: HmrStyle = 'vite', ): ReturnType Config)> | undefined>> { let ROOT: string = process.cwd() let userConfig: Config let addHmr: boolean - let hmrStyle: HmrStyle let compilerPlugins: Array let virtualRouteCompilerPlugins: Array @@ -99,16 +99,12 @@ export function createRouterCodeSplitterPlugin( } addHmr = (userConfig.codeSplittingOptions?.addHmr ?? true) && !isProduction - hmrStyle = userConfig.plugin?.hmr?.style ?? 'vite' - compilerPlugins = [ - ...(addHmr - ? (getFrameworkHmrCompilerPlugins({ - targetFramework: userConfig.target, - hmrStyle, - }) ?? []) - : []), - ...(userConfig.codeSplittingOptions?.compilerPlugins ?? []), - ] + compilerPlugins = addHmr + ? (getFrameworkHmrCompilerPlugins({ + targetFramework: userConfig.target, + hmrStyle, + }) ?? []) + : [] virtualRouteCompilerPlugins = compilerPlugins.filter( (plugin) => plugin.onVirtualRouteSplitNode, ) @@ -186,6 +182,7 @@ export function createRouterCodeSplitterPlugin( targetFramework: userConfig.target, filename: id, id, + isProduction, deleteNodes: userConfig.codeSplittingOptions?.deleteNodes ? new Set(userConfig.codeSplittingOptions.deleteNodes) : undefined, @@ -261,7 +258,6 @@ export function createRouterCodeSplitterPlugin( transform: { filter: { id: { - exclude: [tsrSplit, tsrShared], // this is necessary for webpack / rspack to avoid matching .html files include: /\.(m|c)?(j|t)sx?$/, }, @@ -332,13 +328,13 @@ export function createRouterCodeSplitterPlugin( }, rspack(compiler) { - isProduction = compiler.options.mode === 'production' + isProduction = (compiler.options.mode ?? 'production') === 'production' ROOT = process.cwd() initUserConfig() }, webpack(compiler) { - isProduction = compiler.options.mode === 'production' + isProduction = (compiler.options.mode ?? 'production') === 'production' ROOT = process.cwd() initUserConfig() }, diff --git a/packages/router-plugin/src/core/router-composed-plugin.ts b/packages/router-plugin/src/core/router-composed-plugin.ts index c778e4e8d4..5bcaaf8da9 100644 --- a/packages/router-plugin/src/core/router-composed-plugin.ts +++ b/packages/router-plugin/src/core/router-composed-plugin.ts @@ -4,6 +4,7 @@ import { createRouterCodeSplitterPlugin } from './router-code-splitter-plugin' import { createRouterHmrPlugin } from './router-hmr-plugin' import { createRouterPluginContext } from './router-plugin-context' import type { Config } from './config' +import type { HmrStyle } from './hmr' import type { RspackCompiler, UnpluginFactory, @@ -30,13 +31,18 @@ function applyRspackInlineCssDefaultDefinePlugin(compiler: RspackCompiler) { export const unpluginRouterComposedFactory: UnpluginFactory< Partial Config)> | undefined -> = (options = {}, _meta) => { +> = (options = {}, meta) => { const ROOT: string = process.cwd() const userConfig = getConfig( (typeof options === 'function' ? options() : options) as Partial, ROOT, ) const routerPluginContext = createRouterPluginContext() + // webpack and Rspack share webpack's `import.meta.webpackHot` HMR API. + const hmrStyle: HmrStyle = + meta.framework === 'webpack' || meta.framework === 'rspack' + ? 'webpack' + : 'vite' const getPlugin = (plugin: ReturnType>) => { if (!Array.isArray(plugin)) { @@ -49,7 +55,7 @@ export const unpluginRouterComposedFactory: UnpluginFactory< createRouterGeneratorPlugin(options, routerPluginContext), ) const routerCodeSplitter = getPlugin( - createRouterCodeSplitterPlugin(options, routerPluginContext), + createRouterCodeSplitterPlugin(options, routerPluginContext, hmrStyle), ) const result = [ @@ -89,7 +95,7 @@ export const unpluginRouterComposedFactory: UnpluginFactory< if (!isProduction && !userConfig.autoCodeSplitting) { const routerHmr = getPlugin( - createRouterHmrPlugin(options, routerPluginContext), + createRouterHmrPlugin(options, routerPluginContext, hmrStyle), ) result.push(...routerHmr) } diff --git a/packages/router-plugin/src/core/router-generator-plugin.ts b/packages/router-plugin/src/core/router-generator-plugin.ts index 46dda8c581..50dde9f55c 100644 --- a/packages/router-plugin/src/core/router-generator-plugin.ts +++ b/packages/router-plugin/src/core/router-generator-plugin.ts @@ -19,8 +19,6 @@ export function createRouterGeneratorPlugin( let userConfig: Config let generator: Generator - const routeGenerationDisabled = () => - userConfig.enableRouteGeneration === false const getRoutesDirectoryPath = () => { return isAbsolute(userConfig.routesDirectory) ? userConfig.routesDirectory @@ -46,9 +44,6 @@ export function createRouterGeneratorPlugin( file: string event: 'create' | 'update' | 'delete' }) => { - if (routeGenerationDisabled()) { - return - } let generatorEvent: GeneratorEvent | undefined = undefined if (opts) { const filePath = normalize(opts.file) diff --git a/packages/router-plugin/src/core/router-hmr-plugin.ts b/packages/router-plugin/src/core/router-hmr-plugin.ts index e1dc01a43b..3f14a38be5 100644 --- a/packages/router-plugin/src/core/router-hmr-plugin.ts +++ b/packages/router-plugin/src/core/router-hmr-plugin.ts @@ -7,6 +7,7 @@ import { getConfig } from './config' import { createRouterPluginContext } from './router-plugin-context' import type { UnpluginFactory } from 'unplugin' import type { Config } from './config' +import type { HmrStyle } from './hmr' import type { RouterPluginContext } from './router-plugin-context' /** @@ -18,6 +19,7 @@ import type { RouterPluginContext } from './router-plugin-context' export function createRouterHmrPlugin( options: Partial Config)> | undefined = {}, routerPluginContext: RouterPluginContext, + hmrStyle: HmrStyle = 'vite', ): ReturnType | undefined>> { let ROOT: string = process.cwd() @@ -47,8 +49,6 @@ export function createRouterHmrPlugin( if (debug) console.info('Adding HMR handling to route ', normalizedId) - const hmrStyle = userConfig.plugin?.hmr?.style ?? 'vite' - if (userConfig.target === 'react') { const compilerPlugins = getFrameworkHmrCompilerPlugins({ targetFramework: 'react', diff --git a/packages/router-plugin/src/esbuild.ts b/packages/router-plugin/src/esbuild.ts index 650082964d..e2c184bb3d 100644 --- a/packages/router-plugin/src/esbuild.ts +++ b/packages/router-plugin/src/esbuild.ts @@ -1,7 +1,6 @@ import { createEsbuildPlugin } from 'unplugin' -import { configSchema } from './core/config' -import { createRouterCodeSplitterPlugin } from './core/router-code-splitter-plugin' +import { configSchema, getConfig } from './core/config' import { createRouterGeneratorPlugin } from './core/router-generator-plugin' import { unpluginRouterComposedFactory } from './core/router-composed-plugin' import { createRouterPluginContext } from './core/router-plugin-context' @@ -13,6 +12,20 @@ type RouterPluginOptions = Partial Config)> | undefined const defaultRouterPluginContext = createRouterPluginContext() +const ESBUILD_SPLITTING_ERROR = + '@tanstack/router-plugin: route code splitting (`autoCodeSplitting`) is not supported with esbuild. ' + + 'Use the generator alone (`TanStackRouterGeneratorEsbuild`), or set `autoCodeSplitting: false`.' + +function refuseSplitting(options: RouterPluginOptions) { + const config = + typeof options === 'function' + ? options() + : getConfig(options ?? {}, process.cwd()) + if (config.autoCodeSplitting) { + throw new Error(ESBUILD_SPLITTING_ERROR) + } +} + /** * @example * ```ts @@ -33,22 +46,14 @@ const TanStackRouterGeneratorEsbuild = ( } /** - * @example - * ```ts - * export default { - * plugins: [TanStackRouterCodeSplitterEsbuild()], - * // ... - * } - * ``` + * Route code splitting is not available with esbuild: this entry refuses + * clearly. */ const TanStackRouterCodeSplitterEsbuild = ( - options?: RouterPluginOptions, - routerPluginContext?: RouterPluginContext, -) => { - const pluginContext = routerPluginContext ?? defaultRouterPluginContext - return createEsbuildPlugin((pluginOptions: RouterPluginOptions) => - createRouterCodeSplitterPlugin(pluginOptions, pluginContext), - )(options) + _options?: RouterPluginOptions, + _routerPluginContext?: RouterPluginContext, +): never => { + throw new Error(ESBUILD_SPLITTING_ERROR) } /** @@ -60,7 +65,10 @@ const TanStackRouterCodeSplitterEsbuild = ( * } * ``` */ -const TanStackRouterEsbuild = createEsbuildPlugin(unpluginRouterComposedFactory) +const TanStackRouterEsbuild = (options: RouterPluginOptions = {}) => { + refuseSplitting(options) + return createEsbuildPlugin(unpluginRouterComposedFactory)(options) +} const tanstackRouter = TanStackRouterEsbuild export default TanStackRouterEsbuild diff --git a/packages/router-plugin/src/index.ts b/packages/router-plugin/src/index.ts index 6a6ad158bb..c892c32671 100644 --- a/packages/router-plugin/src/index.ts +++ b/packages/router-plugin/src/index.ts @@ -1,5 +1,4 @@ export { configSchema, getConfig } from './core/config' -export { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin' export { unpluginRouterGeneratorFactory } from './core/router-generator-plugin' export { createRouterPluginContext } from './core/router-plugin-context' export type { @@ -8,16 +7,8 @@ export type { ConfigOutput, CodeSplittingOptions, DeletableNodes, - HmrOptions, } from './core/config' export type { RouterPluginContext } from './core/router-plugin-context' -export { getObjectPropertyKeyName } from './core/utils' -export type { - CodeSplitCompilerPlugin, - ReferenceRouteCompilerPlugin, - ReferenceRouteCompilerPluginContext, - VirtualRouteSplitNodeCompilerPluginContext, -} from './core/code-splitter/plugins' export { tsrSplit, splitRouteIdentNodes, diff --git a/packages/router-plugin/src/rspack.ts b/packages/router-plugin/src/rspack.ts index a31bde74af..6020179cce 100644 --- a/packages/router-plugin/src/rspack.ts +++ b/packages/router-plugin/src/rspack.ts @@ -12,35 +12,6 @@ type RspackRouterPluginOptions = Partial | (() => Partial) const defaultRouterPluginContext = createRouterPluginContext() -/** - * Rspack uses webpack-compatible `module.hot` / `import.meta.webpackHot` HMR. - * Force `plugin.hmr.style = 'webpack'` so the router HMR adapter emits - * `module.hot`-style accept/dispose code instead of Vite's callback-receive - * variant, regardless of what the user passes (or doesn't pass). - */ -function withWebpackHmrStyle( - options: RspackRouterPluginOptions | undefined, -): RspackRouterPluginOptions { - const mergeHmrStyle = ( - config: Partial | undefined, - ): Partial => ({ - ...config, - plugin: { - ...config?.plugin, - hmr: { - ...config?.plugin?.hmr, - style: 'webpack', - }, - }, - }) - - if (typeof options === 'function') { - return () => mergeHmrStyle(options()) - } - - return mergeHmrStyle(options) -} - /** * @example * ```ts @@ -68,6 +39,9 @@ const TanStackRouterGeneratorRspack = ( } /** + * Rspack uses webpack-compatible `import.meta.webpackHot` HMR, which the + * code splitter emits for it. + * * @example * ```ts * export default defineConfig({ @@ -87,10 +61,9 @@ const TanStackRouterCodeSplitterRspack = ( const pluginContext = routerPluginContext ?? defaultRouterPluginContext return createRspackPlugin((pluginOptions) => createRouterCodeSplitterPlugin( - withWebpackHmrStyle( - pluginOptions as RspackRouterPluginOptions | undefined, - ) as Partial Config)>, + pluginOptions as Partial Config)> | undefined, pluginContext, + 'webpack', ), )(options) } @@ -109,13 +82,7 @@ const TanStackRouterCodeSplitterRspack = ( * ``` */ const TanStackRouterRspack = /* #__PURE__ */ createRspackPlugin( - (options, meta) => - unpluginRouterComposedFactory( - withWebpackHmrStyle( - options as RspackRouterPluginOptions | undefined, - ) as Partial Config)>, - meta, - ), + unpluginRouterComposedFactory, ) const tanstackRouter = TanStackRouterRspack export default TanStackRouterRspack diff --git a/packages/router-plugin/src/webpack.ts b/packages/router-plugin/src/webpack.ts index 712372565e..9a0063fd6f 100644 --- a/packages/router-plugin/src/webpack.ts +++ b/packages/router-plugin/src/webpack.ts @@ -10,26 +10,6 @@ import type { RouterPluginContext } from './core/router-plugin-context' const defaultRouterPluginContext = createRouterPluginContext() -/** - * Webpack uses `module.hot` / `import.meta.webpackHot` HMR. Force - * `plugin.hmr.style = 'webpack'` so the router HMR adapter emits the correct - * accept/dispose shape regardless of user config. - */ -function withWebpackHmrStyle( - options: Partial | undefined, -): Partial { - return { - ...options, - plugin: { - ...options?.plugin, - hmr: { - ...options?.plugin?.hmr, - style: 'webpack', - }, - }, - } -} - /** * @example * ```ts @@ -50,6 +30,8 @@ const TanStackRouterGeneratorWebpack = ( } /** + * Route HMR in development goes through `import.meta.webpackHot`. + * * @example * ```ts * export default { @@ -64,10 +46,7 @@ const TanStackRouterCodeSplitterWebpack = ( ) => { const pluginContext = routerPluginContext ?? defaultRouterPluginContext return createWebpackPlugin((pluginOptions: Partial | undefined) => - createRouterCodeSplitterPlugin( - withWebpackHmrStyle(pluginOptions), - pluginContext, - ), + createRouterCodeSplitterPlugin(pluginOptions, pluginContext, 'webpack'), )(options) } @@ -81,11 +60,7 @@ const TanStackRouterCodeSplitterWebpack = ( * ``` */ const TanStackRouterWebpack = /* #__PURE__ */ createWebpackPlugin( - (options, meta) => - unpluginRouterComposedFactory( - withWebpackHmrStyle(options as Partial | undefined), - meta, - ), + unpluginRouterComposedFactory, ) const tanstackRouter = TanStackRouterWebpack diff --git a/packages/router-plugin/tests/add-hmr.test.ts b/packages/router-plugin/tests/add-hmr.test.ts index 52c2645409..0d89832f3b 100644 --- a/packages/router-plugin/tests/add-hmr.test.ts +++ b/packages/router-plugin/tests/add-hmr.test.ts @@ -1,5 +1,13 @@ -import { readFile, readdir } from 'node:fs/promises' +import { + mkdir, + mkdtemp, + readFile, + readdir, + rm, + writeFile, +} from 'node:fs/promises' import path from 'node:path' +import { createServer } from 'vite' import { describe, expect, it } from 'vitest' import { compileCodeSplitReferenceRoute } from '../src/core/code-splitter/compilers' @@ -7,6 +15,7 @@ import { defaultCodeSplitGroupings } from '../src/core/constants' import { getFrameworkHmrCompilerPlugins } from '../src/core/code-splitter/plugins/framework-plugins' import { createRouteHmrStatement } from '../src/core/hmr' import { frameworks } from './constants' +import { formatSnapshot } from './format-snapshot' function getFrameworkDir(framework: string) { const files = path.resolve(__dirname, `./add-hmr/test-files/${framework}`) @@ -37,7 +46,9 @@ describe('add-hmr works', () => { }), }) - await expect(compileResult?.code || code).toMatchFileSnapshot( + await expect( + await formatSnapshot(compileResult?.code || code, filename), + ).toMatchFileSnapshot( path.join(dirs.snapshots, filename.replace('.tsx', '@true.tsx')), ) }, @@ -58,7 +69,9 @@ describe('add-hmr works', () => { targetFramework: framework, }) - await expect(compileResult?.code || code).toMatchFileSnapshot( + await expect( + await formatSnapshot(compileResult?.code || code, filename), + ).toMatchFileSnapshot( path.join(dirs.snapshots, filename.replace('.tsx', '@false.tsx')), ) }, @@ -87,7 +100,9 @@ describe('add-hmr works', () => { }), }) - await expect(compileResult?.code || code).toMatchFileSnapshot( + await expect( + await formatSnapshot(compileResult?.code || code, filename), + ).toMatchFileSnapshot( path.join( getFrameworkDir(framework).snapshots, filename.replace('.tsx', '@webpack-hot.tsx'), @@ -105,7 +120,6 @@ describe('add-hmr works', () => { expect(output).toContain('webpackHot') expect(output).not.toContain('import.meta.hot') expect(output).toContain('oldHasShellComponent') - expect(output).toContain('__routeContext') }) it('supports configurable Vite unsplittable HMR generation', async () => { @@ -121,6 +135,36 @@ describe('add-hmr works', () => { expect(output).toContain('newModule') }) + it('generates lazy reset and scoped route refresh without route context mutation', async () => { + const filename = 'arrow-function.tsx' + const framework = 'react' + const file = await readFile( + path.join(getFrameworkDir(framework).files, filename), + ) + const code = file.toString() + const compileResult = compileCodeSplitReferenceRoute({ + code, + filename, + id: filename, + addHmr: true, + codeSplitGroupings: defaultCodeSplitGroupings, + targetFramework: framework, + compilerPlugins: getFrameworkHmrCompilerPlugins({ + targetFramework: framework, + }), + }) + if (!compileResult) { + throw new Error('Expected the reference route to be transformed') + } + const output = compileResult.code + + expect(output).toContain( + 'router._replaceRouteChunk(oldRoute, newRoute.lazyFn);', + ) + expect(output).toContain('void router._refreshRoute?.();') + expect(output).not.toContain('__routeContext') + }) + it('uses a generated route id fallback for Vite HMR', async () => { const statement = createRouteHmrStatement([], { hmrStyle: 'vite', @@ -160,3 +204,174 @@ describe('add-hmr works', () => { expect(output).not.toContain('/__root') }) }) + +/** + * Starts a Vite dev server with the router plugin (and no framework plugin) + * for an app made of `files`, connects an HMR client to it the way the + * browser's `/@vite/client` does, and requests the app's modules from + * `main.ts` on, as a page would. + */ +async function startDevApp( + files: Record, + options: { autoCodeSplitting: boolean }, +) { + // Keep the app inside the package so runtime imports resolve. + const root = await mkdtemp(path.join(__dirname, '.add-hmr-')) + await mkdir(path.join(root, 'routes')) + const allFiles: Record = { + 'index.html': '', + 'main.ts': `import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +export const router = createRouter({ routeTree }) +`, + 'routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute({}) +`, + ...files, + } + for (const [file, code] of Object.entries(allFiles)) { + await writeFile(path.join(root, file), code) + } + const { tanstackRouter } = await import('../src/vite') + const server = await createServer({ + root, + configFile: false, + logLevel: 'silent', + server: { port: 0, strictPort: false }, + // A dependency optimisation would reload the page on its own. + optimizeDeps: { noDiscovery: true, include: [] }, + plugins: [ + tanstackRouter({ + target: 'react', + routesDirectory: './routes', + generatedRouteTree: './routeTree.gen.ts', + autoCodeSplitting: options.autoCodeSplitting, + }), + ], + }) + const close = async () => { + await server.close() + await rm(root, { recursive: true, force: true }) + } + try { + await server.listen() + const origin = server.resolvedUrls!.local[0]!.replace(/\/$/, '') + const messages: Array<{ type: string }> = [] + const socket = new WebSocket( + `${origin.replace('http', 'ws')}/?token=${server.config.webSocketToken}`, + 'vite-hmr', + ) + socket.addEventListener('message', (event) => { + messages.push(JSON.parse(String(event.data))) + }) + await new Promise((resolve, reject) => { + socket.addEventListener('open', resolve) + socket.addEventListener('error', reject) + }) + const statuses: Record = {} + const served: Record = {} + const queue = ['/main.ts'] + while (queue.length > 0) { + const url = queue.shift()! + if (url in statuses) { + continue + } + const response = await fetch(origin + url) + statuses[url] = response.status + const code = await response.text() + served[url] = code + // Static imports of the app's own modules + for (const [, imported] of code.matchAll( + /^import\s[^'"]*?["'](\/(?!@|node_modules)[^"'?]+)["']/gm, + )) { + queue.push(imported!) + } + } + return { + statuses, + served, + /** Writes `code` to `file`; resolves with Vite's first reaction. */ + async edit(file: string, code: string) { + const seen = messages.length + await writeFile(path.join(root, file), code) + const deadline = Date.now() + 10_000 + while (Date.now() < deadline) { + const reaction = messages + .slice(seen) + .find( + (message) => + message.type === 'update' || message.type === 'full-reload', + ) + if (reaction) { + return reaction.type + } + await new Promise((resolve) => setTimeout(resolve, 50)) + } + return 'nothing' + }, + async close() { + socket.close() + await close() + }, + } + } catch (error) { + await close() + throw error + } +} + +describe('route HMR in a Vite dev server', () => { + // Vite makes a module a hot boundary only when its code spells + // `import.meta.hot.accept(` out. Route modules no framework plugin accepts + // (a `.ts` route file, or an app without `@vitejs/plugin-react`) reloaded + // the page on every edit. + it.each([ + { + name: 'a .ts route file', + file: 'routes/index.ts', + code: `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ loader: () => 'data v1' }) +`, + autoCodeSplitting: true, + }, + { + name: 'a route component, without a framework plugin', + file: 'routes/index.tsx', + code: `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ component: () =>

page v1

}) +`, + autoCodeSplitting: false, + }, + ])( + 'an edit of $name is a hot update, not a page reload', + async ({ file, code, autoCodeSplitting }) => { + const app = await startDevApp({ [file]: code }, { autoCodeSplitting }) + try { + expect(app.statuses[`/${file}`]).toBe(200) + expect(await app.edit(file, code.replace('v1', 'v2'))).toBe('update') + } finally { + await app.close() + } + }, + 30_000, + ) + + it('serves a route file with a binding named hot', async () => { + const app = await startDevApp( + { + 'routes/index.tsx': `import { createFileRoute } from '@tanstack/react-router' +const hot = 'hot' +export const Route = createFileRoute('/')({ component: () =>

{hot}

}) +`, + }, + // Unsplit, so the binding stays in the module the HMR code goes into + { autoCodeSplitting: false }, + ) + try { + expect(app.statuses['/routes/index.tsx']).toBe(200) + expect(app.served['/routes/index.tsx']).toMatch(/const hot = ["']hot["']/) + } finally { + await app.close() + } + }, 30_000) +}) 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 48e3768224..994c89e7b2 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,10 @@ -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 $$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 + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) 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 a463d9ab22..e45f8b634a 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,193 +1,115 @@ -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 $$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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.hot + 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 -}); -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("arrow-function.tsx", ['Route']); + component: TSRSplitComponent, +}) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('arrow-function.tsx', ['Route']) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} 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 44908e32a9..eb655d0287 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,171 +1,107 @@ -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 $$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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.webpackHot + 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 -}); + component: TSRSplitComponent, +}) if (import.meta.webpackHot) { - const hot = import.meta.webpackHot; - const hotData = hot.data ??= {}; - const routeId = hotData['tsr-route-id'] ?? Route.id ?? (Route.isRoot ? '__root__' : undefined); + const hot = import.meta.webpackHot + const hotData = (hot.data ??= {}) + const routeId = + hotData['tsr-route-id'] ?? + Route.id ?? + (Route.isRoot ? '__root__' : undefined) if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } - const existingRoute = typeof window !== 'undefined' && routeId ? window.__TSR_ROUTER__?.routesById?.[routeId] : undefined; + const existingRoute = + typeof window !== 'undefined' && routeId + ? window.__TSR_ROUTER__?.routesById?.[routeId] + : undefined if (routeId && existingRoute && existingRoute !== Route) { - (function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + ;(function handleRouteUpdate(routeId, newRoute) { + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - })(routeId, Route); + })(routeId, Route) try { - const tsrReactRefreshUtils = typeof __react_refresh_utils__ !== 'undefined' ? __react_refresh_utils__ : undefined; - const tsrEnqueueUpdate = tsrReactRefreshUtils && typeof tsrReactRefreshUtils.enqueueUpdate === 'function' ? tsrReactRefreshUtils.enqueueUpdate : undefined; + const tsrReactRefreshUtils = + typeof __react_refresh_utils__ !== 'undefined' + ? __react_refresh_utils__ + : undefined + const tsrEnqueueUpdate = + tsrReactRefreshUtils && + typeof tsrReactRefreshUtils.enqueueUpdate === 'function' + ? tsrReactRefreshUtils.enqueueUpdate + : undefined if (tsrEnqueueUpdate) { - tsrEnqueueUpdate(() => {}); + tsrEnqueueUpdate(() => {}) } } catch (_err) {} } - hot.dispose(data => { + hot.dispose((data) => { if (routeId) { - data['tsr-route-id'] = routeId; + data['tsr-route-id'] = routeId } - }); - hot.accept(); -} \ No newline at end of file + }) + hot.accept() +} 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 a2983e31bd..e0b52f6ad6 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,17 @@ -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 $$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') -}); + errorComponent: lazyRouteComponent( + $$splitErrorComponentImporter, + 'errorComponent', + ), + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) function pendingComponent() { - return
Pending
; -} \ No newline at end of file + return
Pending
+} 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 b04afe83f4..441852d762 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,204 +1,134 @@ -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 $$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; - return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); -})(); + const hot = import.meta.hot + 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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.hot + 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 -}); + component: TSRSplitComponent, +}) function TSRPendingComponent() { - return
Pending
; + return
Pending
} -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("createFileRoute-lowercase-components.tsx", ['Route']); +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set( + 'createFileRoute-lowercase-components.tsx', + ['Route'], + ) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@false.tsx index 5daf018617..7e3ad124ae 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@false.tsx @@ -1,6 +1,3 @@ import * as React from 'react' import { createRootRoute } from '@tanstack/react-router' - -export const Route = createRootRoute({ - component: () =>
root hmr
, -}) +export const Route = createRootRoute({ component: () =>
root hmr
}) 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 9ef182f4b7..f45186bdd9 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,182 +1,100 @@ -import * as React from 'react'; -import { createRootRoute } from '@tanstack/react-router'; -const TSRComponent = () =>
root hmr
; -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("createRootRoute-inline-component.tsx", ['Route']); +import * as React from 'react' +import { createRootRoute } from '@tanstack/react-router' +const TSRComponent = () =>
root hmr
+export const Route = createRootRoute({ component: TSRComponent }) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set( + 'createRootRoute-inline-component.tsx', + ['Route'], + ) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@false.tsx index 20c9a07798..6fac4df1f1 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@false.tsx @@ -1,25 +1,20 @@ import * as React from 'react' import { createRootRoute } from '@tanstack/react-router' - export const Route = createRootRoute({ shellComponent: shellComponent, pendingComponent: pendingComponent, errorComponent: errorComponent, component: component, }) - function shellComponent({ children }: { children: React.ReactNode }) { return {children} } - function pendingComponent() { return
Pending
} - function errorComponent() { return
Error
} - function component() { return
Hello
} 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 d3eae5cb36..f9a6875fe7 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,200 +1,116 @@ -import * as React from 'react'; -import { createRootRoute } from '@tanstack/react-router'; +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 -}: { - children: React.ReactNode; -}) { - return {children}; + component: TSRComponent, +}) +function TSRShellComponent({ children }: { children: React.ReactNode }) { + return {children} } function TSRPendingComponent() { - return
Pending
; + return
Pending
} function TSRErrorComponent() { - return
Error
; + return
Error
} function TSRComponent() { - return
Hello
; + return
Hello
} -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("createRootRoute-lowercase-components.tsx", ['Route']); +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set( + 'createRootRoute-lowercase-components.tsx', + ['Route'], + ) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@false.tsx index e967791f8d..5c779d9876 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@false.tsx @@ -1,10 +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
} 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 9789370efc..3bde5adf5c 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,184 +1,99 @@ -import * as React from 'react'; -import { createRootRoute } from '@tanstack/react-router'; -export const Route = createRootRoute({ - component: RootComponent -}); +import * as React from 'react' +import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute({ component: RootComponent }) function RootComponent() { - return
Hello
; + return
Hello
} -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("createRootRoute.tsx", ['Route']); +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('createRootRoute.tsx', ['Route']) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@false.tsx index 0feadacab5..43f27087a6 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@false.tsx @@ -1,14 +1,11 @@ import * as React from 'react' import { createRootRouteWithContext } from '@tanstack/react-router' - interface MyRouterContext { auth: boolean } - export const Route = createRootRouteWithContext()({ component: RootComponent, }) - function RootComponent() { return
Hello
} 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 6c7073a8f3..c96d6f01a5 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 @@ -1,187 +1,107 @@ -import * as React from 'react'; -import { createRootRouteWithContext } from '@tanstack/react-router'; +import * as React from 'react' +import { createRootRouteWithContext } from '@tanstack/react-router' interface MyRouterContext { - auth: boolean; + auth: boolean } export const Route = createRootRouteWithContext()({ - component: RootComponent -}); + component: RootComponent, +}) function RootComponent() { - return
Hello
; + return
Hello
} -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("createRootRouteWithContext-type-args.tsx", ['Route']); +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set( + 'createRootRouteWithContext-type-args.tsx', + ['Route'], + ) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx index d80f17484f..112fded569 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx @@ -1,11 +1,9 @@ import thing from 'thing' - export function test() { const { foo: { bar: { destructured }, }, } = thing - return destructured } diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx index d80f17484f..112fded569 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx @@ -1,11 +1,9 @@ import thing from 'thing' - export function test() { const { foo: { bar: { destructured }, }, } = thing - return destructured } diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx index 4fdd9d1c68..8109a89624 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx @@ -1,6 +1,3 @@ import React from 'react' import { createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/')({ - component: undefined, -}) +export const Route = createFileRoute('/')({ component: undefined }) 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 bee793d372..99674604fa 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,181 +1,98 @@ -import React from 'react'; -import { createFileRoute } from '@tanstack/react-router'; -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("explicit-undefined-component.tsx", ['Route']); +import React from 'react' +import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ component: undefined }) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('explicit-undefined-component.tsx', [ + 'Route', + ]) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} 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 5d7e2181f5..e2b672f7b8 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,10 @@ -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 $$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 + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) 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 75b457b778..614c38c954 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,193 +1,115 @@ -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 $$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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.hot + 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 -}); -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("function-declaration.tsx", ['Route']); + component: TSRSplitComponent, +}) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('function-declaration.tsx', ['Route']) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} 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 653c0c21f5..456134aadc 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,16 @@ -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 $$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 + errorComponent: lazyRouteComponent( + $$splitErrorComponentImporter, + 'errorComponent', + ), +}) 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 7f28b7b3d3..871bf352e0 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,203 +1,130 @@ -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 $$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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.hot + 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; - return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); -})(); + const hot = import.meta.hot + 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 -}); -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("multi-component.tsx", ['Route']); + errorComponent: TSRSplitErrorComponent, +}) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('multi-component.tsx', ['Route']) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} 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 4fc3129e14..cfb23b03d2 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,16 @@ -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 $$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 + component: lazyRouteComponent($$splitComponentImporter, 'component'), + errorComponent: lazyRouteComponent( + $$splitErrorComponentImporter, + 'errorComponent', + ), +}) 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 6bee992948..6d5b2a1fd3 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,203 +1,130 @@ -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 $$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; - return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); -})(); + const hot = import.meta.hot + 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; - return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); -})(); + const hot = import.meta.hot + 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 -}); -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 => { - const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; - const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; - return [...ignoredExports, ...moduleIgnored]; - }; - return { - ignoredExportsById - }; - })(); - tsrReactRefresh.ignoredExportsById.set("string-literal-keys.tsx", ['Route']); + component: TSRSplitComponent, + errorComponent: TSRSplitErrorComponent, +}) +if (import.meta.hot && typeof window !== 'undefined') { + import.meta.hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('string-literal-keys.tsx', ['Route']) } export function TSRFastRefreshAnchor() { - return null; + return null } if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} 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 b09548da57..10bedc87f0 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,9 @@ -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'; +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 + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) 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 2d1be7e32b..bc531f9000 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,164 +1,79 @@ -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'; +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') -}); + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) if (import.meta.hot) { - const hot = import.meta.hot; - const hotData = hot.data ??= {}; + const hotData = (import.meta.hot.data ??= {}) const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { - const router = window.__TSR_ROUTER__; - const oldRoute = router.routesById[routeId]; + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] if (!oldRoute) { - return; + return } - ; - const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); - const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) + const generatedRouteOptions = {} + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key]; + generatedRouteOptions[key] = oldRoute.options[key] } - }); - const removedKeys = new Set(); - Object.keys(oldRoute.options).forEach(key => { - if (!generatedRouteOptionKeys.has(key) && !(key in newRoute.options)) { - removedKeys.add(key); - delete oldRoute.options[key]; - } - }); - const oldHasShellComponent = "shellComponent" in oldRoute.options; - const newHasShellComponent = "shellComponent" in newRoute.options; - const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; - const componentKeys = []; + }) + const oldHasShellComponent = 'shellComponent' in oldRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + 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]; + newRoute.options[key] = oldRoute.options[key] } - }); + }) } - ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; - oldRoute.options = nextOptions; - oldRoute.update(nextOptions); - oldRoute._componentsPromise = undefined; - oldRoute._lazyPromise = undefined; - router.setRoutes(router.buildRouteTree()); - syncHotRouteExport(oldRoute); - router.resolvePathCache.clear(); - const filter = m => m.routeId === oldRoute.id; - const activeMatch = router.stores.matches.get().find(filter); - const pendingMatch = router.stores.pendingMatches.get().find(filter); - const cachedMatches = router.stores.cachedMatches.get().filter(filter); - if (activeMatch || pendingMatch || cachedMatches.length > 0) { - if (removedKeys.has("loader") || removedKeys.has("beforeLoad")) { - const matchIds = [activeMatch?.id, pendingMatch?.id, ...cachedMatches.map(match => match.id)].filter(Boolean); - router.batch(() => { - for (const matchId of matchIds) { - const store = router.stores.pendingMatchStores.get(matchId) || router.stores.matchStores.get(matchId) || router.stores.cachedMatchStores.get(matchId); - if (store) { - store.set(prev => { - const next = { - ...prev - }; - if (removedKeys.has("loader")) { - next.loaderData = undefined; - } - ; - if (removedKeys.has("beforeLoad")) { - next.__beforeLoadContext = undefined; - next.context = rebuildMatchContextWithoutBeforeLoad(next); - } - ; - return next; - }); - } - } - }); - } - ; - router.invalidate({ - filter, - sync: true - }); - } - ; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions } + oldRoute.options = nextOptions + oldRoute.update(nextOptions) + router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(oldRoute) + router.resolvePathCache.clear() + void router._refreshRoute?.() function syncHotRouteExport(liveRoute) { - newRoute.options = liveRoute.options; - newRoute.parentRoute = liveRoute.parentRoute; - newRoute._path = liveRoute._path; - newRoute._id = liveRoute._id; - newRoute._fullPath = liveRoute._fullPath; - newRoute._to = liveRoute._to; + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to } - function getStoreMatch(matchId) { - return router.stores.pendingMatchStores.get(matchId)?.get() || router.stores.matchStores.get(matchId)?.get() || router.stores.cachedMatchStores.get(matchId)?.get(); - } - function getMatchList(matchId) { - const pendingMatches = router.stores.pendingMatches.get(); - if (pendingMatches.some(match => match.id === matchId)) { - return pendingMatches; - } - ; - const activeMatches = router.stores.matches.get(); - if (activeMatches.some(match => match.id === matchId)) { - return activeMatches; - } - ; - const cachedMatches = router.stores.cachedMatches.get(); - if (cachedMatches.some(match => match.id === matchId)) { - return cachedMatches; - } - ; - return []; - } - function getParentMatch(match) { - const matchList = getMatchList(match.id); - const matchIndex = matchList.findIndex(item => item.id === match.id); - if (matchIndex <= 0) { - return undefined; - } - ; - const parentMatch = matchList[matchIndex - 1]; - return getStoreMatch(parentMatch.id) || parentMatch; - } - function rebuildMatchContextWithoutBeforeLoad(match) { - const parentMatch = getParentMatch(match); - const getParentContext = router.getParentContext; - const parentContext = getParentContext ? getParentContext.call(router, parentMatch) : parentMatch?.context ?? router.options.context; - return { - ...(parentContext ?? {}), - ...(match.__routeContext ?? {}) - }; - } - }; - const initialRouteId = Route.id ?? hotData['tsr-route-id']; + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] if (initialRouteId) { - hotData['tsr-route-id'] = initialRouteId; + hotData['tsr-route-id'] = initialRouteId } - const existingRoute = typeof window !== 'undefined' && initialRouteId ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] : undefined; + const existingRoute = + typeof window !== 'undefined' && initialRouteId + ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] + : undefined if (initialRouteId && existingRoute && existingRoute !== Route) { - handleRouteUpdate(initialRouteId, Route); - hotData['tsr-route-update-handled'] = Route; + handleRouteUpdate(initialRouteId, Route) + hotData['tsr-route-update-handled'] = Route } - hot.accept(newModule => { + import.meta.hot.accept((newModule) => { if (Route && newModule && newModule.Route) { - const routeId = hotData['tsr-route-id'] ?? Route.id; + const routeId = hotData['tsr-route-id'] ?? Route.id if (routeId) { - hotData['tsr-route-id'] = routeId; + hotData['tsr-route-id'] = routeId } if (hotData['tsr-route-update-handled'] === newModule.Route) { - delete hotData['tsr-route-update-handled']; - return; + delete hotData['tsr-route-update-handled'] + return } - handleRouteUpdate(routeId, newModule.Route); + handleRouteUpdate(routeId, newModule.Route) } - }); -} \ No newline at end of file + }) +} diff --git a/packages/router-plugin/tests/code-splitter-dead-code.test.ts b/packages/router-plugin/tests/code-splitter-dead-code.test.ts new file mode 100644 index 0000000000..038f323caf --- /dev/null +++ b/packages/router-plugin/tests/code-splitter-dead-code.test.ts @@ -0,0 +1,462 @@ +import { describe, expect, it } from 'vitest' +import { + compileRouteModules, + declarationOf, + evaluateModule, + expectValidModules, + head, + importSources, + importedNames, + transformWithRouteHmrPlugin, +} from './regression-helpers' + +const sharedModule = 'route.tsx?tsr-shared=1' + +/** Whether a module declares `name` or imports it from the shared module. */ +function binds(module: string, name: string) { + return ( + declarationOf(name).test(module) || + importedNames(module, sharedModule).includes(name) + ) +} + +/** + * The reference module, compiled without and with React HMR: HMR rewrites the + * route options (hoisted components, refresh anchor) before dead code is + * removed, so the removal runs on a different program. + */ +function referenceModules(code: string) { + return { + reference: compileRouteModules(code).modules.reference!, + 'reference with HMR': compileRouteModules(code, { hmr: true }).modules + .reference!, + } +} + +/** + * Renders the split component the way an app loads it: the shared module (if + * any) and the reference module run first, then the component chunk, all + * linked to one instance of the shared module. A top-level statement may then + * reach the component by moving into its chunk or by staying in the + * reference module and writing to a shared binding. + */ +async function renderSplitComponent(modules: Record) { + const stubs: Record> = {} + if (modules.shared) { + stubs[sharedModule] = await evaluateModule(modules.shared) + } + await evaluateModule(modules.reference!, { + ...stubs, + '@tanstack/react-router': { + createFileRoute: () => (options: unknown) => ({ options }), + lazyRouteComponent: () => () => null, + }, + }) + const chunk = await evaluateModule(modules['virtual component']!, stubs) + return chunk.component!() +} + +describe('the reference module only drops code that splitting left unused', () => { + it.each([ + { + name: 'a store subscription that unsubscribes itself', + setup: `import { store } from './store' +const unsubscribe = store.subscribe(() => { + if (store.state.done) unsubscribe() +})`, + declared: ['unsubscribe'], + }, + { + name: 'mutually-referencing declarations', + setup: `import { createPersister } from './persist' +const persister = createPersister({ onRestore: () => restore() }) +function restore() { + persister.restore() +}`, + declared: ['persister', 'restore'], + }, + { + // Source: babel-dead-code-elimination dead-code-elimination.test.ts "only + // eliminates newly unreferenced identifiers", "unexported circular references" + // and "SCC with external caller used -> all preserved" + name: 'unused functions, one calling a helper of the split component', + setup: `function helper() { return 'helper' } +function unused() { return helper() } +function ping(): number { return pong() } +function pong(): number { return ping() }`, + component: '

{helper()}

', + declared: ['helper', 'unused', 'ping', 'pong'], + }, + ])( + 'keeps $name that nothing used before splitting', + async ({ setup, component = '
', declared }) => { + const code = `${head}${setup} +export const Route = createFileRoute('/')({ component: () => ${component} }) +` + const modules = referenceModules(code) + // The validator does not report references to undeclared names. A + // binding the split component reads may come from the shared module. + for (const [module, reference] of Object.entries(modules)) { + for (const name of declared) { + expect(binds(reference, name), `${module} binds ${name}`).toBe(true) + } + } + await expectValidModules(modules) + }, + ) + + // Source: babel-dead-code-elimination dead-code-elimination.test.ts "SCC dead + // code elimination" > "arrow functions in mutual recursion -> removed" + it('moves mutually recursive helpers only the component uses, and their imports, into its chunk', async () => { + const code = `${head}import { dep } from './dep' +const ping = (n: number): number => (n > 0 ? pong(n - 1) : 0) +const pong = function (n: number): number { return n > 0 ? ping(n - 1) : dep } +export const Route = createFileRoute('/')({ + loader: () => 'data', + component: () =>

{ping(3)}

, +}) +` + for (const reference of Object.values(referenceModules(code))) { + expect(reference).not.toMatch(declarationOf('ping')) + expect(reference).not.toMatch(declarationOf('pong')) + expect(importSources(reference)).not.toContain('./dep') + } + const { modules } = compileRouteModules(code) + expect(modules['virtual component']).toMatch(declarationOf('ping')) + expect(modules['virtual component']).toMatch(declarationOf('pong')) + await expectValidModules(modules) + }) + + // Source: Next.js ssg/getStaticProps/should-remove-re-exported-function-declarations-dependents-variables-functions-imports + it('keeps the import specifiers nothing used before splitting', async () => { + const { modules } = + compileRouteModules(`${head}import { used, preUnused } from 'bar' +const b = function apples() { return used } +export const Route = createFileRoute('/')({ + loader: () => 'data', + component: () =>

{b()}

, +}) +`) + expect(importedNames(modules.reference!, 'bar')).toEqual(['preUnused']) + expect(modules.reference).not.toContain('apples') + expect(modules['virtual component']).toMatch(declarationOf('b')) + expect(importedNames(modules['virtual component']!, 'bar')).toContain( + 'used', + ) + await expectValidModules(modules) + }) + + // Source: React Router route-chunks-test.ts "shared imports across chunks but + // not main chunk with shared side effect usage" + it('runs a top-level call only in the reference module, even when the chunks import its callee', async () => { + const { modules } = + compileRouteModules(`${head}import { shared } from './shared' +shared('side-effect-marker') +export const Route = createFileRoute('/')({ + component: () =>
{shared('component')}
, + errorComponent: () =>
{shared('error')}
, +}) +`) + expect(modules.reference).toContain('side-effect-marker') + expect(modules['virtual component']).not.toContain('side-effect-marker') + expect(modules['virtual errorComponent']).not.toContain( + 'side-effect-marker', + ) + await expectValidModules(modules) + }) + + // TypeScript erases type positions, so a declaration whose binding only + // appears in a type is still live code that runs when the route loads. + it.each([ + { + name: 'the reference module', + compile: (code: string) => compileRouteModules(code).modules.reference!, + }, + { + name: 'a route module compiled for HMR', + compile: (code: string) => transformWithRouteHmrPlugin(code), + }, + ])( + 'keeps a declaration only referenced from types in $name', + async ({ compile }) => { + const output = + compile(`${head}import { registerAnalytics } from './analytics' +const analytics = registerAnalytics('/posts') +declare module './analytics' { + interface Registry { + posts: typeof analytics + } +} +export const Route = createFileRoute('/posts')({ + component: () =>

posts

, +}) +`) + expect(output).toMatch(declarationOf('analytics')) + expect(output).toContain('registerAnalytics(') + await expectValidModules({ output }) + }, + ) +}) + +describe('code a split option needs moves with it', () => { + // Source: Qwik optimizer test.rs should_not_move_over_side_effects, + // example_drop_side_effects; Turbopack tree-shaker analyzer/route-kind + it.each([ + { + name: 'a compound component member assignment', + setup: `function Card({ children }) { return
{children}
} +Card.Title = function Title() { return

t

}`, + render: '', + rendered: '

t

', + }, + { + name: 'a registry filled by a top-level call', + setup: `const registry = new Map() +registry.set('a', 'A')`, + render: `

{registry.get('a')}

`, + rendered: '

A

', + }, + { + name: 'a compiled enum initializing a var', + setup: `var Kind: any +;(function (Kind: any) { + Kind['A'] = 'a' +})(Kind || (Kind = {}))`, + render: '

{Kind.A}

', + rendered: '

a

', + }, + ])( + 'renders a split component that relies on $name', + async ({ setup, render, rendered }) => { + const { modules } = compileRouteModules(`${head}${setup} +export const Route = createFileRoute('/')({ + component: () => ${render}, +}) +`) + await expectValidModules(modules) + expect(await renderSplitComponent(modules)).toBe(rendered) + }, + ) + + // Source: React Compiler hook-ref-callback.js and + // dont-memoize-primitive-function-call-non-escaping.js: a function shared by + // the loader and the split component declares a local it never reads. + it.each([ + { name: 'a call', initializer: 'track(id)' }, + { name: 'an optional call', initializer: 'track?.(id)' }, + ])( + 'keeps an unused local initialized by $name in a shared function', + async ({ initializer }) => { + const { modules } = + compileRouteModules(`${head}import { track } from './track' +function useShared(id) { + const unused = ${initializer} + return id +} +export const Route = createFileRoute('/')({ + loader: () => useShared('loader'), + component: () =>

{useShared('component')}

, +}) +`) + const calls: Array = [] + const shared = await evaluateModule(modules.shared!, { + './track': { track: (label: string) => calls.push(label) }, + }) + expect(shared.useShared!('render')).toBe('render') + expect(calls).toEqual(['render']) + }, + ) + + // Source: babel-dead-code-elimination dead-code-elimination.test.ts "object + // pattern" > "within function param" + it('keeps empty destructuring parameters of helpers moved into the chunk', async () => { + const { modules } = + compileRouteModules(`${head}function f(a: any, {}: any) { return a } +const g = (a: any, []: any) => a +export const Route = createFileRoute('/')({ + loader: () => 'data', + component: () =>

{f.length}{g.length}

, +}) +`) + const chunk = await evaluateModule(modules['virtual component']!) + expect(chunk.component!()).toBe('

22

') + }) + + // Source: React Router remove-exports-test.ts "iife with dependencies" + it('moves a component created by an IIFE with its dependencies and shares the helper the loader uses too', async () => { + const { modules, sharedBindings } = + compileRouteModules(`${head}import { removedLib } from 'removed-lib' +import { keptLib } from 'kept-lib' +import { sharedLib } from 'shared-lib' +const sharedUtil = (value?: unknown) => sharedLib(value) +const removedUtil = () => sharedUtil(removedLib()) +const keptUtil = () => sharedUtil(keptLib()) +const Page = (() => { + const message = removedUtil() + return () =>
{String(message)}
+})() +export const Route = createFileRoute('/')({ + loader: () => keptUtil(), + component: Page, +}) +`) + expect(sharedBindings).toEqual(['sharedUtil']) + expect(importSources(modules.reference!)).toEqual([ + '@tanstack/react-router', + 'kept-lib', + 'route.tsx?tsr-shared=1', + ]) + expect(modules.reference).not.toContain('removedUtil') + expect(importSources(modules['virtual component']!)).toEqual([ + 'removed-lib', + 'route.tsx?tsr-shared=1', + ]) + expect(modules['virtual component']).toMatch(declarationOf('Page')) + expect(importSources(modules.shared!)).toEqual(['shared-lib']) + await expectValidModules(modules) + }) + + // Source: React Router route-chunks-test.ts "isolated exported variable + // declarations sharing an export statement"; Next.js + // ssg/getStaticProps/should-remove-re-exported-variable-declarations-safe + it.each([ + { + name: 'plain declarators', + declarations: `const Page = () =>
{chunkMessage}
, + main = mainMessage`, + }, + { + name: 'destructured declarators', + declarations: `const { Page } = { Page: () =>
{chunkMessage}
}, + { main } = { main: mainMessage }`, + }, + ])( + 'gives each of the $name of one statement to the module that reads it', + async ({ declarations }) => { + const { modules, sharedBindings } = + compileRouteModules(`${head}import { chunkMessage, mainMessage } from './messages' +${declarations} +export const Route = createFileRoute('/')({ + loader: () => main, + component: Page, +}) +`) + expect(sharedBindings).toEqual([]) + expect(importedNames(modules.reference!, './messages')).toEqual([ + 'mainMessage', + ]) + expect(modules.reference).not.toMatch(/\bPage\b/) + expect( + importedNames(modules['virtual component']!, './messages'), + ).toEqual(['chunkMessage']) + expect(modules['virtual component']).not.toMatch(/\bmain\b/) + await expectValidModules(modules) + }, + ) + + // Source: React Router route-chunks-test.ts "exported variable declarations + // sharing an export statement" + it('shares a declarator that a sibling declarator reads', async () => { + const { modules, sharedBindings } = + compileRouteModules(`${head}import { sharedMessage } from './messages' +const Page = () =>
{sharedMessage}
, + Preview = Page +export const Route = createFileRoute('/')({ + loader: () => Preview.name, + component: Page, +}) +`) + expect(sharedBindings).toEqual(['Page']) + expect(modules.shared).toMatch(declarationOf('Page')) + expect(modules.reference).toMatch(declarationOf('Preview')) + expect(importedNames(modules.reference!, sharedModule)).toEqual(['Page']) + expect(modules.reference).not.toMatch(declarationOf('Page')) + expect(modules['virtual component']).not.toMatch(declarationOf('Page')) + await expectValidModules(modules) + }) +}) + +describe('var declarations nested in top-level statements', () => { + it.each([ + { + name: 'a for loop head', + setup: 'for (var value = 0; value < 3; value++) {}', + }, + { name: 'a for-of head', setup: "for (var value of ['a']) {}" }, + { + name: 'an if block', + setup: "if (typeof window === 'undefined') { var value = 'server' }", + }, + ])( + 'stay bound in every module when $name declares a binding the loader and the component read', + async ({ setup }) => { + const { modules } = compileRouteModules(`${head}${setup} +export const Route = createFileRoute('/')({ + loader: () => value, + component: () =>
{value}
, +}) +`) + // Known limitation on main: the statement runs in both modules instead + // of once in the shared module; only check that each module binds `value`. + for (const name of ['reference', 'virtual component']) { + expect(binds(modules[name]!, 'value'), `${name} binds value`).toBe(true) + } + await expectValidModules(modules) + }, + ) + + it('stay bound in the reference module when exported and read by the component', async () => { + const { modules } = + compileRouteModules(`${head}if (typeof window === 'undefined') { var flag = 'server' } +export { flag } +export const Route = createFileRoute('/')({ + component: () =>
{flag}
, +}) +`) + expect(binds(modules.reference!, 'flag')).toBe(true) + await expectValidModules(modules) + }) + + // Source: babel-dead-code-elimination dead-code-elimination.test.ts "variable" + // (var bindings declared inside nested statements) + it('follow the only option that reads them', async () => { + const { modules } = + compileRouteModules(`${head}import { compute, connect } from './lib' +if (typeof window !== 'undefined') { + var flag = compute() +} +for (var index = 0; index < 3; index++) {} +{ + var block = connect() +} +export const Route = createFileRoute('/')({ + loader: () => block, + component: () =>

{String(flag)}{index}

, +}) +`) + expect(modules.reference).not.toContain('compute()') + expect(modules.reference).toMatch(declarationOf('block')) + const chunk = modules['virtual component']! + expect(chunk).toMatch(declarationOf('flag')) + expect(chunk).toMatch(declarationOf('index')) + expect(chunk).not.toContain('connect()') + await expectValidModules(modules) + }) +}) + +describe('robustness', () => { + it('compiles a route with a long method chain', async () => { + // Builder APIs (schemas, query builders) produce deep left-nested calls + const chain = Array.from({ length: 200 }, (_, i) => `.add(${i})`).join('') + const { modules } = + compileRouteModules(`${head}import { builder } from './builder' +const schema = builder()${chain} +export const Route = createFileRoute('/')({ + loader: () => schema, + component: () =>
{String(schema)}
, +}) +`) + expect(modules.shared).toContain('.add(199)') + await expectValidModules(modules) + }) +}) diff --git a/packages/router-plugin/tests/code-splitter-imports-exports.test.ts b/packages/router-plugin/tests/code-splitter-imports-exports.test.ts new file mode 100644 index 0000000000..e7c7a504d3 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter-imports-exports.test.ts @@ -0,0 +1,359 @@ +import { transformWithOxc } from 'vite' +import { describe, expect, it } from 'vitest' +import { + buildAndRun, + compileRouteModules, + componentChunk, + declarationOf, + evaluateModule, + expectValidModules, + exportedNames, + head, + importSources, + importedNames, + transformWithRouteHmrPlugin, +} from './regression-helpers' + +describe('each module imports only the specifiers it reads', () => { + // Source: React Router route-chunks-test.ts "functions referencing their own + // identifiers"; babel-dead-code-elimination dead-code-elimination.test.ts + // "import" > "mixed default and named" and "namespace" + it('splits default, named and namespace specifiers between the modules', async () => { + const { modules, sharedBindings } = + compileRouteModules(`${head}import defaultMessage, { targetMessage, otherMessage } from './messages' +import * as messages from './messages' +import other, * as ns from './other' +const getDefault = () => defaultMessage +const getTarget = () => targetMessage +const getOther = () => otherMessage +function getNamespaced() { + return messages.namespaced +} +export const Route = createFileRoute('/')({ + loader: () => [getOther(), other], + component: () =>
{getDefault()}{ns.x}
, + errorComponent: () =>
{getNamespaced()}
, + notFoundComponent: () =>
{getTarget()}
, +}) +`) + expect(sharedBindings).toEqual([]) + const imports = (module: string, source: string) => + importedNames(modules[module]!, source) + expect(imports('reference', './messages')).toEqual(['otherMessage']) + expect(imports('reference', './other')).toEqual(['default']) + expect(imports('virtual component', './messages')).toEqual(['default']) + expect(imports('virtual component', './other')).toEqual(['*']) + expect(imports('virtual errorComponent', './messages')).toEqual(['*']) + expect(imports('virtual notFoundComponent', './messages')).toEqual([ + 'targetMessage', + ]) + await expectValidModules(modules) + }) + + it('moves a specifier with a string name into the chunk', async () => { + const { modules } = + compileRouteModules(`${head}import { "kebab-name" as Kebab } from './icons' +export const Route = createFileRoute('/')({ + loader: () => 'data', + component: () => , +}) +`) + expect(importedNames(modules['virtual component']!, './icons')).toEqual([ + 'kebab-name', + ]) + expect(importSources(modules.reference!)).not.toContain('./icons') + await expectValidModules(modules) + }) + + // Source: babel-dead-code-elimination dead-code-elimination.test.ts "import" > + // "mixed default and named: none used" and "side-effect" + it('removes an import whose specifiers all moved instead of leaving a side-effect import', async () => { + const code = `${head}import a, { b } from 'pkg' +import './styles.css' +export const Route = createFileRoute('/')({ + loader: () => 'data', + component: () =>

{a}{b}

, +}) +` + const { modules } = compileRouteModules(code) + // React HMR rewrites the reference module before unused code is removed. + const hmrReference = compileRouteModules(code, { hmr: true }).modules + .reference! + for (const reference of [modules.reference!, hmrReference]) { + expect(importSources(reference)).toContain('./styles.css') + expect(importSources(reference)).not.toContain('pkg') + } + expect(importedNames(modules['virtual component']!, 'pkg')).toEqual([ + 'b', + 'default', + ]) + await expectValidModules(modules) + }) + + // With React's classic JSX runtime (`jsx: "react"` in tsconfig), JSX + // compiles to `React.createElement`, so a React import that the TypeScript + // code only uses in types must stay. + it.each([ + { name: 'split chunk', compile: componentChunk }, + { + name: 'route module compiled for HMR', + compile: (code: string) => transformWithRouteHmrPlugin(code), + }, + ])( + 'keeps the React import of the $name for classic JSX', + async ({ compile }) => { + const output = compile(`import * as React from 'react' +${head}function Page({ title = 'classic' }: { title?: React.ReactNode }) { + return

{title}

+} +export const Route = createFileRoute('/')({ component: Page }) +`) + const { code } = await transformWithOxc(output, 'module.tsx', { + jsx: { runtime: 'classic' }, + }) + expect(importedNames(code, 'react')).toEqual(['*']) + }, + ) +}) + +describe('exports of the route file', () => { + it.each([ + { name: 'as-is', exports: 'export { Foo }' }, + { name: 'renamed', exports: 'export { Foo as Bar }' }, + ])( + 'are not redeclared when they re-export an import $name', + async ({ exports }) => { + const { modules } = + compileRouteModules(`${head}import { Foo } from './foo' +${exports} +export const Route = createFileRoute('/')({ component: Page }) +function Page() { + return +} +`) + await expectValidModules(modules) + }, + ) + + it('are not redeclared when destructured next to a non-exported binding', async () => { + const { modules } = compileRouteModules(`${head}const { a, b } = getStuff() +export { a } +export const Route = createFileRoute('/')({ + component: () =>
{a}{b}
, +}) +`) + await expectValidModules(modules) + }) + + it.each([ + { name: 'function', declaration: 'function () {\n return null\n}' }, + { name: 'class', declaration: 'class {\n x = 1\n}' }, + ])( + 'keep an anonymous default-exported $name valid in every module', + async ({ declaration }) => { + const { modules } = compileRouteModules(`${head}const cache = new Map() +function Page() { + return
{cache.size}
+} +export const Route = createFileRoute('/')({ + loader: () => cache.get('x'), + component: Page, +}) +export default ${declaration} +`) + expect(Object.keys(modules)).toContain('shared') + await expectValidModules(modules) + }, + ) + + // Source: Next.js ssg/getStaticProps/issue-31855 and multi-declarator-export + it('are imported by the chunk when declared in one statement', async () => { + const { modules } = compileRouteModules(`${head}export const a = 1, + b = 2 +export const Route = createFileRoute('/')({ + component: () =>
{a + b}
, +}) +`) + expect(exportedNames(modules.reference!)).toEqual(['Route', 'a', 'b']) + const chunk = modules['virtual component']! + // From the route module, or from the shared module the route module + // re-exports them from. + expect( + [ + ...importedNames(chunk, 'route.tsx'), + ...importedNames(chunk, 'route.tsx?tsr-shared=1'), + ].sort(), + ).toEqual(['a', 'b']) + expect(chunk).not.toMatch(declarationOf('a')) + expect(chunk).not.toMatch(declarationOf('b')) + await expectValidModules(modules) + }) + + it('keep module-level re-exports in the reference module', async () => { + const { modules } = compileRouteModules(`${head}export * from './lib' +export * as lib from './lib' +export {} +const cache = new Map() +export const Route = createFileRoute('/')({ + loader: () => cache.size, + component: () =>
{cache.size}
, +}) +`) + expect(modules.reference).toMatch(/export \* from ['"]\.\/lib['"]/) + expect(modules.reference).toMatch(/export \* as lib from ['"]\.\/lib['"]/) + await expectValidModules(modules) + }) +}) + +describe('TypeScript-only syntax', () => { + it('erases type-only imports and exports from the split modules', async () => { + const { modules } = + compileRouteModules(`${head}import type { User } from './types' +import { type Settings, defaults } from './settings' +export type * from './types' +export type { User } +const current: User | Settings = defaults +export const Route = createFileRoute('/')({ + loader: () => current, + component: () =>
{String(current)}
, +}) +`) + expect(importedNames(modules['virtual component']!, './types')).toEqual([]) + expect(importedNames(modules.shared!, './types')).toEqual([]) + expect(importedNames(modules.shared!, './settings')).toEqual(['defaults']) + await expectValidModules(modules) + }) + + // Ambient declarations (`declare ...`) have no runtime binding: the + // environment provides the value (a ', + 'entry.js': "import './root.css'; import('./component.js')", + 'component.js': + "import './component.module.css'; import './unused.css?inline'", + 'root.css': '@import "./base.css"; .root { color: red; }', + 'base.css': '.base { --base-marker: 1; }', + 'component.module.css': '.component { --component-marker: 1; }', + 'unused.css': '.unused { --unused-marker: 1; }', + }).map(([file, code]) => writeFile(path.join(root, file), code)), + ) + let snapshot: ReturnType | undefined + const completed = Promise.withResolvers() + const server = await createServer({ + root, + configFile: false, + logLevel: 'silent', + experimental: { bundledDev: true }, + build: { rolldownOptions: { experimental: { devMode: { lazy: false } } } }, + optimizeDeps: { noDiscovery: true }, + server: { port: 0 }, + plugins: [ + { + name: 'capture-completed-styles', + generateBundle() { + // Rolldown module ids use forward slashes, also on Windows. + if (!this.getModuleInfo(normalizePath(path.join(root, 'entry.js')))) { + return + } + snapshot = captureBundledDevStyles(this, root) + completed.resolve() + }, + }, + ], + }) + try { + await server.listen() + const address = server.httpServer!.address() + if (!address || typeof address === 'string') { + throw new Error('Expected the dev server to listen on a TCP port') + } + await fetch(`http://localhost:${address.port}/`) + await completed.promise + const css = collectBundledDevStyles(snapshot, [path.join(root, 'entry.js')]) + expect(css).toContain('/* /root.css */') + expect(css).toContain('/* /component.module.css */') + expect(css?.match(/--base-marker/g)).toHaveLength(1) + expect(css).toContain('--component-marker') + expect(css).not.toContain('--unused-marker') + expect(css!.indexOf('/* /root.css */')).toBeLessThan( + css!.indexOf('/* /component.module.css */'), + ) + expect( + collectBundledDevStyles(snapshot, [path.join(root, 'unknown.js')]), + ).toBeUndefined() + } finally { + await server.close() + await rm(root, { recursive: true, force: true }) + } +}, 20_000) diff --git a/packages/start-plugin-core/tests/vite/dev-styles.test.ts b/packages/start-plugin-core/tests/vite/dev-styles.test.ts new file mode 100644 index 0000000000..da355b74c2 --- /dev/null +++ b/packages/start-plugin-core/tests/vite/dev-styles.test.ts @@ -0,0 +1,644 @@ +import { describe, expect, test } from 'vitest' +import { + collectDevStyles, + fetchCssFromModule, +} from '../../src/vite/dev-server-plugin/dev-styles' +import type { EnvironmentModuleNode } from 'vite' + +function createCssNode(url: string, css: string): EnvironmentModuleNode { + return { + url, + file: `/app${url}`, + importedModules: new Set(), + transformResult: { + code: `const __vite__css = ${JSON.stringify(css)}`, + }, + } as EnvironmentModuleNode +} + +function createEntryNode( + url: string, + depUrl: string | Array, +): EnvironmentModuleNode { + return { + url, + file: `/app${url}`, + importedModules: new Set(), + transformResult: { + deps: Array.isArray(depUrl) ? depUrl : [depUrl], + }, + } as EnvironmentModuleNode +} + +describe('collectDevStyles', () => { + test('recognizes virtual Vue style blocks by URL', async () => { + const styleUrl = '/src/App.vue?vue&type=style&index=0&lang.css' + const entry = createEntryNode('/src/entry.tsx', styleUrl) + const vueStyle = createCssNode(styleUrl, '.vue-style {}') + vueStyle.file = '/app/src/App.vue' + const importedCss = createCssNode('/src/imported.css', '.imported {}') + vueStyle.transformResult!.deps = [importedCss.url] + vueStyle.importedModules.add(importedCss) + const modules = new Map( + [entry, vueStyle, importedCss].map((node) => [node.url, node]), + ) + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(environment, url), + }) + + expect(css).toContain(`/* ${styleUrl} */`) + expect(css).toContain('.vue-style {}') + expect(css).not.toContain('/* /src/imported.css */') + }) + + test('does not traverse dependencies of CSS files', async () => { + const entry = createEntryNode('/src/entry.tsx', '/src/importer.css') + const importerCss = createCssNode( + '/src/importer.css', + '.dep-imported {}\n.module-imported {}\n.importer {}', + ) + const depImportedCss = createCssNode( + '/src/dep-imported.css', + '.dep-imported {}', + ) + const moduleImportedCss = createCssNode( + '/src/module-imported.css', + '.module-imported {}', + ) + importerCss.transformResult!.deps = [depImportedCss.url] + importerCss.importedModules.add(moduleImportedCss) + const modules = new Map( + [entry, importerCss, depImportedCss, moduleImportedCss].map((node) => [ + node.url, + node, + ]), + ) + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(environment, url), + }) + + expect(css).toContain('/* /src/importer.css */') + expect(css).not.toContain('/* /src/dep-imported.css */') + expect(css).not.toContain('/* /src/module-imported.css */') + }) + + test('loads CSS modules from the client environment', async () => { + const serverEntry = createEntryNode( + '/src/entry.tsx', + '/src/route.module.css', + ) + const serverCssModule = createCssNode( + '/src/route.module.css', + '.server-transform {}', + ) + const clientCssModule = createCssNode( + '/src/route.module.css', + '.client-transform {}', + ) + const serverModules = new Map( + [serverEntry, serverCssModule].map((node) => [node.url, node]), + ) + const clientModules = new Map([[clientCssModule.url, clientCssModule]]) + const serverEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return serverModules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + const clientEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return clientModules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(clientEnvironment, url), + }) + + expect(css).toContain('.client-transform {}') + expect(css).not.toContain('.server-transform {}') + }) + + test('traverses code-split modules that are only in importedModules', async () => { + const entry = createEntryNode('/src/entry.tsx', []) + const splitModule = createEntryNode( + '/src/entry.tsx?tsr-split=component', + '/src/code-split.css', + ) + const splitCss = createCssNode('/src/code-split.css', '.code-split {}') + entry.importedModules.add(splitModule) + const modules = new Map( + [entry, splitModule, splitCss].map((node) => [node.url, node]), + ) + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(environment, url), + }) + + expect(css).toContain('/* /src/code-split.css */') + expect(css?.match(/\.code-split \{\}/g)).toHaveLength(1) + }) + + test('preserves entry order when graph lookups finish out of order', async () => { + const rootEntry = createEntryNode('/src/root.tsx', '/src/root.css') + const routeEntry = createEntryNode('/src/route.tsx', '/src/route.css') + const rootCss = createCssNode('/src/root.css', '.root {}') + const routeCss = createCssNode('/src/route.css', '.route {}') + + const modules = new Map( + [rootEntry, routeEntry, rootCss, routeCss].map((node) => [ + node.url, + node, + ]), + ) + const moduleGraph = { + async getModuleByUrl(url: string) { + if (url === rootEntry.url) { + await new Promise((resolve) => setTimeout(resolve, 20)) + } + return modules.get(url) + }, + } + const environment = { + moduleGraph, + async transformRequest() { + return null + }, + } + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/root.tsx', '/app/src/route.tsx'], + loadCssContents: (url) => fetchCssFromModule(environment, url), + }) + + expect(css).toBeDefined() + expect(css!.indexOf('/* /src/root.css */')).toBeLessThan( + css!.indexOf('/* /src/route.css */'), + ) + }) + + test('preserves dependency order while resolving dependencies in parallel', async () => { + const entry = createEntryNode('/src/entry.tsx', [ + '/src/first.css', + '/src/second.css', + ]) + const firstCss = createCssNode('/src/first.css', '.first {}') + const secondCss = createCssNode('/src/second.css', '.second {}') + const modules = new Map( + [entry, firstCss, secondCss].map((node) => [node.url, node]), + ) + + let firstLookupFinished = false + let secondStartedBeforeFirstFinished = false + const moduleGraph = { + async getModuleByUrl(url: string) { + if (url === firstCss.url && !firstLookupFinished) { + await new Promise((resolve) => setTimeout(resolve, 20)) + firstLookupFinished = true + } + if (url === secondCss.url && !firstLookupFinished) { + secondStartedBeforeFirstFinished = true + } + return modules.get(url) + }, + } + const environment = { + moduleGraph, + async transformRequest() { + return null + }, + } + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(environment, url), + }) + + expect(secondStartedBeforeFirstFinished).toBe(true) + expect(css).toContain('/* /src/first.css */') + expect(css).toContain('/* /src/second.css */') + expect(css!.indexOf('/* /src/first.css */')).toBeLessThan( + css!.indexOf('/* /src/second.css */'), + ) + }) + + test('preserves CSS order while loading regular and module CSS in parallel', async () => { + const entry = createEntryNode('/src/entry.tsx', [ + '/src/root.css', + '/src/route.module.css', + ]) + const rootCss = createCssNode('/src/root.css', '') + const routeCss = createCssNode('/src/route.module.css', '') + const modules = new Map( + [entry, rootCss, routeCss].map((node) => [node.url, node]), + ) + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + let rootFinished = false + let routeStartedBeforeRootFinished = false + + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: async (url) => { + if (url === rootCss.url) { + await new Promise((resolve) => setTimeout(resolve, 20)) + rootFinished = true + return '.root {}' + } + if (!rootFinished) { + routeStartedBeforeRootFinished = true + } + return '.route {}' + }, + }) + + expect(routeStartedBeforeRootFinished).toBe(true) + expect(css!.indexOf('/* /src/root.css */')).toBeLessThan( + css!.indexOf('/* /src/route.module.css */'), + ) + }) + + test('handles cycles and coalesces shared dependency lookups', async () => { + const firstEntry = createEntryNode('/src/first.tsx', [ + '/src/first.css', + 'external-package', + '/src/shared.css', + ]) + const secondEntry = createEntryNode('/src/second.tsx', [ + '/src/second.css', + 'external-package', + '/src/shared.css', + ]) + const firstCss = createCssNode('/src/first.css', '.first {}') + const secondCss = createCssNode('/src/second.css', '.second {}') + const sharedCss = createCssNode('/src/shared.css', '.shared {}') + firstEntry.importedModules.add(secondEntry) + secondEntry.importedModules.add(firstEntry) + const modules = new Map( + [firstEntry, secondEntry, firstCss, secondCss, sharedCss].map((node) => [ + node.url, + node, + ]), + ) + const lookupCounts = new Map() + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + lookupCounts.set(url, (lookupCounts.get(url) ?? 0) + 1) + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/first.tsx', '/app/src/second.tsx'], + loadCssContents: async (url) => `.${url.split('/').at(-1)} {}`, + }) + + expect(lookupCounts.get('external-package')).toBe(1) + expect(lookupCounts.get('/src/shared.css')).toBe(1) + expect(css?.match(/\/\* \/src\/shared\.css \*\//g)).toHaveLength(1) + expect(css!.indexOf('/* /src/first.css */')).toBeLessThan( + css!.indexOf('/* /src/shared.css */'), + ) + expect(css!.indexOf('/* /src/shared.css */')).toBeLessThan( + css!.indexOf('/* /src/second.css */'), + ) + }) + + test('refreshes the graph and client CSS after invalidation', async () => { + const entry = createEntryNode('/src/entry.tsx', '/src/old.css') + const oldServerCss = createCssNode('/src/old.css', '') + const newServerCss = createCssNode('/src/new.css', '') + const oldClientCss = createCssNode('/src/old.css', '.old {}') + const newClientCss = createCssNode('/src/new.css', '.new {}') + const newClientTransform = newClientCss.transformResult! + newClientCss.transformResult = null + + const serverModules = new Map( + [entry, oldServerCss, newServerCss].map((node) => [node.url, node]), + ) + const clientModules = new Map( + [oldClientCss, newClientCss].map((node) => [node.url, node]), + ) + const serverEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return serverModules.get(url) + }, + }, + async transformRequest(url: string) { + if (url === entry.url) { + entry.transformResult = { + code: '', + map: null, + deps: [newServerCss.url], + } + } + return entry.transformResult + }, + } + const clientEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return clientModules.get(url) + }, + }, + async transformRequest(url: string) { + if (url === newClientCss.url) { + newClientCss.transformResult = newClientTransform + return newClientTransform + } + return null + }, + } + const options = { + serverEnvironment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url: string) => + fetchCssFromModule(clientEnvironment, url), + } + + const initialCss = await collectDevStyles(options) + entry.transformResult = null + const invalidatedCss = await collectDevStyles(options) + + expect(initialCss).toContain('.old {}') + expect(invalidatedCss).toContain('.new {}') + expect(invalidatedCss).not.toContain('.old {}') + }) + + test('refreshes cached CSS when the same URL is invalidated', async () => { + const entry = createEntryNode('/src/entry.tsx', '/src/route.css') + const serverCss = createCssNode('/src/route.css', '') + const clientCss = createCssNode('/src/route.css', '.old {}') + const serverModules = new Map( + [entry, serverCss].map((node) => [node.url, node]), + ) + const clientModules = new Map([[clientCss.url, clientCss]]) + const newTransform = { + code: `const __vite__css = ${JSON.stringify('.new {}')}`, + map: null, + } + const serverEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return serverModules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + const clientEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return clientModules.get(url) + }, + }, + async transformRequest(url: string) { + if (url === clientCss.url) { + clientCss.transformResult = newTransform + return newTransform + } + return null + }, + } + const options = { + serverEnvironment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url: string) => + fetchCssFromModule(clientEnvironment, url), + } + + const initialCss = await collectDevStyles(options) + clientCss.transformResult = null + const invalidatedCss = await collectDevStyles(options) + + expect(initialCss).toContain('.old {}') + expect(invalidatedCss).toContain('.new {}') + expect(invalidatedCss).not.toContain('.old {}') + }) + + test('snapshots importedModules before awaiting dependency lookups', async () => { + const entry = createEntryNode('/src/entry.tsx', 'slow-dependency') + const initialCss = createCssNode('/src/initial.css', '.initial {}') + const lateCss = createCssNode('/src/late.css', '.late {}') + entry.importedModules.add(initialCss) + const modules = new Map( + [entry, initialCss, lateCss].map((node) => [node.url, node]), + ) + let notifyLookupStarted!: () => void + let finishLookup!: () => void + const lookupStarted = new Promise((resolve) => { + notifyLookupStarted = resolve + }) + const lookupCanFinish = new Promise((resolve) => { + finishLookup = resolve + }) + const environment = { + moduleGraph: { + async getModuleByUrl(url: string) { + if (url === 'slow-dependency') { + notifyLookupStarted() + await lookupCanFinish + } + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + const options = { + serverEnvironment: environment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url: string) => fetchCssFromModule(environment, url), + } + + const inFlightCollection = collectDevStyles(options) + await lookupStarted + entry.importedModules.add(lateCss) + finishLookup() + const inFlightCss = await inFlightCollection + const nextCss = await collectDevStyles(options) + + expect(inFlightCss).toContain('.initial {}') + expect(inFlightCss).not.toContain('.late {}') + expect(nextCss).toContain('.late {}') + }) + + test('keeps other styles when a CSS transform fails', async () => { + const entry = createEntryNode('/src/entry.tsx', [ + '/src/good.css', + '/src/partial.scss', + ]) + const goodServerCss = createCssNode('/src/good.css', '') + const partialServerCss = createCssNode('/src/partial.scss', '') + const goodClientCss = createCssNode('/src/good.css', '.good {}') + const partialClientCss = createCssNode('/src/partial.scss', '') + partialClientCss.transformResult = null + const serverModules = new Map( + [entry, goodServerCss, partialServerCss].map((node) => [node.url, node]), + ) + const clientModules = new Map( + [goodClientCss, partialClientCss].map((node) => [node.url, node]), + ) + const serverEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return serverModules.get(url) + }, + }, + async transformRequest() { + return null + }, + } + const clientEnvironment = { + moduleGraph: { + async getModuleByUrl(url: string) { + return clientModules.get(url) + }, + }, + async transformRequest(url: string) { + if (url === partialClientCss.url) { + throw new Error('Sass partial cannot compile in isolation') + } + return null + }, + } + + const css = await collectDevStyles({ + serverEnvironment, + rootDirectory: '/app', + entries: ['/app/src/entry.tsx'], + loadCssContents: (url) => fetchCssFromModule(clientEnvironment, url), + }) + + expect(css).toContain('.good {}') + expect(css).not.toContain('partial.scss') + }) + + test('does not traverse modules that exist only in the client graph', async () => { + const ssrRoot = createEntryNode('/src/root.tsx', '/src/root.css') + const ssrRootCss = createCssNode('/src/root.css', '') + const ssrModules = new Map( + [ssrRoot, ssrRootCss].map((node) => [node.url, node]), + ) + + const clientRoot = createEntryNode('/src/root.tsx', '/src/root.css') + const clientRootCss = createCssNode('/src/root.css', '.root {}') + const clientOnlyModule = createEntryNode( + '/src/client-only.ts', + '/src/client-only.css', + ) + const clientOnlyCss = createCssNode( + '/src/client-only.css', + '.client-only {}', + ) + clientRoot.importedModules.add(clientOnlyModule) + const clientModules = new Map( + [clientRoot, clientRootCss, clientOnlyModule, clientOnlyCss].map( + (node) => [node.url, node], + ), + ) + + const createEnvironment = ( + modules: Map, + ) => ({ + moduleGraph: { + async getModuleByUrl(url: string) { + return modules.get(url) + }, + }, + async transformRequest() { + return null + }, + }) + const clientEnvironment = createEnvironment(clientModules) + const ssrEnvironment = createEnvironment(ssrModules) + + const css = await collectDevStyles({ + serverEnvironment: ssrEnvironment, + rootDirectory: '/app', + entries: ['/app/src/root.tsx'], + loadCssContents: (url) => fetchCssFromModule(clientEnvironment, url), + }) + + expect(css).toContain('.root {}') + expect(css).not.toContain('.client-only {}') + }) +}) diff --git a/packages/start-plugin-core/vite.config.ts b/packages/start-plugin-core/vite.config.ts index 92ff5875ee..0b33045be3 100644 --- a/packages/start-plugin-core/vite.config.ts +++ b/packages/start-plugin-core/vite.config.ts @@ -1,13 +1,40 @@ -import { defineConfig, mergeConfig } from 'vitest/config' +import { configDefaults, defineConfig, mergeConfig } from 'vitest/config' import { tanstackViteConfig } from '@tanstack/vite-config' import packageJson from './package.json' +/** The build output (`dist`) of this package and `@tanstack/react-start`. */ +const builtStartPackages = + /\/packages\/(?:start-plugin-core|react-start)\/dist\// + const config = defineConfig({ test: { name: packageJson.name, dir: './tests', watch: false, - typecheck: { enabled: true }, + projects: [ + { + // `test:unit` + extends: true, + test: { + name: 'unit', + exclude: [...configDefaults.exclude, 'integration/**'], + typecheck: { enabled: true }, + }, + }, + { + // `test:integration`: real builds and dev servers of Start apps + // (`tests/integration/start-app.ts`), with the built Start packages. + // Node loads them, as it loads an installed package, so the plugin + // and the loaders Rspack loads from the same `dist` share one module + // instance. + extends: true, + test: { + name: 'integration', + include: ['integration/**/*.test.ts'], + server: { deps: { external: [builtStartPackages] } }, + }, + }, + ], }, }) @@ -19,9 +46,9 @@ export default mergeConfig( './src/index.ts', './src/utils.ts', './src/vite/index.ts', - './src/vite/client-compiler-plugin.ts', './src/rsbuild/index.ts', './src/rsbuild/types.ts', + './src/rsbuild/import-protection-loader.ts', './src/rsbuild/start-compiler-metadata-loader.ts', ], srcDir: './src', diff --git a/packages/start-server-core/AGENTS.md b/packages/start-server-core/AGENTS.md new file mode 100644 index 0000000000..af5046c332 --- /dev/null +++ b/packages/start-server-core/AGENTS.md @@ -0,0 +1,6 @@ +# Start server runtime + +- Keep request assets out of cached manifests. Assets may mutate in place between head and Scripts rendering; compose their current contents without caching solely by object identity. Asset transforms must preserve the base manifest; request-dependent transforms use `cache: false`. +- Middleware can replace or wrap an SSR response before its body is read. Preserve response ownership with the existing `SsrResponse` helpers: a returned response continues the owned body when it has the same body stream or the owned body is locked (a pipe, tee, or `Response` copy that reads it). Dispose only unread abandoned bodies, and consume/cancel unused clone or tee branches. Rendering completion, serialization completion, and request cleanup are separate lifecycles; read [`../router-core/src/ssr/STREAMING.md`](../router-core/src/ssr/STREAMING.md) before changing them. +- Merge client-sent context with `safeObjectMerge`, placing trusted server middleware context last. Preserve this precedence for JSON, GET, FormData, and direct SSR calls; validate through the `server-functions-global-middleware` e2e suite. +- Changes to `src/frame-protocol.ts` must remain compatible with `../start-client-core/src/client-rpc/frame-decoder.ts`. Keep both packages' framing tests and relevant RawStream e2e coverage. diff --git a/packages/start-server-core/CHANGELOG.md b/packages/start-server-core/CHANGELOG.md index 18b68b4bb9..fe54531e58 100644 --- a/packages/start-server-core/CHANGELOG.md +++ b/packages/start-server-core/CHANGELOG.md @@ -1,5 +1,323 @@ # @tanstack/start-server-core +## 1.169.45 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + - @tanstack/start-client-core@1.170.39 + - @tanstack/start-storage-context@1.167.41 + +## 1.169.44 + +### Patch Changes + +- [#8212](https://github.com/TanStack/router/pull/8212) [`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031) - Render generated script preloads (`modulepreload`, or `preload as="script"` for IIFE output) with `fetchPriority="low"` and forward it into static Early Hints, so they no longer compete with render-blocking stylesheets, fonts and images. + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + - @tanstack/start-client-core@1.170.38 + - @tanstack/start-storage-context@1.167.40 + +## 1.169.43 + +### Patch Changes + +- [#8710](https://github.com/TanStack/router/pull/8710) [`71d9694`](https://github.com/TanStack/router/commit/71d9694da6346fbece2cda4ecde92b0b12a7ee08) - Update `fetchdts` to `^0.2.0`. The typed request and response header helpers keep the same header names and value types. + +## 1.169.42 + +### Patch Changes + +- [#8451](https://github.com/TanStack/router/pull/8451) [`740b0ce`](https://github.com/TanStack/router/commit/740b0ce17737d1f7398740136acdbeabe80df7d8) - Skip request middleware bookkeeping when no request middleware is configured, and stop copying serialization adapters when the router adds none. + + Server route handlers and route middleware now receive the router's decoded pathname, the same one used for route matching. Characters that would change how the path is read, such as `%2F`, `%3F`, and `%23`, stay encoded. + +- [#8441](https://github.com/TanStack/router/pull/8441) [`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82) - Reuse the parsed request location during SSR instead of repeating input rewrites. Match server routes against the app router's parsed pathname while preserving encoded pathnames for server handlers and middleware. + +- Updated dependencies [[`740b0ce`](https://github.com/TanStack/router/commit/740b0ce17737d1f7398740136acdbeabe80df7d8), [`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/start-storage-context@1.167.39 + - @tanstack/router-core@1.171.37 + - @tanstack/start-client-core@1.170.37 + +## 1.169.41 + +### Patch Changes + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Return 400 Bad Request for malformed percent-encoded request pathnames before running server entry callbacks. Preserve valid encoded paths and query handling. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Reduce request middleware overhead, reuse loaded entries and transport header requirements, and avoid unnecessary URL normalization for server functions. Preserve response helper writes made during body cancellation and SSR cleanup. + + Avoid allocating absent middleware headers and reply context, and construct RPC redirects with their final response state. Preserve middleware accessor evaluation and the documented undefined value for absent `sendContext`. + + Reduce synchronous server-function response overhead while preserving cancellation cleanup and middleware response mutations. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Keep streaming a page when request middleware returns a response that reads the page body, such as a copy made through a wrapped global `Response`, a copy in Bun, or a body piped through a transform. Start now disposes a replaced page stream only when nothing reads it. `transferResponseBodyOwnership` is removed: return the derived response directly. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Let request middleware read the body of a `HEAD` response, and strip it when the response leaves the pipeline. Start no longer applies `Content-Encoding`, `Content-Length`, or other framing headers set through response helpers to error bodies and serialized server-function replies that it builds itself. A response that middleware assigns to `result.response` is now disposed when the middleware returns another response. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Remove the built-in `useSession` API. Applications choose a session library, such as iron-session, and save or destroy sessions explicitly before returning or redirecting. Connect a cookie adapter through `getCookie` and `setCookie`, or append serialized cookies with `appendResponseHeader('set-cookie', cookie)`. Existing session cookies require a deliberate migration or signing in again with a new cookie name. + + `createServerEntry` keeps the complete callback, including custom error handling, inside the request context and converts errors that escape it. The built-in entry still converts errors automatically. Raw `createStartHandler` handlers now rethrow the original error. For custom reporting, catch inside `createServerEntry`, then rethrow for default conversion or return `handleStartError(error)` to preserve response-helper status, headers, and cookies. Return an explicit `Response` when choosing a custom error payload. + + Response helpers now apply consistently across server routes, SSR, server functions, redirects, errors, and middleware response replacements. Helper setters override returned values; cookie helpers preserve independent cookies and replace matching cookie identities. Use `appendResponseHeader('set-cookie', cookie)` when adding a serialized cookie without replacing other cookies. Changed responses receive copied headers and reuse the body stream, so applications should inspect the response returned by Start rather than relying on mutation of the original response. + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`550f478`](https://github.com/TanStack/router/commit/550f47881070c0558a87e1acce7f38fbc85b9549), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + - @tanstack/start-storage-context@1.167.38 + - @tanstack/start-client-core@1.170.36 + +## 1.169.40 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/history@1.162.5 + - @tanstack/router-core@1.171.35 + - @tanstack/start-client-core@1.170.35 + - @tanstack/start-storage-context@1.167.37 + +## 1.169.39 + +### Patch Changes + +- [#8573](https://github.com/TanStack/router/pull/8573) [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb) - Align server function request and response handling. + +- Updated dependencies [[`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/router-core@1.171.34 + - @tanstack/start-client-core@1.170.34 + - @tanstack/start-storage-context@1.167.36 + +## 1.169.38 + +### Patch Changes + +- [#8297](https://github.com/TanStack/router/pull/8297) [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f) - Update `seroval` and `seroval-plugins` from 1.6.2 to 1.6.7. This picks up the typed array length guard, the `maxBase64Length` and `compactArrayBufferViews` options, and the `isStream` export. + +- [#8434](https://github.com/TanStack/router/pull/8434) [`e81845f`](https://github.com/TanStack/router/commit/e81845ff1e4fc66d4e4a87f086be65906f7adb94) - Apply route path parameter parsers, including parent-route parsers, before invoking server route handlers so runtime parameters agree with their inferred types. + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2), [`76a7c0b`](https://github.com/TanStack/router/commit/76a7c0bfadb42d5f7fe7b9e1748acc7333178c91)]: + - @tanstack/router-core@1.171.33 + - @tanstack/start-client-core@1.170.33 + - @tanstack/start-storage-context@1.167.35 + +## 1.169.37 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + - @tanstack/start-client-core@1.170.32 + - @tanstack/start-storage-context@1.167.34 + +## 1.169.36 + +### Patch Changes + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + - @tanstack/start-client-core@1.170.31 + - @tanstack/start-storage-context@1.167.33 + +## 1.169.35 + +### Patch Changes + +- [#8354](https://github.com/TanStack/router/pull/8354) [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244) - Use lightweight request history for SSR and make server navigation a no-op. Use redirect() to issue HTTP redirects. Server hrefs use the same normalization as browser history to handle protocol-relative URLs and control characters. + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`8fff7fa`](https://github.com/TanStack/router/commit/8fff7fa1f2e6f061916b0bf5e0ec486b2e732f94), [`f021f6d`](https://github.com/TanStack/router/commit/f021f6d1c6dce6c9b54d70766f1d636d8fd9e184), [`ae68535`](https://github.com/TanStack/router/commit/ae68535929043607d4ee9438f8ae401f3a064862), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/history@1.162.4 + - @tanstack/start-client-core@1.170.30 + - @tanstack/start-storage-context@1.167.32 + +## 1.169.34 + +### Patch Changes + +- [#8340](https://github.com/TanStack/router/pull/8340) [`d914b08`](https://github.com/TanStack/router/commit/d914b085bb4bf29ec18a531201e377c10681b661) - Fix `setResponseHeaders` to iterate `Headers` entries, replace existing values, and preserve separate `Set-Cookie` values. + +## 1.169.33 + +### Patch Changes + +- [#8308](https://github.com/TanStack/router/pull/8308) [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8) - Validate navigation and redirect destinations, keep ambiguous relative URLs on the current origin, and constrain prerender requests and output paths. Prevent redirect headers from appearing in serialized server function response bodies. + + Preserve native form HTTP redirects, route error handling and masks for document redirects, and per-navigation destinations for shared loader redirects. Avoid redundant origin parsing and reduce link styling and server-rendering work. Configured origins must already be normalized. + + Keep blocked-link inactive props consistent during React hydration, honor explicit redirect Location headers before checking route options, and refresh Vue link state when destinations become internal. Reuse the protocol-relative URL check while parsing redirect schemes once. + + Reduce React link bundle size by sharing pathname comparisons, state-prop selection, and element creation. + + Share normalized pathname comparisons in Solid and Vue links to reduce bundle size. + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/history@1.162.3 + - @tanstack/start-client-core@1.170.29 + - @tanstack/start-storage-context@1.167.31 + +## 1.169.32 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`9035abc`](https://github.com/TanStack/router/commit/9035abc41163d83409ef582f7743a3c7be57dd93), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/history@1.162.2 + - @tanstack/start-client-core@1.170.28 + - @tanstack/start-storage-context@1.167.30 + +## 1.169.31 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + - @tanstack/start-client-core@1.170.27 + - @tanstack/start-storage-context@1.167.29 + +## 1.169.30 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + - @tanstack/start-client-core@1.170.26 + - @tanstack/start-storage-context@1.167.28 + +## 1.169.29 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + - @tanstack/start-client-core@1.170.25 + - @tanstack/start-storage-context@1.167.27 + +## 1.169.28 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + - @tanstack/start-client-core@1.170.24 + - @tanstack/start-storage-context@1.167.26 + +## 1.169.27 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/router-core@1.171.23 + - @tanstack/start-client-core@1.170.23 + - @tanstack/start-storage-context@1.167.25 + +## 1.169.26 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13)]: + - @tanstack/router-core@1.171.22 + - @tanstack/start-client-core@1.170.22 + - @tanstack/start-storage-context@1.167.24 + +## 1.169.25 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + - @tanstack/start-client-core@1.170.21 + - @tanstack/start-storage-context@1.167.23 + +## 1.169.24 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`c59788c`](https://github.com/TanStack/router/commit/c59788ca20f2d2e7f264a859ebe01b7646ba3154), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + - @tanstack/start-client-core@1.170.20 + - @tanstack/start-storage-context@1.167.22 + +## 1.169.23 + +### Patch Changes + +- Updated dependencies [[`2fbc99f`](https://github.com/TanStack/router/commit/2fbc99f2c262b057cb957e6ebba1ee073c655186), [`6bede65`](https://github.com/TanStack/router/commit/6bede65d7074dcd83455151b66b4574268bc782c)]: + - @tanstack/start-client-core@1.170.19 + +## 1.169.22 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + - @tanstack/start-client-core@1.170.18 + - @tanstack/start-storage-context@1.167.21 + +## 1.169.21 + +### Patch Changes + +- [#7967](https://github.com/TanStack/router/pull/7967) [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c) - Preserve path params in their raw string form while matching routes so structured values returned by `params.parse` produce stable match IDs and do not reuse stale loader data. + + `RouterCore.getMatchedRoutes()` now returns `[matchedRoutes, rawParams, foundRoute]` instead of an object. + +- Updated dependencies [[`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/router-core@1.171.18 + - @tanstack/start-client-core@1.170.17 + - @tanstack/history@1.162.1 + - @tanstack/start-storage-context@1.167.20 + +## 1.169.20 + +### Patch Changes + +- [#7962](https://github.com/TanStack/router/pull/7962) [`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5) - Update Seroval dependencies to version 1.6.2. + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + - @tanstack/start-client-core@1.170.16 + - @tanstack/start-storage-context@1.167.19 + +## 1.169.19 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/start-client-core@1.170.15 + - @tanstack/start-storage-context@1.167.18 + +## 1.169.18 + +### Patch Changes + +- [#7944](https://github.com/TanStack/router/pull/7944) [`65f7b7f`](https://github.com/TanStack/router/commit/65f7b7f791272f2ea581a1fe0fcd43183bc01162) - Use focused server entrypoints for shared constants and handler helpers so build tooling and framework renderers do not traverse the full Start server barrel. + ## 1.169.17 ### Patch Changes diff --git a/packages/start-server-core/INTERNALS.md b/packages/start-server-core/INTERNALS.md new file mode 100644 index 0000000000..b2ac36ce80 --- /dev/null +++ b/packages/start-server-core/INTERNALS.md @@ -0,0 +1,77 @@ +# Start server response ownership + +This document describes how Start tracks response bodies while server middleware runs. + +## Two ownership layers + +Response body ownership tells Start which body belongs to the current middleware result. + +Router SSR ownership tells Router when it can release request data, serialization state, readers, timers, and renderer work. + +An internal `SsrResponse` value carries Router SSR cleanup data beside a `Response`. Start stores that data while middleware sees the ordinary `Response`. + +Each request must use a separate router instance. Sharing one router between requests is unsupported. + +## Middleware transfers + +Start keeps one ownership record for the current response body. A response without a body does not need an ownership record. + +Ownership moves to the response that middleware returns in these cases: + +- Middleware returns the same `Response` object. +- Middleware returns another `Response` with the same body object. +- Middleware returns another `Response` with a body while the current body is locked. + +Web Streams do not expose the source of a different body. A lock is the only public sign that code reads the current body. A pipe or `tee()` locks it, and so does a `Response` constructor that copies a body by reading it, as in Bun or with a wrapped global `Response`. + +A lock does not prove stream ancestry: a reader can also stop early. Start cannot tell that reader from a pipe, so it never disposes a locked body when middleware replaces it. Such a stream ends with the request's abort or the SSR stream's lifetime limit. + +Only the same body object keeps the transport headers that Start protects for serialized server-function replies. A different body can carry different bytes. + +When Start rebuilds the current response to apply response helpers or restore protocol headers, the rebuilt response takes over the ownership record directly. Start does not compare bodies for its own rebuilds. + +## Replacement and disposal + +A response with an unrelated body replaces the current ownership record when nothing reads the current body. Start disposes the old record before it stores the replacement. + +For a Router SSR response, disposal releases Router SSR state and cancels the original SSR body. + +If ownership moved to a different body, disposal also cancels that final body. This cancellation propagates through a pipe. + +For a plain response, disposal cancels the current body. + +Body cancellation is best effort. Start does not await it, and a cancellation failure does not block Router cleanup. + +Cleanup paths can request disposal more than once. Router SSR cleanup and native stream cancellation have idempotent effects. + +Every internal `SsrResponse` disposer must also have idempotent effects. + +A result that settles after request cancellation is no longer usable. Start disposes that late result when it arrives. + +## Locks, clones, and branches + +Start checks the lock of the body that the current `Response` exposes when middleware returns a different response. + +Start cannot cancel a locked body through `body.cancel()`. The code that acquired the reader owns that reader and must cancel or release it. + +`Response.clone()` creates two body branches. It can also change the body object exposed by the original `Response`. Middleware should return the original response and read the clone. When middleware returns the clone, Start sees the original branch and continues the stream only while that branch is being read. + +Start reads the current response body during disposal. It keeps only the original SSR body for Router cleanup. + +Middleware owns every clone or `tee()` branch that it does not return. Middleware must consume or cancel each unused branch. + +## Final handoff + +Redirect conversion and `HEAD` handling dispose any body that they replace or remove. + +Before returning a Router SSR stream, Start checks request cancellation. Start disposes the stream immediately if the request is already aborted. + +Start binds later request cancellation to the disposer. While Router SSR state is live, SSR cleanup removes that listener. Otherwise the one-time listener ends with the request signal. + +The Router stream transform releases Router SSR state after natural completion, stream errors, or consumer cancellation. + +After handoff, the HTTP runtime owns consumption or cancellation of the returned body. + +If Start does not hand off Router SSR ownership, the request cleanup block releases any remaining Router SSR state. + +An abort can race with final handoff. Cleanup is idempotent. Either path can safely request cleanup. diff --git a/packages/start-server-core/docs/RECONCILIATION.md b/packages/start-server-core/docs/RECONCILIATION.md new file mode 100644 index 0000000000..3f3b49f88e --- /dev/null +++ b/packages/start-server-core/docs/RECONCILIATION.md @@ -0,0 +1,200 @@ +# Response Reconciliation + +This package owns request and response state for the TanStack Start server runtime. Applications choose their session library and connect it to Start's request and response cookie helpers. + +## Request State + +Every Start request runs inside a shared `AsyncLocalStorage` event. The event contains: + +- `request`: the original platform `Request` +- `requestUrl`: the parsed request URL, memoized so the framework parses each request URL only once +- `responseState`: lazily created mutable Start response state (`undefined` until the first helper write) +- `currentResponse`: the most recently reconciled response +- `responseHeaderAppends`: lazily created request-owned records of already-applied header appends + +The ALS instance is stored on a global symbol so separately bundled copies of this module share one request context. Helper state and append records belong to that invocation. Protocol protection describes the response body: its immutable snapshot is attached to Start-created responses through a non-enumerable global symbol. This protection follows the response through delegated requests, including cloned requests and separately bundled runtime copies. + +`createServerEntry` owns the scope around the complete entry callback, including custom error handling. Delegating through another wrapped entry or Start handler with the same `Request` object reuses that scope. A different `Request` object gets its own scope. + +Native helpers read directly from this event: + +- `getRequest` +- `getRequestHeaders` +- `getRequestHeader` +- `getRequestHost` +- `getRequestProtocol` +- `getRequestUrl` +- `getRequestIP` +- `getCookies` +- `getCookie` + +These helpers do not construct or read from an h3 event. + +## Response State + +Start response helpers mutate event-owned state, not `h3` state: + +- `setResponseStatus` +- `setResponseHeader` +- `setResponseHeaders` +- `appendResponseHeader` +- `removeResponseHeader` +- `clearResponseHeaders` +- `setCookie` +- `deleteCookie` + +Response state is created lazily on the first helper write. Requests that never call a response helper skip response-state allocation. Reconciliation still enforces bodyless response rules, and Start restores protocol headers when a server-function reply leaves the request middleware pipeline. + +`getResponseHeader` and `getResponseHeaders` read the current returned response plus helper overlay. Helper writes are visible immediately, even before a final `Response` exists. `getResponseHeaders()` returns a detached snapshot with a read-only TypeScript interface. Its `forEach` callback also receives that read-only interface. Casting the snapshot to `Headers` and mutating it does not change outgoing response state; outside production, `set`, `append`, and `delete` on the snapshot log a warning that lists the helpers to use instead. Use `setResponseHeader`, `setResponseHeaders`, `appendResponseHeader`, `removeResponseHeader`, or `clearResponseHeaders` for writes. Use `getSetCookie()` on the snapshot when all individual cookie values are needed. + +Internal code can use `getSerializedResponseState` to read the helper status and status text that apply to a serialized server-function reply. This is not public API and it is read-only; all writes go through the status/header/cookie helpers above. + +## Reconciliation Model + +Route handlers, middleware, SSR handlers, and server functions can all return `Response` objects. Start reconciles those responses with helper mutations before they cross each user middleware boundary. The request-scope wrapper only establishes or reuses the scope; it does not repeat reconciliation after the pipeline completes. Responses created outside the pipeline, including resolved redirects and server-function errors, are finalized at those creation points. + +When middleware replaces a body, or response status rules drop it, Start disposes the body before reading the helper state and recording applied appends. Synchronous cancellation and SSR cleanup callbacks can therefore contribute headers to the outgoing response. Eager router cleanup also finishes before final response publication. + +Reconciliation rules: + +- Helper state overlays returned `Response` state. +- Status and status text from `setResponseStatus` win over returned response status. +- Header replacement helpers win over returned response headers; append helpers retain the existing values. +- `removeResponseHeader` and `clearResponseHeaders` can remove headers from a returned response. +- Helper deltas survive when a later middleware replaces the response. +- Direct mutations to an old `response.headers` object do not survive response replacement. +- Direct mutations to the current response are visible while that response remains current. +- Reconciliation returns the original `Response` instance when its effective headers, status, status text, and body shape are unchanged. It still records which helper appends have been applied. +- If headers, status, or body shape change, reconciliation creates a new `Response` with copied headers and the same body stream, unless the body must be dropped. + +Reconciliation does not mutate a response supplied by application code, including a response reused across requests. It does not call `Response.clone()` or tee the body. The replacement becomes the body owner; application code must not also consume the original response's body. + +Router redirect responses keep their navigation options until Start resolves their destination and, for server-function RPC calls, creates the JSON redirect envelope. Generic response materialization runs after this step. While a redirect is pending, response getter helpers see the helper overlay, but direct reads of `result.response.headers` or `result.response.status` still see the unresolved redirect's own values. + +## Header Tracking + +Helper intent is recorded directly by the helper write functions: + +- `setResponseHeader`/`setResponseHeaders` record a helper write. +- `appendResponseHeader` records a helper write without replacing values. +- `removeResponseHeader` records a helper removal. +- `clearResponseHeaders()` records a full clear. + +This metadata matters because a plain `Headers` object cannot distinguish between "not set" and "explicitly removed". All response-state mutations flow through these module-level functions; the state object never escapes for direct mutation. + +For example, appending `Origin` to a response containing `Vary: Accept-Encoding` produces `Vary: Accept-Encoding, Origin`. Repeated reconciliation of that response does not repeat the append. A later append is applied once, and helper appends also apply when middleware replaces the response with a fresh response. + +An application-created response is a new explicit base. If middleware copies headers that already contain an applied helper append into a new response, that copied value is part of the new base and the helper append can appear again. Reuse the current response when it already contains the desired headers; returning a new response does not transfer Start's private append metadata. + +## Cookies + +Cookies use native `cookie-es` parsing and serialization. + +`setCookie` appends `Set-Cookie` values and dedupes by cookie identity: + +- name +- domain +- path + +If domain is absent, identity uses an empty domain. `setCookie` defaults to `Path=/`, but returned `Set-Cookie` headers without `Path` keep an empty path identity so they do not dedupe against explicit-path cookies. + +A `Set-Cookie` value that `cookie-es` cannot parse, for example one whose name is an `Object.prototype` key such as `constructor` or whose name and value exceed 4096 characters, is identified by its exact string. Only identical strings dedupe. + +Cookie behavior has two modes: + +- `setCookie`/`deleteCookie`/`appendResponseHeader('set-cookie', ...)`: merge with existing returned response cookies. +- `setResponseHeader('set-cookie', ...)`: replace returned response cookies. + +This preserves multiple `Set-Cookie` headers and lets explicit header APIs replace cookie state when requested. + +`appendResponseHeader('set-cookie', ...)` takes fully serialized cookie strings and merges them through the same identity dedupe as `setCookie`. It is the generic primitive for bridging external session/auth libraries that produce raw `Set-Cookie` strings. + +## Protected Transport Headers + +Server function protocol responses protect required header values and required absence: + +- Serialized JSON and framed results require their content type and `x-tss-serialized: true`, with `x-tss-raw` absent. +- Plain redirect and not-found JSON require JSON content type, with both incompatible transport markers absent. +- Explicit raw responses require `x-tss-raw: true`; their application content type is not protected. +- A non-redirect `Response` that a server function or its function middleware throws requires `x-tss-raw: thrown`, and the client rejects the call with it. Its application content type is not protected either. `fetch` follows a raw or thrown `Response` with a redirect status and `Location` before the client sees it, so navigation uses `redirect()`. + +Every serialized reply (JSON and framed results, errors, not-found envelopes, and RPC redirect envelopes) also requires `Location` to be absent, whether it comes from a helper, from error metadata, or from `notFound({ headers })`. The client decodes these replies from their body. Error replies always use an error status, but a helper can still select a 3xx status for other serialized replies, and an HTTP `Location` would then make fetch follow the redirect before the client decodes the reply. For redirect envelopes, the client reads the destination from the JSON `href`. Native form and document redirects still use `Location`. Helper status and status text control HTTP metadata, while the redirect's own `statusCode` remains in its Router navigation options. + +Other helper headers and cookies still reconcile onto server function responses. Replacing, removing, or clearing headers through the helpers cannot change protected protocol requirements. + +Middleware can also change protocol headers directly on `result.response`, including from a callback attached to the `next()` promise it returns. Start restores the protocol headers once, when the reply leaves the request middleware pipeline, so the client always receives them. Until then, outer middleware reading `result.response.headers` sees such a direct change, while `getResponseHeader` and `getResponseHeaders` always report the protocol values. Without request middleware, only Start has handled the reply, so nothing is checked. Start does not check at every middleware boundary because `Headers.get` validates each header name on every call, which made the check a measurable share of each server-function request. + +## Null Body Responses + +Reconciliation drops bodies for response shapes that cannot carry one: + +- `HEAD` requests +- status `204` +- status `205` +- status `304` + +Request middleware still sees the body of a `HEAD` response, so middleware that reads it to compute an `ETag` or `Content-Length` produces the same headers as for `GET`. Start strips a `HEAD` body once, when the response leaves the request middleware pipeline. + +`setResponseStatus` ignores codes that are not integers from `200` to `599`, such as informational `101`, `0`, or `NaN`, because Fetch responses cannot carry them. The call changes neither status nor status text: an earlier helper status, or otherwise the returned or error status, stays in effect, and Start logs a warning outside production. Call `setResponseStatus(undefined, text)` to set only the status text. + +Server-function replies that Start serializes are the exception. Their protected content type describes a body that the client must decode, so reconciliation never applies a helper-selected `204`, `205`, or `304` to them, together with that call's status text. Serialized errors ignore these statuses from error metadata too. Outside production, Start logs a warning, once per request, when it ignores such a status for a serialized reply. Serialized replies are recognized by the protocol requirements Start attaches to the `Response` it creates. Only a wrapper around the same body stream keeps those requirements. A clone, or a response rebuilt around a new body, is an ordinary response, so a bodyless helper status drops its body and its `Location` is not removed. A raw `Response` returned by a server function is not serialized and still follows the rules above. + +If a middleware sets one of these statuses after a streamed SSR response is produced, the middleware executor treats that as response replacement and disposes the original SSR stream owner. + +## Stream Ownership + +SSR streaming responses carry cleanup ownership metadata. Middleware reconciliation preserves or disposes that ownership based on the final body: + +- Same response: ownership is preserved. +- Wrapper response with the same body: ownership moves to the wrapper, and the wrapper keeps the protected transport headers of the body it wraps. Start recognizes such a wrapper by the identity of its body stream. A wrapper around a reply without a body has no stream to compare and is an ordinary replacement response without protocol protection. +- Response with a different body while the original body is being read: ownership moves to the new response, without protected transport headers. A pipe, `tee()`, or a `Response` constructor that copies a body by reading it locks the original body. This includes Bun, which gives a same-body wrapper a new stream object, and libraries that wrap the global `Response`. Start cannot tell such a reader from one that stops early, so a stream whose reader stops early ends with the request's abort or the SSR stream's lifetime limit. +- Different response while nothing reads the original body, or dropped body: original stream owner is disposed. +- Middleware error after `next()`: original stream owner is disposed. +- Response assigned to `result.response` and then replaced by a returned response: Start takes over the assigned response before the returned one, so a replacement disposes the assigned body, such as a transform piped from the original. +- Late result from an abandoned `next()`: a middleware can return its own response while its `next()` is still running, for example a timeout built with `Promise.race`. From then on, the result of that `next()` is abandoned, even while outer middleware is still running. It never replaces or cancels the response the middleware returned, and its body is disposed. Helper writes made by the abandoned work still apply, because helper state belongs to the request. + +This prevents cleanup leaks while still allowing middleware to wrap streamed responses without prematurely disposing the stream. + +A same-body wrapper does not copy helper append records: an application wrapper's headers remain a fresh base for helper writes. + +## Error Handling + +`createStartHandler` rethrows the original uncaught value, including primitive values. No error object is used as a key for recovering request state. Concurrent requests can throw the same error or reusable bodyless response without sharing helper state. A response body stream still has a single consumer. + +Built-in server entries use `createServerEntry` to keep the complete entry callback inside its request scope. The wrapper catches an uncaught value in that scope and calls `handleStartError`. A custom catch inside the wrapper can log and rethrow the error, return a custom response, or call `handleStartError(error)` to preserve Start's helper state. + +Server function RPC errors are converted before the top-level server-entry boundary so serialized protocol headers and bodies are preserved. Their body is the same `{ error }` envelope that a failed server-function call sends, so the client rethrows whatever value was thrown, including strings, plain objects, and `undefined`. A value that cannot be serialized is replaced by the serialization error, as for a result that cannot be serialized. A `Response` that request middleware throws during a server-function request is sent with `x-tss-raw: thrown`, and the client rejects the call with it. Throwing the reply that `next()` returned, or a wrapper around its body, re-sends that reply unchanged, because the body keeps the protocol that decodes it. + +Errors thrown inside a server-function handler or its function middleware do not reach these builders: the function returns them in its serialized result, which uses the helper status or `200` like any other result. A thrown non-redirect `Response` is sent raw instead, with its own status unless a helper selected one. Both error builders resolve status the same way. An error response only uses an error status (`400`-`599`). A status set with `setResponseStatus` before the error applies only when it is an error status. A success, redirect, or bodyless status such as `200`, `201`, `302`, or `204` describes the response that the failure replaced, so Start discards it together with its status text and uses the error's own status or `500`. Error metadata such as `error.status` or `error.statusCode` likewise applies only when it is `400` or higher. Start logs the error to the server console unless the error's own metadata marks it as an HTTP error with a status of `400` or higher, even when a helper selected the status. Because a discarded helper status no longer applies, later reconciliation and `getResponseStatus()` report the error status. + +Both error builders adopt HTTP-style metadata from the thrown value, or from `error.cause` when the error has no `headers`. Start builds a new JSON body for an error, so it never copies the framing and connection headers `Content-Length`, `Content-Encoding`, `Transfer-Encoding`, `Trailer`, `Connection`, `Keep-Alive`, `Proxy-Connection`, and `TE` from error metadata. It does not apply them from response helpers either, for example when a handler set the encoding and length of a file before reading it failed. The same holds for every serialized server-function reply, whose body Start also builds. When `error.cause` is a `Response`, such as a failed upstream `fetch` from any fetch implementation, Start uses its status and status text but none of its headers, because they were written for that upstream reply. + +`handleStartError` behavior: + +- Inside an active request scope, it uses that invocation's event for object, response, and primitive throws. +- If the error is a `Response`, it returns that response when no Start event exists. +- Otherwise it returns a generic JSON error response. + +Calling `handleStartError` after a raw handler has escaped its request scope cannot recover that request's state. Wrap the complete entry callback with `createServerEntry` instead. When rewriting or cloning a request, invoke a wrapped entry for that new `Request`, so errors are converted within its child scope. Calling a raw handler with the new request and catching only in the original request's scope cannot recover the child's helper writes. + +A response returned by a custom entry catch is used as-is. It does not automatically inherit helper state; call `handleStartError` when that inheritance is intended. Delegation through wrapped entries with the same request shares helper state, but each wrapped entry still converts uncaught errors. Invoke a raw `createStartHandler` function when an outer custom catch needs the original thrown value. + +## External sessions + +Start has no built-in session API, session cache, encryption engine, or direct h3 dependency. Session policy and persistence belong to the application's chosen library. + +Three integration boundaries are supported: + +- Libraries that read `Cookie` and emit serialized `Set-Cookie`: use `getRequestHeader('cookie')` and `appendResponseHeader('set-cookie', serializedCookie)`. +- Libraries with a cookie adapter, such as iron-session 9: supply `{ read: getCookie, write: setCookie }`. Load inside the request, then await `session.save()` before returning or redirecting. +- Libraries with a Fetch handler: return the library's `fetch(request)` response from a Start server route. Its response cookies participate in normal reconciliation. + +Use `appendResponseHeader` once for each serialized cookie. Preserve separate `Set-Cookie` values with `headers.getSetCookie()` when adapting a headers collection; commas in `Expires` are not cookie separators. `setResponseHeader('set-cookie', ...)` intentionally replaces the cookie collection and is inappropriate for adding an independent session cookie. + +Start does not auto-save session mutations, consume flash values, renew tokens, share multiple independently loaded session objects, or revoke server-side records. Read a session once per request and share that object through request middleware context when needed. Commit changes explicitly before a response is sent. Parallel requests still need the selected store's concurrency policy; request context does not serialize them. + +Removing the old APIs does not migrate existing sealed h3 cookies. Choose a fresh cookie name and require sign-in again, or implement and test an application-specific transition with the old library before removing it. See the authentication guide and the external-session fixture for concrete integrations. + +## Malformed URLs + +The request boundary validates `request.url` before creating its scope. A URL construction `TypeError` becomes `400 Bad Request`. Other errors are rethrown. diff --git a/packages/start-server-core/package.json b/packages/start-server-core/package.json index b25fd3ac95..020747da69 100644 --- a/packages/start-server-core/package.json +++ b/packages/start-server-core/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/start-server-core", - "version": "1.169.17", + "version": "1.169.45", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,17 +27,28 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit", "test:unit": "vitest", + "test:perf": "NODE_ENV=production vitest bench --config vitest.bench.config.ts", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, + "nx": { + "targets": { + "test:perf": { + "dependsOn": [ + "^build" + ], + "cache": false + } + } + }, "type": "module", "types": "dist/esm/index.d.ts", "exports": { @@ -65,6 +76,12 @@ "default": "./dist/esm/request-response.js" } }, + "./constants": { + "import": { + "types": "./dist/esm/constants.d.ts", + "default": "./dist/esm/constants.js" + } + }, "./virtual-modules": { "import": { "types": "./dist/esm/virtual-modules.d.ts", @@ -97,14 +114,20 @@ "@tanstack/router-core": "workspace:*", "@tanstack/start-client-core": "workspace:*", "@tanstack/start-storage-context": "workspace:*", - "fetchdts": "^0.1.6", - "h3-v2": "npm:h3@2.0.1-rc.20", - "seroval": "^1.5.4" + "cookie-es": "^3.0.0", + "fetchdts": "^0.2.0", + "seroval": "^1.6.7" }, "devDependencies": { "@standard-schema/spec": "^1.0.0", - "cookie-es": "^3.0.0", "vite": "*", - "@types/node": ">=20" + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:", + "iron-session": "9.0.1" } } diff --git a/packages/start-server-core/skills/_artifacts/domain_map.yaml b/packages/start-server-core/skills/_artifacts/domain_map.yaml index 1a6351bdea..7dc4d303ac 100644 --- a/packages/start-server-core/skills/_artifacts/domain_map.yaml +++ b/packages/start-server-core/skills/_artifacts/domain_map.yaml @@ -1,12 +1,12 @@ # domain_map.yaml # Library: @tanstack/start-server-core -# Version: 1.166.2 +# Version: 1.169.17 # Date: 2026-03-08 # Status: reviewed library: name: '@tanstack/start-server-core' - version: '1.166.2' + version: '1.169.17' repository: 'https://github.com/TanStack/router' description: >- Server-side runtime for TanStack Start: createStartHandler, @@ -62,4 +62,20 @@ skills: priority: MEDIUM status: active + - mistake: 'Capturing request or environment state at module scope' + mechanism: >- + Request context and edge runtime environment values are per-request. + Module-level capture can read undefined values or leak state between + concurrent requests. + priority: CRITICAL + status: active + + - mistake: 'Treating cookie session data as authoritative persistence' + mechanism: >- + Cookie sessions should contain a small stable identifier. Current + permissions and revocable state belong in an authoritative server + store and must be loaded for each protected request. + priority: HIGH + status: active + gaps: [] diff --git a/packages/start-server-core/skills/_artifacts/skill_spec.md b/packages/start-server-core/skills/_artifacts/skill_spec.md index 19270dc59a..402eb2c118 100644 --- a/packages/start-server-core/skills/_artifacts/skill_spec.md +++ b/packages/start-server-core/skills/_artifacts/skill_spec.md @@ -12,13 +12,15 @@ Server-side runtime for TanStack Start: createStartHandler, request/response uti | Skill | Type | Domain | What it covers | Failure modes | | ----------------- | ---- | -------------- | ---------------------------------------------------------------- | ------------- | -| start-server-core | core | server-runtime | createStartHandler, cookies, sessions, three-phase handling, ALS | 2 | +| start-server-core | core | server-runtime | createStartHandler, cookies, sessions, three-phase handling, ALS | 4 | ## Failure Mode Inventory -### start-server-core (2 failure modes) +### start-server-core (4 failure modes) -| # | Mistake | Priority | Source | -| --- | ---------------------------------------------- | -------- | ----------- | -| 1 | Missing AsyncLocalStorage setup | HIGH | source/docs | -| 2 | Incorrect handler export for deployment target | MEDIUM | source/docs | +| # | Mistake | Priority | Source | +| --- | --------------------------------------------------------- | -------- | ---------------------- | +| 1 | Missing AsyncLocalStorage setup | HIGH | source/docs | +| 2 | Incorrect handler export for deployment target | MEDIUM | source/docs | +| 3 | Capturing request or environment state at module scope | CRITICAL | protocol-v4 evaluation | +| 4 | Treating cookie session data as authoritative persistence | HIGH | protocol-v4 evaluation | diff --git a/packages/start-server-core/skills/_artifacts/skill_tree.yaml b/packages/start-server-core/skills/_artifacts/skill_tree.yaml index 6c792cf1bd..70125a39b6 100644 --- a/packages/start-server-core/skills/_artifacts/skill_tree.yaml +++ b/packages/start-server-core/skills/_artifacts/skill_tree.yaml @@ -1,6 +1,6 @@ library: name: '@tanstack/start-server-core' - version: '1.166.2' + version: '1.169.17' repository: 'https://github.com/TanStack/router' description: >- Server-side runtime for TanStack Start: createStartHandler, diff --git a/packages/start-server-core/skills/start-server-core/SKILL.md b/packages/start-server-core/skills/start-server-core/SKILL.md index 7dc16d517f..2e37e7b7ff 100644 --- a/packages/start-server-core/skills/start-server-core/SKILL.md +++ b/packages/start-server-core/skills/start-server-core/SKILL.md @@ -3,11 +3,12 @@ name: start-server-core description: >- Server-side runtime for TanStack Start: createStartHandler, request/response utilities (getRequest, setResponseHeader, - setCookie, getCookie, useSession), three-phase request handling, + setCookie, getCookie, appendResponseHeader), three-phase request handling, AsyncLocalStorage context. -type: core -library: tanstack-start -library_version: '1.166.2' +metadata: + type: core + library: tanstack-start + library_version: '1.169.17' sources: - TanStack/router:packages/start-server-core/src - TanStack/router:docs/start/framework/react/guide/server-entry-point.md @@ -15,11 +16,13 @@ sources: # Start Server Core (`@tanstack/start-server-core`) -Server-side runtime for TanStack Start. Provides the request handler, request/response utilities, cookie management, and session management. All utilities are available anywhere in the call stack during a request via AsyncLocalStorage. +Server-side runtime for TanStack Start. Provides the request handler, request/response utilities, cookie management, and integration primitives for external session libraries. All utilities are available anywhere in the call stack during a request via AsyncLocalStorage. > **CRITICAL**: These utilities are SERVER-ONLY. Import them from `@tanstack/-start/server`, not from the main entry point. They throw if called outside a server request context. > > **CRITICAL**: Types are FULLY INFERRED. Never cast, never annotate inferred values. +> +> **CRITICAL**: Read cookies, headers, request URLs, and runtime environment values inside the active request. Do not capture them at module scope; edge runtimes may inject them per request, and concurrent requests must never share request-derived state. ## `createStartHandler` @@ -89,6 +92,7 @@ import { getResponseHeaders, getResponseHeader, getResponseStatus, + appendResponseHeader, removeResponseHeader, clearResponseHeaders, } from '@tanstack/react-start/server' @@ -102,6 +106,14 @@ const serverFn = createServerFn({ method: 'POST' }).handler(async () => { }) ``` +`getResponseHeader` and `getResponseHeaders` are read helpers. Treat the `Headers` returned by `getResponseHeaders()` as a snapshot; mutating it does not change the outgoing response. Use the setter/removal helpers for writes. + +`appendResponseHeader(name, value)` appends without replacing existing values. For `set-cookie` it accepts fully serialized cookie strings and merges them by cookie identity (name + domain + path; a value `cookie-es` cannot parse is identified by its exact string) — the primitive for bridging external session/auth libraries: + +```ts +appendResponseHeader('set-cookie', await externalSessionLib.commit()) +``` + ## Cookie Management ```ts @@ -120,7 +132,8 @@ const serverFn = createServerFn({ method: 'POST' }).handler(async () => { setCookie('preference', 'dark', { httpOnly: true, - secure: true, + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', maxAge: 60 * 60 * 24 * 30, // 30 days path: '/', }) @@ -129,89 +142,62 @@ const serverFn = createServerFn({ method: 'POST' }).handler(async () => { }) ``` -## Session Management +## External Session Libraries -Encrypted sessions stored in cookies. Requires a password for encryption. +Start has no built-in session API. Use an external library and connect it to the active request using the cookie helpers, serialized headers, or a Fetch handler. + +For a cookie adapter, iron-session 9 accepts Start's cookie functions directly: ```ts -// Use @tanstack/-start for your framework (react, solid, vue) -import { createServerFn } from '@tanstack/react-start' -import { - useSession, - getSession, - updateSession, - clearSession, -} from '@tanstack/react-start/server' +import { getIronSession } from 'iron-session' +import { getCookie, setCookie } from '@tanstack/react-start/server' -const sessionConfig = { - password: process.env.SESSION_SECRET!, - name: 'my-app-session', - maxAge: 60 * 60 * 24 * 7, // 7 days +// This is an application helper, not a Start export. +export function getAppSession() { + const password = process.env.SESSION_SECRET + if (!password || password.length < 32) { + throw new Error('SESSION_SECRET must be at least 32 characters') + } + + return getIronSession<{ userId: string }>( + { read: getCookie, write: setCookie }, + { + cookieName: 'app-session', + password, + ttl: 7 * 24 * 60 * 60, + cookieOptions: { + httpOnly: true, + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + path: '/', + }, + }, + ) } -// Full session manager -const getUser = createServerFn({ method: 'GET' }).handler(async () => { - const session = await useSession<{ userId: string }>(sessionConfig) - return session.data -}) +// After validating credentials in a server function: +const session = await getAppSession() +session.userId = user.id +await session.save() -// Update session -const login = createServerFn({ method: 'POST' }) - .validator((data: { userId: string }) => data) - .handler(async ({ data }) => { - await updateSession(sessionConfig, { userId: data.userId }) - return { success: true } - }) - -// Clear session -const logout = createServerFn({ method: 'POST' }).handler(async () => { - await clearSession(sessionConfig) - return { success: true } -}) +// In a logout handler: +const logoutSession = await getAppSession() +logoutSession.destroy() ``` -### Session Config +Use `session.userId`, with an absent-user check, when reading. Keep one session object per operation, or pass it from middleware through request context. The adapter reads the incoming cookie; calling it again does not read pending response cookies. Await writes before returning or redirecting. Do not put a session object or request-derived configuration in module scope. -| Option | Type | Default | Description | -| ---------- | ------------------------ | ----------- | ----------------- | -| `password` | `string` | required | Encryption key | -| `name` | `string` | `'start'` | Cookie name | -| `maxAge` | `number` | `undefined` | Expiry in seconds | -| `cookie` | `false \| CookieOptions` | `undefined` | Cookie settings | +iron-session checks `ttl` when unsealing, and each save renews that lifetime. Choose and test expiration, rotation, and storage behavior explicitly. -### Session Manager Methods +For libraries that accept a Fetch `Request` and return a `Response`, pass the current request and return the library's response from a server route. For cookie-only transfer, append each value from `response.headers.getSetCookie()` separately; commas can occur inside an `Expires` attribute. Do not use `setResponseHeader('set-cookie', ...)` to append alongside unrelated cookies. -```ts -const session = await useSession<{ userId: string }>(config) +### Production Session Rules -session.id // Session ID (string | undefined) -session.data // Session data (typed) -await session.update({ userId: '123' }) // Persist session data -await session.clear() // Clear session data -``` - -## Query Validation - -Validate query string parameters using a Standard Schema: - -```ts -// Use @tanstack/-start for your framework (react, solid, vue) -import { getValidatedQuery } from '@tanstack/react-start/server' -import { z } from 'zod' - -const serverFn = createServerFn({ method: 'GET' }).handler(async () => { - const query = await getValidatedQuery( - z.object({ - page: z.coerce.number().default(1), - limit: z.coerce.number().default(20), - }), - ) - - return { page: query.page } -}) -``` - -> Note: `getValidatedQuery` accepts a Standard Schema validator, not a callback function. +- Keep credentials and session objects in server code; use a new object for each request. +- Load current account permissions from the authoritative store. A client route guard does not authorize a server function. +- Use server-side session records for immediate revocation, device tracking, or large data. Deleting a cookie does not invalidate copies of stateless credentials. +- Use `HttpOnly`, an appropriate `SameSite`, `Path=/`, and `Secure` on HTTPS deployments. Cookie flags complement CSRF protection. +- Test login, authenticated SSR and navigation, persistence before redirects, expiry, logout, and concurrent requests. Start handles request/response plumbing; the application and its session library own session semantics. ## How Request Handling Works @@ -247,16 +233,20 @@ const getAuth = createServerFn({ method: 'GET' }).handler(async () => { }) ``` -### 2. HIGH: Forgetting session password for most session operations +### 2. HIGH: Forgetting to persist an external session -`useSession`, `getSession`, `updateSession`, and `sealSession` all require a `password` field for encryption. Missing it throws at runtime. `clearSession` accepts `Partial`, so password is optional for clearing. +Mutating a session object does not necessarily write a cookie. Follow the library's explicit save or commit API and await it before returning or redirecting. Append serialized `Set-Cookie` values individually, preserving cookies from other middleware. ### 3. MEDIUM: Using session without HTTPS in production Session cookies should use `secure: true` in production. The default cookie options may not enforce this. +### 4. CRITICAL: Capturing request or environment state at module scope + +Do not create session config from `process.env` at module load or cache `getRequest()`, headers, cookies, or session data in a module variable. Create config and read request state inside the handler or middleware callback. This is required for per-request edge environments and prevents cross-request data leaks. + ## Cross-References -- [start-core/server-functions](../../../start-client-core/skills/start-core/server-functions/SKILL.md) — creating server functions that use these utilities -- [start-core/middleware](../../../start-client-core/skills/start-core/middleware/SKILL.md) — request middleware -- [start-core/server-routes](../../../start-client-core/skills/start-core/server-routes/SKILL.md) — server route handlers +- `@tanstack/start-client-core#start-core/server-functions` — creating server functions that use these utilities +- `@tanstack/start-client-core#start-core/middleware` — request middleware +- `@tanstack/start-client-core#start-core/server-routes` — server route handlers diff --git a/packages/start-server-core/src/createStartHandler.ts b/packages/start-server-core/src/createStartHandler.ts index 90d4e706f9..f1be8fe0d9 100644 --- a/packages/start-server-core/src/createStartHandler.ts +++ b/packages/start-server-core/src/createStartHandler.ts @@ -1,5 +1,7 @@ -import { createMemoryHistory } from '@tanstack/history' +import { createServerHistory } from '@tanstack/history' import { + X_TSS_RAW_RESPONSE, + X_TSS_SERIALIZED, createCsrfMiddleware, createNullProtoObject, csrfSymbol, @@ -8,26 +10,41 @@ import { safeObjectMerge, } from '@tanstack/start-client-core' import { - executeRewriteInput, + _getRenderedMatches, + isDangerousProtocol, + isPromise, isRedirect, - isResolvedRedirect, } from '@tanstack/router-core' import { attachRouterServerSsrUtils, + bindSsrResponseToRequest, + disposeSsrResponse, getNormalizedURL, - getOrigin, isSsrResponse, normalizeSsrResponse, - replaceSsrResponse, stripSsrResponseBody, + waitForRequest, } from '@tanstack/router-core/ssr/server' import { getStartContext, runWithStartContext, } from '@tanstack/start-storage-context' -import { requestHandler } from './request-response' +import { + createFinalizedResponse, + finalizeResponse, + reconcileResponse, + restoreResponseProtocol, + transferResponseMetadata, + transferResponseProtocol, + withStartRequest, +} from './internal-request-response' import { getStartManifest } from './router-manifest' -import { handleServerAction } from './server-functions-handler' +import { + DeferredResponse, + createServerFnErrorResponse, + handleServerAction, + toThrownServerFnResponse, +} from './server-functions-handler' import { createEarlyHintsCollector } from './early-hints' import { createCachedBaseManifestLoader, @@ -45,7 +62,8 @@ import type { RouterEntry, StartEntry, } from '@tanstack/start-client-core' -import type { RequestHandler } from './request-handler' +import type { RequestHandler, RequestOptions } from './request-handler' +import type { StartEvent } from './internal-request-response' import type { AnyRoute, AnyRouter, @@ -69,16 +87,13 @@ export interface CreateStartHandlerOptions extends FinalManifestOptions { handler: HandlerCallback } -function getStartResponseHeaders(opts: { router: AnyRouter }) { - const headers = mergeHeaders( - { - 'Content-Type': 'text/html; charset=utf-8', - }, - ...opts.router.stores.matches.get().map((match) => { - return match.headers - }), - ) - return headers +function getStartResponseHeaders(router: AnyRouter) { + const headers = new Headers({ 'content-type': 'text/html; charset=utf-8' }) + const matches = _getRenderedMatches(router.stores.matches.get()) + // Most matches set no headers; merge only when one does. + return matches.some((match) => match.headers) + ? mergeHeaders(headers, ...matches.map((match) => match.headers)) + : headers } interface PluginAdaptersEntry { @@ -92,9 +107,8 @@ interface Entries { pluginAdapters: PluginAdaptersEntry } -// Cached entries - promises stored immediately to prevent concurrent imports -// that can cause race conditions during module initialization -let entriesPromise: Promise | undefined +// Share initialization, then reuse the loaded entries without a promise wait. +let cachedEntries: Entries | Promise | undefined let hasWarnedMissingCsrfMiddleware = false const defaultCsrfMiddleware = createCsrfMiddleware({ filter: (ctx) => ctx.handlerType === 'serverFn', @@ -128,10 +142,13 @@ async function loadEntries(): Promise { } function getEntries() { - if (!entriesPromise) { - entriesPromise = loadEntries() + if (!cachedEntries) { + cachedEntries = loadEntries().then((entries) => { + cachedEntries = entries + return entries + }) } - return entriesPromise + return cachedEntries } function hasCsrfMiddleware( @@ -191,156 +208,382 @@ function throwIfMayNotDefer(): never { throw new Error(ERR_NO_DEFER) } -/** - * Check if a value is a special response (Response or Redirect) - */ -function isSpecialResponse(value: unknown): value is Response { - return value instanceof Response || isRedirect(value) +function getResponseFromResult(result: TODO): TODO { + return isSsrResponse(result) || result instanceof Response + ? result + : result?.response } -/** - * Normalize middleware result to context shape - */ -function handleCtxResult(result: TODO) { - if (isSsrResponse(result) || isSpecialResponse(result)) { - return { response: result } +type StreamSsrResponse = Extract + +type ResponseBody = NonNullable +type ResponseWithBody = Response & { readonly body: ResponseBody } + +/** The context object threaded through one middleware pipeline. */ +interface PipelineContext { + request: Request + pathname: string + handlerType: 'serverFn' | 'router' + context: Record + params?: Record + response?: Response + // Middleware may add arbitrary own properties through `next(ctx)`. + [key: string]: unknown +} + +interface MiddlewareResponseOwnership { + response: ResponseWithBody + sourceBody: ResponseBody + streamResponse?: StreamSsrResponse +} + +function disposeResponseResult(result: TODO, reason: unknown): void { + const response = getResponseFromResult(result) + if (isSsrResponse(response) || response instanceof Response) { + disposeSsrResponse(response, reason) } - return result } /** - * Execute a middleware chain + * A new body continues the owned one when it is the same stream, or when the + * owned body is already being read, as by a pipe, a tee, or a `Response` that + * copies a body by reading it (Bun, or a wrapped global `Response`). Start + * cannot tell such a reader from one that stops early, so it disposes only an + * unread body. A stream whose reader stops early ends with the request's abort + * or the SSR stream's lifetime limit. + */ +function inheritsResponseOwnership( + ownership: MiddlewareResponseOwnership, + body: ResponseBody, +): boolean { + const ownedBody = ownership.response.body + return body === ownedBody || ownedBody.locked +} + +function disposeResponseOwnership( + ownership: MiddlewareResponseOwnership, + reason: unknown, +): void { + const { response, sourceBody, streamResponse } = ownership + streamResponse?.dispose(reason) + if (!streamResponse || response.body !== sourceBody) { + void response.body.cancel(reason).catch(() => {}) + } +} + +function getOwnedResponse( + ownership: MiddlewareResponseOwnership, +): HandlerCallbackResult { + const { response, sourceBody, streamResponse } = ownership + if (!streamResponse) { + return response + } + if (streamResponse.response === response && response.body === sourceBody) { + return streamResponse + } + if (response.body === sourceBody) { + return { ...streamResponse, response } + } + return { + ...streamResponse, + response, + dispose(reason): undefined { + disposeResponseOwnership(ownership, reason) + }, + } +} + +function createLateResponseDisposer(signal: AbortSignal) { + return (result: TODO) => disposeResponseResult(result, signal.reason) +} + +/** + * Compose middleware around a terminal response handler. With no middleware + * the terminal runs directly. */ async function executeMiddleware( middlewares: Array, - ctx: TODO, -): Promise<{ ctx: TODO; response: HandlerCallbackResult }> { + terminal: TODO, + ctx: PipelineContext, + signal: AbortSignal, + event: StartEvent, + terminalNext?: TODO, +): Promise { let index = -1 - let streamResponse: - | Extract - | undefined + let responseOwnership: MiddlewareResponseOwnership | undefined + // Invocations form one chain: invocation `d` runs middleware `d` and calls + // next() at most once; the pipeline itself is depth -1. Once an invocation + // returns, a result of next() still pending below it is abandoned: it must + // not replace or cancel the response that invocation chose (for example the + // winner of a `Promise.race`). A caller at depth `d` is therefore abandoned + // when `returnedDepth <= d`, where this is the shallowest returned depth. + let returnedDepth = Infinity + const disposeAbandonedResult = createLateResponseDisposer(signal) - const setResponse = (response: TODO) => { - if (isSsrResponse(response)) { - if (response.serverSsrCleanup === 'stream') { - streamResponse = response + const adoptResponse = ( + exposed: Response | undefined, + streamResponse?: StreamSsrResponse, + ) => { + const current = responseOwnership + // Read the body once: the getter can allocate a stream for a response + // that has not exposed one yet. + const body = exposed instanceof Response ? exposed.body : null + // `exposed` is a Response with this body whenever `body` is set. + const response = exposed as ResponseWithBody + if (streamResponse && !body && streamResponse !== current?.streamResponse) { + streamResponse.dispose('Response body dropped by Start reconciliation') + } + if (current && current.response === exposed) { + current.streamResponse ??= streamResponse + } else if (current && body && inheritsResponseOwnership(current, body)) { + // A wrapper around the same body stream carries the same encoded bytes, + // so it keeps the transport requirements that decode them. + if (body === current.response.body) { + transferResponseProtocol(current.response, response) + } + current.response = response + current.streamResponse ??= streamResponse + } else { + if (current) { + responseOwnership = undefined + disposeResponseOwnership(current, 'middleware response replaced') + } + responseOwnership = body + ? { response, sourceBody: body, streamResponse } + : undefined + } + ctx.response = exposed + } + + const disposeCurrentBody = (reason: string) => { + const current = responseOwnership + responseOwnership = undefined + if (current) { + disposeResponseOwnership(current, reason) + } + } + + const setResponse = (response: TODO, caller: number) => { + // The owned response is already adopted; only helper state can still + // change it. + const owned = + response !== undefined && response === responseOwnership?.response + const ssrResponse = !owned && isSsrResponse(response) ? response : undefined + const exposed: Response | undefined = ssrResponse + ? ssrResponse.response + : response + + if (returnedDepth <= caller) { + if (exposed !== ctx.response) { + disposeResponseResult(response, 'late middleware response') } - ctx.response = response.response return } - - ctx.response = response + if (!owned) { + // Dispose a replaced body before reading helper state: cancellation and + // SSR cleanup callbacks may set headers on the response that replaces it. + adoptResponse( + exposed, + ssrResponse?.serverSsrCleanup === 'stream' ? ssrResponse : undefined, + ) + } + if (exposed instanceof Response) { + const reconciled = reconcileResponse(exposed, event, disposeCurrentBody) + if (reconciled !== exposed) { + adoptRebuilt(exposed, reconciled) + } + } } - const disposeStreamResponse = async (reason: string) => { - const response = streamResponse - if (!response) { - return + // Start rebuilds the owned response around its body, or without a body when + // the response cannot have one. A rebuilt body takes over ownership without + // comparing streams: a wrapped global `Response` copies it into a new one. + const adoptRebuilt = (exposed: Response, rebuilt: Response) => { + const current = responseOwnership + if (current?.response === exposed && rebuilt.body) { + current.response = rebuilt as ResponseWithBody + ctx.response = rebuilt + } else { + adoptResponse(rebuilt) } - - streamResponse = undefined - const currentResponse = ctx.response - if ( - currentResponse === response.response || - (currentResponse instanceof Response && - response.response.body !== null && - currentResponse.body === response.response.body) - ) { - ctx.response = undefined - } - await response.dispose(reason) } - const getFinalResponse = async (): Promise => { - const response = ctx.response - if (!response) { - throwRouteHandlerError() - } + let nextPromise: Promise | undefined - if (!streamResponse) { - return response - } - - if (response === streamResponse.response) { - return streamResponse - } - - if ( - streamResponse.response.body !== null && - response.body === streamResponse.response.body - ) { - return { ...streamResponse, response } - } - - await disposeStreamResponse('middleware response replaced') - return response + function next(nextCtx?: TODO): Promise { + // Only the deepest started invocation can call next(). + const result = runNext(index, nextCtx) + nextPromise = result + return result } - const next = async (nextCtx?: TODO): Promise => { + async function runNext(caller: number, nextCtx?: TODO): Promise { + signal.throwIfAborted() + // Merge context if provided using safeObjectMerge for prototype pollution prevention if (nextCtx) { if (nextCtx.context) { ctx.context = safeObjectMerge(ctx.context, nextCtx.context) } - // Copy own properties except context (Object.keys returns only own enumerable properties) - for (const key of Object.keys(nextCtx)) { + // Copy own properties except context (Object.keys returns only own + // enumerable properties). An indexed loop avoids the iterator protocol. + const keys = Object.keys(nextCtx) + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < keys.length; i++) { + const key = keys[i]! if (key === 'response') { - setResponse(nextCtx.response) + setResponse(nextCtx.response, caller) } else if (key !== 'context') { ctx[key] = nextCtx[key] } } } - index++ - const middleware = middlewares[index] - if (!middleware) return ctx + const depth = ++index + const isTerminal = depth === middlewares.length + const middleware = + depth < middlewares.length + ? middlewares[depth] + : isTerminal + ? terminal + : undefined + const middlewareNext = isTerminal && terminalNext ? terminalNext : next + if (!middleware) { + return ctx + } let result: TODO try { - result = await middleware({ ...ctx, next }) + const pending = middleware({ ...ctx, next: middlewareNext }) + // A directly returned next() promise already propagates request aborts. + if (nextPromise && pending === nextPromise) { + nextPromise = undefined + result = await pending + signal.throwIfAborted() + } else if (!isPromise(pending)) { + result = pending + signal.throwIfAborted() + } else { + result = await waitForRequest( + pending, + signal, + disposeAbandonedResult, + disposeAbandonedResult, + ) + } } catch (err) { - if (isSpecialResponse(err)) { - setResponse(err) + if (depth < returnedDepth) { + returnedDepth = depth + } + if (returnedDepth > caller) { + // Middleware can replace next()'s shared response before throwing. + // Track that body for cleanup without rebuilding a body it may have + // already locked, consumed, or transferred. + adoptResponse(ctx.response) + } + if (signal.aborted) { + if (result !== undefined) { + disposeAbandonedResult(result) + } + if (err !== signal.reason) { + disposeAbandonedResult(err) + } + throw signal.reason + } + if (err instanceof Response) { + // A thrown Response replies to the request. For a server function + // call, the client rejects the call with it. + setResponse( + ctx.handlerType === 'serverFn' ? toThrownServerFnResponse(err) : err, + caller, + ) return ctx } - await disposeStreamResponse('middleware error') throw err } + if (depth < returnedDepth) { + returnedDepth = depth + } - const normalized = handleCtxResult(result) - if (normalized) { - if (normalized.response !== undefined) { - setResponse(normalized.response) + if (isTerminal && terminalNext && !result) { + throwRouteHandlerError() + } + + if (isTerminal && !terminalNext && result instanceof DeferredResponse) { + if (returnedDepth > caller) { + // Cleanup may write response helpers. Construct only after it has run, + // then publish without rechecking headers that no user has received. + adoptResponse(undefined) + adoptResponse(result.createResponse(event)) } - if (normalized.context) { - ctx.context = safeObjectMerge(ctx.context, normalized.context) + return ctx + } + + if (result && result !== ctx) { + const response = getResponseFromResult(result) + // Select the replacement before reconciling: middleware may already + // have transferred or piped the previous response's body. + if (response !== undefined) { + // Middleware can assign next()'s shared response and then return + // another one, such as a 304 after transforming the body. Track the + // assigned body first, so the replacement disposes it, without + // rebuilding a body it may have already locked or consumed. + if ( + ctx.response !== responseOwnership?.response && + ctx.response !== response && + returnedDepth > caller + ) { + adoptResponse(ctx.response) + } + setResponse(response, caller) + } else { + setResponse(ctx.response, caller) } + if ( + returnedDepth > caller && + response !== result && + result.context && + result.context !== ctx.context + ) { + ctx.context = safeObjectMerge(ctx.context, result.context) + } + } else { + setResponse(ctx.response, caller) } return ctx } - await next() - return { ctx, response: await getFinalResponse() } -} - -/** - * Wrap a route handler as middleware - */ -function handlerToMiddleware( - handler: RouteMethodHandlerFn, - mayDefer: boolean = false, -): TODO { - if (mayDefer) { - return handler - } - return async (ctx: TODO) => { - const response = await handler({ ...ctx, next: throwIfMayNotDefer }) + try { + await runNext(-1) + let response = ctx.response if (!response) { throwRouteHandlerError() } - return response + if (signal.aborted) { + throw signal.reason + } + returnedDepth = -1 + // Middleware can change protocol headers directly on a server-function + // reply, the only response that has them. Restore them once, as the reply + // leaves the pipeline; without middleware only Start has handled it. + if (middlewares.length && ctx.handlerType === 'serverFn') { + const restored = restoreResponseProtocol(response, event) + if (restored !== response) { + adoptRebuilt(response, restored) + response = restored + } + } + return responseOwnership ? getOwnedResponse(responseOwnership) : response + } catch (err) { + returnedDepth = -1 + if (responseOwnership) { + disposeResponseOwnership( + responseOwnership, + signal.aborted ? signal.reason : err, + ) + } + throw err } } @@ -396,30 +639,56 @@ export function createStartHandler( }) } - const startRequestResolver: RequestHandler = async ( - request, - requestOpts, - ) => { - let router: AnyRouter | null = null as AnyRouter | null - let responseOwnsCleanup = false as boolean + const startRequestResolver = async ( + request: Request, + requestOpts: RequestOptions | undefined, + event: StartEvent, + ): Promise => { + const signal = request.signal + let router: AnyRouter | undefined + let routerPromise: Promise | undefined + let responseOwnsCleanup = false + let response: Response | undefined try { - // normalizing and sanitizing the pathname here for server, so we always deal with the same format during SSR. - // during normalization paths like '//posts' are flattened to '/posts'. - // in these cases we would prefer to redirect to the new path - const { url, handledProtocolRelativeURL } = getNormalizedURL(request.url) - const href = url.pathname + url.search + url.hash - const origin = getOrigin(request) - - if (handledProtocolRelativeURL) { - return Response.redirect(url, 308) + signal.throwIfAborted() + // The Start event already parsed and validated the request URL; reuse + // it instead of re-parsing. The memoized URL must not be mutated. + const requestUrl = event.requestUrl + let url = requestUrl + const pathname = url.pathname + // Plain RPC paths need no routing normalization. Their payload is read + // from the original query; normalize only if they later request a router. + if ( + !SERVER_FN_BASE || + !pathname.startsWith(SERVER_FN_BASE) || + pathname.includes('%') || + pathname.startsWith('//') + ) { + const normalized = getNormalizedURL(requestUrl) + url = normalized.url + if (normalized.handledProtocolRelativeURL) { + return finalizeResponse(Response.redirect(url, 308), event) + } } - const entries = await getEntries() - const hasStartInstance = !!entries.startEntry.startInstance - const startOptions: AnyStartInstanceOptions = - (await entries.startEntry.startInstance?.getOptions()) || - ({} as AnyStartInstanceOptions) + const pendingEntries = getEntries() + const entries = isPromise(pendingEntries) + ? await waitForRequest(pendingEntries, signal) + : pendingEntries + const isServerFnRequest = + !!SERVER_FN_BASE && url.pathname.startsWith(SERVER_FN_BASE) + const startInstance = entries.startEntry.startInstance + let startOptions: AnyStartInstanceOptions + if (startInstance) { + const pendingStartOptions = startInstance.getOptions() + startOptions = isPromise(pendingStartOptions) + ? await waitForRequest(pendingStartOptions, signal) + : pendingStartOptions + signal.throwIfAborted() + } else { + startOptions = {} as AnyStartInstanceOptions + } const { hasPluginAdapters, pluginSerializationAdapters } = entries.pluginAdapters @@ -432,57 +701,88 @@ export function createStartHandler( const requestStartOptions = { ...startOptions, - requestMiddleware: hasStartInstance + requestMiddleware: startInstance ? startOptions.requestMiddleware - : [defaultCsrfMiddleware], + : isServerFnRequest + ? [defaultCsrfMiddleware] + : undefined, serializationAdapters, } - // Flatten request middlewares once - const flattenedRequestMiddlewares = requestStartOptions.requestMiddleware - ? flattenMiddlewares(requestStartOptions.requestMiddleware) - : [] - - // Create set for deduplication - const executedRequestMiddlewares = new Set( - flattenedRequestMiddlewares, - ) - - // Memoized router getter - const getRouter = async (): Promise => { - if (router) return router - - router = await entries.routerEntry.getRouter() - - let isShell = IS_SHELL_ENV - if (IS_PRERENDERING && !isShell) { - isShell = request.headers.get(HEADERS.TSS_SHELL) === 'true' - } - - const history = createMemoryHistory({ - initialEntries: [href], - }) - - router.update({ - history, - isShell, - isPrerendering: IS_PRERENDERING, - origin: router.options.origin ?? origin, - ...{ - defaultSsr: requestStartOptions.defaultSsr, - serializationAdapters: [ - ...requestStartOptions.serializationAdapters, - ...(router.options.serializationAdapters || []), - ], - }, - basepath: ROUTER_BASEPATH, - }) - - return router + const requestMiddleware = requestStartOptions.requestMiddleware + let executedRequestMiddlewares: Set | undefined + let flattenedRequestMiddlewares: ReturnType = + [] + if (requestMiddleware?.length) { + // Reuse the flattening set for request middleware deduplication. + executedRequestMiddlewares = new Set() + flattenedRequestMiddlewares = flattenMiddlewares( + requestMiddleware, + undefined, + executedRequestMiddlewares, + ) } - // Check for server function requests first (early exit) - if (SERVER_FN_BASE && url.pathname.startsWith(SERVER_FN_BASE)) { + // Memoized router getter + const getRouter = (): Promise => { + routerPromise ??= (async () => { + signal.throwIfAborted() + const routerUrl = url === requestUrl ? getNormalizedURL(url).url : url + const pendingRouter = entries.routerEntry.getRouter() + const requestRouter = isPromise(pendingRouter) + ? await waitForRequest(pendingRouter, signal) + : pendingRouter + + let isShell = IS_SHELL_ENV + if (IS_PRERENDERING && !isShell) { + isShell = request.headers.get(HEADERS.TSS_SHELL) === 'true' + } + + const history = createServerHistory( + routerUrl.pathname + routerUrl.search + routerUrl.hash, + ) + + requestRouter.update({ + history, + isShell, + isPrerendering: IS_PRERENDERING, + origin: requestRouter.options.origin ?? routerUrl.origin, + // Start-owned options that RouterConstructorOptions omits. + ...{ + defaultSsr: requestStartOptions.defaultSsr, + serializationAdapters: requestRouter.options.serializationAdapters + ?.length + ? [ + ...requestStartOptions.serializationAdapters, + ...requestRouter.options.serializationAdapters, + ] + : requestStartOptions.serializationAdapters, + }, + basepath: ROUTER_BASEPATH, + }) + + router = requestRouter + return requestRouter + })() + + return routerPromise + } + + const handlerType = isServerFnRequest + ? ('serverFn' as const) + : ('router' as const) + const startContext = { + getRouter, + startOptions: requestStartOptions, + request, + executedRequestMiddlewares, + handlerType, + } + let terminal: ( + ctx: PipelineContext, + ) => Promise + + if (isServerFnRequest) { if ( process.env.NODE_ENV !== 'production' && process.env.TSS_DISABLE_CSRF_MIDDLEWARE_WARNING !== 'true' && @@ -499,217 +799,249 @@ export function createStartHandler( throw new Error('Invalid server action param for serverFnId') } - const serverFnHandler = async ({ context }: TODO) => { - return runWithStartContext( - { - getRouter, - startOptions: requestStartOptions, - contextAfterGlobalMiddlewares: context, - request, - executedRequestMiddlewares, - handlerType: 'serverFn', - }, + terminal = ({ context }) => + runWithStartContext( + { ...startContext, contextAfterGlobalMiddlewares: context }, () => handleServerAction({ request, - context: requestOpts?.context, serverFnId, }), ) - } + } else { + // Runs as the route pipeline's terminal, which waits on the request + // signal and disposes a result that settles after an abort. + const executeRouter = async ( + serverContext: TODO, + matchedRoutes: ReadonlyArray, + routerInstance: AnyRouter, + ): Promise => { + if ( + !/(^|,)\s*(\*\/\*|text\/html)/.test( + request.headers.get('Accept') || '*/*', + ) + ) { + return normalizeSsrResponse( + Response.json( + { error: 'Only HTML requests are supported here' }, + { status: 406 }, + ), + ) + } - const middlewares = flattenedRequestMiddlewares.map( - (d) => d.options.server, - ) - const { response: middlewareResponse } = await executeMiddleware( - [...middlewares, serverFnHandler], - { + const pendingManifest = resolveManifestForRequest({ request, - pathname: url.pathname, - handlerType: 'serverFn', - context: createNullProtoObject(requestOpts?.context), - }, - ) + requestInlineCss: requestOpts?.inlineCss, + getBaseManifest: () => getBaseManifest(matchedRoutes), + }) + const manifest = isPromise(pendingManifest) + ? await waitForRequest(pendingManifest, signal) + : pendingManifest - const result = await handleRedirectResponse( - middlewareResponse, - request, - getRouter, - ) - responseOwnsCleanup = result.serverSsrCleanup === 'stream' - return result.response - } + const earlyHints = createEarlyHintsForRequest(requestOpts) - // Router execution function - const executeRouter = async ( - serverContext: TODO, - matchedRoutes?: ReadonlyArray, - ): Promise => { - const acceptHeader = request.headers.get('Accept') || '*/*' - const acceptParts = acceptHeader.split(',') - const supportedMimeTypes = ['*/*', 'text/html'] + earlyHints?.collectStatic({ manifest, matchedRoutes }) - const isSupported = supportedMimeTypes.some((mimeType) => - acceptParts.some((part) => part.trim().startsWith(mimeType)), - ) + // The request's stored context, not the resolver's template: RSC + // adds request assets to it, so read them at call time. + const storedStartContext = getStartContext({ throwIfNotFound: false }) + attachRouterServerSsrUtils({ + router: routerInstance, + manifest, + getRequestAssets: () => storedStartContext?.requestAssets, + }) - if (!isSupported) { + // `additionalContext` is request-scoped and only read from router.options + // during load; avoid a full router.update() and redundant location parse. + routerInstance.options.additionalContext = { serverContext } + await routerInstance.load({ + _signal: signal, + _skipLocationUpdate: true, + }) + signal.throwIfAborted() + + if (routerInstance._serverResult?.type === 'redirect') { + return normalizeSsrResponse(routerInstance._serverResult.redirect) + } + + earlyHints?.collectDynamic( + _getRenderedMatches(routerInstance.stores.matches.get()), + ) + + // Pass request-scoped assets to dehydrate for manifest injection + await routerInstance.serverSsr!.dehydrate({ + requestAssets: storedStartContext?.requestAssets, + signal, + }) + signal.throwIfAborted() + + const responseHeaders = getStartResponseHeaders(routerInstance) + earlyHints?.appendResponseHeaders(responseHeaders) + signal.throwIfAborted() return normalizeSsrResponse( - Response.json( - { error: 'Only HTML requests are supported here' }, - { status: 500 }, - ), + await cb({ + request, + router: routerInstance, + responseHeaders, + }), ) } - const manifest = await resolveManifestForRequest({ - request, - requestInlineCss: requestOpts?.inlineCss, - getBaseManifest: () => getBaseManifest(matchedRoutes), - }) - - const earlyHints = createEarlyHintsForRequest({ - onEarlyHints: requestOpts?.onEarlyHints, - responseLinkHeader: requestOpts?.responseLinkHeader, - }) - - earlyHints?.collectStatic({ manifest, matchedRoutes }) - - const routerInstance = await getRouter() - - attachRouterServerSsrUtils({ - router: routerInstance, - manifest, - getRequestAssets: () => - getStartContext({ throwIfNotFound: false })?.requestAssets, - }) - - // `additionalContext` is request-scoped and only read from router.options - // during load; avoid a full router.update() and redundant location parse. - routerInstance.options.additionalContext = { serverContext } - await routerInstance.load() - - if (routerInstance.state.redirect) { - return normalizeSsrResponse(routerInstance.state.redirect) - } - - earlyHints?.collectDynamic(routerInstance.stores.matches.get()) - - // Pass request-scoped assets to dehydrate for manifest injection - const ctx = getStartContext({ throwIfNotFound: false }) - await routerInstance.serverSsr!.dehydrate({ - requestAssets: ctx?.requestAssets, - }) - - const responseHeaders = getStartResponseHeaders({ - router: routerInstance, - }) - earlyHints?.appendResponseHeaders(responseHeaders) - const response = await cb({ - request, - router: routerInstance, - responseHeaders, - }) - return normalizeSsrResponse(response) - } - - // Main request handler - const requestHandlerMiddleware = async ({ context }: TODO) => { - return runWithStartContext( - { - getRouter, - startOptions: requestStartOptions, - contextAfterGlobalMiddlewares: context, - request, - executedRequestMiddlewares, - handlerType: 'router', - }, - async () => { - try { - return await handleServerRoutes({ + terminal = ({ context }) => + runWithStartContext( + { ...startContext, contextAfterGlobalMiddlewares: context }, + () => + handleServerRoutes({ getRouter, request, - url, executeRouter, context, executedRequestMiddlewares, - }) - } catch (err) { - if (err instanceof Response) { - return err - } - throw err - } - }, - ) + signal, + event, + }), + ) } - const middlewares = flattenedRequestMiddlewares.map( - (d) => d.options.server, - ) - const { response: middlewareResponse } = await executeMiddleware( - [...middlewares, requestHandlerMiddleware], - { - request, - pathname: url.pathname, - handlerType: 'router', - context: createNullProtoObject(requestOpts?.context), - }, - ) - - const response = await handleRedirectResponse( - middlewareResponse, + const middlewareCtx: PipelineContext = { request, - getRouter, - ) - responseOwnsCleanup = response.serverSsrCleanup === 'stream' - return response.response + pathname: url.pathname, + handlerType, + context: createNullProtoObject(requestOpts?.context), + } + let middlewareResponse: HandlerCallbackResult + try { + if (!isServerFnRequest && flattenedRequestMiddlewares.length === 0) { + // An empty global pipeline has no additional middleware to run. The + // route pipeline already reconciles responses, owns cleanup, and + // waits on the request signal for every pending result. Only + // server-function terminals can defer JSON construction. + middlewareResponse = await (terminal( + middlewareCtx, + ) as Promise) + } else { + middlewareResponse = await executeMiddleware( + flattenedRequestMiddlewares.map((d) => d.options.server), + terminal, + middlewareCtx, + signal, + event, + ) + } + } catch (error) { + if (signal.aborted) { + throw error + } + if (error instanceof Response) { + middlewareResponse = reconcileResponse(error, event) + } else if (!isServerFnRequest) { + throw error + } else { + // Request middleware can throw before the server function runs. + const disposeLate = createLateResponseDisposer(signal) + middlewareResponse = await waitForRequest( + runWithStartContext( + { + ...startContext, + contextAfterGlobalMiddlewares: middlewareCtx.context, + }, + () => createServerFnErrorResponse(error), + ), + signal, + disposeLate, + disposeLate, + ) + middlewareResponse = reconcileResponse(middlewareResponse, event) + } + } + + let result: SsrResponse + try { + result = normalizeSsrResponse(middlewareResponse) + if (isRedirect(result.response)) { + result = await handleRedirectResponse( + result, + getRouter, + signal, + isServerFnRequest && + request.headers.get('x-tsr-serverFn') === 'true', + event, + ) + } + // Request middleware can read a HEAD body, for example to compute an + // ETag, so it is stripped only when the response leaves the pipeline. + if (request.method === 'HEAD' && result.response.body !== null) { + const source = result.response + result = stripSsrResponseBody(result, 'HEAD body stripped') + transferResponseMetadata(source, result.response) + } + } catch (error) { + disposeResponseResult( + middlewareResponse, + signal.aborted ? signal.reason : error, + ) + throw error + } + bindSsrResponseToRequest(router, result, signal) + signal.throwIfAborted() + responseOwnsCleanup = result.serverSsrCleanup === 'stream' + response = result.response } finally { if (router?.serverSsr && !responseOwnsCleanup) { - // Clean up router SSR state if it was set up but won't be cleaned up by the callback - // (e.g., in redirect cases or early returns before the callback is invoked). - // Transformed streaming response bodies clean up when consumed/cancelled. + // Stream disposal already publishes its cleanup writes at the pipeline + // boundary. Only live eager SSR state can still add response helpers. router.serverSsr.cleanup() + if (response) { + response = finalizeResponse(response, event) + } } - router = null + // `routerPromise` stays memoized: a streamed Suspense boundary or a late + // server function may still ask for this request's router. } + return response } - return requestHandler(startRequestResolver) + return withStartRequest(startRequestResolver) } +const relativeRedirectProtocols = new Set() +const SERIALIZED_REDIRECT_HEADERS: ReadonlyMap = new Map( + [ + ['content-type', 'application/json'], + ['location', null], + [X_TSS_RAW_RESPONSE, null], + [X_TSS_SERIALIZED, null], + ], +) + async function handleRedirectResponse( - response: HandlerCallbackResult, - request: Request, + ssrResponse: SsrResponse, getRouter: () => Promise, + signal: AbortSignal, + serializeRedirect: boolean, + event: StartEvent, ): Promise { - const ssrResponse = normalizeSsrResponse(response) - if (!isRedirect(ssrResponse.response)) { + signal.throwIfAborted() + const redirect = ssrResponse.response + if (!isRedirect(redirect)) { return ssrResponse } - if (isResolvedRedirect(ssrResponse.response)) { - if (request.headers.get('x-tsr-serverFn') === 'true') { - return replaceSsrResponse( - ssrResponse, - Response.json( - { ...ssrResponse.response.options, isSerializedRedirect: true }, - { headers: ssrResponse.response.headers }, - ), - 'redirect response replaced', - ) - } - return ssrResponse - } - - const opts = ssrResponse.response.options - if (opts.to && typeof opts.to === 'string' && !opts.to.startsWith('/')) { + const opts = redirect.options + const href = redirect.headers.get('Location') || opts.href + if ( + !href && + opts.to && + typeof opts.to === 'string' && + !opts.to.startsWith('/') + ) { throw new Error( `Server side redirects must use absolute paths via the 'href' or 'to' options. The redirect() method's "to" property accepts an internal path only. Use the "href" property to provide an external URL. Received: ${JSON.stringify(opts)}`, ) } if ( + !href && ['params', 'search', 'hash'].some( (d) => typeof (opts as TODO)[d] === 'function', ) @@ -724,54 +1056,115 @@ async function handleRedirectResponse( ) } - const router = await getRouter() - const redirect = router.resolveRedirect(ssrResponse.response) - - if (request.headers.get('x-tsr-serverFn') === 'true') { - return replaceSsrResponse( - ssrResponse, - Response.json( - { ...ssrResponse.response.options, isSerializedRedirect: true }, - { headers: ssrResponse.response.headers }, - ), - 'redirect response replaced', - ) + signal.throwIfAborted() + // Unambiguous relative hrefs need no route resolution or protocol policy. + // Every scheme falls back to the router to honor its custom allowlist. + if (href && !isDangerousProtocol(href, relativeRedirectProtocols)) { + opts.href = href + redirect.headers.set('Location', href) + } else { + const router = await getRouter() + signal.throwIfAborted() + // Resolves `redirect` in place. + router.resolveRedirect(redirect) } - return replaceSsrResponse(ssrResponse, redirect, 'redirect response replaced') + if (serializeRedirect) { + const redirectOptions = { ...(opts as TODO) } + delete redirectOptions.headers + redirectOptions.isSerializedRedirect = true + const responseHeaders = new Headers(redirect.headers) + responseHeaders.set('content-type', 'application/json') + // The client follows the href in this JSON envelope. An HTTP Location + // would let fetch follow it first if a response helper selected 3xx. + responseHeaders.delete('location') + responseHeaders.delete(X_TSS_RAW_RESPONSE) + responseHeaders.delete(X_TSS_SERIALIZED) + // A caller-supplied toJSON can return undefined despite the library type. + const body = JSON.stringify(redirectOptions) as string | undefined + if (body === undefined) { + throw new TypeError('Value is not JSON serializable') + } + // Both serialization and disposal can write helpers. Construct the envelope + // afterward with its final state instead of reconciling a temporary response. + disposeSsrResponse(ssrResponse, 'redirect response replaced') + return { + response: createFinalizedResponse( + body, + responseHeaders, + SERIALIZED_REDIRECT_HEADERS, + event, + ), + serverSsrCleanup: 'none', + } + } + + ssrResponse.response = finalizeResponse(redirect, event) + return ssrResponse +} + +function withParsedParams( + handler: RouteMethodHandlerFn, + matchedRoutes: ReadonlyArray, +): TODO { + if ( + !matchedRoutes.some( + (route) => route.options.params?.parse ?? route.options.parseParams, + ) + ) { + return handler + } + + return (ctx: TODO) => { + // Parse inside the pipeline so middleware can catch errors. Keep the raw + // params for app-router validation when the handler defers to rendering. + const params = Object.assign(Object.create(null), ctx.params) + for (const route of matchedRoutes) { + const parse = route.options.params?.parse ?? route.options.parseParams + if (parse) { + Object.assign(params, parse(params)) + } + } + return handler({ ...ctx, params }) + } } async function handleServerRoutes({ getRouter, request, - url, executeRouter, context, executedRequestMiddlewares, + signal, + event, }: { getRouter: () => Promise request: Request - url: URL executeRouter: ( serverContext: any, - matchedRoutes?: ReadonlyArray, + matchedRoutes: ReadonlyArray, + router: AnyRouter, ) => Promise context: any - executedRequestMiddlewares: Set + executedRequestMiddlewares: Set | undefined + signal: AbortSignal + event: StartEvent }): Promise { const router = await getRouter() - const rewrittenUrl = executeRewriteInput(router.rewrite, url) - const pathname = rewrittenUrl.pathname + const { pathname } = router.latestLocation // this will perform a fuzzy match, however for server routes we need an exact match // if the route is not an exact match, executeRouter will handle rendering the app router - // the match will be cached internally, so no extra work is done during the app router render - const { matchedRoutes, foundRoute, routeParams } = + // The cached match avoids another route-tree traversal during the app router render. + const [matchedRoutes, rawParams, foundRoute] = router.getMatchedRoutes(pathname) - const isExactMatch = foundRoute && routeParams['**'] === undefined + const isExactMatch = foundRoute && rawParams['**'] === undefined // Collect and dedupe route middlewares const routeMiddlewares: Array = [] + let terminalHandler: TODO = (ctx: TODO) => + executeRouter(ctx.context, matchedRoutes, router) + let terminalNext: TODO // Collect middleware from matched routes, filtering out those already executed // in the request phase @@ -782,7 +1175,7 @@ async function handleServerRoutes({ if (serverMiddleware) { const flattened = flattenMiddlewares(serverMiddleware) for (const m of flattened) { - if (!executedRequestMiddlewares.has(m)) { + if (!executedRequestMiddlewares?.has(m)) { routeMiddlewares.push(m.options.server) } } @@ -791,7 +1184,6 @@ async function handleServerRoutes({ // Add handler middleware if exact match const server = foundRoute?.options.server - let isHeadFallback = false if (server?.handlers && isExactMatch) { const handlers = typeof server.handlers === 'function' @@ -805,50 +1197,45 @@ async function handleServerRoutes({ requestMethod === 'HEAD' ? (handlers['HEAD'] ?? handlers['GET'] ?? handlers['ANY']) : (handlers[requestMethod] ?? handlers['ANY']) - isHeadFallback = - requestMethod === 'HEAD' && handler !== undefined && !handlers['HEAD'] - if (handler) { const mayDefer = !!foundRoute.options.component - if (typeof handler === 'function') { - routeMiddlewares.push(handlerToMiddleware(handler, mayDefer)) - } else { + if (typeof handler !== 'function') { if (handler.middleware?.length) { const handlerMiddlewares = flattenMiddlewares(handler.middleware) for (const m of handlerMiddlewares) { routeMiddlewares.push(m.options.server) } } - if (handler.handler) { - routeMiddlewares.push(handlerToMiddleware(handler.handler, mayDefer)) + } + const routeHandler = + typeof handler === 'function' ? handler : handler.handler + if (routeHandler) { + const parsedHandler = withParsedParams(routeHandler, matchedRoutes) + if (!mayDefer) { + terminalHandler = parsedHandler + terminalNext = throwIfMayNotDefer + } else { + routeMiddlewares.push(parsedHandler) } } } } - // Final middleware: execute router with matched routes for dev styles - routeMiddlewares.push(((ctx: TODO) => - executeRouter(ctx.context, matchedRoutes)) as TODO) - - const { ctx, response } = await executeMiddleware(routeMiddlewares, { - request, - context, - params: routeParams, - pathname, - handlerType: 'router', - }) - - // RFC 9110 §9.3.2: HEAD must carry the same header fields as GET but no body. - // Resolve any redirect before stripping so the Location header survives. - if (isHeadFallback) { - if (!ctx.response) { - throwRouteHandlerError() - } - - const resolved = await handleRedirectResponse(response, request, getRouter) - return stripSsrResponseBody(resolved, 'HEAD body stripped') - } + const response = await executeMiddleware( + routeMiddlewares, + terminalHandler, + { + request, + context, + params: rawParams, + pathname, + handlerType: 'router', + }, + signal, + event, + terminalNext, + ) return normalizeSsrResponse(response) } diff --git a/packages/start-server-core/src/early-hints.ts b/packages/start-server-core/src/early-hints.ts index f46cf5f587..4b504d77d5 100644 --- a/packages/start-server-core/src/early-hints.ts +++ b/packages/start-server-core/src/early-hints.ts @@ -191,7 +191,7 @@ export function collectStaticHintsFromManifest( rel: attrs.rel, as: 'script', } - if (attrs.crossOrigin !== undefined) hint.crossOrigin = attrs.crossOrigin + addEarlyHintFetchAttrs(hint, attrs) hints.push(hint) } diff --git a/packages/start-server-core/src/finalManifest.ts b/packages/start-server-core/src/finalManifest.ts index 274e6cb000..f1a9a7044e 100644 --- a/packages/start-server-core/src/finalManifest.ts +++ b/packages/start-server-core/src/finalManifest.ts @@ -3,10 +3,7 @@ import { resolveTransformAssetsConfig, transformManifestAssets, } from './transformAssetUrls' -import { - getStaticHandlerInlineCssDefault, - resolveInlineCssForRequest, -} from './inlineCss' +import { getStaticInlineCss, resolveInlineCssForRequest } from './inlineCss' import type { ServerManifest } from '@tanstack/router-core' import type { HandlerInlineCssOption } from './inlineCss' import type { @@ -40,7 +37,12 @@ export interface FinalManifestOptions { } type FinalManifestCacheKey = 'inline-css' | 'linked-css' -type FinalManifestCache = Map> +// An entry holds the pending manifest, then the manifest itself once it +// resolves, so later requests read it without waiting. +type FinalManifestCache = Map< + FinalManifestCacheKey, + ServerManifest | Promise +> export type GetBaseManifest = () => Promise export interface FinalManifestRequestOptions { @@ -62,7 +64,9 @@ export interface FinalManifestResolver { warmup: (opts: { getBaseManifest: GetBaseManifest }) => Promise | undefined - resolveCached: (opts: FinalManifestRequestOptions) => Promise + resolveCached: ( + opts: FinalManifestRequestOptions, + ) => ServerManifest | Promise resolveUncached: ( opts: FinalManifestRequestOptions, ) => Promise @@ -143,9 +147,7 @@ export function createFinalManifestResolver( opts.transformAssets, { cacheCreateTransform: opts.cacheCreateTransform }, ) - const handlerDefaultInlineCss = getStaticHandlerInlineCssDefault( - opts.inlineCss, - ) + const handlerDefaultInlineCss = getStaticInlineCss(undefined, opts.inlineCss) const getRequestManifestOptions = async ( requestOpts: FinalManifestRequestOptions, @@ -190,8 +192,24 @@ export function createFinalManifestResolver( transformResolver.getTransformFn({ warmup: true }), onError: transformResolver.clearCachedCreateTransform, }), - resolveCached: (requestOpts) => - resolveRequest(requestOpts, finalManifestCache), + resolveCached: (requestOpts) => { + // With a cached transform, the entry for the request's inline-CSS choice + // is the manifest resolveRequest would produce, unless a handler + // callback still has to make that choice. + const inlineCss = getStaticInlineCss( + requestOpts.requestInlineCss, + opts.inlineCss, + ) + if (transformResolver.cache && inlineCss !== undefined) { + const cached = finalManifestCache.get( + getFinalManifestCacheKey(inlineCss), + ) + if (cached) { + return cached + } + } + return resolveRequest(requestOpts, finalManifestCache) + }, resolveUncached: (requestOpts) => resolveRequest(requestOpts, undefined), } } @@ -201,35 +219,41 @@ function getFinalManifestCacheKey(inlineCss: boolean): FinalManifestCacheKey { } function cacheFinalManifestPromise( - cachedFinalManifestPromises: FinalManifestCache, + finalManifestCache: FinalManifestCache, cacheKey: FinalManifestCacheKey, promise: Promise, ): Promise { - const cachedFinalManifestPromise = promise.catch((error) => { - if ( - cachedFinalManifestPromises.get(cacheKey) === cachedFinalManifestPromise - ) { - cachedFinalManifestPromises.delete(cacheKey) - } - throw error - }) + const cachedPromise = promise.then( + (manifest) => { + if (finalManifestCache.get(cacheKey) === cachedPromise) { + finalManifestCache.set(cacheKey, manifest) + } + return manifest + }, + (error) => { + if (finalManifestCache.get(cacheKey) === cachedPromise) { + finalManifestCache.delete(cacheKey) + } + throw error + }, + ) - cachedFinalManifestPromises.set(cacheKey, cachedFinalManifestPromise) - return cachedFinalManifestPromise + finalManifestCache.set(cacheKey, cachedPromise) + return cachedPromise } -function getOrCreateCachedFinalManifestPromise( - cachedFinalManifestPromises: FinalManifestCache, +function getOrCreateCachedFinalManifest( + finalManifestCache: FinalManifestCache, cacheKey: FinalManifestCacheKey, computeFinalManifest: () => Promise, -): Promise { - const cachedFinalManifestPromise = cachedFinalManifestPromises.get(cacheKey) - if (cachedFinalManifestPromise) { - return cachedFinalManifestPromise +): ServerManifest | Promise { + const cached = finalManifestCache.get(cacheKey) + if (cached) { + return cached } return cacheFinalManifestPromise( - cachedFinalManifestPromises, + finalManifestCache, cacheKey, Promise.resolve().then(computeFinalManifest), ) @@ -263,7 +287,7 @@ async function resolveFinalManifest(opts: { } if (opts.finalManifestCache && (!opts.transformFn || opts.cache)) { - return getOrCreateCachedFinalManifestPromise( + return getOrCreateCachedFinalManifest( opts.finalManifestCache, getFinalManifestCacheKey(opts.inlineCss), computeFinalManifest, @@ -290,11 +314,13 @@ function warmupFinalManifest(opts: { return undefined } + // Warmup runs when the handler is created, before any request fills the + // cache. const inlineCss = opts.handlerDefaultInlineCss - const warmupPromise = getOrCreateCachedFinalManifestPromise( + const warmupPromise = cacheFinalManifestPromise( opts.finalManifestCache, getFinalManifestCacheKey(inlineCss), - async () => { + Promise.resolve().then(async () => { const [base, transformFn] = await Promise.all([ opts.getBaseManifest(), opts.getTransformFn(), @@ -305,7 +331,7 @@ function warmupFinalManifest(opts: { transformFn, inlineCss, }) - }, + }), ) if (opts.onError) { diff --git a/packages/start-server-core/src/frame-protocol.ts b/packages/start-server-core/src/frame-protocol.ts index e96275c0bb..b1f32eb702 100644 --- a/packages/start-server-core/src/frame-protocol.ts +++ b/packages/start-server-core/src/frame-protocol.ts @@ -8,31 +8,41 @@ * - payload: variable length bytes */ -// Re-export constants from shared location -import { FRAME_HEADER_SIZE, FrameType } from '@tanstack/start-client-core' - -export { +import { FRAME_HEADER_SIZE, - FrameType, - TSS_CONTENT_TYPE_FRAMED, - TSS_CONTENT_TYPE_FRAMED_VERSIONED, - TSS_FRAMED_PROTOCOL_VERSION, -} from '@tanstack/start-client-core' + FRAME_TYPE_CHUNK, + FRAME_TYPE_END, + FRAME_TYPE_ERROR, + FRAME_TYPE_JSON, + MAX_FRAME_PAYLOAD_SIZE, +} from '@tanstack/start-client-core/client-rpc' + +type FrameType = + | typeof FRAME_TYPE_JSON + | typeof FRAME_TYPE_CHUNK + | typeof FRAME_TYPE_END + | typeof FRAME_TYPE_ERROR /** Cached TextEncoder for frame encoding */ const textEncoder = new TextEncoder() /** Shared empty payload for END frames - avoids allocation per call */ const EMPTY_PAYLOAD = new Uint8Array(0) +const MAX_ERROR_MESSAGE_CODE_UNITS = 4096 /** * Encodes a single frame with header and payload. */ -export function encodeFrame( +function encodeFrame( type: FrameType, streamId: number, payload: Uint8Array, ): Uint8Array { + if (payload.byteLength > MAX_FRAME_PAYLOAD_SIZE) { + throw new RangeError( + `Frame payload exceeds ${MAX_FRAME_PAYLOAD_SIZE} bytes`, + ) + } const frame = new Uint8Array(FRAME_HEADER_SIZE + payload.length) // Write header bytes directly to avoid DataView allocation per frame // Frame format: [type:1][streamId:4 BE][length:4 BE] @@ -49,37 +59,15 @@ export function encodeFrame( return frame } -/** - * Encodes a JSON frame (type 0, streamId 0). - */ -export function encodeJSONFrame(json: string): Uint8Array { - return encodeFrame(FrameType.JSON, 0, textEncoder.encode(json)) -} - -/** - * Encodes a raw stream chunk frame. - */ -export function encodeChunkFrame( - streamId: number, - chunk: Uint8Array, -): Uint8Array { - return encodeFrame(FrameType.CHUNK, streamId, chunk) -} - -/** - * Encodes a raw stream end frame. - */ -export function encodeEndFrame(streamId: number): Uint8Array { - return encodeFrame(FrameType.END, streamId, EMPTY_PAYLOAD) -} - -/** - * Encodes a raw stream error frame. - */ -export function encodeErrorFrame(streamId: number, error: unknown): Uint8Array { - const message = +/** Encodes an error message payload, truncated to a bounded length. */ +function encodeErrorPayload(error: unknown): Uint8Array { + const originalMessage = error instanceof Error ? error.message : String(error ?? 'Unknown error') - return encodeFrame(FrameType.ERROR, streamId, textEncoder.encode(message)) + const message = + originalMessage.length > MAX_ERROR_MESSAGE_CODE_UNITS + ? `${originalMessage.slice(0, MAX_ERROR_MESSAGE_CODE_UNITS)}…` + : originalMessage + return textEncoder.encode(message) } /** @@ -91,168 +79,280 @@ export interface LateStreamRegistration { stream: ReadableStream } +/** One serialized JSON patch and the raw streams referenced by that patch. */ +export interface MultiplexedStreamRecord { + json: Uint8Array + rawStreams: Array +} + +export interface MultiplexedStreamOptions { + onCancel?: (reason?: unknown) => void + signal?: AbortSignal +} + +type CancellableReader = Pick< + ReadableStreamDefaultReader, + 'cancel' | 'releaseLock' +> + /** - * Creates a multiplexed ReadableStream from JSON stream and raw streams. + * Creates a multiplexed ReadableStream from serialized response records. * - * The JSON stream emits NDJSON lines (from seroval's toCrossJSONStream). - * Raw streams are pumped concurrently, interleaved with JSON frames. - * - * Supports late stream registration for RawStreams discovered after initial - * serialization (e.g., from resolved Promises). - * - * @param jsonStream Stream of JSON strings (each string is one NDJSON line) - * @param rawStreams Map of stream IDs to raw binary streams (known at start) - * @param lateStreamSource Optional stream of late registrations for streams discovered later + * A record's JSON frame is admitted before any raw stream referenced by that + * record starts. Raw streams from admitted records are pumped concurrently. + * The caller bounds the stream count before records reach this function. */ export function createMultiplexedStream( - jsonStream: ReadableStream, - rawStreams: Map>, - lateStreamSource?: ReadableStream, + recordStream: ReadableStream, + options: MultiplexedStreamOptions = {}, ): ReadableStream { - // Shared state for the multiplexed stream let controller: ReadableStreamDefaultController - let cancelled = false - const readers: Array> = [] + let stopped: false | [unknown] = false + let activePumps = 0 + let wakeDemand: (() => void) | undefined + let admission: Promise | undefined + const readers = new Set() + const pendingRawStreams = new Set>() + const abortOutput = () => errorOutput(options.signal?.reason) - // Helper to enqueue a frame, ignoring errors if stream is closed/cancelled - const enqueue = (frame: Uint8Array): boolean => { - if (cancelled) return false - try { - controller.enqueue(frame) - return true - } catch { - return false - } + const wakeAdmission = () => { + const wake = wakeDemand + wakeDemand = undefined + wake?.() } - // Helper to error the output stream (for fatal errors like JSON stream failure) - const errorOutput = (error: unknown): void => { - if (cancelled) return - cancelled = true + const cancelReader = (reader: CancellableReader, reason?: unknown) => { + void reader.cancel(reason).catch(() => {}) + } + + const cancelStream = (stream: ReadableStream, reason?: unknown) => { + void stream.cancel(reason).catch(() => {}) + } + + const stop = (reason?: unknown) => { + if (stopped) { + return false + } + stopped = [reason] + options.signal?.removeEventListener('abort', abortOutput) + wakeAdmission() + for (const reader of readers) { + cancelReader(reader, reason) + } + for (const stream of pendingRawStreams) { + cancelStream(stream, reason) + } + pendingRawStreams.clear() + return true + } + + const errorOutput = (error: unknown) => { + if (!stop(error)) { + return + } try { controller.error(error) } catch { - // Already errored - } - // Cancel all readers to stop other pumps - for (const reader of readers) { - reader.cancel().catch(() => {}) + // The output was already closed by its consumer. } } - // Pumps a raw stream, sending CHUNK frames and END/ERROR on completion + const waitForDemand = async () => { + while (!stopped && (controller.desiredSize ?? 0) <= 0) { + await new Promise((resolve) => { + wakeDemand = resolve + }) + } + return !stopped + } + + // Only the pump at the head of this chain may inspect desiredSize and + // enqueue. Each other pump can retain at most one unencoded source chunk. + // The frame is encoded only once the output has demand for it. + const admitFrame = ( + type: FrameType, + streamId: number, + payload: Uint8Array, + ): boolean | Promise => { + if (stopped) { + return false + } + if (!admission && (controller.desiredSize ?? 0) > 0) { + controller.enqueue(encodeFrame(type, streamId, payload)) + return true + } + + const runAdmission = async () => { + if (!(await waitForDemand())) { + return false + } + controller.enqueue(encodeFrame(type, streamId, payload)) + return true + } + const result = admission ? admission.then(runAdmission) : runAdmission() + const clearAdmission = () => { + if (admission === tail) { + admission = undefined + } + } + const tail = result.then(clearAdmission, clearAdmission) + admission = tail + return result + } + + const maybeClose = () => { + if (activePumps !== 0 || !stop()) { + return + } + try { + controller.close() + } catch { + // The output was already closed by its consumer. + } + } + + const startPump = (pump: () => Promise) => { + activePumps++ + void pump().then( + () => { + activePumps-- + maybeClose() + }, + (error) => { + activePumps-- + errorOutput(error) + }, + ) + } + async function pumpRawStream( streamId: number, stream: ReadableStream, - ): Promise { + ) { const reader = stream.getReader() - readers.push(reader) + readers.add(reader) try { - while (!cancelled) { + while (!stopped) { const { done, value } = await reader.read() - if (done) { - enqueue(encodeEndFrame(streamId)) + // Cancellation can run while the read is suspended. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (stopped) { return } - if (!enqueue(encodeChunkFrame(streamId, value))) return + if (done) { + const frameAdmission = admitFrame( + FRAME_TYPE_END, + streamId, + EMPTY_PAYLOAD, + ) + if (frameAdmission !== true) { + await frameAdmission + } + return + } + if (!(value instanceof Uint8Array)) { + throw new TypeError('RawStream chunks must be Uint8Array') + } + // One frame per read, split only when the chunk exceeds a frame. + let offset = 0 + do { + const chunk = + value.byteLength <= MAX_FRAME_PAYLOAD_SIZE + ? value + : value.subarray(offset, offset + MAX_FRAME_PAYLOAD_SIZE) + const frameAdmission = admitFrame(FRAME_TYPE_CHUNK, streamId, chunk) + if ( + frameAdmission !== true && + (frameAdmission === false || !(await frameAdmission)) + ) { + return + } + offset += MAX_FRAME_PAYLOAD_SIZE + } while (offset < value.byteLength) } } catch (error) { - // Raw stream error - send ERROR frame, don't fail entire response - enqueue(encodeErrorFrame(streamId, error)) + if (!stopped) { + // A raw-stream failure is isolated to that stream. + const frameAdmission = admitFrame( + FRAME_TYPE_ERROR, + streamId, + encodeErrorPayload(error), + ) + if (frameAdmission !== true) { + await frameAdmission + } + } } finally { + readers.delete(reader) reader.releaseLock() } } - // Pumps the JSON stream, sending JSON frames - // JSON stream errors are fatal - they error the entire output - async function pumpJSON(): Promise { - const reader = jsonStream.getReader() - readers.push(reader) + async function pumpRecords() { + const reader = recordStream.getReader() + readers.add(reader) try { - while (!cancelled) { + while (!stopped) { const { done, value } = await reader.read() - if (done) return - if (!enqueue(encodeJSONFrame(value))) return + // Cancellation can run while the read is suspended. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (stopped) { + if (!done) { + for (const registration of value.rawStreams) { + cancelStream(registration.stream, stopped[0]) + } + } + return + } + if (done) { + return + } + for (const registration of value.rawStreams) { + pendingRawStreams.add(registration.stream) + } + const frameAdmission = admitFrame(FRAME_TYPE_JSON, 0, value.json) + if ( + frameAdmission !== true && + (frameAdmission === false || !(await frameAdmission)) + ) { + return + } + for (const registration of value.rawStreams) { + pendingRawStreams.delete(registration.stream) + startPump( + pumpRawStream.bind(undefined, registration.id, registration.stream), + ) + } } } catch (error) { - // JSON stream error is fatal - error the entire output - errorOutput(error) - throw error // Re-throw to signal failure to Promise.all - } finally { - reader.releaseLock() - } - } - - // Pumps late stream registrations, spawning raw stream pumps as they arrive - async function pumpLateStreams(): Promise>> { - if (!lateStreamSource) return [] - - const lateStreamPumps: Array> = [] - const reader = lateStreamSource.getReader() - readers.push(reader) - try { - while (!cancelled) { - const { done, value } = await reader.read() - if (done) break - // Start pumping this late stream and track it - lateStreamPumps.push(pumpRawStream(value.id, value.stream)) + if (!stopped) { + // JSON records describe the response graph, so losing one is fatal. + errorOutput(error) } } finally { + readers.delete(reader) reader.releaseLock() } - return lateStreamPumps } return new ReadableStream({ - async start(ctrl) { + start(ctrl) { controller = ctrl - - // Collect all pump promises - const pumps: Array>>> = [pumpJSON()] - - for (const [streamId, stream] of rawStreams) { - pumps.push(pumpRawStream(streamId, stream)) - } - - // Add late stream pump (returns array of spawned pump promises) - if (lateStreamSource) { - pumps.push(pumpLateStreams()) - } - - try { - // Wait for initial pumps to complete - const results = await Promise.all(pumps) - - // Wait for any late stream pumps that were spawned - const latePumps = results.find(Array.isArray) as - | Array> - | undefined - if (latePumps && latePumps.length > 0) { - await Promise.all(latePumps) - } - - // All pumps done - close the output stream - if (!cancelled) { - try { - controller.close() - } catch { - // Already closed - } - } - } catch { - // Error already handled by errorOutput in pumpJSON - // or was a raw stream error (non-fatal, already sent ERROR frame) + if (options.signal?.aborted) { + cancelStream(recordStream, options.signal.reason) + errorOutput(options.signal.reason) + return } + options.signal?.addEventListener('abort', abortOutput, { once: true }) + startPump(pumpRecords) }, - - cancel() { - cancelled = true - // Cancel all readers to stop pumps quickly - for (const reader of readers) { - reader.cancel().catch(() => {}) + pull() { + wakeAdmission() + }, + cancel(reason) { + if (stop(reason)) { + options.onCancel?.(reason) } - readers.length = 0 }, }) } diff --git a/packages/start-server-core/src/headers.ts b/packages/start-server-core/src/headers.ts new file mode 100644 index 0000000000..e336588a32 --- /dev/null +++ b/packages/start-server-core/src/headers.ts @@ -0,0 +1,14 @@ +import { splitSetCookieString } from 'cookie-es' + +type HeadersWithGetSetCookie = Headers & { + getSetCookie?: () => Array +} + +export function getSetCookieValues(headers: Headers): Array { + const headersWithSetCookie = headers as HeadersWithGetSetCookie + if (typeof headersWithSetCookie.getSetCookie === 'function') { + return headersWithSetCookie.getSetCookie() + } + const value = headers.get('set-cookie') + return value ? splitSetCookieString(value) : [] +} diff --git a/packages/start-server-core/src/index.tsx b/packages/start-server-core/src/index.tsx index ee818e0cf1..00d036b024 100644 --- a/packages/start-server-core/src/index.tsx +++ b/packages/start-server-core/src/index.tsx @@ -30,8 +30,6 @@ export { HEADERS } from './constants' export type { RequestHandler, RequestOptions } from './request-handler' -export type { SessionConfig } from './session' - export type { EarlyHint, EarlyHintsEvent, diff --git a/packages/start-server-core/src/inlineCss.ts b/packages/start-server-core/src/inlineCss.ts index 249b7f40c8..6fd7bd7fe2 100644 --- a/packages/start-server-core/src/inlineCss.ts +++ b/packages/start-server-core/src/inlineCss.ts @@ -4,13 +4,21 @@ export type HandlerInlineCssOption = | boolean | ((ctx: { request: Request }) => Awaitable) -export function getStaticHandlerInlineCssDefault( +/** + * The inline-CSS choice that needs no handler callback: a request override + * wins, then a static handler option, then the default. Undefined when a + * handler callback has to decide. + */ +export function getStaticInlineCss( + requestInlineCss: boolean | undefined, handlerInlineCss: HandlerInlineCssOption | undefined, -) { +): boolean | undefined { + if (requestInlineCss !== undefined) { + return requestInlineCss + } if (typeof handlerInlineCss === 'function') { return undefined } - return handlerInlineCss ?? true } @@ -19,13 +27,15 @@ export async function resolveInlineCssForRequest(opts: { handlerInlineCss: HandlerInlineCssOption | undefined requestInlineCss: boolean | undefined }) { - if (opts.requestInlineCss !== undefined) { - return opts.requestInlineCss + const inlineCss = getStaticInlineCss( + opts.requestInlineCss, + opts.handlerInlineCss, + ) + if (inlineCss !== undefined) { + return inlineCss } - - if (typeof opts.handlerInlineCss === 'function') { - return await opts.handlerInlineCss({ request: opts.request }) - } - - return opts.handlerInlineCss ?? true + // Only a handler callback leaves the choice open. + return await ( + opts.handlerInlineCss as Exclude + )({ request: opts.request }) } diff --git a/packages/start-server-core/src/internal-request-response.ts b/packages/start-server-core/src/internal-request-response.ts new file mode 100644 index 0000000000..90128ab29c --- /dev/null +++ b/packages/start-server-core/src/internal-request-response.ts @@ -0,0 +1,1490 @@ +import { AsyncLocalStorage } from 'node:async_hooks' +import { isRedirect } from '@tanstack/router-core' + +import { parseCookie, parseSetCookie, serializeCookie } from 'cookie-es' +import { getSetCookieValues } from './headers' +import type { + RequestHeaderMap, + RequestHeaderName, + ResponseHeaderMap, + ResponseHeaderName, + TypedHeaders, +} from 'fetchdts' + +import type { CookieSerializeOptions } from 'cookie-es' +import type { RequestHandler } from './request-handler' + +export interface StartEvent { + request: Request + /** The parsed request URL. Callers must not mutate it. */ + requestUrl: URL + /** + * Lazily created response state. Stays `undefined` until the first + * response helper write so requests that never use helpers pay nothing. + */ + responseState?: ResponseState + /** The most recently reconciled response, used by response read helpers. */ + currentResponse?: Response + /** Applied helper operations belong to this invocation, across runtime copies. */ + responseHeaderAppends?: WeakMap> +} + +/** + * Event-owned mutable response state, recorded by the response helpers. + * + * A plain `Headers` object cannot distinguish between "not set" and + * "explicitly removed", so removals and Set-Cookie intent are tracked + * alongside the headers. All mutations flow through the helper functions in + * this module (`setResponseHeader`, `setCookie`, ...), which record that + * intent directly. + */ +interface ResponseState { + status?: number + statusText?: string + headers: Headers + removedHeaders?: Set + clearHeaders: boolean + setCookieBehavior?: 'merge' | 'replace' + headerAppends?: Map + /** Outside production: a discarded bodyless status was already reported. */ + bodylessStatusWarned?: boolean + /** Identity of each Set-Cookie string seen by this request's merges. */ + setCookieKeys?: Map +} + +interface HeaderAppendOperation { + value: string + previous?: HeaderAppendOperation +} + +// Use a global symbol to ensure the same AsyncLocalStorage instance is shared +// across different bundles that may each bundle this module. +const GLOBAL_EVENT_STORAGE_KEY = Symbol.for('tanstack-start:event-storage') + +const globalObj = globalThis as typeof globalThis & { + [GLOBAL_EVENT_STORAGE_KEY]?: AsyncLocalStorage +} + +if (!globalObj[GLOBAL_EVENT_STORAGE_KEY]) { + globalObj[GLOBAL_EVENT_STORAGE_KEY] = new AsyncLocalStorage() +} + +const eventStorage = globalObj[GLOBAL_EVENT_STORAGE_KEY] + +export type { ResponseHeaderName, RequestHeaderName } + +/** A detached view of outgoing headers. Use the response helpers for writes. */ +export type ReadonlyResponseHeaders = Omit< + TypedHeaders, + 'append' | 'delete' | 'set' | 'forEach' +> & { + forEach: ( + callback: ( + value: string, + name: ResponseHeaderName, + headers: ReadonlyResponseHeaders, + ) => void, + thisArg?: unknown, + ) => void +} + +// Lowercase protocol header names mapped to a required value, or to null when +// the header must be absent. Set-Cookie is never protected: it has one value +// per cookie. +type ProtectedHeaders = ReadonlyMap + +type MaybePromise = T | Promise + +// Protocol requirements describe the response body, so they follow the response +// through delegated requests as well as separately bundled runtime copies. +const PROTECTED_RESPONSE_HEADERS = Symbol.for( + 'tanstack-start:protected-response-headers', +) +type ProtectedResponse = Response & { + [PROTECTED_RESPONSE_HEADERS]?: ProtectedHeaders +} + +function getProtectedResponseHeaders( + response: Response, +): ProtectedHeaders | undefined { + return (response as ProtectedResponse)[PROTECTED_RESPONSE_HEADERS] +} + +function installProtectedResponseHeaders( + response: Response, + headers: ProtectedHeaders, +): void { + Object.defineProperty(response, PROTECTED_RESPONSE_HEADERS, { + value: headers, + configurable: true, + }) +} + +/** Transport requirements belong to the encoded body, not its wrapper. */ +export function transferResponseProtocol( + source: Response, + target: Response, +): void { + const protectedHeaders = getProtectedResponseHeaders(source) + if ( + protectedHeaders && + getProtectedResponseHeaders(target) !== protectedHeaders + ) { + installProtectedResponseHeaders(target, protectedHeaders) + } +} + +/** Preserve metadata when Start reconstructs an existing response. */ +export function transferResponseMetadata( + source: Response, + target: Response, +): void { + transferResponseProtocol(source, target) + const event = eventStorage.getStore() + const appliedHeaderAppends = event?.responseHeaderAppends?.get(source) + if (appliedHeaderAppends) { + event!.responseHeaderAppends!.set(target, appliedHeaderAppends) + } +} + +function normalizeHeaderName(name: string): string { + return name.toLowerCase() +} + +function sanitizeStatusMessage(statusMessage: string): string { + // Strip everything except horizontal tab and printable ASCII (space–'~') + // to prevent header injection through status text. + return statusMessage.replace(/[^\t\x20-\x7e]/g, '') +} + +// The Fetch `Response` constructor only accepts statuses in the 200-599 +// range (anything else throws a RangeError). Start responses are always +// represented as `Response` objects — for server routes and SSR documents +// just like for server functions — so out-of-range statuses (1xx, or exotic +// codes like 783/999) cannot be carried through the pipeline at all. +function sanitizeStatusCode( + statusCode: string | number | undefined, +): number | undefined { + const code = typeof statusCode === 'string' ? Number(statusCode) : statusCode + if ( + code === undefined || + !Number.isInteger(code) || + code < 200 || + code > 599 + ) { + return undefined + } + return code +} + +function getObjectProperty(value: unknown, key: string): unknown { + if ((typeof value === 'object' && value) || typeof value === 'function') { + return (value as Record)[key] + } + return undefined +} + +function getStatusCodeProperty( + value: unknown, + key: 'status' | 'statusCode', +): string | number | undefined { + const property = getObjectProperty(value, key) + if (typeof property === 'string' || typeof property === 'number') { + return property + } + return undefined +} + +function getErrorStatus(error: unknown): number | undefined { + const cause = getObjectProperty(error, 'cause') + return sanitizeStatusCode( + getStatusCodeProperty(error, 'status') ?? + getStatusCodeProperty(error, 'statusCode') ?? + getStatusCodeProperty(cause, 'status') ?? + getStatusCodeProperty(cause, 'statusCode'), + ) +} + +function getErrorStatusText(error: unknown): string | undefined { + const cause = getObjectProperty(error, 'cause') + const statusText = + getObjectProperty(error, 'statusText') ?? + getObjectProperty(error, 'statusMessage') ?? + getObjectProperty(cause, 'statusText') ?? + getObjectProperty(cause, 'statusMessage') + if (typeof statusText === 'string') { + return sanitizeStatusMessage(statusText) + } + return undefined +} + +// Start builds error bodies and serialized replies itself. These headers +// describe another body's framing or its connection, whether they come from +// error metadata or from helpers, so they would corrupt that body on the wire. +const GENERATED_BODY_EXCLUDED_HEADERS: ReadonlySet = new Set([ + 'connection', + 'content-encoding', + 'content-length', + 'keep-alive', + 'proxy-connection', + 'te', + 'trailer', + 'transfer-encoding', +]) + +// Responses from another fetch implementation or realm fail instanceof. +function isResponse(value: unknown): boolean { + return ( + value instanceof Response || + Object.prototype.toString.call(value) === '[object Response]' + ) +} + +export function getErrorHeaders(error: unknown): Headers | undefined { + let init = getObjectProperty(error, 'headers') + if (!init) { + const cause = getObjectProperty(error, 'cause') + // A Response cause is another server's reply, such as a failed upstream + // fetch. Its headers were written for that reply, not for this client. + if (isResponse(cause)) { + return undefined + } + init = getObjectProperty(cause, 'headers') + } + if (!init) { + return undefined + } + let headers: Headers + try { + headers = new Headers(init as HeadersInit) + } catch { + return undefined + } + for (const name of GENERATED_BODY_EXCLUDED_HEADERS) { + headers.delete(name) + } + return headers +} + +function getResponseState(event: StartEvent): ResponseState { + return (event.responseState ||= { + headers: new Headers(), + clearHeaders: false, + }) +} + +function setHeaderState(event: StartEvent, name: string, value: string): void { + const state = getResponseState(event) + const normalizedName = normalizeHeaderName(name) + state.headers.set(name, value) + state.headerAppends?.delete(normalizedName) + state.removedHeaders?.delete(normalizedName) + if (normalizedName === 'set-cookie') { + state.setCookieBehavior = 'replace' + } +} + +function appendHeaderState( + event: StartEvent, + name: string, + value: string, +): void { + const state = getResponseState(event) + const normalizedName = normalizeHeaderName(name) + const appendToReturnedHeader = + normalizedName !== 'set-cookie' && + !state.clearHeaders && + !state.removedHeaders?.has(normalizedName) && + (!state.headers.has(normalizedName) || + state.headerAppends?.has(normalizedName)) + // Validate and normalize through native Headers before recording intent. + state.headers.append(name, value) + if (appendToReturnedHeader) { + const appends = (state.headerAppends ||= new Map()) + appends.set(normalizedName, { + value, + previous: appends.get(normalizedName), + }) + } + state.removedHeaders?.delete(normalizedName) + if ( + normalizedName === 'set-cookie' && + state.setCookieBehavior !== 'replace' + ) { + state.setCookieBehavior = 'merge' + } +} + +function deleteHeaderState(event: StartEvent, name: string): void { + const state = getResponseState(event) + const normalizedName = normalizeHeaderName(name) + state.headers.delete(name) + state.headerAppends?.delete(normalizedName) + ;(state.removedHeaders ||= new Set()).add(normalizedName) + if (normalizedName === 'set-cookie') { + state.setCookieBehavior = 'replace' + } +} + +function getDistinctCookieKey( + name: string, + options: { domain?: string; path?: string }, + defaultPath = '', +): string { + return [name, options.domain || '', options.path ?? defaultPath].join(';') +} + +function getDistinctCookieKeyFromHeader(cookie: string): string { + const parsed = parseSetCookie(cookie) + // A cookie the parser rejects is identified by its exact string, so merging + // it again replaces it. Header values cannot contain NUL, so this key cannot + // match a parsed name, domain, and path. + return parsed ? getDistinctCookieKey(parsed.name, parsed) : `\0${cookie}` +} + +function replaceSetCookieValues( + headers: Headers, + cookies: Array, +): void { + headers.delete('set-cookie') + for (const cookie of cookies) { + headers.append('set-cookie', cookie) + } +} + +// Every reconcile pass merges the same immutable cookie strings again, so +// parse each string's identity once per request. +function getCookieKey(state: ResponseState, cookie: string): string { + const keys = (state.setCookieKeys ||= new Map()) + let key = keys.get(cookie) + if (key === undefined) { + key = getDistinctCookieKeyFromHeader(cookie) + keys.set(cookie, key) + } + return key +} + +function getMergedSetCookieValues( + state: ResponseState, + currentCookies: Array, + cookiesToMerge: Array, +): Array { + if (currentCookies.length === 0) { + return cookiesToMerge + } + const cookieKeysToMerge = new Set() + for (const cookie of cookiesToMerge) { + cookieKeysToMerge.add(getCookieKey(state, cookie)) + } + return currentCookies + .filter((cookie) => !cookieKeysToMerge.has(getCookieKey(state, cookie))) + .concat(cookiesToMerge) +} + +function mergeStartSetCookieValues( + event: StartEvent, + cookies: Array, +): void { + if (cookies.length === 0) { + return + } + + const state = getResponseState(event) + state.removedHeaders?.delete('set-cookie') + if (state.setCookieBehavior !== 'replace') { + state.setCookieBehavior = 'merge' + } + replaceSetCookieValues( + state.headers, + getMergedSetCookieValues(state, getSetCookieValues(state.headers), cookies), + ) +} + +function hasProtectedHeaderChanges( + response: Response, + protectedHeaders: ProtectedHeaders, +): boolean { + const headers = response.headers + for (const [name, value] of protectedHeaders) { + if (headers.get(name) !== value) { + return true + } + } + return false +} + +function applyProtectedHeaders( + protectedHeaders: ProtectedHeaders, + headers: Headers, +): void { + for (const [name, value] of protectedHeaders) { + if (value === null) { + headers.delete(name) + } else { + headers.set(name, value) + } + } +} + +function applyHeaderState( + target: Headers, + state: ResponseState, + generatedBody: boolean, + protectedHeaders?: ProtectedHeaders, + appliedHeaderAppends?: Map, +): Headers { + let headers = target + const mutableHeaders = () => { + if (headers === target) { + headers = new Headers(target) + } + return headers + } + + if (state.clearHeaders) { + // Snapshot the keys before deleting: deleting during live Headers + // iteration skips entries. + for (const name of Array.from(target.keys())) { + if (!protectedHeaders?.has(name)) { + mutableHeaders().delete(name) + } + } + } + + if (!state.clearHeaders && state.removedHeaders) { + for (const name of state.removedHeaders) { + if (!protectedHeaders?.has(name) && headers.has(name)) { + mutableHeaders().delete(name) + } + } + } + + // Headers iteration combines repeated header values into one comma-joined + // value, so `set` carries multi-value headers (Link, Vary, ...) losslessly. + // Set-Cookie is the one header where comma-joining is unsafe (cookie + // attributes like Expires contain commas), so it is handled separately. + for (const [name, value] of state.headers) { + if ( + name !== 'set-cookie' && + !protectedHeaders?.has(name) && + !(generatedBody && GENERATED_BODY_EXCLUDED_HEADERS.has(name)) + ) { + let append = state.headerAppends?.get(name) + if (!append) { + if (headers.get(name) !== value) { + mutableHeaders().set(name, value) + } + continue + } + const applied = appliedHeaderAppends?.get(name) + const pending: Array = [] + while (append && append !== applied) { + pending.push(append.value) + append = append.previous + } + for (let index = pending.length - 1; index >= 0; index--) { + mutableHeaders().append(name, pending[index]!) + } + } + } + + if (state.setCookieBehavior && !protectedHeaders?.has('set-cookie')) { + const eventSetCookies = getSetCookieValues(state.headers) + const currentCookies = getSetCookieValues(headers) + const cookies = + state.setCookieBehavior === 'replace' + ? eventSetCookies + : getMergedSetCookieValues(state, currentCookies, eventSetCookies) + if ( + cookies.length !== currentCookies.length || + cookies.some((cookie, index) => cookie !== currentCookies[index]) + ) { + replaceSetCookieValues(mutableHeaders(), cookies) + } + } + return headers +} + +function canHaveBody(method: string, status: number): boolean { + return method !== 'HEAD' && status !== 204 && status !== 205 && status !== 304 +} + +/** A protected content type marks a Start-serialized body the client decodes. */ +function isSerializedResponse(protectedHeaders: ProtectedHeaders | undefined) { + return typeof protectedHeaders?.get('content-type') === 'string' +} + +/** + * A helper status that forbids a body never applies to a serialized + * server-function reply, because the client must decode it. Only a HEAD request + * drops its body. + */ +function getHelperStatus( + state: ResponseState | undefined, + serialized: boolean, +): number | undefined { + const status = state?.status + if (!serialized || status === undefined || canHaveBody('GET', status)) { + return status + } + if (process.env.NODE_ENV !== 'production' && !state!.bodylessStatusWarned) { + state!.bodylessStatusWarned = true + console.warn( + `setResponseStatus(${status}) does not apply to serialized server function responses, because the client must decode their body. Return a Response from the server function to send a response without a body.`, + ) + } + return undefined +} + +/** Helper status text describes the helper status and is ignored with it. */ +function getHelperStatusText( + state: ResponseState | undefined, + helperStatus: number | undefined, +): string | undefined { + return helperStatus === state?.status ? state?.statusText : undefined +} + +function cancelDroppedBody(response: Response, reason: string): void { + try { + response.body?.cancel(reason).catch(() => {}) + } catch { + // Ignore locked or already-consumed bodies. + } +} + +function createReconciledResponse( + body: Response['body'], + status: number, + statusText: string, + headers: Headers, +): Response { + try { + return new Response(body, { + status, + statusText, + headers, + }) + } catch (cause) { + throw new Error( + 'Unable to reconcile response because its body has already been consumed or locked.', + { cause }, + ) + } +} + +/** Apply helper state to a response that leaves Start. */ +export function finalizeResponse( + response: Response, + event: StartEvent, +): Response { + return applyResponseState(response, event, event.request.method) +} + +/** + * Apply helper state with the body rules of `method`. Request middleware still + * reads a HEAD response's body, so the pipeline applies GET rules and strips a + * HEAD body only when the response leaves it. + */ +function applyResponseState( + response: Response, + event: StartEvent, + method: string, + disposeBody?: (reason: string) => void, +): Response { + const protectedHeaders = getProtectedResponseHeaders(response) + const serialized = isSerializedResponse(protectedHeaders) + let helperStatus = getHelperStatus(event.responseState, serialized) + // Some runtimes, such as Bun, allow a body on a 204, 205, or 304 response, + // so check the response's own status too. Read the body last: the getter + // allocates a stream for responses that have not exposed one yet. + const mustDropBody = + !canHaveBody(method, helperStatus ?? response.status) && + response.body !== null + if (mustDropBody) { + const reason = + method === 'HEAD' + ? 'HEAD body stripped' + : 'Response body dropped by Start reconciliation' + if (disposeBody) { + disposeBody(reason) + } else { + cancelDroppedBody(response, reason) + } + // Cancellation/SSR cleanup can write helpers. Read their final state + // before applying headers or recording appends. + helperStatus = getHelperStatus(event.responseState, serialized) + } + const state = event.responseState + + // Without helper writes, preserve the response. + if (!state && !mustDropBody) { + event.currentResponse = response + return response + } + + const status = helperStatus ?? response.status + const statusText = + getHelperStatusText(state, helperStatus) ?? response.statusText + const statusChanged = status !== response.status + const statusTextChanged = statusText !== response.statusText + // applyHeaderState returns the same headers when helper intent changes + // nothing. + const headers = state + ? applyHeaderState( + response.headers, + state, + serialized, + protectedHeaders, + event.responseHeaderAppends?.get(response), + ) + : response.headers + + const reconciled = + statusChanged || + statusTextChanged || + mustDropBody || + headers !== response.headers + ? createReconciledResponse( + mustDropBody ? null : response.body, + status, + statusText, + headers, + ) + : response + if (protectedHeaders && reconciled !== response) { + installProtectedResponseHeaders(reconciled, protectedHeaders) + } + return publishResponse(reconciled, event) +} + +function publishResponse(response: Response, event: StartEvent): Response { + const headerAppends = event.responseState?.headerAppends + if (headerAppends?.size) { + ;(event.responseHeaderAppends ||= new WeakMap()).set( + response, + new Map(headerAppends), + ) + } + event.currentResponse = response + return response +} + +function getHttpErrorStatus(status: number | undefined): number | undefined { + return status !== undefined && status >= 400 ? status : undefined +} + +/** + * Status for a response built from an uncaught error. Only an error status + * (400-599) from a helper or from error metadata describes the failure, so a + * success or redirect status set before the throw cannot hide it. The error is + * logged unless its own metadata marks it as an HTTP error. Reporting runs + * before helper state is read, so hooks that write helpers are included. + */ +function resolveErrorStatus( + error: unknown, + event: Pick | undefined, +): { status: number; statusText: string } { + const metadataStatus = getErrorStatus(error) + const errorStatus = getHttpErrorStatus(metadataStatus) + if (errorStatus === undefined) { + console.error(error) + } + const state = event?.responseState + const helperStatus = getHttpErrorStatus(state?.status) + const status = helperStatus ?? errorStatus ?? 500 + const statusText = + getHelperStatusText(state, helperStatus) ?? + (status === errorStatus || metadataStatus === undefined + ? getErrorStatusText(error) + : undefined) ?? + '' + if (state && state.status !== helperStatus) { + // The failure replaced the response that status was meant for. Discard it + // so later reconciliation keeps the error status. + state.status = undefined + state.statusText = undefined + } + return { status, statusText } +} + +/** + * Internal: status and status text for a serialized server-function error. + * Logs the error and discards a non-error helper status, like any error + * response Start builds. + */ +export function resolveErrorResponseStatus(error: unknown): { + status: number + statusText: string +} { + return resolveErrorStatus(error, eventStorage.getStore()) +} + +function createErrorResponse(error: unknown, event: StartEvent): Response { + // Error metadata and reporting hooks can call public response helpers. + // Materialize them before taking the state used to build the response. + let headers = getErrorHeaders(error) ?? new Headers() + const { status, statusText } = resolveErrorStatus(error, event) + const state = event.responseState + const body = canHaveBody(event.request.method, status) + ? JSON.stringify({ + status, + statusText, + unhandled: true, + message: 'HTTPError', + }) + : null + if (!headers.has('content-type')) { + headers.set('content-type', 'application/json') + } + + if (state) { + headers = applyHeaderState(headers, state, true) + } + + // Build Start-owned errors with their final headers instead of creating a + // response that reconciliation must immediately reconstruct. A byte body + // keeps Fetch from restoring Content-Type after an explicit helper removal. + return publishResponse( + new Response( + body !== null && !headers.has('content-type') + ? new TextEncoder().encode(body) + : body, + { status, statusText, headers }, + ), + event, + ) +} + +function finalizeError(error: unknown, event: StartEvent): Response { + if (error instanceof Response) { + return finalizeResponse(error, event) + } + return createErrorResponse(error, event) +} + +export function handleStartError(error: unknown): Response { + const event = eventStorage.getStore() + if (event) { + return finalizeError(error, event) + } + if (error instanceof Response) { + return error + } + // Outside a server entry there is no invocation to recover. The thrown + // value is never used as a request identifier. + const request = new Request('http://localhost') + return createErrorResponse(error, { + request, + requestUrl: new URL(request.url), + }) +} + +/** Apply helper state to a response inside the request middleware pipeline. */ +export function reconcileResponse( + response: Response, + event: StartEvent, + disposeBody?: (reason: string) => void, +): Response { + // Without helper writes, only a bodyless status could change the response, + // and the response Start last published already satisfies it. Router + // redirects still need destination resolution (or an RPC envelope), so they + // keep their identity until createStartHandler resolves them; response + // getters can already read the helper overlay on this snapshot. + if ( + (!event.responseState && + (response === event.currentResponse || + canHaveBody('GET', response.status))) || + isRedirect(response) + ) { + event.currentResponse = response + return response + } + return applyResponseState(response, event, 'GET', disposeBody) +} + +/** + * Restore protocol headers that middleware changed directly on the response. + * Start does this once, when the response leaves the request middleware + * pipeline; helper writes never override them. + */ +export function restoreResponseProtocol( + response: Response, + event: StartEvent, +): Response { + const protectedHeaders = getProtectedResponseHeaders(response) + if ( + !protectedHeaders || + !hasProtectedHeaderChanges(response, protectedHeaders) + ) { + return response + } + const headers = new Headers(response.headers) + applyProtectedHeaders(protectedHeaders, headers) + const restored = createReconciledResponse( + response.body, + response.status, + response.statusText, + headers, + ) + transferResponseMetadata(response, restored) + event.currentResponse = restored + return restored +} + +/** + * Build a Start-owned serialized reply with already normalized protocol + * headers. A bodyless helper status never applies to it; only a HEAD request + * drops its body. + */ +export function createFinalizedResponse( + body: string | Uint8Array, + headers: Headers, + protectedHeaders: ProtectedHeaders, + event: StartEvent, +): Response { + const state = event.responseState + let status = 200 + let statusText = '' + if (state) { + const helperStatus = getHelperStatus(state, true) + status = helperStatus ?? 200 + statusText = getHelperStatusText(state, helperStatus) ?? '' + headers = applyHeaderState(headers, state, true, protectedHeaders) + } + const response = new Response( + canHaveBody(event.request.method, status) ? (body as BodyInit) : null, + { status, statusText, headers }, + ) + // A new response has no protection to merge with. + installProtectedResponseHeaders(response, protectedHeaders) + return publishResponse(response, event) +} + +export function protectResponseHeaders( + response: Response, + headers: ProtectedHeaders, +): void { + // Callers supply immutable protocol requirements with lowercase names. + // Share those requirements across responses instead of capturing each one. + const previous = getProtectedResponseHeaders(response) + if (previous === headers) { + return + } + if (previous) { + const merged = new Map(previous) + for (const [name, value] of headers) { + merged.set(name, value) + } + headers = merged + } + installProtectedResponseHeaders(response, headers) +} + +/** + * Set and protect transport headers on a new response. Reuse the body stream + * without cloning or teeing it; callers transfer ownership to the result. + */ +export function setProtectedResponseHeaders( + response: Response, + headers: ProtectedHeaders, +): Response { + let next: Response + try { + // Response copies its initializer's headers; change only that fresh copy. + next = new Response(response.body, response) + applyProtectedHeaders(headers, next.headers) + } catch (cause) { + throw new Error( + 'Unable to set response header because its body has already been consumed or locked.', + { cause }, + ) + } + transferResponseMetadata(response, next) + protectResponseHeaders(next, headers) + return next +} + +function decodePathname(pathname: string): string | undefined { + try { + // Return the value so bundlers preserve the potentially throwing decode. + return decodeURI(pathname) + } catch (error) { + if (error instanceof URIError) { + return undefined + } + throw error + } +} + +/** A Start handler that runs in a request scope and receives its event. */ +type ScopedRequestHandler = ( + request: Request, + requestOpts: any, + event: StartEvent, +) => MaybePromise + +function runInStartRequest( + request: Request, + requestOpts: any, + handler: ScopedRequestHandler, +): MaybePromise { + let requestUrl: URL + try { + requestUrl = new URL(request.url) + } catch (error) { + if (error instanceof TypeError) { + return new Response(null, { status: 400, statusText: 'Bad Request' }) + } + throw error + } + const pathname = requestUrl.pathname + // Validate encoded paths without changing the pathname used for routing. + if (pathname.includes('%') && decodePathname(pathname) === undefined) { + return new Response(null, { status: 400, statusText: 'Bad Request' }) + } + const event: StartEvent = { request, requestUrl } + return eventStorage.run(event, handler, request, requestOpts, event) +} + +/** + * Keep the complete server entry, including custom error handling, inside one + * request scope. A custom returned response is used as-is; call handleStartError + * in a custom catch to preserve Start's response helper state. + */ +export function createServerEntry(entry: { + fetch: RequestHandler +}): { fetch: RequestHandler } { + return { + fetch: withStartRequest(async (request: Request, requestOpts: any) => { + try { + return await entry.fetch(request, requestOpts) + } catch (error) { + return handleStartError(error) + } + }), + } +} + +/** + * Establish request scope; the response pipeline owns reconciliation. A nested + * handler delegating the same request participates in its scope. Independent + * fetch invocations and different requests get a fresh event. + */ +export function withStartRequest(handler: ScopedRequestHandler) { + return (request: Request, requestOpts: any): MaybePromise => { + const event = eventStorage.getStore() + if (event?.request === request) { + return handler(request, requestOpts, event) + } + return runInStartRequest(request, requestOpts, handler) + } +} + +export function getStartEvent() { + const event = eventStorage.getStore() + if (!event) { + throw new Error( + `No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`, + ) + } + return event +} + +/** + * Internal: returns the per-request parsed URL for `request`, memoized on the + * Start event so the framework parses each request URL only once. Falls back + * to parsing when called outside a Start event (e.g. in unit tests) or for a + * foreign request. Callers MUST NOT mutate the returned URL. + */ +export function getParsedRequestUrl(request: Request): URL { + const event = eventStorage.getStore() + if (event && event.request === request) { + return event.requestUrl + } + return new URL(request.url) +} + +export function getRequest(): Request { + return getStartEvent().request +} + +export function getRequestHeaders(): TypedHeaders { + return getStartEvent().request.headers as TypedHeaders +} + +export function getRequestHeader(name: RequestHeaderName): string | undefined { + return getRequestHeaders().get(name) ?? undefined +} + +export function getRequestIP(opts?: { + /** + * Use the X-Forwarded-For HTTP header set by proxies. + * + * Note: Make sure that this header can be trusted (your application running behind a CDN or reverse proxy) before enabling. + */ + xForwardedFor?: boolean +}) { + const request = getRequest() + if (opts?.xForwardedFor) { + const forwardedFor = request.headers.get('x-forwarded-for') + const forwardedIp = forwardedFor?.split(',', 1)[0]?.trim() + if (forwardedIp) { + return forwardedIp + } + } + + return ( + (request as Request & { context?: { clientAddress?: string }; ip?: string }) + .context?.clientAddress || + (request as Request & { ip?: string }).ip || + undefined + ) +} + +/** + * Get the request hostname. + * + * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists. + * + * If no host header is found, it uses the request URL's host. + */ +export function getRequestHost(opts?: { xForwardedHost?: boolean }) { + const headers = getRequestHeaders() + if (opts?.xForwardedHost) { + const forwardedHost = headers.get('x-forwarded-host') + const host = forwardedHost?.split(',', 1)[0]?.trim() + if (host) { + return host + } + } + return headers.get('host') || getStartEvent().requestUrl.host || 'localhost' +} + +/** + * Get the full incoming request URL. + * + * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists. + * + * If `xForwardedProto` is `false`, it will not use the `x-forwarded-proto` header. + */ +export function getRequestUrl(opts?: { + xForwardedHost?: boolean + xForwardedProto?: boolean +}) { + const event = getStartEvent() + // Clone the memoized URL so callers can mutate the result freely. + const url = new URL(event.requestUrl) + url.protocol = getRequestProtocol(opts) + if (opts?.xForwardedHost) { + const host = getRequestHost(opts) + if (host) { + url.host = host + if (!/:\d+$/.test(host)) { + url.port = '' + } + } + } + return url +} + +/** + * Get the request protocol. + * + * If `x-forwarded-proto` header is set to "https", it will return "https". You can disable this behavior by setting `xForwardedProto` to `false`. + * + * If protocol cannot be determined, it will default to "http". + */ +export function getRequestProtocol(opts?: { + xForwardedProto?: boolean +}): 'http' | 'https' | (string & {}) { + const request = getRequest() + if (opts?.xForwardedProto !== false) { + const forwardedProto = request.headers + .get('x-forwarded-proto') + ?.split(',', 1)[0] + ?.trim() + .toLowerCase() + if (forwardedProto === 'https') { + return 'https' + } + if (forwardedProto === 'http') { + return 'http' + } + } + const url = getStartEvent().requestUrl + return url.protocol.slice(0, -1) as 'http' | 'https' | (string & {}) +} + +export function setResponseHeaders( + headers: TypedHeaders | ReadonlyResponseHeaders, +): void { + if (headers instanceof Headers) { + for (const [name, value] of headers) { + if (name !== 'set-cookie') { + setResponseHeader(name as ResponseHeaderName, value) + } + } + + const cookies = getSetCookieValues(headers) + if (cookies.length > 0) { + setResponseHeader( + 'set-cookie', + cookies.length === 1 ? cookies[0]! : cookies, + ) + } + return + } + + if (!Array.isArray(headers)) { + for (const [name, value] of Object.entries( + headers as unknown as Record>, + )) { + setResponseHeader(name as ResponseHeaderName, value) + } + return + } + + const groupedHeaders = new Map< + string, + { name: ResponseHeaderName; values: Array } + >() + const addHeader = (name: string, value: string) => { + const normalizedName = normalizeHeaderName(name) + let header = groupedHeaders.get(normalizedName) + if (!header) { + header = { name: name as ResponseHeaderName, values: [] } + groupedHeaders.set(normalizedName, header) + } + header.values.push(value) + } + + for (const [name, value] of headers) { + addHeader(name, value) + } + + for (const { name, values } of groupedHeaders.values()) { + setResponseHeader(name, values.length === 1 ? values[0]! : values) + } +} + +let SnapshotHeaders: typeof Headers | undefined + +/** + * Outside production, return the snapshot as a Headers subclass that warns when + * code tries to change the outgoing response through it. Its contents and + * behavior are identical to the production snapshot. + */ +function toResponseHeadersSnapshot(headers: Headers): ReadonlyResponseHeaders { + if (process.env.NODE_ENV === 'production') { + return headers as ReadonlyResponseHeaders + } + SnapshotHeaders ??= class ResponseHeadersSnapshot extends Headers { + override append(name: string, value: string): void { + warnSnapshotMutation('append') + super.append(name, value) + } + override delete(name: string): void { + warnSnapshotMutation('delete') + super.delete(name) + } + override set(name: string, value: string): void { + warnSnapshotMutation('set') + super.set(name, value) + } + } + // The constructor fills entries without calling the overridden methods. + const entries: Array<[string, string]> = [] + for (const [name, value] of headers) { + if (name !== 'set-cookie') { + entries.push([name, value]) + } + } + for (const cookie of getSetCookieValues(headers)) { + entries.push(['set-cookie', cookie]) + } + return new SnapshotHeaders(entries) as ReadonlyResponseHeaders +} + +function warnSnapshotMutation(method: string): void { + console.warn( + `getResponseHeaders().${method}() does not change the response: getResponseHeaders() returns a read-only snapshot. Use setResponseHeader, appendResponseHeader, removeResponseHeader, clearResponseHeaders, or setCookie instead.`, + ) +} + +/** + * Read a detached snapshot of the effective response headers. + * Use response header and cookie helpers to change the outgoing response. + */ +export function getResponseHeaders(): ReadonlyResponseHeaders { + const event = getStartEvent() + const state = event.responseState + const currentResponse = event.currentResponse + if (!currentResponse) { + return toResponseHeadersSnapshot( + state ? new Headers(state.headers) : new Headers(), + ) + } + const protectedHeaders = getProtectedResponseHeaders(currentResponse) + let headers = currentResponse.headers + if (state) { + headers = applyHeaderState( + headers, + state, + isSerializedResponse(protectedHeaders), + protectedHeaders, + event.responseHeaderAppends?.get(currentResponse), + ) + } + // Read helpers always return a detached snapshot, including when applying + // helper intent did not need to copy any headers. + if (headers === currentResponse.headers) { + headers = new Headers(headers) + } + if (protectedHeaders) { + applyProtectedHeaders(protectedHeaders, headers) + } + return toResponseHeadersSnapshot(headers) +} + +export function getResponseHeader( + name: ResponseHeaderName, +): string | undefined { + const event = getStartEvent() + const normalizedName = normalizeHeaderName(name) + if ( + normalizedName === 'set-cookie' || + event.responseState?.headerAppends?.has(normalizedName) + ) { + return getResponseHeaders().get(name) ?? undefined + } + const currentResponse = event.currentResponse + const protectedHeaders = currentResponse + ? getProtectedResponseHeaders(currentResponse) + : undefined + if (protectedHeaders?.has(normalizedName)) { + return protectedHeaders.get(normalizedName) ?? undefined + } + if ( + GENERATED_BODY_EXCLUDED_HEADERS.has(normalizedName) && + isSerializedResponse(protectedHeaders) + ) { + return currentResponse!.headers.get(name) ?? undefined + } + + const state = event.responseState + if (state) { + const stateValue = state.headers.get(name) + if (stateValue !== null) { + return stateValue + } + + if (state.clearHeaders) { + return undefined + } + + if (state.removedHeaders?.has(normalizedName)) { + return undefined + } + } + + return currentResponse?.headers.get(name) ?? undefined +} + +export function setResponseHeader( + name: ResponseHeaderName, + value: string | Array, +): void { + const event = getStartEvent() + if (Array.isArray(value)) { + deleteHeaderState(event, name) + for (const valueItem of value) { + appendHeaderState(event, name, valueItem) + } + } else { + setHeaderState(event, name, value) + } +} + +/** + * Append a response header value without replacing existing values. + * + * Ordinary values are appended once per returned response. Start transfers + * that application state when it reconstructs a response. A new response + * created by application code is fresh input: copying already-reconciled + * headers into it also copies their appended values, and helper appends apply + * again. Mutate the current response or pass its middleware result through + * when preserving an existing response's headers. + * + * For `set-cookie`, values must be fully serialized cookie strings; they are + * merged into the outgoing cookies and deduped by cookie identity + * (name + domain + path), exactly like `setCookie`. A value that cannot be + * parsed is identified by its exact string. This is the primitive to + * use when bridging external session/auth libraries that produce raw + * `Set-Cookie` strings. + * + * ```ts + * appendResponseHeader('set-cookie', await externalLib.commitSession(session)) + * ``` + */ +export function appendResponseHeader( + name: ResponseHeaderName, + value: string | Array, +): void { + const event = getStartEvent() + const values = Array.isArray(value) ? value : [value] + if (normalizeHeaderName(name) === 'set-cookie') { + // Merge one value at a time so a batched call behaves exactly like + // sequential calls (same-identity cookies dedupe, last wins). + for (const valueItem of values) { + // Validate before changing cookie identity or removal intent. External + // libraries supply serialized strings, which can fail native validation. + const headers = new Headers({ 'set-cookie': valueItem }) + mergeStartSetCookieValues(event, getSetCookieValues(headers)) + } + return + } + for (const valueItem of values) { + appendHeaderState(event, name, valueItem) + } +} + +export function removeResponseHeader(name: ResponseHeaderName): void { + deleteHeaderState(getStartEvent(), name) +} + +export function clearResponseHeaders( + headerNames?: Array, +): void { + const event = getStartEvent() + if (headerNames && headerNames.length > 0) { + for (const name of headerNames) { + deleteHeaderState(event, name) + } + return + } + + const state = getResponseState(event) + state.clearHeaders = true + state.headers = new Headers() + state.headerAppends = undefined +} + +export function getResponseStatus(): number { + const event = getStartEvent() + const currentResponse = event.currentResponse + const serialized = + !!currentResponse && + isSerializedResponse(getProtectedResponseHeaders(currentResponse)) + return ( + getHelperStatus(event.responseState, serialized) ?? + currentResponse?.status ?? + 200 + ) +} + +export function setResponseStatus(code?: number, text?: string): void { + const event = getStartEvent() + if (code !== undefined) { + // An unusable code must not replace an earlier, returned, or error status. + // Ignore the whole call, including its status text, which describes it. + const status = sanitizeStatusCode(code) + if (status === undefined) { + if (process.env.NODE_ENV !== 'production') { + console.warn( + `setResponseStatus(${code}) was ignored: Fetch Response status codes must be integers from 200 to 599.`, + ) + } + return + } + getResponseState(event).status = status + } + if (text) { + getResponseState(event).statusText = sanitizeStatusMessage(text) + } +} + +/** + * Parse the request to get HTTP Cookie header string and return an object of all cookie name-value pairs. + * @returns Object of cookie name-value pairs + * ```ts + * const cookies = getCookies() + * ``` + */ +export function getCookies(): Record { + const cookies = parseCookie(getRequestHeaders().get('cookie') || '') + const definedCookies: Record = Object.create(null) + + for (const [name, value] of Object.entries(cookies)) { + if (value !== undefined) { + definedCookies[name] = value + } + } + + return definedCookies +} + +/** + * Get a cookie value by name. + * @param name Name of the cookie to get + * @returns {*} Value of the cookie (String or undefined) + * ```ts + * const authorization = getCookie('Authorization') + * ``` + */ +export function getCookie(name: string): string | undefined { + return getCookies()[name] +} + +/** + * Set a cookie value by name. + * @param name Name of the cookie to set + * @param value Value of the cookie to set + * @param options {CookieSerializeOptions} Options for serializing the cookie + * ```ts + * setCookie('Authorization', '1234567') + * ``` + */ +export function setCookie( + name: string, + value: string, + options?: CookieSerializeOptions, +): void { + const { encode, stringify, ...attrs } = options ?? {} + mergeStartSetCookieValues(getStartEvent(), [ + serializeCookie( + { name, value, path: '/', ...attrs }, + { encode, stringify }, + ), + ]) +} + +/** + * Remove a cookie by name. + * @param name Name of the cookie to delete + * @param serializeOptions {CookieSerializeOptions} Cookie options + * ```ts + * deleteCookie('SessionId') + * ``` + */ +export function deleteCookie( + name: string, + options?: CookieSerializeOptions, +): void { + setCookie(name, '', { + ...options, + maxAge: 0, + }) +} + +/** + * Internal: helper status state for a serialized server-function reply. + * Bodyless statuses never apply to it and are omitted with their status text. + */ +export function getSerializedResponseState(): { + status: number | undefined + statusText: string | undefined +} { + const state = getStartEvent().responseState + const status = getHelperStatus(state, true) + return { status, statusText: getHelperStatusText(state, status) } +} diff --git a/packages/start-server-core/src/request-response.ts b/packages/start-server-core/src/request-response.ts index e0ad8a336a..83c529ff9f 100644 --- a/packages/start-server-core/src/request-response.ts +++ b/packages/start-server-core/src/request-response.ts @@ -1,428 +1,30 @@ -import { AsyncLocalStorage } from 'node:async_hooks' +export { + appendResponseHeader, + clearResponseHeaders, + createServerEntry, + deleteCookie, + getCookie, + getCookies, + getRequest, + getRequestHeader, + getRequestHeaders, + getRequestHost, + getRequestIP, + getRequestProtocol, + getRequestUrl, + getResponseHeader, + getResponseHeaders, + getResponseStatus, + handleStartError, + removeResponseHeader, + setCookie, + setResponseHeader, + setResponseHeaders, + setResponseStatus, +} from './internal-request-response' -import { - H3Event, - clearSession as h3_clearSession, - deleteCookie as h3_deleteCookie, - getRequestHost as h3_getRequestHost, - getRequestIP as h3_getRequestIP, - getRequestProtocol as h3_getRequestProtocol, - getRequestURL as h3_getRequestURL, - getSession as h3_getSession, - getValidatedQuery as h3_getValidatedQuery, - parseCookies as h3_parseCookies, - sanitizeStatusCode as h3_sanitizeStatusCode, - sanitizeStatusMessage as h3_sanitizeStatusMessage, - sealSession as h3_sealSession, - setCookie as h3_setCookie, - toResponse as h3_toResponse, - unsealSession as h3_unsealSession, - updateSession as h3_updateSession, - useSession as h3_useSession, -} from 'h3-v2' -import type { - RequestHeaderMap, +export type { + ReadonlyResponseHeaders, RequestHeaderName, - ResponseHeaderMap, ResponseHeaderName, - TypedHeaders, -} from 'fetchdts' - -import type { CookieSerializeOptions } from 'cookie-es' -import type { - Session, - SessionConfig, - SessionData, - SessionManager, - SessionUpdate, -} from './session' -import type { StandardSchemaV1 } from '@standard-schema/spec' -import type { RequestHandler } from './request-handler' - -interface StartEvent { - h3Event: H3Event -} - -// Use a global symbol to ensure the same AsyncLocalStorage instance is shared -// across different bundles that may each bundle this module. -const GLOBAL_EVENT_STORAGE_KEY = Symbol.for('tanstack-start:event-storage') - -const globalObj = globalThis as typeof globalThis & { - [GLOBAL_EVENT_STORAGE_KEY]?: AsyncLocalStorage -} - -if (!globalObj[GLOBAL_EVENT_STORAGE_KEY]) { - globalObj[GLOBAL_EVENT_STORAGE_KEY] = new AsyncLocalStorage() -} - -const eventStorage = globalObj[GLOBAL_EVENT_STORAGE_KEY] - -export type { ResponseHeaderName, RequestHeaderName } - -type HeadersWithGetSetCookie = Headers & { - getSetCookie?: () => Array -} - -type MaybePromise = T | Promise - -function isPromiseLike(value: MaybePromise): value is Promise { - return typeof (value as Promise).then === 'function' -} - -function getSetCookieValues(headers: Headers): Array { - const headersWithSetCookie = headers as HeadersWithGetSetCookie - if (typeof headersWithSetCookie.getSetCookie === 'function') { - return headersWithSetCookie.getSetCookie() - } - const value = headers.get('set-cookie') - return value ? [value] : [] -} - -function mergeEventResponseHeaders(response: Response, event: H3Event): void { - if (response.ok) { - return - } - - const eventSetCookies = getSetCookieValues(event.res.headers) - if (eventSetCookies.length === 0) { - return - } - - const responseSetCookies = getSetCookieValues(response.headers) - response.headers.delete('set-cookie') - for (const cookie of responseSetCookies) { - response.headers.append('set-cookie', cookie) - } - for (const cookie of eventSetCookies) { - response.headers.append('set-cookie', cookie) - } -} - -function attachResponseHeaders( - value: MaybePromise, - event: H3Event, -): MaybePromise { - if (isPromiseLike(value)) { - return value.then((resolved) => { - if (resolved instanceof Response) { - mergeEventResponseHeaders(resolved, event) - } - return resolved - }) - } - - if (value instanceof Response) { - mergeEventResponseHeaders(value, event) - } - - return value -} - -export function requestHandler( - handler: RequestHandler, -) { - return (request: Request, requestOpts: any): Promise | Response => { - let h3Event: H3Event - try { - h3Event = new H3Event(request) - } catch (error) { - if (error instanceof URIError) { - return new Response(null, { - status: 400, - statusText: 'Bad Request', - }) - } - throw error - } - - const response = eventStorage.run({ h3Event }, () => - handler(request, requestOpts), - ) - return h3_toResponse(attachResponseHeaders(response, h3Event), h3Event) - } -} - -function getH3Event() { - const event = eventStorage.getStore() - if (!event) { - throw new Error( - `No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`, - ) - } - return event.h3Event -} - -export function getRequest(): Request { - const event = getH3Event() - return event.req -} - -export function getRequestHeaders(): TypedHeaders { - return getH3Event().req.headers -} - -export function getRequestHeader(name: RequestHeaderName): string | undefined { - return getRequestHeaders().get(name) || undefined -} - -export function getRequestIP(opts?: { - /** - * Use the X-Forwarded-For HTTP header set by proxies. - * - * Note: Make sure that this header can be trusted (your application running behind a CDN or reverse proxy) before enabling. - */ - xForwardedFor?: boolean -}) { - return h3_getRequestIP(getH3Event(), opts) -} - -/** - * Get the request hostname. - * - * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists. - * - * If no host header is found, it will default to "localhost". - */ -export function getRequestHost(opts?: { xForwardedHost?: boolean }) { - return h3_getRequestHost(getH3Event(), opts) -} - -/** - * Get the full incoming request URL. - * - * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists. - * - * If `xForwardedProto` is `false`, it will not use the `x-forwarded-proto` header. - */ -export function getRequestUrl(opts?: { - xForwardedHost?: boolean - xForwardedProto?: boolean -}) { - return h3_getRequestURL(getH3Event(), opts) -} - -/** - * Get the request protocol. - * - * If `x-forwarded-proto` header is set to "https", it will return "https". You can disable this behavior by setting `xForwardedProto` to `false`. - * - * If protocol cannot be determined, it will default to "http". - */ -export function getRequestProtocol(opts?: { - xForwardedProto?: boolean -}): 'http' | 'https' | (string & {}) { - return h3_getRequestProtocol(getH3Event(), opts) -} - -export function setResponseHeaders( - headers: TypedHeaders, -): void { - const event = getH3Event() - for (const [name, value] of Object.entries(headers)) { - event.res.headers.set(name, value) - } -} - -export function getResponseHeaders(): TypedHeaders { - const event = getH3Event() - return event.res.headers -} - -export function getResponseHeader( - name: ResponseHeaderName, -): string | undefined { - const event = getH3Event() - return event.res.headers.get(name) || undefined -} - -export function setResponseHeader( - name: ResponseHeaderName, - value: string | Array, -): void { - const event = getH3Event() - if (Array.isArray(value)) { - event.res.headers.delete(name) - for (const valueItem of value) { - event.res.headers.append(name, valueItem) - } - } else { - event.res.headers.set(name, value) - } -} -export function removeResponseHeader(name: ResponseHeaderName): void { - const event = getH3Event() - event.res.headers.delete(name) -} - -export function clearResponseHeaders( - headerNames?: Array, -): void { - const event = getH3Event() - // If headerNames is provided, clear only those headers - if (headerNames && headerNames.length > 0) { - for (const name of headerNames) { - event.res.headers.delete(name) - } - // Otherwise, clear all headers - } else { - for (const name of event.res.headers.keys()) { - event.res.headers.delete(name) - } - } -} - -export function getResponseStatus(): number { - return getH3Event().res.status || 200 -} - -export function setResponseStatus(code?: number, text?: string): void { - const event = getH3Event() - if (code) { - event.res.status = h3_sanitizeStatusCode(code, event.res.status) - } - if (text) { - event.res.statusText = h3_sanitizeStatusMessage(text) - } -} - -/** - * Parse the request to get HTTP Cookie header string and return an object of all cookie name-value pairs. - * @returns Object of cookie name-value pairs - * ```ts - * const cookies = getCookies() - * ``` - */ -export function getCookies(): Record { - const event = getH3Event() - const cookies = h3_parseCookies(event) - const definedCookies: Record = Object.create(null) - - for (const [name, value] of Object.entries(cookies)) { - if (value !== undefined) { - definedCookies[name] = value - } - } - - return definedCookies -} - -/** - * Get a cookie value by name. - * @param name Name of the cookie to get - * @returns {*} Value of the cookie (String or undefined) - * ```ts - * const authorization = getCookie('Authorization') - * ``` - */ -export function getCookie(name: string): string | undefined { - return getCookies()[name] -} - -/** - * Set a cookie value by name. - * @param name Name of the cookie to set - * @param value Value of the cookie to set - * @param options {CookieSerializeOptions} Options for serializing the cookie - * ```ts - * setCookie('Authorization', '1234567') - * ``` - */ -export function setCookie( - name: string, - value: string, - options?: CookieSerializeOptions, -): void { - const event = getH3Event() - h3_setCookie(event, name, value, options) -} - -/** - * Remove a cookie by name. - * @param name Name of the cookie to delete - * @param serializeOptions {CookieSerializeOptions} Cookie options - * ```ts - * deleteCookie('SessionId') - * ``` - */ -export function deleteCookie( - name: string, - options?: CookieSerializeOptions, -): void { - const event = getH3Event() - h3_deleteCookie(event, name, options) -} - -function getDefaultSessionConfig(config: SessionConfig): SessionConfig { - return { - name: 'start', - ...config, - } -} - -/** - * Create a session manager for the current request. - */ -export function useSession( - config: SessionConfig, -): Promise> { - const event = getH3Event() - return h3_useSession(event, getDefaultSessionConfig(config)) -} -/** - * Get the session for the current request - */ -export function getSession( - config: SessionConfig, -): Promise> { - const event = getH3Event() - return h3_getSession(event, getDefaultSessionConfig(config)) -} - -/** - * Update the session data for the current request. - */ -export function updateSession( - config: SessionConfig, - update?: SessionUpdate, -): Promise> { - const event = getH3Event() - return h3_updateSession(event, getDefaultSessionConfig(config), update) -} - -/** - * Encrypt and sign the session data for the current request. - */ -export function sealSession(config: SessionConfig): Promise { - const event = getH3Event() - return h3_sealSession(event, getDefaultSessionConfig(config)) -} -/** - * Decrypt and verify the session data for the current request. - */ -export function unsealSession( - config: SessionConfig, - sealed: string, -): Promise> { - const event = getH3Event() - return h3_unsealSession(event, getDefaultSessionConfig(config), sealed) -} - -/** - * Clear the session data for the current request. - */ -export function clearSession(config: Partial): Promise { - const event = getH3Event() - return h3_clearSession(event, { name: 'start', ...config }) -} - -export function getResponse() { - const event = getH3Event() - return event.res -} - -// not public API (yet) -export function getValidatedQuery( - schema: StandardSchemaV1, -): Promise> { - return h3_getValidatedQuery(getH3Event(), schema) -} +} from './internal-request-response' diff --git a/packages/start-server-core/src/serializer/ServerFunctionSerializationAdapter.ts b/packages/start-server-core/src/serializer/ServerFunctionSerializationAdapter.ts index d127b253d5..0eb4993cac 100644 --- a/packages/start-server-core/src/serializer/ServerFunctionSerializationAdapter.ts +++ b/packages/start-server-core/src/serializer/ServerFunctionSerializationAdapter.ts @@ -18,7 +18,18 @@ export const ServerFunctionSerializationAdapter = createSerializationAdapter({ // to another server function), it originates from the client and must be // validated the same way as direct HTTP calls to server functions. const serverFn = await getServerFnById(functionId, { origin: 'client' }) - const result = await serverFn(opts ?? {}, signal) + const result = await serverFn( + { + data: opts?.data, + context: opts?.context, + method: serverFn.method ?? 'GET', + }, + signal, + ) + // Only a failed call has an `error` key, holding the thrown value. + if ('error' in result) { + throw result.error + } return result.result } return fn as never diff --git a/packages/start-server-core/src/server-functions-handler.ts b/packages/start-server-core/src/server-functions-handler.ts index e7d961decf..9fdad40281 100644 --- a/packages/start-server-core/src/server-functions-handler.ts +++ b/packages/start-server-core/src/server-functions-handler.ts @@ -1,51 +1,186 @@ +import { invariant, isNotFound, isRedirect } from '@tanstack/router-core' import { createRawStreamRPCPlugin, - invariant, - isNotFound, - isRedirect, -} from '@tanstack/router-core' + defaultSerovalDeserializerPlugins as routerDefaultSerovalPlugins, +} from '@tanstack/router-core/ssr/server' import { + TSS_CONTENT_TYPE_FRAMED_VERSIONED, TSS_FORMDATA_CONTEXT, X_TSS_RAW_RESPONSE, X_TSS_SERIALIZED, - getDefaultSerovalPlugins, - safeObjectMerge, + getSerovalPlugins, } from '@tanstack/start-client-core' -import { fromJSON, toCrossJSONAsync, toCrossJSONStream } from 'seroval' -import { getResponse } from './request-response' -import { getServerFnById } from './getServerFnById' import { - TSS_CONTENT_TYPE_FRAMED_VERSIONED, - createMultiplexedStream, + MAX_FRAMED_STREAMS, + MAX_FRAME_PAYLOAD_SIZE, +} from '@tanstack/start-client-core/client-rpc' +import { fromJSON, toCrossJSONAsync, toCrossJSONStream } from 'seroval' +import { + createFinalizedResponse, + getErrorHeaders, + getParsedRequestUrl, + getSerializedResponseState, + protectResponseHeaders, + resolveErrorResponseStatus, + setProtectedResponseHeaders, +} from './internal-request-response' +import { getServerFnById } from './getServerFnById' +import { createMultiplexedStream } from './frame-protocol' +import type { + LateStreamRegistration, + MultiplexedStreamOptions, + MultiplexedStreamRecord, } from './frame-protocol' -import type { LateStreamRegistration } from './frame-protocol' import type { Plugin as SerovalPlugin } from 'seroval' +import type { StartEvent } from './internal-request-response' -// Cache serovalPlugins at module level to avoid repeated calls -let serovalPlugins: Array> | undefined = undefined +// Serialized replies are decoded by the client from their body. With a +// helper-selected 3xx status, a Location would let fetch follow it first. +const SERIALIZED_JSON_HEADERS: ReadonlyMap = new Map([ + ['content-type', 'application/json'], + [X_TSS_SERIALIZED, 'true'], + [X_TSS_RAW_RESPONSE, null], + ['location', null], +]) +// A shared template the Response constructor copies. Never mutate it. +const SERIALIZED_JSON_HEADER_INIT = new Headers({ + 'content-type': 'application/json', + [X_TSS_SERIALIZED]: 'true', +}) -// Known FormData 'Content-Type' header values - module-level constant -const FORM_DATA_CONTENT_TYPES = [ - 'multipart/form-data', - 'application/x-www-form-urlencoded', -] +/** Completed bytes own no stream until the request pipeline accepts them. */ +export class DeferredResponse { + constructor(private readonly body: Uint8Array) {} + + createResponse(event: StartEvent): Response { + return createFinalizedResponse( + this.body, + SERIALIZED_JSON_HEADER_INIT, + SERIALIZED_JSON_HEADERS, + event, + ) + } +} + +const SERIALIZED_FRAMED_HEADERS: ReadonlyMap = new Map([ + ['content-type', TSS_CONTENT_TYPE_FRAMED_VERSIONED], + [X_TSS_SERIALIZED, 'true'], + [X_TSS_RAW_RESPONSE, null], + ['location', null], +]) +const NOT_FOUND_HEADERS: ReadonlyMap = new Map([ + ['content-type', 'application/json'], + [X_TSS_SERIALIZED, null], + [X_TSS_RAW_RESPONSE, null], + ['location', null], +]) +const RAW_RESPONSE_HEADERS: ReadonlyMap = new Map([ + [X_TSS_RAW_RESPONSE, 'true'], +]) +// A Response the server function threw. The client rethrows it. +const THROWN_RESPONSE_HEADERS: ReadonlyMap = new Map([ + [X_TSS_RAW_RESPONSE, 'thrown'], +]) // Maximum payload size for GET requests (1MB) const MAX_PAYLOAD_SIZE = 1_000_000 +const MAX_PENDING_SERIALIZATION_RECORDS = 1024 +const MAX_PENDING_SERIALIZATION_BYTES = 32 * 1024 * 1024 +const textEncoder = new TextEncoder() +function encodeSerializationRecord(value: unknown) { + return textEncoder.encode(JSON.stringify(value)) +} + +function exceedsPendingSerializationLimit( + record: Uint8Array, + recordCount: number, + pendingBytes: number, +) { + return ( + recordCount >= MAX_PENDING_SERIALIZATION_RECORDS || + pendingBytes + record.byteLength > MAX_PENDING_SERIALIZATION_BYTES + ) +} + +function runSerializationCleanup(dispose: () => void) { + try { + dispose() + } catch {} +} + +function cancelRawStream(stream: ReadableStream, reason?: unknown) { + void stream.cancel(reason).catch(() => {}) +} + +/** + * Marks a Response thrown during a server-function request so the client + * rejects the call with it. Redirects keep their own protocol. + */ +export function toThrownServerFnResponse(response: Response): Response { + return isRedirect(response) + ? response + : setProtectedResponseHeaders(response, THROWN_RESPONSE_HEADERS) +} + +/** + * Builds the reply for a server-function request that failed outside the + * function, such as in request middleware. Like a failed call, it carries + * only the thrown value under an `error` key, so the client rethrows it. + */ +export async function createServerFnErrorResponse( + error: unknown, + serovalPlugins?: Array>, +) { + if (isNotFound(error)) { + return isNotFoundResponse(error) + } + + // Header getters and reporting hooks can write helpers before the status + // is resolved. Error statuses are always body-bearing, as the client needs. + const headers = getErrorHeaders(error) ?? new Headers() + const { status, statusText } = resolveErrorResponseStatus(error) + headers.set('Content-Type', 'application/json') + headers.set(X_TSS_SERIALIZED, 'true') + headers.delete(X_TSS_RAW_RESPONSE) + headers.delete('location') + + const plugins = + serovalPlugins ?? getSerovalPlugins(routerDefaultSerovalPlugins) + let serializedError: string + try { + serializedError = JSON.stringify( + await toCrossJSONAsync({ error }, { refs: new Map(), plugins }), + ) + } catch (serializationError) { + // Like a result that cannot be serialized, the call rejects with the + // serialization error instead of the value it could not send. + serializedError = JSON.stringify( + await toCrossJSONAsync( + { error: serializationError }, + { refs: new Map(), plugins }, + ), + ) + } + const errorResponse = new Response(serializedError, { + status, + statusText, + headers, + }) + protectResponseHeaders(errorResponse, SERIALIZED_JSON_HEADERS) + return errorResponse +} + +// The action merges the client context with the trusted server context +// (__executeServer), so the client context is passed through unmerged. export const handleServerAction = async ({ request, - context, serverFnId, }: { request: Request - context: any serverFnId: string }) => { - const method = request.method - const methodUpper = method.toUpperCase() - const url = new URL(request.url) - + const methodUpper = request.method.toUpperCase() const action = await getServerFnById(serverFnId, { origin: 'client' }) // Early method check: reject mismatched HTTP methods before parsing @@ -62,370 +197,420 @@ export const handleServerAction = async ({ ) } - const isServerFn = request.headers.get('x-tsr-serverFn') === 'true' - - // Initialize serovalPlugins lazily (cached at module level) - if (!serovalPlugins) { - serovalPlugins = getDefaultSerovalPlugins() + const headers = request.headers + const isServerFn = headers.get('x-tsr-serverfn') === 'true' + let serovalPlugins: Array> | undefined + const getRequestSerovalPlugins = () => { + return (serovalPlugins ??= getSerovalPlugins(routerDefaultSerovalPlugins)) } + const contentType = headers.get('content-type') - const contentType = request.headers.get('Content-Type') - - function parsePayload(payload: any) { - const parsedPayload = fromJSON(payload, { plugins: serovalPlugins }) - return parsedPayload as any - } - - const response = await (async () => { - try { - let res = await (async () => { - // FormData - if ( - FORM_DATA_CONTENT_TYPES.some( - (type) => contentType && contentType.includes(type), + try { + let res: any + if ( + contentType && + (contentType.includes('multipart/form-data') || + contentType.includes('application/x-www-form-urlencoded')) + ) { + // We don't support GET requests with FormData payloads... that seems impossible + if (methodUpper === 'GET') { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + 'Invariant failed: GET requests with FormData payloads are not supported', ) - ) { - // We don't support GET requests with FormData payloads... that seems impossible - if (methodUpper === 'GET') { - if (process.env.NODE_ENV !== 'production') { - throw new Error( - 'Invariant failed: GET requests with FormData payloads are not supported', - ) - } - - invariant() - } - const formData = await request.formData() - const serializedContext = formData.get(TSS_FORMDATA_CONTEXT) - formData.delete(TSS_FORMDATA_CONTEXT) - - const params = { - context, - data: formData, - method: methodUpper, - } - if (typeof serializedContext === 'string') { - try { - const parsedContext = JSON.parse(serializedContext) - const deserializedContext = fromJSON(parsedContext, { - plugins: serovalPlugins, - }) - if ( - typeof deserializedContext === 'object' && - deserializedContext - ) { - params.context = safeObjectMerge( - deserializedContext as Record, - context, - ) - } - } catch (e) { - // Log warning for debugging but don't expose to client - if (process.env.NODE_ENV === 'development') { - console.warn('Failed to parse FormData context:', e) - } - } - } - - return await action(params) } - // Get requests use the query string - if (methodUpper === 'GET') { - // Get payload directly from searchParams - const payloadParam = url.searchParams.get('payload') - // Reject oversized payloads to prevent DoS - if (payloadParam && payloadParam.length > MAX_PAYLOAD_SIZE) { - throw new Error('Payload too large') - } - // If there's a payload, we should try to parse it - const payload: any = payloadParam - ? parsePayload(JSON.parse(payloadParam)) - : {} - payload.context = safeObjectMerge(payload.context, context) - payload.method = methodUpper - // Send it through! - return await action(payload) - } - - let jsonPayload - if (contentType?.includes('application/json')) { - jsonPayload = await request.json() - } - - const payload = jsonPayload ? parsePayload(jsonPayload) : {} - payload.context = safeObjectMerge(payload.context, context) - payload.method = methodUpper - return await action(payload) - })() - - const unwrapped = res.result || res.error - - if (isNotFound(res)) { - res = isNotFoundResponse(res) + invariant() } + const formData = await request.formData() + const serializedContext = formData.get(TSS_FORMDATA_CONTEXT) + formData.delete(TSS_FORMDATA_CONTEXT) - if (!isServerFn) { - return unwrapped + const params: { context?: unknown; data: FormData; method: string } = { + data: formData, + method: methodUpper, } - - if (unwrapped instanceof Response) { - if (isRedirect(unwrapped)) { - return unwrapped - } - unwrapped.headers.set(X_TSS_RAW_RESPONSE, 'true') - return unwrapped - } - - return serializeResult(res) - - function serializeResult(res: unknown): Response { - let nonStreamingBody: any = undefined - - const alsResponse = getResponse() - if (res !== undefined) { - // Collect raw streams encountered during initial synchronous serialization - const rawStreams = new Map>() - - // Track whether we're still in the initial synchronous phase - // After initial phase, new RawStreams go to lateStreamWriter - let initialPhase = true - - // Late stream registration for RawStreams discovered after initial pass - // (e.g., from resolved Promises) - let lateStreamWriter: - | WritableStreamDefaultWriter - | undefined - let lateStreamReadable: - | ReadableStream - | undefined = undefined - const pendingLateStreams: Array = [] - - const rawStreamPlugin = createRawStreamRPCPlugin( - (id: number, stream: ReadableStream) => { - if (initialPhase) { - rawStreams.set(id, stream) - return - } - - if (lateStreamWriter) { - // Late stream - write to the late stream channel - lateStreamWriter.write({ id, stream }).catch(() => { - // Ignore write errors - stream may be closed - }) - return - } - - // Discovered after initial phase but before writer exists. - pendingLateStreams.push({ id, stream }) - }, - ) - - // Build plugins with RawStreamRPCPlugin first (before default SSR plugin) - const plugins = [rawStreamPlugin, ...(serovalPlugins || [])] - - // first run without the stream in case `result` does not need streaming - let done = false as boolean - const callbacks: { - onParse: (value: any) => void - onDone: () => void - onError: (error: any) => void - } = { - onParse: (value) => { - nonStreamingBody = value - }, - onDone: () => { - done = true - }, - onError: (error) => { - throw error - }, - } - toCrossJSONStream(res, { - refs: new Map(), - plugins, - onParse(value) { - callbacks.onParse(value) - }, - onDone() { - callbacks.onDone() - }, - onError: (error) => { - callbacks.onError(error) - }, + if (typeof serializedContext === 'string') { + try { + const parsedContext = JSON.parse(serializedContext) + const deserializedContext = fromJSON(parsedContext, { + plugins: getRequestSerovalPlugins(), }) - - // End of initial synchronous phase - any new RawStreams are "late" - initialPhase = false - - // If any RawStreams are discovered after this point but before the - // late-stream writer exists, we buffer them and flush once the writer - // is ready. This avoids an occasional missed-stream race. - - // If no raw streams and done synchronously, return simple JSON - if (done && rawStreams.size === 0) { - return new Response( - nonStreamingBody ? JSON.stringify(nonStreamingBody) : undefined, - { - status: alsResponse.status, - statusText: alsResponse.statusText, - headers: { - 'Content-Type': 'application/json', - [X_TSS_SERIALIZED]: 'true', - }, - }, - ) + if (typeof deserializedContext === 'object' && deserializedContext) { + params.context = deserializedContext } - - // Not done synchronously or has raw streams - use framed protocol - // This supports late RawStreams from resolved Promises - const { readable, writable } = - new TransformStream() - lateStreamReadable = readable - lateStreamWriter = writable.getWriter() - - // Flush any late streams that were discovered in the small window - // between end of initial serialization and writer setup. - for (const registration of pendingLateStreams) { - lateStreamWriter.write(registration).catch(() => { - // Ignore write errors - stream may be closed - }) + } catch (e) { + // Log warning for debugging but don't expose to client + if (process.env.NODE_ENV === 'development') { + console.warn('Failed to parse FormData context:', e) } - pendingLateStreams.length = 0 - - // Create a stream of JSON chunks - const jsonStream = new ReadableStream({ - start(controller) { - callbacks.onParse = (value) => { - controller.enqueue(JSON.stringify(value) + '\n') - } - callbacks.onDone = () => { - try { - controller.close() - } catch { - // Already closed - } - // Close late stream writer when JSON serialization is done - // Any RawStreams not yet discovered won't be sent - lateStreamWriter - ?.close() - .catch(() => { - // Ignore close errors - }) - .finally(() => { - lateStreamWriter = undefined - }) - } - - callbacks.onError = (error) => { - controller.error(error) - lateStreamWriter - ?.abort(error) - .catch(() => { - // Ignore abort errors - }) - .finally(() => { - lateStreamWriter = undefined - }) - } - - // Emit initial body if we have one - if (nonStreamingBody !== undefined) { - callbacks.onParse(nonStreamingBody) - } - // If serialization already completed synchronously, close now - // This handles the case where onDone was called during toCrossJSONStream - // before we overwrote callbacks.onDone - if (done) { - callbacks.onDone() - } - }, - cancel() { - lateStreamWriter?.abort().catch(() => {}) - lateStreamWriter = undefined - }, - }) - - // Create multiplexed stream with JSON, initial raw streams, and late streams - const multiplexedStream = createMultiplexedStream( - jsonStream, - rawStreams, - lateStreamReadable, - ) - - return new Response(multiplexedStream, { - status: alsResponse.status, - statusText: alsResponse.statusText, - headers: { - 'Content-Type': TSS_CONTENT_TYPE_FRAMED_VERSIONED, - [X_TSS_SERIALIZED]: 'true', - }, - }) } - - return new Response(undefined, { - status: alsResponse.status, - statusText: alsResponse.statusText, - }) - } - } catch (error: any) { - if (error instanceof Response) { - return error - } - // else if ( - // isPlainObject(error) && - // 'result' in error && - // error.result instanceof Response - // ) { - // return error.result - // } - - // Currently this server-side context has no idea how to - // build final URLs, so we need to defer that to the client. - // The client will check for __redirect and __notFound keys, - // and if they exist, it will handle them appropriately. - - if (isNotFound(error)) { - return isNotFoundResponse(error) } - console.info() - console.info('Server Fn Error!') - console.info() - console.error(error) - console.info() - - const serializedError = JSON.stringify( - await Promise.resolve( - toCrossJSONAsync(error, { - refs: new Map(), - plugins: serovalPlugins, - }), - ), - ) - const response = getResponse() - return new Response(serializedError, { - status: response.status ?? 500, - statusText: response.statusText, - headers: { - 'Content-Type': 'application/json', - [X_TSS_SERIALIZED]: 'true', - }, + res = await action(params) + } else { + let json: any + if (methodUpper === 'GET') { + // Get payload directly from searchParams + const payloadParam = + getParsedRequestUrl(request).searchParams.get('payload') + // Reject oversized payloads to prevent DoS + if (payloadParam && payloadParam.length > MAX_PAYLOAD_SIZE) { + throw new Error('Payload too large') + } + json = payloadParam ? JSON.parse(payloadParam) : undefined + } else if (contentType?.includes('application/json')) { + json = await request.json() + } + const payload: any = + json === undefined + ? undefined + : fromJSON(json, { plugins: getRequestSerovalPlugins() }) + // Pass only the fields a client sends, so a crafted `error` or + // `result` key cannot decide the outcome of the call. + res = await action({ + data: payload?.data, + context: payload?.context, + method: methodUpper, }) } - })() - return response + const failed = 'error' in res + const unwrapped = failed ? res.error : res.result + + if ( + !isServerFn && + (unwrapped instanceof Response || + unwrapped === null || + typeof unwrapped !== 'object') + ) { + return unwrapped + } + + if (unwrapped instanceof Response) { + if (failed) { + return toThrownServerFnResponse(unwrapped) + } + if (isRedirect(unwrapped)) { + return unwrapped + } + return setProtectedResponseHeaders(unwrapped, RAW_RESPONSE_HEADERS) + } + + return serializeResult(res, request, getRequestSerovalPlugins()) + } catch (error: any) { + if (error instanceof Response) { + return error + } + + // Currently this server-side context has no idea how to + // build final URLs, so we need to defer that to the client. + // The client will check for __redirect and __notFound keys, + // and if they exist, it will handle them appropriately. + + return createServerFnErrorResponse(error, serovalPlugins) + } +} + +/** + * Serializes a server-function result. A result that Seroval completes + * synchronously without RawStreams becomes plain JSON; everything else is a + * framed response whose records and raw streams are multiplexed in order. + */ +function serializeResult( + res: unknown, + request: Request, + plugins: Array>, +): Response | DeferredResponse { + const initialRecords: Array = [] + let initialBytes = 0 + const pendingRawStreams: Array = [] + + // Seroval replays synchronously discovered work before returning. Collect + // that first pass so a complete result can skip framing entirely. + let done = false as boolean + let initialParsed = false + let serializationFailure: [unknown] | undefined + let disposeSerialization: (() => void) | undefined + let onParse = (value: any, initial: boolean) => { + if (serializationFailure) { + return + } + initialParsed ||= initial + const record = encodeSerializationRecord(value) + if ( + exceedsPendingSerializationLimit( + record, + initialRecords.length, + initialBytes, + ) + ) { + serializationFailure = [ + new Error( + 'Server function serialization exceeded its pending output limit', + ), + ] + return + } + initialRecords.push(record) + initialBytes += record.byteLength + } + let onDone = () => { + if (initialParsed) { + done = true + } + } + let onError = (error: any) => { + serializationFailure ??= [error] + } + const rawStreamPlugin = createRawStreamRPCPlugin( + (id: number, stream: ReadableStream) => { + if (serializationFailure) { + cancelRawStream(stream, serializationFailure[0]) + return + } + if (id > MAX_FRAMED_STREAMS) { + const error = new Error( + `Too many raw streams in framed response (max ${MAX_FRAMED_STREAMS})`, + ) + cancelRawStream(stream, error) + onError(error) + return + } + pendingRawStreams.push({ id, stream }) + }, + ) + + const dispose = toCrossJSONStream(res, { + refs: new Map(), + plugins: [rawStreamPlugin, ...plugins], + onParse(value, initial) { + onParse(value, initial) + }, + onDone() { + onDone() + }, + onError: (error) => { + onError(error) + }, + }) + if (serializationFailure) { + runSerializationCleanup(dispose) + for (const registration of pendingRawStreams) { + cancelRawStream(registration.stream, serializationFailure[0]) + } + throw serializationFailure[0] + } + if (!done) { + disposeSerialization = dispose + } + + if (done && pendingRawStreams.length === 0 && initialRecords.length === 1) { + return new DeferredResponse(initialRecords[0]!) + } + + if (done && initialRecords.length === 1) { + const json = initialRecords[0]! + if (json.byteLength > MAX_FRAME_PAYLOAD_SIZE) { + const error = new Error( + 'Server function serialization exceeded its pending output limit', + ) + for (const registration of pendingRawStreams) { + cancelRawStream(registration.stream, error) + } + throw error + } + + // Serialization is complete, so this one bounded record needs no writer + // or pending-serialization lifecycle. The mux still controls raw demand. + const rawStreams = pendingRawStreams.splice(0) + initialRecords.length = 0 + return createFramedResponse( + new ReadableStream({ + start(controller) { + controller.enqueue({ json, rawStreams }) + controller.close() + }, + cancel(reason) { + for (const registration of rawStreams) { + cancelRawStream(registration.stream, reason) + } + }, + }), + { signal: request.signal }, + ) + } + + // Couple every JSON patch to the RawStreams it introduces. The mux admits + // each JSON reference before it starts that stream's chunks. + const { readable, writable } = new TransformStream() + const writer = writable.getWriter() + const recordAbortController = new AbortController() + let pendingBytes = 0 + const pendingRecords = new Set() + + const abortRecordStream = (error: unknown) => { + if (serializationFailure) { + return + } + serializationFailure = [error] + const disposeCurrentSerialization = disposeSerialization + disposeSerialization = undefined + for (const registration of pendingRawStreams.splice(0)) { + cancelRawStream(registration.stream, error) + } + for (const record of pendingRecords) { + for (const registration of record.rawStreams) { + cancelRawStream(registration.stream, error) + } + } + pendingRecords.clear() + recordAbortController.abort(error) + void writer.abort(error).catch(() => {}) + if (disposeCurrentSerialization) { + runSerializationCleanup(disposeCurrentSerialization) + } + } + + const writeRecord = ( + json: Uint8Array, + rawStreams: Array, + ) => { + if (serializationFailure) { + for (const registration of rawStreams) { + cancelRawStream(registration.stream, serializationFailure[0]) + } + return false + } + + if ( + json.byteLength > MAX_FRAME_PAYLOAD_SIZE || + exceedsPendingSerializationLimit(json, pendingRecords.size, pendingBytes) + ) { + const error = new Error( + 'Server function serialization exceeded its pending output limit', + ) + for (const registration of rawStreams) { + cancelRawStream(registration.stream, error) + } + onError(error) + return false + } + + pendingBytes += json.byteLength + const record = { json, rawStreams } + pendingRecords.add(record) + void writer.write(record).then( + () => { + pendingRecords.delete(record) + pendingBytes -= json.byteLength + }, + (error) => { + const stillOwned = pendingRecords.delete(record) + pendingBytes -= json.byteLength + if (stillOwned) { + for (const registration of rawStreams) { + cancelRawStream(registration.stream, error) + } + } + }, + ) + return true + } + + onParse = (value) => { + if (serializationFailure) { + return + } + writeRecord(encodeSerializationRecord(value), pendingRawStreams.splice(0)) + } + onDone = () => { + if (serializationFailure) { + return + } + disposeSerialization = undefined + void writer.close().catch(() => {}) + } + onError = (error) => { + abortRecordStream(error) + } + + // Seroval buffers nested patches during its initial traversal. Their + // RawStream callbacks may precede the root callback, so start every + // synchronously discovered stream only after all initial records. + const initialRawStreams = pendingRawStreams.splice(0) + for (let index = 0; index < initialRecords.length; index++) { + const isLast = index === initialRecords.length - 1 + if (!writeRecord(initialRecords[index]!, isLast ? initialRawStreams : [])) { + // `writeRecord` recorded the failure. Nothing was handed to the client + // yet, so fail the whole call. + if (!isLast) { + for (const registration of initialRawStreams) { + cancelRawStream(registration.stream, serializationFailure![0]) + } + } + initialRecords.length = 0 + throw serializationFailure![0] + } + } + initialRecords.length = 0 + if (done) { + onDone() + } + + void writer.closed.catch((error) => { + abortRecordStream(error) + }) + + return createFramedResponse(readable, { + signal: AbortSignal.any([recordAbortController.signal, request.signal]), + onCancel: abortRecordStream, + }) +} + +function createFramedResponse( + records: ReadableStream, + options: MultiplexedStreamOptions, +) { + const multiplexedStream = createMultiplexedStream(records, options) + // Completed JSON reads helper state later, when the pipeline accepts it. + const { status, statusText } = getSerializedResponseState() + try { + const response = new Response(multiplexedStream, { + status, + statusText, + headers: { + 'Content-Type': TSS_CONTENT_TYPE_FRAMED_VERSIONED, + [X_TSS_SERIALIZED]: 'true', + }, + }) + protectResponseHeaders(response, SERIALIZED_FRAMED_HEADERS) + return response + } catch (error) { + cancelRawStream(multiplexedStream, error) + throw error + } } function isNotFoundResponse(error: any) { const { headers, ...rest } = error + let responseHeaders: HeadersInit + if (headers) { + // Snapshot caller headers before serialization can run user callbacks. + const copiedHeaders = new Headers(headers) + copiedHeaders.set('Content-Type', 'application/json') + copiedHeaders.delete(X_TSS_SERIALIZED) + copiedHeaders.delete(X_TSS_RAW_RESPONSE) + copiedHeaders.delete('location') + responseHeaders = copiedHeaders + } else { + responseHeaders = { 'Content-Type': 'application/json' } + } - return new Response(JSON.stringify(rest), { + const response = new Response(JSON.stringify(rest), { status: 404, - headers: { - 'Content-Type': 'application/json', - ...(headers || {}), - }, + headers: responseHeaders, }) + protectResponseHeaders(response, NOT_FOUND_HEADERS) + return response } diff --git a/packages/start-server-core/src/session.ts b/packages/start-server-core/src/session.ts deleted file mode 100644 index 8617cf8ae7..0000000000 --- a/packages/start-server-core/src/session.ts +++ /dev/null @@ -1,75 +0,0 @@ -// TODO discuss do we want to copy this interface into Start we well? -import type { CookieSerializeOptions } from 'cookie-es' - -// TODO discuss do we want to copy this interface into Start as shown below? - -/** Algorithm used for encryption and decryption. */ -type EncryptionAlgorithm = 'aes-128-ctr' | 'aes-256-cbc' -/** Algorithm used for integrity verification. */ -type IntegrityAlgorithm = 'sha256' -/** @internal */ -type _Algorithm = EncryptionAlgorithm | IntegrityAlgorithm -/** - * Options for customizing the key derivation algorithm used to generate encryption and integrity verification keys as well as the algorithms and salt sizes used. - */ -type SealOptions = Readonly<{ - /** Encryption step options. */ - encryption: SealOptionsSub - /** Integrity step options. */ - integrity: SealOptionsSub - /* Sealed object lifetime in milliseconds where 0 means forever. Defaults to 0. */ - ttl: number - /** Number of seconds of permitted clock skew for incoming expirations. Defaults to 60 seconds. */ - timestampSkewSec: number - /** - * Local clock time offset, expressed in number of milliseconds (positive or negative). Defaults to 0. - */ - localtimeOffsetMsec: number -}> -/** `seal()` method options. */ -type SealOptionsSub = Readonly<{ - /** The length of the salt (random buffer used to ensure that two identical objects will generate a different encrypted result). Defaults to 256. */ - saltBits: number - /** The algorithm used. Defaults to 'aes-256-cbc' for encryption and 'sha256' for integrity. */ - algorithm: TAlgorithm - /** The number of iterations used to derive a key from the password. Defaults to 1. */ - iterations: number - /** Minimum password size. Defaults to 32. */ - minPasswordlength: number -}> -/** Password secret string or buffer.*/ - -type SessionDataT = Record -export type SessionData = Partial -export interface Session { - id: string - createdAt: number - data: SessionData -} - -export type SessionUpdate = - | Partial> - | ((oldData: SessionData) => Partial> | undefined) - -export interface SessionManager { - readonly id: string | undefined - readonly data: SessionData - update: (update: SessionUpdate) => Promise> - clear: () => Promise> -} -export interface SessionConfig { - /** Private key used to encrypt session tokens */ - password: string - /** Session expiration time in seconds */ - maxAge?: number - /** default is 'start' */ - name?: string - /** Default is secure, httpOnly, / */ - cookie?: false | CookieSerializeOptions - /** Default is x-start-session / x-{name}-session */ - sessionHeader?: false | string - seal?: SealOptions - crypto?: Crypto - /** Default is Crypto.randomUUID */ - generateId?: () => string -} diff --git a/packages/start-server-core/tests/createCsrfMiddleware.test.ts b/packages/start-server-core/tests/createCsrfMiddleware.test.ts index a46aa444d2..9d5ce5569e 100644 --- a/packages/start-server-core/tests/createCsrfMiddleware.test.ts +++ b/packages/start-server-core/tests/createCsrfMiddleware.test.ts @@ -264,6 +264,110 @@ describe('createCsrfMiddleware', () => { expect(next).toHaveBeenCalledTimes(1) }) + it.each([false, true])( + 'waits for an async filter returning %s before validating', + async (shouldValidate) => { + let resolveFilter!: (result: boolean) => void + const filterResult = new Promise((resolve) => { + resolveFilter = resolve + }) + const matcher = vi.fn(() => false) + const middleware = createCsrfMiddleware({ + filter: () => filterResult, + secFetchSite: matcher, + }) + const ctx = createContext({ + headers: { 'Sec-Fetch-Site': 'same-origin' }, + }) + const pending = runMiddleware(middleware, ctx) + + expect(matcher).not.toHaveBeenCalled() + resolveFilter(shouldValidate) + const { result, next } = await pending + + expect(matcher).toHaveBeenCalledTimes(shouldValidate ? 1 : 0) + expect(next).toHaveBeenCalledTimes(shouldValidate ? 0 : 1) + if (shouldValidate) { + expect((result as Response).status).toBe(403) + } + }, + ) + + it.each([ + ['secFetchSite', 'Sec-Fetch-Site', 'same-origin'], + ['origin', 'Origin', requestOrigin], + ['referer', 'Referer', `${requestOrigin}/path`], + ] as const)( + 'awaits async %s matchers before continuing or rejecting', + async (option, header, value) => { + for (const allowed of [false, true]) { + const matcher = vi.fn(async () => allowed) + const middleware = createCsrfMiddleware({ [option]: matcher }) + const ctx = createContext({ headers: { [header]: value } }) + + const { result, next } = await runMiddleware(middleware, ctx) + + expect(matcher).toHaveBeenCalledOnce() + expect(matcher).toHaveBeenCalledWith( + value, + expect.objectContaining({ request: ctx.request }), + ) + expect(next).toHaveBeenCalledTimes(allowed ? 1 : 0) + if (!allowed) { + expect((result as Response).status).toBe(403) + } + } + }, + ) + + it('matches a Referer origin with an async origin matcher', async () => { + const matcher = vi.fn(async () => true) + const middleware = createCsrfMiddleware({ origin: matcher }) + const ctx = createContext({ + headers: { Referer: `${requestOrigin}/path` }, + }) + + const { next } = await runMiddleware(middleware, ctx) + + expect(matcher).toHaveBeenCalledWith( + requestOrigin, + expect.objectContaining({ request: ctx.request }), + ) + expect(next).toHaveBeenCalledOnce() + }) + + it.each(['filter', 'secFetchSite', 'origin', 'referer', 'failureResponse'])( + 'rejects when a synchronous or async %s callback throws', + async (option) => { + const error = new Error('CSRF callback failed') + const ctx = createContext({ + headers: + option === 'secFetchSite' + ? { 'Sec-Fetch-Site': 'same-origin' } + : option === 'origin' + ? { Origin: requestOrigin } + : option === 'referer' + ? { Referer: `${requestOrigin}/path` } + : {}, + }) + + for (const callback of [ + () => { + throw error + }, + () => Promise.reject(error), + ]) { + const middleware = createCsrfMiddleware({ [option]: callback }) + const next = vi.fn() + // Synchronous callback errors must still become rejected promises. + const result = middleware.options.server!({ ...ctx, next } as any) + + await expect(result).rejects.toBe(error) + expect(next).not.toHaveBeenCalled() + } + }, + ) + it('uses custom failure responses', async () => { const middleware = createCsrfMiddleware({ failureResponse: new Response('CSRF failed', { status: 419 }), @@ -275,6 +379,39 @@ describe('createCsrfMiddleware', () => { expect((result as Response).status).toBe(419) await expect((result as Response).text()).resolves.toBe('CSRF failed') }) + + it('awaits custom failure response callbacks', async () => { + const response = new Response('CSRF failed', { status: 419 }) + const failureResponse = vi.fn(async () => response) + const middleware = createCsrfMiddleware({ failureResponse }) + const ctx = createContext({}) + + const { result, next } = await runMiddleware(middleware, ctx) + + expect(failureResponse).toHaveBeenCalledWith( + expect.objectContaining({ request: ctx.request }), + ) + expect(result).toBe(response) + expect(next).not.toHaveBeenCalled() + }) + + it('clones a configured failure response for every request', async () => { + const failureResponse = new Response('CSRF failed', { status: 419 }) + const middleware = createCsrfMiddleware({ failureResponse }) + + for (let i = 0; i < 2; i++) { + const { result, next } = await runMiddleware( + middleware, + createContext({}), + ) + + expect(result).not.toBe(failureResponse) + expect((result as Response).status).toBe(419) + await expect((result as Response).text()).resolves.toBe('CSRF failed') + expect(next).not.toHaveBeenCalled() + } + expect(failureResponse.bodyUsed).toBe(false) + }) }) function createContextFromRequest( diff --git a/packages/start-server-core/tests/createStartHandler.test.ts b/packages/start-server-core/tests/createStartHandler.test.ts index 5b7c7d3a7a..f2918ed523 100644 --- a/packages/start-server-core/tests/createStartHandler.test.ts +++ b/packages/start-server-core/tests/createStartHandler.test.ts @@ -1,29 +1,89 @@ +// @vitest-environment node + +import { ReadableStream as NodeReadableStream } from 'node:stream/web' import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' import { createMemoryHistory } from '@tanstack/history' -import { createMiddleware } from '@tanstack/start-client-core' -import { BaseRootRoute, BaseRoute, RouterCore } from '@tanstack/router-core' +import { splitSetCookieString } from 'cookie-es' import { + createMiddleware, + getRouterInstance, +} from '@tanstack/start-client-core' +import { + BaseRootRoute, + BaseRoute, + RouterCore, createNonReactiveMutableStore, createNonReactiveReadonlyStore, + createSerializationAdapter, + redirect, } from '@tanstack/router-core' import { attachRouterServerSsrUtils, createSsrStreamResponse, + transformReadableStreamWithRouter, } from '@tanstack/router-core/ssr/server' import { createStartHandler } from '../src/createStartHandler' import { - getStaticHandlerInlineCssDefault, + appendResponseHeader, + clearResponseHeaders, + createServerEntry, + getCookie, + getCookies, + getRequestHost, + getRequestIP, + getRequestProtocol, + getRequestUrl, + getResponseHeader, + getResponseHeaders, + getResponseStatus, + getStartEvent, + handleStartError, + protectResponseHeaders, + reconcileResponse, + setCookie, + setResponseHeader, + setResponseHeaders, + setResponseStatus, +} from '../src/internal-request-response' +import { + getStaticInlineCss, resolveInlineCssForRequest, } from '../src/inlineCss' +import type { AnyRoute, AnyRouter } from '@tanstack/router-core' +import type { + HandlersFnOpts, + RouteMethodHandlerFn, +} from '@tanstack/start-client-core' + +type TestRouteHandlerFn = RouteMethodHandlerFn< + {}, + AnyRoute, + '/', + {}, + undefined, + undefined, + TContext +> const startMocks = vi.hoisted(() => { + const hadServerFnBase = Object.prototype.hasOwnProperty.call( + process.env, + 'TSS_SERVER_FN_BASE', + ) const previousServerFnBase = process.env.TSS_SERVER_FN_BASE process.env.TSS_SERVER_FN_BASE = '/_serverFn/' return { + hadServerFnBase, previousServerFnBase, requestMiddleware: [] as Array, serverFnResult: undefined as undefined | Response | object, - router: undefined as undefined | ReturnType, + serverFnHandler: undefined as + | undefined + | ((opts: { serverFnId: string }) => unknown), + serverFnCalls: [] as Array<{ context?: unknown }>, + router: undefined as undefined | AnyRouter, + routerFactory: undefined as undefined | (() => AnyRouter), + serializationAdapters: [] as Array, } }) @@ -31,18 +91,62 @@ vi.mock('#tanstack-start-entry', () => ({ startInstance: { getOptions: () => ({ requestMiddleware: startMocks.requestMiddleware, - serializationAdapters: [], + serializationAdapters: startMocks.serializationAdapters, }), }, })) vi.mock('#tanstack-router-entry', () => ({ - getRouter: () => startMocks.router, + getRouter: () => startMocks.routerFactory?.() ?? startMocks.router, })) -vi.mock('../src/server-functions-handler', () => ({ - handleServerAction: () => startMocks.serverFnResult, -})) +vi.mock('../src/server-functions-handler', async (importOriginal) => { + const actual = + await importOriginal() + const { getStartContext } = await import('@tanstack/start-storage-context') + return { + ...actual, + createServerFnErrorResponse: () => { + return new Response(JSON.stringify({ message: 'middleware failed' }), { + status: 500, + headers: { + 'content-type': 'application/json', + 'x-tss-serialized': 'true', + }, + }) + }, + handleServerAction: (opts: { serverFnId: string }) => { + // Server functions read the trusted server context from the start + // context, like __executeServer. + startMocks.serverFnCalls.push({ + context: getStartContext().contextAfterGlobalMiddlewares, + }) + return startMocks.serverFnHandler + ? startMocks.serverFnHandler(opts) + : startMocks.serverFnResult + }, + } +}) + +function createTestStartHandler( + options: Parameters[0], +) { + return createServerEntry({ fetch: createStartHandler(options) }).fetch +} + +// Only server-function replies carry protocol headers. +function createProtocolRequest() { + return new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }) +} + +function createResponseHandler(callback: () => Response | Promise) { + startMocks.requestMiddleware = [createMiddleware().server(callback)] + return createStartHandler(() => { + throw new Error('Response middleware should prevent rendering') + }) +} const getStoreConfig = () => ({ createMutableStore: createNonReactiveMutableStore, @@ -50,12 +154,13 @@ const getStoreConfig = () => ({ batch: (fn: () => void) => fn(), }) -function makeRouter() { +function makeRouter(routeOptions: Record = {}) { const rootRoute = new BaseRootRoute({}) const indexRoute = new BaseRoute({ getParentRoute: () => rootRoute, path: '/', component: () => null, + ...routeOptions, }) const router = new RouterCore( { @@ -68,35 +173,2260 @@ function makeRouter() { return router } -function makeStreamResponse(router: ReturnType) { +function makeRouterWithRouteWork(routeWork: { + beforeLoad?: (ctx: { abortController: AbortController }) => unknown + loader?: (ctx: { abortController: AbortController }) => unknown +}) { + const rootRoute = new BaseRootRoute({}) + const workRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/work', + component: () => null, + ...routeWork, + }) + const router = new RouterCore( + { + history: createMemoryHistory({ initialEntries: ['/work'] }), + routeTree: rootRoute.addChildren([workRoute]), + }, + getStoreConfig, + ) + router.isServer = true + return router +} + +function waitForAbortOrRelease(signal: AbortSignal) { + return new Promise((resolve) => { + const release = () => { + signal.removeEventListener('abort', release) + resolve() + } + signal.addEventListener('abort', release, { once: true }) + }) +} + +function makeStreamResponse( + router: ReturnType, + onCancel?: (reason?: unknown) => void, +) { attachRouterServerSsrUtils({ router: router as any, manifest: undefined }) const stream = new ReadableStream({ start(controller) { controller.enqueue(new TextEncoder().encode('stream')) }, - cancel() { + cancel(reason) { + onCancel?.(reason) router.serverSsr?.cleanup() }, }) return createSsrStreamResponse(router as any, new Response(stream)) } +function makeCompletingStreamResponse(router: ReturnType) { + attachRouterServerSsrUtils({ router: router as any, manifest: undefined }) + router.serverSsr!.disableHydration() + const source = new NodeReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('stream')) + controller.close() + }, + }) + const stream = transformReadableStreamWithRouter(router as any, source) + return createSsrStreamResponse( + router as any, + new Response(stream as unknown as BodyInit), + ) +} + +function getSetCookieValues(headers: Headers): Array { + const headersWithSetCookie = headers as Headers & { + getSetCookie?: () => Array + } + if (typeof headersWithSetCookie.getSetCookie === 'function') { + return headersWithSetCookie.getSetCookie() + } + const value = headers.get('set-cookie') + if (value) { + return splitSetCookieString(value) + } + return [] +} + +function expectSetCookie( + cookies: Array, + name: string, + value: string, +): void { + expect( + cookies.filter((cookie) => cookie.startsWith(`${name}=${value};`)), + ).toHaveLength(1) +} + afterEach(() => { startMocks.requestMiddleware = [] startMocks.serverFnResult = undefined + startMocks.serverFnHandler = undefined + startMocks.serverFnCalls = [] startMocks.router = undefined + startMocks.routerFactory = undefined + startMocks.serializationAdapters = [] vi.unstubAllEnvs() }) afterAll(() => { - if (startMocks.previousServerFnBase === undefined) { + if (!startMocks.hadServerFnBase) { delete (process.env as Partial).TSS_SERVER_FN_BASE } else { process.env.TSS_SERVER_FN_BASE = startMocks.previousServerFnBase } }) +describe('createStartHandler response reconciliation', () => { + it('preserves returned response cookies when getSetCookie is unavailable', async () => { + const handler = createResponseHandler(() => { + setCookie('helper', '1', { path: '/' }) + const headers = new Headers() + headers.append('set-cookie', 'returned-one=1; Path=/') + headers.append('set-cookie', 'returned-two=2; Path=/') + const response = new Response('ok', { headers }) + const responseHeaders = response.headers as unknown as { + getSetCookie?: unknown + } + responseHeaders.getSetCookie = undefined + return response + }) + + const response = await handler(new Request('http://localhost/'), {}) + const cookies = getSetCookieValues(response.headers) + + expectSetCookie(cookies, 'returned-one', '1') + expectSetCookie(cookies, 'returned-two', '2') + expectSetCookie(cookies, 'helper', '1') + }) + + it('does not dedupe absent-path cookies against explicit-path cookies', async () => { + const handler = createResponseHandler(() => { + setCookie('same', 'helper', { path: '/' }) + return new Response('ok', { + headers: { 'set-cookie': 'same=returned' }, + }) + }) + + const response = await handler(new Request('http://localhost/nested'), {}) + const cookies = getSetCookieValues(response.headers) + + expect(cookies.filter((cookie) => cookie.startsWith('same='))).toEqual([ + 'same=returned', + 'same=helper; Path=/', + ]) + }) + + it('restores protected headers after direct response mutation', async () => { + const handler = createResponseHandler(() => { + const response = new Response('ok', { + headers: { + 'content-type': 'application/json', + 'x-tss-serialized': 'true', + }, + }) + protectResponseHeaders( + response, + new Map([ + ['content-type', 'application/json'], + ['x-tss-serialized', 'true'], + ]), + ) + response.headers.set('content-type', 'text/plain') + response.headers.set('x-tss-serialized', 'false') + return response + }) + + const response = await handler(createProtocolRequest(), {}) + + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + }) + + it('merges repeated protected header snapshots', async () => { + const handler = createResponseHandler(() => { + const response = new Response('ok', { + headers: { + 'content-type': 'application/json', + 'x-tss-raw': 'true', + }, + }) + protectResponseHeaders( + response, + new Map([['content-type', 'application/json']]), + ) + protectResponseHeaders(response, new Map([['x-tss-raw', 'true']])) + response.headers.set('content-type', 'text/plain') + response.headers.set('x-tss-raw', 'false') + return response + }) + + const response = await handler(createProtocolRequest(), {}) + + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-raw')).toBe('true') + }) + + it('reads protected header snapshots after direct response mutation', async () => { + let seenHeader: string | undefined + let seenHeadersHeader: string | null | undefined + const handler = createResponseHandler(() => { + const response = new Response('ok', { + headers: { 'x-transport': 'original' }, + }) + protectResponseHeaders(response, new Map([['x-transport', 'original']])) + const reconciled = reconcileResponse(response, getStartEvent()) + reconciled.headers.set('x-transport', 'mutated') + seenHeader = getResponseHeader('x-transport') + seenHeadersHeader = getResponseHeaders().get('x-transport') + return reconciled + }) + + const response = await handler(createProtocolRequest(), {}) + + expect(seenHeader).toBe('original') + expect(seenHeadersHeader).toBe('original') + expect(response.headers.get('x-transport')).toBe('original') + }) + + it('returns getResponseHeaders as a read-only snapshot after reconciliation', async () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + const response = reconcileResponse( + new Response('ok', { + headers: { + 'x-keep': 'yes', + 'x-remove': 'remove-me', + }, + }), + getStartEvent(), + ) + const headers = getResponseHeaders() as Headers + expect(headers.get('x-remove')).toBe('remove-me') + headers.set('x-added', 'yes') + headers.delete('x-remove') + return response + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.headers.get('x-keep')).toBe('yes') + expect(response.headers.get('x-added')).toBe(null) + expect(response.headers.get('x-remove')).toBe('remove-me') + expect(warnSpy).toHaveBeenCalledTimes(2) + } finally { + warnSpy.mockRestore() + } + }) + + it('preserves empty string response header values', async () => { + let seenHeader: string | undefined + const handler = createResponseHandler(() => { + setResponseHeader('x-empty', '') + seenHeader = getResponseHeader('x-empty') + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(seenHeader).toBe('') + expect(response.headers.get('x-empty')).toBe('') + }) + + it('keeps helper headers set after clearing response headers', async () => { + const handler = createResponseHandler(() => { + clearResponseHeaders() + setResponseHeader('x-after-clear', 'yes') + return new Response('ok', { + headers: { + 'x-returned': 'removed', + }, + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.headers.get('x-returned')).toBe(null) + expect(response.headers.get('x-after-clear')).toBe('yes') + }) + + it('replaces Set-Cookie arrays and keeps later semantic cookie updates', async () => { + const handler = createResponseHandler(() => { + setResponseHeader('set-cookie', ['array=1; Path=/', 'same=first; Path=/']) + setCookie('same', 'second', { path: '/' }) + return new Response('ok', { + headers: { + 'set-cookie': 'returned=1; Path=/', + }, + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + const cookies = getSetCookieValues(response.headers) + + expect(cookies).toEqual(['array=1; Path=/', 'same=second; Path=/']) + }) + + it('appends non-cookie response headers without replacing values', async () => { + const handler = createResponseHandler(() => { + appendResponseHeader('link', '; rel=preload') + appendResponseHeader('link', ['; rel=preload']) + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.headers.get('link')).toBe( + '; rel=preload, ; rel=preload', + ) + }) + + it('merges appended raw Set-Cookie strings by cookie identity', async () => { + const handler = createResponseHandler(() => { + setCookie('helper', '1', { path: '/' }) + appendResponseHeader('set-cookie', 'external=abc; Path=/; HttpOnly') + // Same cookie identity replaces the previous value instead of + // duplicating — across calls and within one batched call. + appendResponseHeader('set-cookie', [ + 'external=def; Path=/; HttpOnly', + 'other=overwritten; Path=/', + 'other=1; Path=/', + ]) + return new Response('ok', { + headers: { 'set-cookie': 'returned=1; Path=/' }, + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + const cookies = getSetCookieValues(response.headers) + + expectSetCookie(cookies, 'returned', '1') + expectSetCookie(cookies, 'helper', '1') + expectSetCookie(cookies, 'external', 'def') + expectSetCookie(cookies, 'other', '1') + expect(cookies.filter((c) => c.startsWith('external='))).toHaveLength(1) + expect(cookies.filter((c) => c.startsWith('other='))).toHaveLength(1) + }) + + it('warns in development when setResponseStatus is out of range', async () => { + vi.stubEnv('NODE_ENV', 'development') + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(999) + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(200) + expect(warnSpy).toHaveBeenCalledTimes(1) + expect(warnSpy.mock.calls[0]![0]).toContain('setResponseStatus(999)') + } finally { + warnSpy.mockRestore() + vi.unstubAllEnvs() + } + }) + + it('returns the same response after repeated clean reconciliation', async () => { + let firstResponse: Response | undefined + let secondResponse: Response | undefined + const handler = createResponseHandler(() => { + const response = new Response('ok') + firstResponse = reconcileResponse(response, getStartEvent()) + secondResponse = reconcileResponse(firstResponse, getStartEvent()) + return secondResponse + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(secondResponse).toBe(firstResponse) + expect(response).toBe(firstResponse) + }) + + it('applies helper mutations after the same response was reconciled', async () => { + let reconciledResponse: Response | undefined + const handler = createResponseHandler(() => { + const response = new Response('ok') + reconciledResponse = reconcileResponse(response, getStartEvent()) + setResponseHeader('x-late-helper', 'true') + return reconciledResponse + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response).not.toBe(reconciledResponse) + expect(response.body).toBe(reconciledResponse?.body) + expect(reconciledResponse?.headers.get('x-late-helper')).toBeNull() + expect(response.headers.get('x-late-helper')).toBe('true') + }) + + it('reapplies helper headers after direct mutation of a reconciled response', async () => { + const handler = createResponseHandler(() => { + setResponseHeader('x-helper', 'true') + const response = reconcileResponse(new Response('ok'), getStartEvent()) + response.headers.delete('x-helper') + return response + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.headers.get('x-helper')).toBe('true') + }) + + it('applies earlier helper state to later replacement responses', async () => { + let firstResponse: Response | undefined + const handler = createResponseHandler(() => { + setResponseHeader('x-helper', 'true') + firstResponse = reconcileResponse(new Response('first'), getStartEvent()) + return new Response('second') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response).not.toBe(firstResponse) + expect(response.headers.get('x-helper')).toBe('true') + await expect(response.text()).resolves.toBe('second') + }) + + it('restores protected headers changed directly on the response as it leaves the pipeline', async () => { + let returned: Response | undefined + const handler = createResponseHandler(() => { + const response = new Response('ok', { + headers: { 'x-transport': 'original' }, + }) + protectResponseHeaders(response, new Map([['x-transport', 'original']])) + response.headers.set('x-transport', 'mutated') + returned = response + return response + }) + + const response = await handler(createProtocolRequest(), {}) + + expect(response).not.toBe(returned) + expect(response.body).toBe(returned?.body) + expect(returned?.headers.get('x-transport')).toBe('mutated') + expect(response.headers.get('x-transport')).toBe('original') + }) + + it('applies helper status to the returned response', async () => { + const handler = createResponseHandler(() => { + setResponseStatus(201, 'Created') + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(201) + expect(response.statusText).toBe('Created') + }) + + it('sanitizes helper statusText writes', async () => { + const handler = createResponseHandler(() => { + setResponseStatus(418, 'Bad\nTeapot') + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(418) + expect(response.statusText).toBe('BadTeapot') + }) + + it('returns 400 for malformed URLs that throw TypeError', async () => { + const handler = createResponseHandler(() => new Response('unused')) + const response = await handler({ url: 'http://%' } as Request, {}) + + expect(response.status).toBe(400) + expect(response.statusText).toBe('Bad Request') + }) + + it('parses request helpers from forwarded headers and cookies', async () => { + const handler = createResponseHandler(() => { + return Response.json({ + host: getRequestHost(), + forwardedHost: getRequestHost({ xForwardedHost: true }), + protocol: getRequestProtocol(), + originalProtocol: getRequestProtocol({ xForwardedProto: false }), + url: getRequestUrl({ xForwardedHost: true }).toString(), + ip: getRequestIP() ?? null, + forwardedIp: getRequestIP({ xForwardedFor: true }), + cookies: getCookies(), + encodedCookie: getCookie('encoded'), + }) + }) + + const response = await handler( + new Request('http://internal.local:3000/path?x=1', { + headers: { + cookie: 'plain=value; encoded=hello%20world', + host: 'origin.example:8080', + 'x-forwarded-for': '203.0.113.10, 10.0.0.1', + 'x-forwarded-host': 'public.example, proxy.example', + 'x-forwarded-proto': 'https, http', + }, + }), + {}, + ) + + await expect(response.json()).resolves.toEqual({ + host: 'origin.example:8080', + forwardedHost: 'public.example', + protocol: 'https', + originalProtocol: 'http', + url: 'https://public.example/path?x=1', + ip: null, + forwardedIp: '203.0.113.10', + cookies: { + plain: 'value', + encoded: 'hello world', + }, + encodedCookie: 'hello world', + }) + }) + + it('preserves HTTP-style error status, statusText, and headers', async () => { + const handler = createResponseHandler(() => { + const error = new Error('handled') as Error & { + status: number + statusText: string + headers: HeadersInit + } + error.status = 418 + error.statusText = 'Teapot' + error.headers = { 'x-error': 'handled' } + throw error + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(418) + expect(response.statusText).toBe('Teapot') + expect(response.headers.get('x-error')).toBe('handled') + expect(response.headers.get('content-type')).toBe('application/json') + }) + + it('converts errors through handleStartError', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + const handler = createResponseHandler(() => { + throw new Error('handled by default') + }) + + try { + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(500) + expect(response.headers.get('content-type')).toBe('application/json') + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }) + + it('preserves HTTP-style error headers from cause', async () => { + const handler = createResponseHandler(() => { + throw new Error('wrapped', { + cause: { + status: 409, + headers: { 'x-error-cause': 'handled' }, + }, + }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(409) + expect(response.headers.get('x-error-cause')).toBe('handled') + }) + + it.each([200, 201, 302])( + 'does not let a helper %s status hide an uncaught error', + async (helperStatus) => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(helperStatus, 'Helper Status') + throw new TypeError('unexpected failure') + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(500) + expect(response.statusText).toBe('') + await expect(response.json()).resolves.toMatchObject({ + status: 500, + unhandled: true, + }) + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }, + ) + + it('logs an error thrown after a helper selects an error status', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(401, 'Unauthorized') + throw new Error('not signed in') + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(401) + expect(response.statusText).toBe('Unauthorized') + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }) + + it('uses 500 when error metadata carries a non-error status', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + throw Object.assign(new Error('moved'), { + status: 302, + statusText: 'Found', + }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(500) + expect(response.statusText).toBe('') + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }) + + it('does not log errors whose metadata carries an HTTP error status', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(201) + throw Object.assign(new Error('conflict'), { statusCode: 409 }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(409) + expect(consoleError).not.toHaveBeenCalled() + } finally { + consoleError.mockRestore() + } + }) + + it('adopts only the status of an upstream Response cause', async () => { + const handler = createResponseHandler(() => { + throw new Error('upstream failed', { + cause: new Response('

upstream

', { + status: 502, + headers: { + 'content-encoding': 'gzip', + 'content-length': '999', + 'content-type': 'text/html', + 'set-cookie': 'upstream=1; Path=/', + 'x-upstream': 'yes', + }, + }), + }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(502) + expect(response.headers.get('x-upstream')).toBeNull() + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('content-encoding')).toBeNull() + expect(response.headers.get('content-length')).toBeNull() + expect(response.headers.getSetCookie()).toEqual([]) + await expect(response.json()).resolves.toMatchObject({ status: 502 }) + }) + + it('adopts no headers from a Response cause of another fetch implementation', async () => { + // npm undici, node-fetch, or another realm: not an instance of the global + // Response, but tagged as one. + class ForeignResponse { + readonly [Symbol.toStringTag] = 'Response' + readonly status = 502 + readonly headers = new Headers({ + 'content-type': 'text/html', + 'set-cookie': 'upstream=1; Path=/', + 'www-authenticate': 'Basic realm="upstream"', + }) + } + const handler = createResponseHandler(() => { + throw new Error('upstream failed', { cause: new ForeignResponse() }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(502) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('www-authenticate')).toBeNull() + expect(response.headers.getSetCookie()).toEqual([]) + }) + + it('strips body framing headers from explicit error headers', async () => { + const handler = createResponseHandler(() => { + throw Object.assign(new Error('handled'), { + status: 401, + headers: { + connection: 'close', + 'content-encoding': 'br', + 'content-length': '1', + 'content-range': 'bytes 0-0/1', + 'keep-alive': 'timeout=5', + 'transfer-encoding': 'chunked', + 'set-cookie': 'explicit=1; Path=/', + 'www-authenticate': 'Bearer', + }, + }) + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(401) + for (const name of [ + 'connection', + 'content-encoding', + 'content-length', + 'keep-alive', + 'transfer-encoding', + ]) { + expect(response.headers.get(name)).toBeNull() + } + // Headers an application writes for its own error status still apply. + expect(response.headers.get('content-range')).toBe('bytes 0-0/1') + expect(response.headers.get('www-authenticate')).toBe('Bearer') + expect(response.headers.getSetCookie()).toEqual(['explicit=1; Path=/']) + await expect(response.json()).resolves.toMatchObject({ status: 401 }) + }) + + it('keeps helper status over HTTP-style error status', async () => { + const handler = createResponseHandler(() => { + setResponseStatus(401, 'Unauthorized') + const error = new Error('handled') as Error & { status: number } + error.status = 418 + throw error + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(401) + expect(response.statusText).toBe('Unauthorized') + }) + + it('sends a Response thrown by request middleware on a document request unmarked', async () => { + const handler = createResponseHandler(() => { + throw new Response('teapot', { status: 418 }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(418) + expect(response.headers.get('x-tss-raw')).toBeNull() + await expect(response.text()).resolves.toBe('teapot') + }) + + it('rethrows primitive errors', async () => { + const handler = createResponseHandler(() => { + return Promise.reject('primitive failure') + }) + + await expect(handler(new Request('http://localhost/'), {})).rejects.toBe( + 'primitive failure', + ) + }) + + it('does not recover request state from an error outside the active entry', async () => { + const error = Object.assign(new Error('outside'), { + status: 409, + headers: { 'x-error': 'yes' }, + }) + const handler = createResponseHandler(() => { + setResponseHeader('x-helper', 'yes') + throw error + }) + + let caught: unknown + try { + await handler(new Request('http://localhost/'), {}) + } catch (error) { + caught = error + } + + const response = handleStartError(caught) + + expect(response.status).toBe(409) + expect(response.headers.get('x-error')).toBe('yes') + expect(response.headers.get('x-helper')).toBeNull() + }) + + it('returns response errors verbatim outside the active event', () => { + const response = new Response('handled', { status: 418 }) + + expect(handleStartError(response)).toBe(response) + }) + + it('returns a generic response for primitive errors outside the active event', () => { + const response = handleStartError('primitive failure') + + expect(response.status).toBe(500) + expect(response.headers.get('content-type')).toBe('application/json') + }) + + it('cancels returned response bodies when reconciliation drops them', async () => { + let cancelledReason: unknown + let resolveCancel!: () => void + const cancelled = new Promise((resolve) => { + resolveCancel = resolve + }) + const handler = createResponseHandler(() => { + setResponseStatus(204) + return new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([1])) + }, + cancel(reason) { + cancelledReason = reason + resolveCancel() + }, + }), + ) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(204) + expect(response.body).toBe(null) + await expect(cancelled).resolves.toBeUndefined() + expect(cancelledReason).toBe( + 'Response body dropped by Start reconciliation', + ) + }) + + it.each([204, 205, 304])( + 'drops the body of a returned %s response on runtimes that allow one', + async (status) => { + // Bun accepts a body on 204, 205, and 304 responses; Node rejects them. + // This subclass reports the bodyless status for a body-bearing response, + // as Bun would. Fields initialize after the base constructor has + // validated the body. + class BodylessStatusResponse extends Response { + reportsBodylessStatus = true + override get status() { + return this.reportsBodylessStatus ? status : super.status + } + } + let cancelledReason: unknown + const handler = createResponseHandler( + () => + new BodylessStatusResponse( + new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([1])) + }, + cancel(reason) { + cancelledReason = reason + }, + }), + { headers: { 'x-returned': 'yes' } }, + ), + ) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(status) + expect(response.body).toBeNull() + expect(response.headers.get('x-returned')).toBe('yes') + await vi.waitFor(() => + expect(cancelledReason).toBe( + 'Response body dropped by Start reconciliation', + ), + ) + }, + ) + + it('falls back from informational statuses that Fetch responses cannot use', async () => { + const handler = createResponseHandler(() => { + setResponseStatus(101) + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(200) + }) + + it('keeps the previous status when a helper write is out of range', async () => { + const handler = createResponseHandler(() => { + setResponseStatus(418) + setResponseStatus(700) + return new Response('ok') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(418) + }) + + it.each([101, 199, 600, 999, 404.5])( + 'ignores setResponseStatus(%s) instead of overriding a returned status', + async (status) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(status, 'Ignored') + return new Response('missing', { + status: 404, + statusText: 'Not Found', + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(404) + expect(response.statusText).toBe('Not Found') + expect(warnSpy).toHaveBeenCalledOnce() + expect(warnSpy.mock.calls[0]![0]).toContain( + `setResponseStatus(${status}) was ignored`, + ) + } finally { + warnSpy.mockRestore() + } + }, + ) + + it.each([0, Number.NaN])( + 'ignores setResponseStatus(%s) with its status text', + async (status) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(status, 'Ignored') + return new Response('missing', { + status: 404, + statusText: 'Not Found', + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(404) + expect(response.statusText).toBe('Not Found') + expect(warnSpy).toHaveBeenCalledOnce() + } finally { + warnSpy.mockRestore() + } + }, + ) + + it('ignores out-of-range statuses without a warning in production', async () => { + vi.stubEnv('NODE_ENV', 'production') + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(999) + return new Response('missing', { status: 404 }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(404) + expect(warnSpy).not.toHaveBeenCalled() + } finally { + warnSpy.mockRestore() + vi.unstubAllEnvs() + } + }) + + it('keeps the uncaught error status and log after an ignored status write', async () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const handler = createResponseHandler(() => { + setResponseStatus(999) + throw new Error('unexpected failure') + }) + + const response = await createServerEntry({ fetch: handler }).fetch( + new Request('http://localhost/'), + {}, + ) + + expect(response.status).toBe(500) + await expect(response.json()).resolves.toMatchObject({ + status: 500, + unhandled: true, + }) + expect(consoleError).toHaveBeenCalledOnce() + } finally { + warnSpy.mockRestore() + consoleError.mockRestore() + } + }) +}) + +describe('createStartHandler redirect safety', () => { + it('publishes early normalized redirects with helper writes from the custom entry', async () => { + const handler = createStartHandler(() => { + throw new Error('Early redirects should not render HTML') + }) + const entry = createServerEntry({ + fetch: async (request, options) => { + setCookie('entry', 'visited') + const response = await handler(request, options) + expect(getResponseStatus()).toBe(308) + expect(getResponseHeader('location')).toBe('http://localhost/target') + expect(getResponseHeaders().getSetCookie()).toEqual([ + 'entry=visited; Path=/', + ]) + return response + }, + }) + + const response = await entry.fetch( + new Request('http://localhost//target'), + {}, + ) + + expect(response.status).toBe(308) + expect(response.headers.getSetCookie()).toEqual(['entry=visited; Path=/']) + }) + + it.each(['GET', 'HEAD'])( + 'publishes the final %s server-function redirect response to custom-entry helpers', + async (method) => { + startMocks.routerFactory = makeRouter + startMocks.serverFnResult = redirect({ to: '/login' }) + const handler = createStartHandler(() => { + throw new Error('Server function redirects should not render HTML') + }) + const entry = createServerEntry({ + fetch: async (request, options) => { + const response = await handler(request, options) + expect(getResponseStatus()).toBe(200) + expect(getResponseHeader('location')).toBeUndefined() + expect(getResponseHeaders().get('content-type')).toBe( + 'application/json', + ) + return response + }, + }) + + const response = await entry.fetch( + new Request('http://localhost/_serverFn/test', { + method, + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(response.headers.get('location')).toBeNull() + if (method === 'HEAD') { + expect(response.body).toBeNull() + } else { + await expect(response.json()).resolves.toMatchObject({ + href: '/login', + isSerializedRedirect: true, + }) + } + }, + ) + + it.each( + [false, true].flatMap((rpc) => + ['relative-to', 'functional-options'].flatMap((options) => + ['/login', 'http://localhost/login', '//evil.example'].map((href) => ({ + rpc, + options, + href, + })), + ), + ), + )( + 'uses an explicit Location before ignored $options (RPC=$rpc, href=$href)', + async ({ rpc, options, href }) => { + const factory = vi.fn(makeRouter) + const updater = vi.fn(() => ({})) + const hash = vi.fn(() => 'ignored') + startMocks.routerFactory = factory + const headers = { Location: href } + const result = + options === 'relative-to' + ? redirect({ headers, to: 'ignored' }) + : redirect({ headers, search: updater, params: updater, hash }) + if (rpc) { + startMocks.serverFnResult = result + } else { + startMocks.requestMiddleware = [createMiddleware().server(() => result)] + } + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request(`http://localhost/${rpc ? '_serverFn/test' : ''}`, { + headers: rpc ? { 'x-tsr-serverFn': 'true' } : undefined, + }), + {}, + ) + const blocked = href.startsWith('//') + expect(response.status).toBe(blocked ? 500 : rpc ? 200 : 307) + expect(response.headers.get('Location')).toBe( + blocked || rpc ? null : '/login', + ) + expect(factory).toHaveBeenCalledTimes(href === '/login' ? 0 : 1) + expect(updater).not.toHaveBeenCalled() + expect(hash).not.toHaveBeenCalled() + if (rpc && !blocked) { + expect(await response.json()).toMatchObject({ + href: '/login', + isSerializedRedirect: true, + }) + } + }, + ) + + it.each( + [undefined, ''].flatMap((location) => + ['to', 'params', 'search', 'hash'].map((option) => ({ + location, + option, + })), + ), + )( + 'still validates unresolved $option with Location=$location', + async ({ location, option }) => { + const factory = vi.fn(makeRouter) + const updater = vi.fn(() => ({})) + const hash = vi.fn(() => 'ignored') + startMocks.routerFactory = factory + const headers = + location === undefined ? undefined : { Location: location } + const result = + option === 'to' + ? redirect({ headers, to: 'relative' }) + : redirect({ + headers, + to: '/login', + params: option === 'params' ? updater : undefined, + search: option === 'search' ? updater : undefined, + hash: option === 'hash' ? hash : undefined, + }) + startMocks.requestMiddleware = [createMiddleware().server(() => result)] + const response = await createTestStartHandler( + () => new Response('unused'), + )(new Request('http://localhost/'), {}) + expect(response.status).toBe(500) + expect(response.headers.get('Location')).toBeNull() + expect(factory).not.toHaveBeenCalled() + expect(updater).not.toHaveBeenCalled() + expect(hash).not.toHaveBeenCalled() + }, + ) + + it('applies custom protocol policy to a header-only redirect with ignored options', async () => { + startMocks.routerFactory = () => { + const router = makeRouter() + router.update({ protocolAllowlist: [] }) + return router + } + startMocks.requestMiddleware = [ + createMiddleware().server(() => + redirect({ + to: 'ignored', + headers: { Location: 'https://other.example/login' }, + }), + ), + ] + const response = await createTestStartHandler(() => new Response('unused'))( + new Request('http://localhost/'), + {}, + ) + expect(response.status).toBe(500) + expect(response.headers.get('Location')).toBeNull() + }) + + it.each([ + '/login', + '../login', + '?next=https://example.com', + '#details', + '/items/a:b', + ])( + 'returns an early relative redirect to %j without initializing the router', + async (href) => { + const factory = vi.fn(makeRouter) + startMocks.routerFactory = factory + startMocks.requestMiddleware = [ + createMiddleware().server(() => redirect({ href })), + ] + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(307) + expect(response.headers.get('Location')).toBe(href) + expect(factory).not.toHaveBeenCalled() + }, + ) + + it('serializes an early relative server-function redirect without initializing the router', async () => { + const factory = vi.fn(makeRouter) + startMocks.routerFactory = factory + startMocks.serverFnResult = redirect({ + href: '/ignored', + headers: { Location: '/login', 'set-cookie': 'session=secret; HttpOnly' }, + }) + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(response.headers.get('Location')).toBeNull() + expect(response.headers.get('set-cookie')).toBe('session=secret; HttpOnly') + const body = await response.json() + expect(body).toMatchObject({ href: '/login', isSerializedRedirect: true }) + expect(body).not.toHaveProperty('headers') + expect(factory).not.toHaveBeenCalled() + }) + + it.each([ + { href: 'https://example.com/login', protocols: [], status: 500 }, + { href: 'myapp:login', protocols: ['myapp:'], status: 307 }, + { href: 'myapp:login', protocols: [], status: 500 }, + ])( + 'uses router policy for an early redirect to $href with $protocols', + async ({ href, protocols, status }) => { + const factory = vi.fn(() => { + const router = makeRouter() + router.update({ protocolAllowlist: protocols }) + return router + }) + startMocks.routerFactory = factory + startMocks.requestMiddleware = [ + createMiddleware().server(() => + redirect({ + href: '/ignored', + headers: { Location: href }, + }), + ), + ] + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(status) + expect(response.headers.get('Location')).toBe( + status === 307 ? href : null, + ) + expect(factory).toHaveBeenCalledTimes(1) + }, + ) + + it('resolves route-based early redirects through the router', async () => { + const factory = vi.fn(() => makeRouterWithRouteWork({})) + startMocks.routerFactory = factory + startMocks.requestMiddleware = [ + createMiddleware().server(() => + redirect({ + to: '/work', + search: { next: 'home' }, + }), + ), + ] + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler(new Request('http://localhost/'), {}) + expect(response.status).toBe(307) + expect(response.headers.get('Location')).toBe('/work?next=home') + expect(factory).toHaveBeenCalledTimes(1) + }) + + it('resolves redirects thrown by a server handlers factory before route middleware runs', async () => { + startMocks.router = makeRouter({ + server: { + handlers: () => { + setCookie('factory', 'visited') + throw redirect({ to: '/login' }) + }, + }, + }) + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(307) + expect(response.headers.get('Location')).toBe('/login') + expect(response.headers.getSetCookie()).toEqual(['factory=visited; Path=/']) + expect(render).not.toHaveBeenCalled() + }) + + it.each([ + { href: '/login', status: 307, factories: 0, location: '/login' }, + { href: '/\\evil.example', status: 500, factories: 1, location: null }, + { + href: 'http://localhost/login', + status: 307, + factories: 1, + location: '/login', + }, + ])( + 'validates a header-only early redirect to $href', + async ({ href, status, factories, location }) => { + const factory = vi.fn(makeRouter) + startMocks.routerFactory = factory + startMocks.requestMiddleware = [ + createMiddleware().server(() => + redirect({ + headers: { Location: href }, + throw: true, + }), + ), + ] + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler(new Request('http://localhost/'), {}) + expect(response.status).toBe(status) + expect(response.headers.get('Location')).toBe(location) + expect(factory).toHaveBeenCalledTimes(factories) + }, + ) + + it.each( + [ + '//evil.example', + '/\\evil.example', + '/\\\\evil.example', + '/\\/evil.example', + '\\/evil.example', + '\\\\evil.example', + ].flatMap((href) => [false, true].map((rpc) => ({ href, rpc }))), + )( + 'validates a resolved server function redirect to $href (RPC=$rpc)', + async ({ href, rpc }) => { + startMocks.router = makeRouter() + startMocks.serverFnResult = redirect({ href }) + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: rpc ? { 'x-tsr-serverFn': 'true' } : undefined, + }), + {}, + ) + + expect(response.status).toBe(500) + expect(response.headers.get('Location')).toBeNull() + }, + ) + + it('validates a structured redirect before returning it directly', async () => { + startMocks.router = makeRouter() + startMocks.requestMiddleware = [ + createMiddleware().server(() => redirect({ href: '/\\evil.example' })), + ] + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(500) + expect(response.headers.get('Location')).toBeNull() + }) + + it('does not serialize structured redirect headers into the response body', async () => { + startMocks.router = makeRouter() + startMocks.serverFnResult = redirect({ + href: '/safe', + headers: { 'set-cookie': 'session=secret; HttpOnly' }, + }) + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(response.headers.get('set-cookie')).toBe('session=secret; HttpOnly') + const responseText = await response.text() + expect(responseText).not.toContain('session=secret') + expect(JSON.parse(responseText)).toEqual( + expect.objectContaining({ + href: '/safe', + statusCode: 307, + isSerializedRedirect: true, + }), + ) + }) + + it.each(['href', 'to'] as const)( + 'snapshots RPC redirect headers before %s option serialization writes helpers', + async (target) => { + startMocks.routerFactory = makeRouter + const callerHeaders = new Headers([ + ['x-snapshot', 'before'], + ['set-cookie', 'first=1; Path=/'], + ['set-cookie', 'second=2; Path=/'], + ]) + const state = { + toJSON() { + source.headers.set('x-snapshot', 'after') + source.headers.append('set-cookie', 'late=3; Path=/') + setResponseHeader('x-serialization', 'complete') + appendResponseHeader('x-steps', 'serialized') + return { serialized: true } + }, + } + const options = { [target]: '/safe', headers: callerHeaders, state } + const source = redirect(options) + startMocks.serverFnResult = source + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.headers.get('x-snapshot')).toBe('before') + expect(response.headers.getSetCookie()).toEqual([ + 'first=1; Path=/', + 'second=2; Path=/', + ]) + expect(response.headers.get('x-serialization')).toBe('complete') + expect(response.headers.get('x-steps')).toBe('serialized') + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('location')).toBeNull() + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('x-tss-serialized')).toBeNull() + expect(await response.json()).toEqual( + expect.objectContaining({ + href: '/safe', + state: { serialized: true }, + isSerializedRedirect: true, + }), + ) + expect(source.headers.get('x-snapshot')).toBe('after') + expect(options.headers).toBe(callerHeaders) + expect(callerHeaders.get('x-snapshot')).toBe('before') + expect(options.state).toBe(state) + }, + ) + + it('preserves redirect headers and caller options across RPC then native form reuse', async () => { + const headers = { + Location: '/work', + 'set-cookie': 'session=secret; HttpOnly', + 'content-type': 'text/plain', + } + const options = { href: '/work', statusCode: 303, headers } + const result = redirect(options) + startMocks.serverFnResult = result + const handler = createTestStartHandler(() => new Response('unused')) + + const rpcResponse = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + expect(rpcResponse.status).toBe(200) + expect(rpcResponse.headers.get('content-type')).toBe('application/json') + expect(await rpcResponse.json()).not.toHaveProperty('headers') + expect(options.headers).toBe(headers) + expect(result.headers.get('content-type')).toBe('text/plain') + + const formResponse = await handler( + new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + body: 'name=test', + }), + {}, + ) + expect(formResponse.status).toBe(303) + expect(formResponse.headers.get('Location')).toBe('/work') + expect(formResponse.headers.get('set-cookie')).toBe( + 'session=secret; HttpOnly', + ) + expect(formResponse.headers.get('content-type')).toBe('text/plain') + expect(await formResponse.text()).toBe('') + }) + + it('does not serialize an ordinary redirect with a spoofed server function header', async () => { + startMocks.router = makeRouter() + startMocks.requestMiddleware = [ + createMiddleware().server(() => redirect({ href: '/safe' })), + ] + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(307) + expect(response.headers.get('Location')).toBe('/safe') + expect(response.headers.get('content-type')).toBeNull() + expect(await response.text()).toBe('') + }) + + it.each([{ href: '/work' }, { to: '/work' }, { hash: () => 'ignored' }])( + 'preserves native form redirects for %j without the RPC header', + async (target) => { + startMocks.routerFactory = () => makeRouterWithRouteWork({}) + startMocks.serverFnResult = redirect({ + ...target, + statusCode: 303, + headers: { + 'set-cookie': 'session=secret; HttpOnly', + ...('hash' in target ? { Location: '/work' } : undefined), + }, + }) + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + accept: 'text/html', + }, + body: 'name=test', + }), + {}, + ) + + expect(response.status).toBe(303) + expect(response.headers.get('Location')).toBe('/work') + expect(response.headers.get('set-cookie')).toBe( + 'session=secret; HttpOnly', + ) + expect(response.headers.get('content-type')).not.toBe('application/json') + expect(await response.text()).toBe('') + }, + ) +}) + +describe('createStartHandler request location reuse', () => { + it.each( + ['plain', 'café'].flatMap((path) => + [false, true].map((renderApp) => ({ path, renderApp })), + ), + )( + 'rewrites once for $path (renderApp=$renderApp)', + async ({ path, renderApp }) => { + const input = vi.fn(({ url }: { url: URL }) => { + url.pathname = url.pathname.replace('/public/', '/') + return url + }) + const middlewarePathnames: Array = [] + const routeMiddleware = createMiddleware().server( + ({ pathname, next }) => { + middlewarePathnames.push(pathname) + return next() + }, + ) + const serverHandler = vi.fn() + const rootRoute = new BaseRootRoute({}) + const route = new BaseRoute({ + getParentRoute: () => rootRoute, + path, + component: () => null, + server: { + middleware: [routeMiddleware], + handlers: { + GET: ({ pathname, next }) => { + serverHandler(pathname) + return renderApp ? next() : new Response('server response') + }, + }, + }, + }) + const router = new RouterCore( + { + history: createMemoryHistory({ initialEntries: ['/'] }), + routeTree: rootRoute.addChildren([route]), + rewrite: { + input, + output: ({ url }) => { + url.pathname = `/public${url.pathname}` + return url + }, + }, + }, + getStoreConfig, + ) + router.isServer = true + startMocks.router = router + input.mockClear() + const getMatchedRoutes = vi.spyOn(router, 'getMatchedRoutes') + const render = vi.fn(() => new Response('app response')) + const handler = createStartHandler(render) + + const response = await handler( + new Request( + `http://localhost/public/${encodeURIComponent(path)}?view=full#section`, + ), + {}, + ) + + expect(response.status).toBe(200) + expect(await response.text()).toBe( + renderApp ? 'app response' : 'server response', + ) + expect(input).toHaveBeenCalledOnce() + expect(serverHandler).toHaveBeenCalledExactlyOnceWith(`/${path}`) + expect(middlewarePathnames).toEqual([`/${path}`]) + expect(render).toHaveBeenCalledTimes(renderApp ? 1 : 0) + expect( + getMatchedRoutes.mock.calls.every( + ([pathname]) => pathname === `/${path}`, + ), + ).toBe(true) + if (renderApp) { + expect(router.state.matches.at(-1)?.routeId).toBe(route.id) + } + }, + ) + + it('uses the configured origin for server route rewrites', async () => { + const input = vi.fn(({ url }: { url: URL }) => { + url.pathname = + url.hostname === 'public.example' ? '/work' : '/wrong-origin' + return url + }) + const router = makeRouterWithRouteWork({}) + router.update({ + origin: 'https://public.example', + rewrite: { + input, + output: ({ url }) => { + url.pathname = '/public' + return url + }, + }, + }) + const serverHandler = vi.fn(() => new Response('server response')) + router.routesById['/work']!.options.server = { + handlers: { GET: serverHandler }, + } + startMocks.router = router + input.mockClear() + const handler = createStartHandler(() => new Response('app response')) + + const response = await handler( + new Request('http://internal.example/public'), + {}, + ) + + expect(response.status).toBe(200) + expect(await response.text()).toBe('server response') + expect(serverHandler).toHaveBeenCalledOnce() + expect(input).toHaveBeenCalledOnce() + }) + + it('reuses search parsed after route middleware updates the router', async () => { + const parseSearch = vi.fn((search: string) => + Object.fromEntries(new URLSearchParams(search)), + ) + const middleware = createMiddleware().server(({ next }) => { + startMocks.router!.update({ + parseSearch, + stringifySearch: (search) => + `?${new URLSearchParams(search).toString()}`, + }) + return next() + }) + const root = new BaseRootRoute() + const route = new BaseRoute({ + getParentRoute: () => root, + path: '/work', + component: () => null, + loader: ({ location }) => location.search, + server: { middleware: [middleware] }, + }) + startMocks.router = new RouterCore( + { isServer: true, routeTree: root.addChildren([route]) }, + getStoreConfig, + ) + const handler = createStartHandler(({ router }) => + Response.json({ + search: router.state.location.search, + loaderData: router.state.matches.at(-1)?.loaderData, + }), + ) + + const response = await handler( + new Request('http://localhost/work?page=2'), + {}, + ) + + expect(response.status).toBe(200) + expect(await response.json()).toEqual({ + search: { page: '2' }, + loaderData: { page: '2' }, + }) + expect(parseSearch).toHaveBeenCalledExactlyOnceWith('?page=2') + }) + + // Handlers receive the router's pathname: decoded, except for characters + // that would change how the path is read. + it.each([ + ['a/b', 'a%2Fb'], + ['a%b', 'a%25b'], + ['a b', 'a b'], + ['a?b', 'a%3Fb'], + ['a#b', 'a%23b'], + ])( + 'preserves encoded params %j when a server handler continues to SSR', + async (value, pathname) => { + const handlerParams: Array = [] + const handlerPathnames: Array = [] + const root = new BaseRootRoute() + const route = new BaseRoute({ + getParentRoute: () => root, + path: '/params/$value', + component: () => null, + loader: ({ params }) => params.value, + server: { + handlers: { + GET: ({ params, pathname, next }) => { + handlerParams.push(params.value) + handlerPathnames.push(pathname) + params.value = 'changed by server handler' + return next() + }, + }, + }, + }) + startMocks.router = new RouterCore( + { isServer: true, routeTree: root.addChildren([route]) }, + getStoreConfig, + ) + const handler = createStartHandler(({ router }) => + Response.json({ + params: router.state.matches.at(-1)?.params, + loaderData: router.state.matches.at(-1)?.loaderData, + }), + ) + + const response = await handler( + new Request(`http://localhost/params/${encodeURIComponent(value)}`), + {}, + ) + + expect(response.status).toBe(200) + expect(handlerParams).toEqual([value]) + expect(handlerPathnames).toEqual([`/params/${pathname}`]) + expect(await response.json()).toEqual({ + params: { value }, + loaderData: value, + }) + }, + ) +}) + +it('keeps the request URL when server code attempts navigation', async () => { + const loader = vi.fn(async () => { + const router = startMocks.router! + router.history.push('/pushed') + router.history.replace('/replaced') + await router.navigate({ to: '/navigated' }) + return 'request data' + }) + const router = makeRouterWithRouteWork({ loader }) + startMocks.router = router + const load = vi.spyOn(router, 'load') + const handler = createTestStartHandler(({ router: loadedRouter }) => { + expect(loadedRouter.state.location.pathname).toBe('/work') + expect(loadedRouter.history.location.pathname).toBe('/work') + expect(loadedRouter.history.length).toBe(1) + return new Response(loadedRouter.state.matches.at(-1)?.loaderData as string) + }) + const response = await handler(new Request('http://localhost/work'), {}) + + expect(response.status).toBe(200) + expect(await response.text()).toBe('request data') + expect(loader).toHaveBeenCalledTimes(1) + expect(load).toHaveBeenCalledTimes(1) +}) + +describe('createStartHandler router request Accept handling', () => { + it('returns 406 JSON for router requests that do not accept HTML', async () => { + startMocks.routerFactory = vi.fn(makeRouter) + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + headers: { accept: 'application/json' }, + }), + {}, + ) + + expect(response.status).toBe(406) + expect(response.headers.get('content-type')).toContain('application/json') + expect(await response.json()).toEqual({ + error: 'Only HTML requests are supported here', + }) + expect(render).not.toHaveBeenCalled() + }) + + it.each(['text/html', '*/*', undefined])( + 'does not return 406 for Accept: %s', + async (accept) => { + startMocks.routerFactory = vi.fn(makeRouter) + const render = vi.fn(() => new Response('ok')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + headers: accept === undefined ? undefined : { accept }, + }), + {}, + ) + + expect(response.status).not.toBe(406) + expect(await response.text()).toBe('ok') + expect(render).toHaveBeenCalledTimes(1) + }, + ) +}) + describe('createStartHandler SSR cleanup ownership', () => { + it.each([204, 200])( + 'preserves cancellation helper writes when a short-circuit body is dropped and cleanup selects %s without a router', + async (status) => { + const routerFactory = vi.fn(makeRouter) + startMocks.routerFactory = routerFactory + const cancel = vi.fn(() => { + setResponseStatus(status) + setCookie('cleanup', 'visited') + setResponseHeader('x-cleanup', 'complete') + appendResponseHeader('x-cleanup-steps', 'cancelled') + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setResponseStatus(204) + return new Response(new ReadableStream({ cancel }), { + headers: { 'x-cleanup-steps': 'initial' }, + }) + }), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(routerFactory).not.toHaveBeenCalled() + expect(render).not.toHaveBeenCalled() + expect(cancel).toHaveBeenCalledOnce() + expect(response.status).toBe(status) + expect(response.body).toBeNull() + expect(response.headers.getSetCookie()).toEqual([ + 'cleanup=visited; Path=/', + ]) + expect(response.headers.get('x-cleanup')).toBe('complete') + expect(response.headers.get('x-cleanup-steps')).toBe('initial, cancelled') + }, + ) + + it('preserves cancellation helper writes when outermost middleware replaces a server-function response without a router', async () => { + const routerFactory = vi.fn(makeRouter) + startMocks.routerFactory = routerFactory + const cancel = vi.fn(() => { + setCookie('cleanup', 'visited') + setResponseHeader('x-cleanup', 'complete') + appendResponseHeader('x-cleanup-steps', 'cancelled') + }) + startMocks.serverFnHandler = () => + new Response(new ReadableStream({ cancel })) + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + await next() + return new Response('replacement', { + headers: { 'x-cleanup-steps': 'replacement' }, + }) + }), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(routerFactory).not.toHaveBeenCalled() + expect(render).not.toHaveBeenCalled() + expect(startMocks.serverFnCalls).toHaveLength(1) + expect(cancel).toHaveBeenCalledOnce() + expect(response.status).toBe(200) + expect(response.headers.getSetCookie()).toEqual(['cleanup=visited; Path=/']) + expect(response.headers.get('x-cleanup')).toBe('complete') + expect(response.headers.get('x-cleanup-steps')).toBe( + 'replacement, cancelled', + ) + await expect(response.text()).resolves.toBe('replacement') + }) + + it.each(['drop', 'replace'] as const)( + 'preserves cleanup helper writes when middleware disposes SSR through %s', + async (mode) => { + const router = makeRouter() + startMocks.router = router + const cancel = vi.fn() + const cleanup = vi.fn(() => { + setResponseHeader('x-cleanup', 'complete') + setCookie('cleanup', 'visited') + }) + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + if (mode === 'drop') { + setResponseStatus(204) + return result + } + return new Response('replacement') + }), + ] + const handler = createTestStartHandler(({ router: requestRouter }) => { + requestRouter.serverSsr!.onCleanup(cleanup) + return createSsrStreamResponse( + requestRouter, + new Response(new ReadableStream({ cancel })), + ) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(cancel).toHaveBeenCalledOnce() + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + expect(response.headers.get('x-cleanup')).toBe('complete') + expect(response.headers.getSetCookie()).toEqual([ + 'cleanup=visited; Path=/', + ]) + if (mode === 'drop') { + expect(response.status).toBe(204) + expect(response.body).toBeNull() + } else { + expect(response.status).toBe(200) + await expect(response.text()).resolves.toBe('replacement') + } + }, + ) + + it('preserves response helper writes made by eager SSR cleanup callbacks', async () => { + const router = makeRouter() + startMocks.router = router + const cleanup = vi.fn(() => { + setResponseStatus(202, 'Accepted') + setResponseHeader('x-cleanup', 'complete') + setCookie('cleanup', 'visited') + }) + const handler = createTestStartHandler(({ router: requestRouter }) => { + requestRouter.serverSsr!.onCleanup(cleanup) + return new Response('eager document') + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + expect(response.status).toBe(202) + expect(response.statusText).toBe('Accepted') + expect(response.headers.get('x-cleanup')).toBe('complete') + expect(response.headers.getSetCookie()).toEqual(['cleanup=visited; Path=/']) + await expect(response.text()).resolves.toBe('eager document') + }) + + it('preserves helper appends when an eager renderer cleans up before returning', async () => { + const router = makeRouter() + startMocks.router = router + const handler = createTestStartHandler(({ router: requestRouter }) => { + requestRouter.serverSsr!.onCleanup(() => { + setResponseStatus(202, 'Accepted') + appendResponseHeader('x-steps', 'cleanup') + setCookie('cleanup', 'visited') + }) + requestRouter.serverSsr!.cleanup() + return new Response('eager document', { + headers: { 'x-steps': 'render' }, + }) + }) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(router.serverSsr).toBeUndefined() + expect(response.status).toBe(202) + expect(response.statusText).toBe('Accepted') + expect(response.headers.get('x-steps')).toBe('render, cleanup') + expect(response.headers.getSetCookie()).toEqual(['cleanup=visited; Path=/']) + await expect(response.text()).resolves.toBe('eager document') + }) + + it.each([ + { method: 'GET', status: 204, hasBody: true }, + { method: 'HEAD', status: 200, hasBody: false }, + ])( + 'serializes $method RPC redirect options with helper status $status', + async ({ method, status, hasBody }) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const toJSON = vi.fn(() => { + clearResponseHeaders() + setResponseStatus(status) + setResponseHeader('content-type', 'text/plain') + setResponseHeader('location', '/ignored') + setResponseHeader('x-tss-serialized', 'true') + setResponseHeader('x-tss-raw', 'true') + appendResponseHeader('x-steps', 'serialized') + setCookie('serialization', 'visited') + return { serialized: true } + }) + startMocks.serverFnResult = redirect({ href: '/safe', state: { toJSON } }) + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + method, + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + warnSpy.mockRestore() + expect(toJSON).toHaveBeenCalledOnce() + // The client decodes the envelope, so a bodyless helper status is + // ignored. Only HEAD drops the body. + expect(response.status).toBe(200) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('location')).toBeNull() + expect(response.headers.get('x-tss-serialized')).toBeNull() + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('x-steps')).toBe('serialized') + expect(response.headers.getSetCookie()).toEqual([ + 'serialization=visited; Path=/', + ]) + if (hasBody) { + await expect(response.json()).resolves.toMatchObject({ + href: '/safe', + isSerializedRedirect: true, + }) + } else { + expect(response.body).toBeNull() + } + }, + ) + + it('rejects an RPC redirect whose options cannot be serialized as JSON', async () => { + const options = { href: '/safe', toJSON: () => undefined } + startMocks.serverFnResult = redirect(options) + const handler = createStartHandler(() => new Response('unused')) + + await expect( + handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ), + ).rejects.toThrow('Value is not JSON serializable') + }) + + it('does not duplicate helper cookies across repeated reconciliation', async () => { + startMocks.serverFnResult = new Response('ok') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + setCookie('first', '1', { path: '/' }) + const result = await next() + setCookie('second', '2', { path: '/' }) + return result + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + const cookies = getSetCookieValues(response.headers) + + expect( + cookies.filter((cookie) => cookie.startsWith('first=1;')), + ).toHaveLength(1) + expect( + cookies.filter((cookie) => cookie.startsWith('second=2;')), + ).toHaveLength(1) + }) + + it('does not duplicate cookies the cookie parser rejects across middleware levels', async () => { + const longValue = 'x'.repeat(5000) + startMocks.serverFnResult = new Response('ok') + const passThrough = createMiddleware().server(({ next }) => next()) + startMocks.requestMiddleware = [ + passThrough, + createMiddleware().server(({ next }) => next()), + createMiddleware().server(async ({ next }) => { + setCookie('constructor', '1', { path: '/' }) + setCookie('long', longValue, { path: '/' }) + return next() + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + const cookies = getSetCookieValues(response.headers) + + expect( + cookies.filter((cookie) => cookie.startsWith('constructor=1;')), + ).toHaveLength(1) + expect( + cookies.filter((cookie) => cookie.startsWith(`long=${longValue};`)), + ).toHaveLength(1) + }) + + it('disposes stream response when later reconciliation drops the body', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + setResponseStatus(204) + return result + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(204) + expect(response.body).toBe(null) + expect(dispose).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + it('converts middleware errors by default', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + await next() + throw new Error('middleware failed') + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(500) + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(dispose).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + it('passes request middleware context to server functions', async () => { + startMocks.serverFnResult = new Response('ok') + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => { + return next({ context: { middleware: 'yes' } }) + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(startMocks.serverFnCalls).toHaveLength(1) + expect(startMocks.serverFnCalls[0]?.context).toMatchObject({ + middleware: 'yes', + }) + }) + it('preserves serverFn stream cleanup ownership through early return', async () => { startMocks.requestMiddleware = [] const router = makeRouter() @@ -105,7 +2435,7 @@ describe('createStartHandler SSR cleanup ownership', () => { startMocks.serverFnResult = ssrResponse const dispose = vi.spyOn(ssrResponse as any, 'dispose') - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -121,6 +2451,114 @@ describe('createStartHandler SSR cleanup ownership', () => { expect(router.serverSsr).toBeUndefined() }) + it('does not cancel the returned response when an inner result settles late', async () => { + let resolveInner!: (response: Response) => void + startMocks.serverFnHandler = () => + new Promise((resolve) => { + resolveInner = resolve + }) + const timeoutCancel = vi.fn() + const timeoutResponse = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('timeout')) + controller.close() + }, + cancel: timeoutCancel, + }), + { status: 504 }, + ) + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => + Promise.race([ + next(), + new Promise((resolve) => + setTimeout(() => resolve(timeoutResponse), 5), + ), + ]), + ), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + expect(response.status).toBe(504) + + const innerCancel = vi.fn() + resolveInner(new Response(new ReadableStream({ cancel: innerCancel }))) + await new Promise((resolve) => setTimeout(resolve, 20)) + + expect(timeoutCancel).not.toHaveBeenCalled() + expect(innerCancel).toHaveBeenCalledExactlyOnceWith( + 'late middleware response', + ) + expect(await response.text()).toBe('timeout') + }) + + it.each(['shared result', 'captured response'] as const)( + 'keeps an inner fallback when the result it abandoned settles while an outer middleware awaits (%s)', + async (returned) => { + let resolveInner!: (response: Response) => void + startMocks.serverFnHandler = () => + new Promise((resolve) => { + resolveInner = resolve + }) + const timeoutCancel = vi.fn() + const timeoutResponse = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('timeout')) + controller.close() + }, + cancel: timeoutCancel, + }), + { status: 504 }, + ) + const innerCancel = vi.fn() + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + const captured = result.response + // The abandoned inner result settles while this middleware awaits. + resolveInner( + new Response(new ReadableStream({ cancel: innerCancel }), { + status: 200, + }), + ) + await new Promise((resolve) => setTimeout(resolve, 10)) + return returned === 'shared result' ? result : captured + }), + createMiddleware().server(({ next }) => + Promise.race([ + next(), + new Promise((resolve) => + setTimeout(() => resolve(timeoutResponse), 5), + ), + ]), + ), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(504) + expect(timeoutCancel).not.toHaveBeenCalled() + expect(innerCancel).toHaveBeenCalledExactlyOnceWith( + 'late middleware response', + ) + expect(await response.text()).toBe('timeout') + }, + ) + it('disposes stream response replaced by middleware result', async () => { const router = makeRouter() startMocks.router = router @@ -135,7 +2573,7 @@ describe('createStartHandler SSR cleanup ownership', () => { }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -164,7 +2602,7 @@ describe('createStartHandler SSR cleanup ownership', () => { }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -193,7 +2631,7 @@ describe('createStartHandler SSR cleanup ownership', () => { }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -209,6 +2647,139 @@ describe('createStartHandler SSR cleanup ownership', () => { expect(router.serverSsr).toBeUndefined() }) + it('adopts a replacement registered on a directly returned next promise', async () => { + startMocks.router = makeRouter() + const cancel = vi.fn() + const original = new Response(new ReadableStream({ cancel })) + const replacement = new Response('replacement') + const cancelReplacement = vi.spyOn(replacement.body!, 'cancel') + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => { + const pending = Promise.resolve(next()) + void pending.then((result) => { + result.response = replacement + }) + return pending + }), + ] + + const handler = createTestStartHandler(() => original) + const response = await handler(new Request('http://localhost/'), {}) + + expect(response).toBe(replacement) + expect(cancel).toHaveBeenCalledExactlyOnceWith( + 'middleware response replaced', + ) + expect(cancelReplacement).not.toHaveBeenCalled() + await expect(response.text()).resolves.toBe('replacement') + }) + + it('disposes SSR ownership when a directly returned next promise drops the body', async () => { + const router = makeRouter() + startMocks.router = router + const cancel = vi.fn() + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => { + const pending = Promise.resolve(next()) + void pending.then(() => { + setResponseStatus(204) + }) + return pending + }), + ] + + const handler = createTestStartHandler(({ router: requestRouter }) => + createSsrStreamResponse( + requestRouter, + new Response(new ReadableStream({ cancel })), + ), + ) + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(204) + expect(response.body).toBeNull() + expect(cancel).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + it.each(['return', 'mutate', 'throw'] as const)( + 'cancels a plain stream that outer middleware replaces via %s', + async (mode) => { + const router = makeRouter() + startMocks.router = router + const cancel = vi.fn(() => new Promise(() => {})) + startMocks.serverFnResult = new Response(new ReadableStream({ cancel })) + const replacement = new Response('replacement') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + if (mode === 'return') { + return replacement + } + if (mode === 'throw') { + throw replacement + } + result.response = replacement + return result + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + if (mode === 'throw') { + // A Response thrown on a server-function request is marked so the + // client rejects the call; the marked copy keeps the same body. + expect(response.headers.get('x-tss-raw')).toBe('thrown') + await expect(response.text()).resolves.toBe('replacement') + } else { + expect(response).toBe(replacement) + } + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith('middleware response replaced') + }, + ) + + it('preserves a plain stream when middleware pipes the body', async () => { + const router = makeRouter() + startMocks.router = router + const cancel = vi.fn() + startMocks.serverFnResult = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('stream')) + controller.close() + }, + cancel, + }), + ) + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + return new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + await expect(response.text()).resolves.toBe('stream') + expect(cancel).not.toHaveBeenCalled() + }) + it('preserves stream ownership when middleware wraps same body', async () => { const router = makeRouter() startMocks.router = router @@ -225,7 +2796,7 @@ describe('createStartHandler SSR cleanup ownership', () => { }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -243,20 +2814,365 @@ describe('createStartHandler SSR cleanup ownership', () => { expect(router.serverSsr).toBeUndefined() }) - it('disposes stream response on middleware error after next', async () => { + it('keeps stream ownership when Start rebuilds a response with a wrapped Response', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + // Start rebuilds the response to apply this header. + setResponseHeader('x-after-next', 'yes') + return result + }), + ] + // A wrapped global Response that copies stream bodies into new streams, + // reading the original only once the copy is read. + vi.stubGlobal( + 'Response', + new Proxy(Response, { + construct(target, [body, init], newTarget) { + if (body instanceof ReadableStream) { + const source: ReadableStream = body + let reader: ReadableStreamDefaultReader | undefined + body = new ReadableStream({ + async pull(controller) { + reader ??= source.getReader() + const chunk = await reader.read() + if (chunk.done) { + controller.close() + } else { + controller.enqueue(chunk.value) + } + }, + cancel(reason) { + return reader ? reader.cancel(reason) : source.cancel(reason) + }, + }) + } + return Reflect.construct(target, [body, init], newTarget) + }, + }), + ) + + try { + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.headers.get('x-after-next')).toBe('yes') + expect(dispose).not.toHaveBeenCalled() + await expect(response.text()).resolves.toBe('stream') + expect(router.serverSsr).toBeUndefined() + } finally { + vi.unstubAllGlobals() + } + }) + + it('preserves stream ownership when middleware pipes the body', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + let wrappedResponse: Response | undefined + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + wrappedResponse = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + return wrappedResponse + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response).toBe(wrappedResponse) + expect(dispose).not.toHaveBeenCalled() + await expect(response.text()).resolves.toBe('stream') + expect(router.serverSsr).toBeUndefined() + }) + + it.each([false, true])( + 'cancels a derived body after handoff with a router transform: %s', + async (useRouterTransform) => { + const router = makeRouter() + startMocks.router = router + const sourceCancel = vi.fn() + const source = new ReadableStream({ cancel: sourceCancel }) + let dispose: ReturnType + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + return new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + }), + ] + const requestController = new AbortController() + const handler = createTestStartHandler( + ({ router: requestRouter, request }) => { + const responseBody = useRouterTransform + ? transformReadableStreamWithRouter(requestRouter, source, { + signal: request.signal, + }) + : source + const ssrResponse = createSsrStreamResponse( + requestRouter, + new Response(responseBody), + ) + dispose = vi.spyOn(ssrResponse, 'dispose') + return ssrResponse + }, + ) + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + const derivedCancel = vi.spyOn(response.body!, 'cancel') + const reason = new Error('request disconnected') + + expect(source.locked).toBe(true) + requestController.abort(reason) + + await vi.waitFor(() => { + expect(dispose).toHaveBeenCalledExactlyOnceWith(reason) + expect(derivedCancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(sourceCancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(source.locked).toBe(false) + expect(router.serverSsr).toBeUndefined() + }) + }, + ) + + it('preserves both Response.clone() branches when the clone is assigned', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + let siblingText!: Promise + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + const siblingResponse = result.response + result.response = siblingResponse.clone() + // The branch middleware keeps must be read or cancelled. An unread + // branch is abandoned with the stream. + siblingText = siblingResponse.text() + return result + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(dispose).not.toHaveBeenCalled() + await expect(Promise.all([response.text(), siblingText])).resolves.toEqual([ + 'stream', + 'stream', + ]) + expect(router.serverSsr).toBeUndefined() + }) + + it('disposes a piped stream that outer middleware replaces', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + const replacement = new Response('replacement') + let derivedCancel!: ReturnType + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + await next() + expect(dispose).not.toHaveBeenCalled() + return replacement + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + const response = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + derivedCancel = vi.spyOn(response.body!, 'cancel') + return response + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response).toBe(replacement) + expect(dispose).toHaveBeenCalledOnce() + expect(derivedCancel).toHaveBeenCalledWith('middleware response replaced') + expect(router.serverSsr).toBeUndefined() + }) + + it('refreshes a cloned response before an outer replacement', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => undefined) + const replacement = new Response('replacement') + let ownerBody!: ReadableStream + let cloneCancellation!: Promise + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + await next() + return replacement + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + cloneCancellation = result.response.clone().body!.cancel('not used') + ownerBody = result.response.body! + vi.spyOn(ownerBody, 'cancel') + return result + }), + ] + + try { + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response).toBe(replacement) + await expect(response.text()).resolves.toBe('replacement') + expect(dispose).toHaveBeenCalledOnce() + expect(ownerBody.cancel).toHaveBeenCalledOnce() + await cloneCancellation + expect(router.serverSsr).toBeUndefined() + await Promise.resolve() + await Promise.resolve() + expect(consoleError).not.toHaveBeenCalled() + } finally { + consoleError.mockRestore() + } + }) + + it('disposes a locked stream that middleware replaces with no body', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + let reader: ReadableStreamDefaultReader | undefined + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + reader = result.response.body!.getReader() + return new Response(null, { status: 204 }) + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(204) + expect(response.body).toBeNull() + expect(dispose).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + reader?.releaseLock() + }) + + it('leaves a stream that middleware reads to the response that replaces it', async () => { const router = makeRouter() startMocks.router = router const ssrResponse = makeStreamResponse(router) startMocks.serverFnResult = ssrResponse const dispose = vi.spyOn(ssrResponse as any, 'dispose') + const replacement = new Response('replacement') + const requestController = new AbortController() + let reader: ReadableStreamDefaultReader | undefined startMocks.requestMiddleware = [ createMiddleware().server(async ({ next }) => { - await next() + const result = await next() + // A reader is indistinguishable from a pipe that feeds the + // replacement, so Start must not dispose the stream under it. + reader = result.response.body!.getReader() + return replacement + }), + ] + + try { + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + signal: requestController.signal, + }), + {}, + ) + + expect(response).toBe(replacement) + expect(dispose).not.toHaveBeenCalled() + expect(router.serverSsr).toBeDefined() + + const reason = new Error('request disconnected') + requestController.abort(reason) + expect(dispose).toHaveBeenCalledExactlyOnceWith(reason) + expect(router.serverSsr).toBeUndefined() + } finally { + reader?.releaseLock() + } + }) + + it('disposes an in-place replacement on middleware error', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + const cancel = vi.fn() + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + result.response = new Response(new ReadableStream({ cancel })) throw new Error('middleware failed') }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -266,6 +3182,7 @@ describe('createStartHandler SSR cleanup ownership', () => { expect(response.status).toBe(500) expect(dispose).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledOnce() expect(router.serverSsr).toBeUndefined() }) @@ -278,12 +3195,13 @@ describe('createStartHandler SSR cleanup ownership', () => { const replacement = new Response('handled', { status: 418 }) startMocks.requestMiddleware = [ createMiddleware().server(async ({ next }) => { - await next() + const result = await next() + result.response = result.response.clone() throw replacement }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -291,11 +3209,49 @@ describe('createStartHandler SSR cleanup ownership', () => { {}, ) - expect(response).toBe(replacement) + // The client-facing copy is marked as thrown and keeps the same body. + expect(response.status).toBe(418) + expect(response.headers.get('x-tss-raw')).toBe('thrown') + await expect(response.text()).resolves.toBe('handled') expect(dispose).toHaveBeenCalledOnce() expect(router.serverSsr).toBeUndefined() }) + it('disposes a side-cloned stream before an unrelated thrown response', async () => { + const router = makeRouter() + startMocks.router = router + const ssrResponse = makeCompletingStreamResponse(router) + startMocks.serverFnResult = ssrResponse + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + const replacement = new Response('handled', { status: 418 }) + let cloneCancellation!: Promise + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + cloneCancellation = result.response.clone().body!.cancel('not used') + throw replacement + }), + ] + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + // The client-facing copy is marked as thrown and keeps the same body. + expect(response.status).toBe(418) + expect(response.headers.get('x-tss-raw')).toBe('thrown') + await expect(response.text()).resolves.toBe('handled') + expect(dispose).toHaveBeenCalledOnce() + // The clone's cancellation races Start's disposal of the shared source: it + // resolves, or rejects with the cleanup's abort. Either way it settles. + await cloneCancellation.catch(() => {}) + expect(router.serverSsr).toBeUndefined() + }) + it('honors in-place response assignment on returned context', async () => { const router = makeRouter() startMocks.router = router @@ -311,7 +3267,7 @@ describe('createStartHandler SSR cleanup ownership', () => { }), ] - const handler = createStartHandler(() => new Response('unused')) + const handler = createTestStartHandler(() => new Response('unused')) const response = await handler( new Request('http://localhost/_serverFn/test', { headers: { 'x-tsr-serverFn': 'true' }, @@ -325,6 +3281,1505 @@ describe('createStartHandler SSR cleanup ownership', () => { }) }) +describe('createStartHandler router initialization', () => { + it('keeps adapter order and router adapters isolated to their request', async () => { + const adapter = (key: string) => + createSerializationAdapter({ + key, + test: (value: unknown): value is Date => value instanceof Date, + toSerializable: (value: Date) => value.toISOString(), + fromSerializable: (value: string) => new Date(value), + }) + const startAdapter = adapter('start') + const routerAdapter = adapter('router') + const startAdapters = [startAdapter] + startMocks.serializationAdapters = startAdapters + let requestCount = 0 + startMocks.routerFactory = () => { + const router = makeRouter() + router.options.serializationAdapters = + requestCount++ === 0 ? [routerAdapter] : [] + return router + } + const handler = createStartHandler(({ router }) => + Response.json( + router.options.serializationAdapters?.map(({ key }) => key), + ), + ) + + const first = await handler(new Request('http://localhost/'), {}) + const second = await handler(new Request('http://localhost/'), {}) + + expect(await first.json()).toEqual(['start', '$TSS/serverfn', 'router']) + expect(await second.json()).toEqual(['start', '$TSS/serverfn']) + expect(startAdapters).toEqual([startAdapter]) + }) + + it('normalizes a server function router URL while preserving the incoming URL', async () => { + const requestUrl = + 'http://localhost/_serverFn/test?space=a%20b&tilde=~&bad=%GG&a=1&a=2#part' + let middlewarePathname: string | undefined + let middlewareRequestUrl: string | undefined + let factoryCalls = 0 + startMocks.requestMiddleware = [ + createMiddleware().server(({ pathname, request, next }) => { + middlewarePathname = pathname + middlewareRequestUrl = request.url + return next() + }), + ] + startMocks.routerFactory = () => { + factoryCalls++ + return makeRouter() + } + startMocks.serverFnHandler = async () => { + const [first, second] = await Promise.all([ + getRouterInstance(), + getRouterInstance(), + ]) + return Response.json({ + href: first.history.location.href, + origin: first.options.origin, + requestUrl: getRequestUrl().href, + sameRouter: first === second, + }) + } + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request(requestUrl, { headers: { 'x-tsr-serverFn': 'true' } }), + {}, + ) + + expect(response.status).toBe(200) + expect(await response.json()).toEqual({ + href: '/_serverFn/test?space=a+b&tilde=%7E&bad=%25GG&a=1&a=2#part', + origin: 'http://localhost', + requestUrl, + sameRouter: true, + }) + expect(middlewarePathname).toBe('/_serverFn/test') + expect(middlewareRequestUrl).toBe(requestUrl) + expect(factoryCalls).toBe(1) + }) + + it.each(['/%5FserverFn/test', '/_serverFn/%74est'])( + 'dispatches an encoded server function pathname: %s', + async (pathname) => { + let middlewarePathname: string | undefined + startMocks.requestMiddleware = [ + createMiddleware().server(({ pathname: currentPathname, next }) => { + middlewarePathname = currentPathname + return next() + }), + ] + startMocks.serverFnHandler = ({ serverFnId }) => { + return Response.json({ serverFnId, requestUrl: getRequestUrl().href }) + } + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request(`http://localhost${pathname}`, { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(await response.json()).toEqual({ + serverFnId: 'test', + requestUrl: `http://localhost${pathname}`, + }) + expect(middlewarePathname).toBe('/_serverFn/test') + }, + ) + + it('redirects a protocol-relative server function pathname before dispatch', async () => { + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost//_serverFn/test?space=a%20b', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(308) + expect(response.headers.get('location')).toBe( + 'http://localhost/_serverFn/test?space=a+b', + ) + expect(startMocks.serverFnCalls).toHaveLength(0) + }) + + it('shares one router between concurrent request-context reads', async () => { + let factoryCalls = 0 + let instances: Array = [] + startMocks.routerFactory = () => { + factoryCalls++ + return makeRouter() + } + startMocks.serverFnHandler = async () => { + instances = await Promise.all([getRouterInstance(), getRouterInstance()]) + return new Response('ok') + } + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + await expect(response.text()).resolves.toBe('ok') + expect(factoryCalls).toBe(1) + expect(instances[0]).toBe(instances[1]) + }) + + it('shares one router failure between sequential request-context reads', async () => { + const factoryError = new Error('router factory failed') + const errors: Array = [] + let factoryCalls = 0 + startMocks.routerFactory = () => { + factoryCalls++ + throw factoryError + } + startMocks.serverFnHandler = async () => { + for (let attempt = 0; attempt < 2; attempt++) { + try { + await getRouterInstance() + } catch (error) { + errors.push(error) + } + } + return new Response('ok') + } + + const handler = createTestStartHandler(() => new Response('unused')) + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + await expect(response.text()).resolves.toBe('ok') + expect(factoryCalls).toBe(1) + expect(errors).toEqual([factoryError, factoryError]) + }) + + it('does not start the router factory from a continuation after request abort', async () => { + const requestController = new AbortController() + const reason = new Error('request aborted') + let factoryCalls = 0 + let lateError: unknown + let continueServerFn!: () => void + const serverFnCanContinue = new Promise((resolve) => { + continueServerFn = resolve + }) + let notifyServerFnStarted!: () => void + const serverFnStarted = new Promise((resolve) => { + notifyServerFnStarted = resolve + }) + let notifyLateReadFinished!: () => void + const lateReadFinished = new Promise((resolve) => { + notifyLateReadFinished = resolve + }) + + startMocks.routerFactory = () => { + factoryCalls++ + return makeRouter() + } + startMocks.serverFnHandler = async () => { + notifyServerFnStarted() + await serverFnCanContinue + try { + await getRouterInstance() + } catch (error) { + lateError = error + } + notifyLateReadFinished() + return new Response('late') + } + + const handler = createTestStartHandler(() => new Response('unused')) + const response = handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + signal: requestController.signal, + }), + {}, + ) + + await serverFnStarted + requestController.abort(reason) + expect((await response).status).toBe(500) + + continueServerFn() + await lateReadFinished + expect(factoryCalls).toBe(0) + expect(lateError).toBe(reason) + }) +}) + +describe('createStartHandler direct server routes', () => { + it.each([false, true])( + 'runs shared route middleware once and preserves its context (global=%s)', + async (global) => { + const runMiddleware = vi.fn(({ next }) => + next({ context: { message: 'trusted middleware' } }), + ) + const middleware = createMiddleware().server(runMiddleware) + startMocks.requestMiddleware = global ? [middleware] : [] + const root = new BaseRootRoute({ + server: { middleware: [middleware] }, + }) + startMocks.router = new RouterCore( + { + isServer: true, + routeTree: root.addChildren([ + new BaseRoute({ + getParentRoute: () => root, + path: '/', + component: () => null, + }), + ]), + }, + getStoreConfig, + ) + const handler = createStartHandler<{ + server: { requestContext: { message: string; requestValue: string } } + }>(({ router }) => + Response.json(router.options.additionalContext?.serverContext), + ) + + const response = await handler(new Request('http://localhost/'), { + context: { message: 'request context', requestValue: 'retained' }, + }) + + expect(response.status).toBe(200) + expect(await response.json()).toEqual({ + message: 'trusted middleware', + requestValue: 'retained', + }) + expect(runMiddleware).toHaveBeenCalledOnce() + }, + ) + + it('disposes a thrown sole-terminal response when the request aborts after the fast-path check', async () => { + const requestController = new AbortController() + const cancellation = new Error('request disconnected') + const cancel = vi.fn() + const thrownResponse = new Response( + new ReadableStream({ cancel }), + ) + // Abort during the `instanceof Response` check, immediately after the + // fast path's first abort check has passed. + const responsePrototype = new Proxy(Response.prototype, { + getPrototypeOf() { + requestController.abort(cancellation) + return Response.prototype + }, + }) + Object.setPrototypeOf(thrownResponse, responsePrototype) + startMocks.serverFnHandler = () => { + throw thrownResponse + } + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + signal: requestController.signal, + }), + {}, + ) + + expect(response.status).toBe(500) + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(cancellation) + }) + }) + + it.each([ + ['Response', 'sole-terminal'], + ['SsrResponse', 'sole-terminal'], + ['Response', 'middleware-chain'], + ['SsrResponse', 'middleware-chain'], + ] as const)( + 'does not read context from a direct %s result in the %s path', + async (resultType, executionPath) => { + if (executionPath === 'middleware-chain') { + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => next()), + ] + } + const directResponse = new Response(resultType, { status: 202 }) + const directResult = + resultType === 'Response' + ? directResponse + : { response: directResponse, serverSsrCleanup: 'none' as const } + const contextGetter = vi.fn(() => { + throw new Error('direct response context must not be read') + }) + Object.defineProperty(directResult, 'context', { + get: contextGetter, + }) + startMocks.serverFnHandler = () => directResult + const handler = createTestStartHandler(() => new Response('unused')) + + const response = await handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(202) + await expect(response.text()).resolves.toBe(resultType) + expect(contextGetter).not.toHaveBeenCalled() + }, + ) + + it('does not invoke the sole terminal after abort while copying request context', async () => { + const requestController = new AbortController() + const cancellation = new Error('request disconnected') + const serverFnHandler = vi.fn(() => new Response('must not run')) + const requestContext = {} as { abort: boolean } + Object.defineProperty(requestContext, 'abort', { + enumerable: true, + get() { + requestController.abort(cancellation) + return true + }, + }) + startMocks.serverFnHandler = serverFnHandler + const handler = createStartHandler<{ + server: { requestContext: { abort: boolean } } + }>(() => new Response('unused')) + + await expect( + handler( + new Request('http://localhost/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + signal: requestController.signal, + }), + { context: requestContext }, + ), + ).rejects.toBe(cancellation) + expect(serverFnHandler).not.toHaveBeenCalled() + }) + + it('does not invoke a direct handler when its handler factory aborts', async () => { + const requestController = new AbortController() + const cancellation = new Error('request disconnected') + const routeHandler = vi.fn(() => new Response('must not run')) + const handlers = vi.fn(() => { + requestController.abort(cancellation) + return { GET: routeHandler } + }) + const router = makeRouter({ + component: undefined, + server: { handlers }, + }) + startMocks.router = router + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + expect(response.status).toBe(500) + expect(handlers).toHaveBeenCalledOnce() + expect(routeHandler).not.toHaveBeenCalled() + expect(render).not.toHaveBeenCalled() + }) + + it('returns an exact non-component handler response without rendering a document', async () => { + const routeHandler = vi.fn(() => new Response('direct', { status: 201 })) + const router = makeRouter({ + component: undefined, + server: { + handlers: { + GET: routeHandler, + }, + }, + }) + startMocks.router = router + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(201) + await expect(response.text()).resolves.toBe('direct') + expect(routeHandler).toHaveBeenCalledOnce() + expect(render).not.toHaveBeenCalled() + expect(router.serverSsr).toBeUndefined() + }) + + it('preserves request context, params, and pathname for a direct handler', async () => { + const routeHandler = vi.fn( + ({ context, params, pathname, handlerType, request }: any) => + Response.json({ + context, + params, + pathname, + handlerType, + requestUrl: request.url, + }), + ) + const router = makeRouter({ + path: '/items/$itemId', + component: undefined, + server: { + handlers: { + GET: routeHandler, + }, + }, + }) + startMocks.router = router + const render = vi.fn(() => new Response('must not render')) + const handler = createStartHandler<{ + server: { requestContext: { requestValue: string } } + }>(render) + + const response = await handler( + new Request('http://localhost/items/42?source=test'), + { context: { requestValue: 'preserved' } }, + ) + + await expect(response.json()).resolves.toMatchObject({ + context: { requestValue: 'preserved' }, + params: { itemId: '42' }, + pathname: '/items/42', + handlerType: 'router', + requestUrl: 'http://localhost/items/42?source=test', + }) + expect(render).not.toHaveBeenCalled() + }) + + it.each( + [false, true].flatMap((component) => + ['function', 'object'].flatMap((handlerKind) => + ['params.parse', 'parseParams'].map((parserKind) => ({ + component, + handlerKind, + parserKind, + })), + ), + ), + )( + 'parses server handler params (component=$component, handler=$handlerKind, parser=$parserKind)', + async ({ component, handlerKind, parserKind }) => { + const parse = (params: { itemId: string }) => ({ + itemId: Number(params.itemId), + }) + const routeHandler = vi.fn(({ params }: any) => Response.json(params)) + startMocks.router = makeRouter({ + path: '/items/$itemId', + component: component ? () => null : undefined, + ...(parserKind === 'params.parse' + ? { params: { parse } } + : { parseParams: parse }), + server: { + handlers: { + GET: + handlerKind === 'function' + ? routeHandler + : { handler: routeHandler }, + }, + }, + }) + const render = vi.fn(() => new Response('must not render')) + const handler = createStartHandler(render) + + const response = await handler( + new Request('http://localhost/items/42'), + {}, + ) + + expect(response.status).toBe(200) + await expect(response.json()).resolves.toEqual({ itemId: 42 }) + expect(routeHandler).toHaveBeenCalledOnce() + expect(render).not.toHaveBeenCalled() + }, + ) + + it.each(['route', 'handler'] as const)( + 'lets %s middleware catch terminal handler parameter parsing errors', + async (placement) => { + const error = new Error('Invalid item id') + const middleware = createMiddleware().server(async ({ next }) => { + try { + return await next() + } catch (caught) { + expect(caught).toBe(error) + return new Response(error.message, { status: 400 }) + } + }) + const routeHandler = vi.fn(() => new Response('must not run')) + startMocks.router = makeRouter({ + path: '/items/$itemId', + component: undefined, + params: { + parse: () => { + throw error + }, + }, + server: { + ...(placement === 'route' ? { middleware: [middleware] } : {}), + handlers: { + GET: + placement === 'handler' + ? { middleware: [middleware], handler: routeHandler } + : routeHandler, + }, + }, + }) + const render = vi.fn(() => new Response('must not render')) + const handler = createStartHandler(render) + + const response = await handler( + new Request('http://localhost/items/nope'), + {}, + ) + + expect(response.status).toBe(400) + await expect(response.text()).resolves.toBe('Invalid item id') + expect(routeHandler).not.toHaveBeenCalled() + expect(render).not.toHaveBeenCalled() + }, + ) + + it.each(['route', 'handler'] as const)( + 'runs %s middleware instead of incorrectly taking the direct path', + async (placement) => { + const events: Array = [] + const middleware = createMiddleware().server(async ({ next }) => { + events.push('middleware before') + const result = await next({ + context: { middlewarePlacement: placement }, + }) + events.push('middleware after') + result.response.headers.set('x-middleware', placement) + return result + }) + const routeHandler = vi.fn(({ context }: any) => { + events.push('handler') + return Response.json(context) + }) + const handlers = { + GET: + placement === 'handler' + ? { middleware: [middleware], handler: routeHandler } + : routeHandler, + } + const router = makeRouter({ + component: undefined, + server: { + ...(placement === 'route' ? { middleware: [middleware] } : {}), + handlers, + }, + }) + startMocks.router = router + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.headers.get('x-middleware')).toBe(placement) + await expect(response.json()).resolves.toMatchObject({ + middlewarePlacement: placement, + }) + expect(events).toEqual([ + 'middleware before', + 'handler', + 'middleware after', + ]) + expect(render).not.toHaveBeenCalled() + }, + ) + + it('rejects a missing direct response before middleware resumes', async () => { + const afterNext = vi.fn() + const middleware = createMiddleware().server(async ({ next }) => { + await next() + afterNext() + return new Response('must not return') + }) + const router = makeRouter({ + component: undefined, + server: { + middleware: [middleware], + handlers: { GET: () => undefined }, + }, + }) + startMocks.router = router + const handler = createTestStartHandler( + () => new Response('must not render'), + ) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(response.status).toBe(500) + expect(afterNext).not.toHaveBeenCalled() + }) + + it.each(['function', 'object'] as const)( + 'preserves the non-component %s handler next callback', + async (handlerKind) => { + const events: Array = [] + let observedNext: unknown + let caught: unknown + const middleware = createMiddleware().server(async ({ next }) => { + events.push('middleware before') + try { + return await next() + } catch (error) { + caught = error + events.push('middleware caught') + return new Response('cannot defer', { status: 409 }) + } + }) + const routeHandler = vi.fn(({ next }) => { + events.push('handler') + observedNext = next + return next() + }) + startMocks.router = makeRouter({ + component: undefined, + server: { + middleware: [middleware], + handlers: + handlerKind === 'function' + ? { GET: routeHandler } + : ({ + createHandlers, + }: HandlersFnOpts<{}, AnyRoute, '/', {}, undefined>) => + createHandlers({ GET: { handler: routeHandler } }), + }, + }) + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), {}) + + expect(observedNext).toBeTypeOf('function') + expect(caught).toBeInstanceOf(Error) + expect(caught).not.toBeInstanceOf(TypeError) + expect(response.status).toBe(409) + await expect(response.text()).resolves.toBe('cannot defer') + expect(events).toEqual([ + 'middleware before', + 'handler', + 'middleware caught', + ]) + expect(routeHandler).toHaveBeenCalledOnce() + expect(render).not.toHaveBeenCalled() + }, + ) + + it('lets a component route handler defer context to document rendering with next', async () => { + const events: Array = [] + const requestContext = Object.freeze({ nonce: 'request' }) + const globalContext = Object.freeze({ global: 'yes', shared: 'global' }) + const routeContext = Object.freeze({ route: 'yes', shared: 'route' }) + const handlerContext = Object.freeze({ handler: 'yes', shared: 'handler' }) + let loadedContext: unknown + let resumedContext: unknown + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + events.push('global before') + const result = await next({ context: globalContext }) + events.push('global after') + appendResponseHeader('x-after', 'global') + return result + }), + ] + const middleware = createMiddleware().server(async ({ next }) => { + events.push('route before') + const result = await next({ context: routeContext }) + resumedContext = result.context + events.push('route after') + appendResponseHeader('x-after', 'route') + return result + }) + const routeHandler = vi.fn>( + async ({ next }) => { + events.push('handler before') + const result = await next({ context: handlerContext }) + events.push('handler after') + appendResponseHeader('x-after', 'handler') + return result + }, + ) + const loader = vi.fn( + ({ serverContext }: { serverContext?: Record }) => { + events.push('loader') + loadedContext = serverContext + return 'loaded' + }, + ) + const router = makeRouter({ + loader, + server: { + middleware: [middleware], + handlers: { + GET: routeHandler, + }, + }, + }) + startMocks.router = router + const render = vi.fn(() => { + events.push('render') + return Response.json({ context: loadedContext }) + }) + const handler = createTestStartHandler(render) + + const response = await handler(new Request('http://localhost/'), { + context: requestContext, + }) + + const expectedContext = { + nonce: 'request', + global: 'yes', + route: 'yes', + handler: 'yes', + shared: 'handler', + } + expect(response.status).toBe(200) + await expect(response.json()).resolves.toEqual({ context: expectedContext }) + expect(resumedContext).toEqual(expectedContext) + expect(response.headers.get('x-after')).toBe('handler, route, global') + expect(events).toEqual([ + 'global before', + 'route before', + 'handler before', + 'loader', + 'render', + 'handler after', + 'route after', + 'global after', + ]) + expect(requestContext).toEqual({ nonce: 'request' }) + expect(globalContext).toEqual({ global: 'yes', shared: 'global' }) + expect(routeContext).toEqual({ route: 'yes', shared: 'route' }) + expect(handlerContext).toEqual({ handler: 'yes', shared: 'handler' }) + expect(routeHandler).toHaveBeenCalledOnce() + expect(loader).toHaveBeenCalledOnce() + expect(render).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + it('cancels a direct handler body that resolves after request abort', async () => { + const requestController = new AbortController() + const cancellation = new Error('request disconnected') + let notifyHandlerStarted!: () => void + const handlerStarted = new Promise((resolve) => { + notifyHandlerStarted = resolve + }) + let resolveHandler!: (response: Response) => void + const handlerResult = new Promise((resolve) => { + resolveHandler = resolve + }) + const routeHandler = vi.fn(() => { + notifyHandlerStarted() + return handlerResult + }) + const router = makeRouter({ + component: undefined, + server: { + handlers: { + GET: routeHandler, + }, + }, + }) + startMocks.router = router + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await handlerStarted + requestController.abort(cancellation) + expect((await response).status).toBe(500) + + const cancel = vi.fn((_reason: unknown) => new Promise(() => {})) + resolveHandler(new Response(new ReadableStream({ cancel }))) + + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(cancellation) + }) + expect(render).not.toHaveBeenCalled() + }) +}) + +describe('createStartHandler HEAD fallback', () => { + it('strips and disposes the rendered document body', async () => { + const router = makeRouter() + startMocks.router = router + const cancel = vi.fn() + let cleanupEffects = 0 + + const handler = createTestStartHandler(({ router: requestRouter }) => { + requestRouter.serverSsr!.onCleanup(() => { + cleanupEffects++ + }) + return createSsrStreamResponse( + requestRouter, + new Response(new ReadableStream({ cancel }), { + headers: { 'x-rendered': 'true' }, + status: 201, + }), + ) + }) + const response = await handler( + new Request('http://localhost/', { method: 'HEAD' }), + {}, + ) + + expect(response.status).toBe(201) + expect(response.headers.get('x-rendered')).toBe('true') + expect(response.body).toBeNull() + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith('HEAD body stripped') + expect(cleanupEffects).toBe(1) + expect(router.serverSsr).toBeUndefined() + }) + + it('cancels a plain streaming GET body before stripping it', async () => { + const cancel = vi.fn() + const router = makeRouter({ + server: { + handlers: { + GET: () => + new Response( + new ReadableStream({ + cancel, + }), + ), + }, + }, + }) + startMocks.router = router + + const handler = createTestStartHandler( + () => new Response('must not render'), + ) + const response = await handler( + new Request('http://localhost/', { method: 'HEAD' }), + {}, + ) + + expect(response.body).toBeNull() + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith('HEAD body stripped') + }) +}) + +describe('createStartHandler request cancellation', () => { + it.each(['beforeLoad', 'loader'] as const)( + 'aborts route %s work and does not render HTML', + async (hook) => { + let routeSignal: AbortSignal | undefined + let notifyStarted: (() => void) | undefined + const started = new Promise((resolve) => { + notifyStarted = resolve + }) + const routeWork = ({ + abortController, + }: { + abortController: AbortController + }) => { + routeSignal = abortController.signal + notifyStarted?.() + return waitForAbortOrRelease(abortController.signal) + } + const router = makeRouterWithRouteWork({ [hook]: routeWork }) + startMocks.router = router + const requestController = new AbortController() + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + const response = handler( + new Request('http://localhost/work', { + signal: requestController.signal, + }), + {}, + ) + + await started + const cancellation = new Error('request disconnected') + requestController.abort(cancellation) + + expect((await response).status).toBe(500) + expect(routeSignal?.aborted).toBe(true) + expect(routeSignal?.reason).toBe(cancellation) + expect(render).not.toHaveBeenCalled() + }, + ) + + it('settles and cleans up while the render callback is still pending', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let notifyRenderStarted!: () => void + const renderStarted = new Promise((resolve) => { + notifyRenderStarted = resolve + }) + let resolveRender!: ( + value: ReturnType, + ) => void + const renderResult = new Promise< + ReturnType + >((resolve) => { + resolveRender = resolve + }) + let cleanupEffects = 0 + let cancelCalls = 0 + let lateStreamResponse!: ReturnType + const handler = createTestStartHandler(({ router: requestRouter }) => { + const serverSsr = requestRouter.serverSsr! + serverSsr.onCleanup(() => { + cleanupEffects++ + }) + lateStreamResponse = createSsrStreamResponse( + requestRouter, + new Response( + new ReadableStream({ + cancel() { + cancelCalls++ + return new Promise(() => {}) + }, + }), + ), + ) + notifyRenderStarted() + return renderResult + }) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await renderStarted + requestController.abort(new Error('request disconnected')) + + expect((await response).status).toBe(500) + expect(cleanupEffects).toBe(1) + expect(router.serverSsr).toBeUndefined() + + resolveRender(lateStreamResponse) + await Promise.resolve() + await Promise.resolve() + expect(cleanupEffects).toBe(1) + expect(cancelCalls).toBe(1) + expect(router.serverSsr).toBeUndefined() + }) + + it('cancels a plain response resolved by the render callback later', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let notifyRenderStarted!: () => void + const renderStarted = new Promise((resolve) => { + notifyRenderStarted = resolve + }) + let resolveRender!: (value: Response) => void + const renderResult = new Promise((resolve) => { + resolveRender = resolve + }) + const cancel = vi.fn((_reason: unknown) => new Promise(() => {})) + const handler = createTestStartHandler(() => { + notifyRenderStarted() + return renderResult + }) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await renderStarted + const cancellation = new Error('request disconnected') + requestController.abort(cancellation) + + expect((await response).status).toBe(500) + resolveRender(new Response(new ReadableStream({ cancel }))) + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledTimes(1) + expect(cancel).toHaveBeenCalledWith(cancellation) + }) + }) + + it.each(['resolves', 'rejects'] as const)( + 'cancels a plain response when request middleware %s later', + async (settlement) => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let notifyMiddlewareStarted!: () => void + const middlewareStarted = new Promise((resolve) => { + notifyMiddlewareStarted = resolve + }) + let settleMiddleware!: (value: Response) => void + const middlewareResult = new Promise((resolve, reject) => { + settleMiddleware = settlement === 'resolves' ? resolve : reject + }) + const cancel = vi.fn((_reason: unknown) => new Promise(() => {})) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + notifyMiddlewareStarted() + return middlewareResult + }), + ] + const handler = createTestStartHandler( + () => new Response('must not render'), + ) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await middlewareStarted + const cancellation = new Error('request disconnected') + requestController.abort(cancellation) + + expect((await response).status).toBe(500) + settleMiddleware(new Response(new ReadableStream({ cancel }))) + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledTimes(1) + expect(cancel).toHaveBeenCalledWith(cancellation) + }) + }, + ) + + it('cancels a stream resolved by the render callback later', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let notifyRenderStarted!: () => void + const renderStarted = new Promise((resolve) => { + notifyRenderStarted = resolve + }) + let resolveRender!: ( + value: ReturnType, + ) => void + const renderResult = new Promise< + ReturnType + >((resolve) => { + resolveRender = resolve + }) + const cancel = vi.fn((_reason: unknown) => new Promise(() => {})) + let streamResponse!: ReturnType + + const handler = createTestStartHandler(({ router: requestRouter }) => { + streamResponse = createSsrStreamResponse( + requestRouter, + new Response(new ReadableStream({ cancel })), + ) + notifyRenderStarted() + return renderResult + }) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await renderStarted + const cancellation = new Error('request disconnected') + requestController.abort(cancellation) + expect((await response).status).toBe(500) + + resolveRender(streamResponse) + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledTimes(1) + expect(cancel).toHaveBeenCalledWith(cancellation) + }) + }) + + it('disposes a side-cloned stream when the request aborts after handoff', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let cancelCalls = 0 + let siblingResponse!: Response + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + siblingResponse = result.response.clone() + return result + }), + ] + const handler = createTestStartHandler(({ router: requestRouter }) => + createSsrStreamResponse( + requestRouter, + new Response( + new ReadableStream({ + cancel() { + cancelCalls++ + return new Promise(() => {}) + }, + }), + ), + ), + ) + + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + expect(response.body).not.toBeNull() + expect(router.serverSsr).toBeDefined() + const cancel = vi.spyOn(response.body!, 'cancel') + const reason = new Error('request disconnected') + + requestController.abort(reason) + void siblingResponse.body!.cancel(reason) + + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledWith(reason) + expect(cancelCalls).toBe(1) + expect(router.serverSsr).toBeUndefined() + }) + }) + + it('unwinds nested middleware when an inner operation ignores cancellation', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const outerFinally = vi.fn() + let notifyInnerStarted!: () => void + const innerStarted = new Promise((resolve) => { + notifyInnerStarted = resolve + }) + const pending = new Promise(() => {}) + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => next()), + createMiddleware().server(async ({ next }) => { + try { + return await next() + } finally { + outerFinally() + } + }), + createMiddleware().server(() => { + notifyInnerStarted() + return pending + }), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await innerStarted + requestController.abort(new Error('request disconnected')) + + expect((await response).status).toBe(500) + expect(outerFinally).toHaveBeenCalledOnce() + expect(render).not.toHaveBeenCalled() + }) + + it('cancels an all-synchronous direct next chain', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + let notifyInnerStarted!: () => void + const innerStarted = new Promise((resolve) => { + notifyInnerStarted = resolve + }) + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => next()), + createMiddleware().server(({ next }) => next()), + createMiddleware().server(() => { + notifyInnerStarted() + return new Promise(() => {}) + }), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + const response = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await innerStarted + requestController.abort(new Error('request disconnected')) + + expect((await response).status).toBe(500) + expect(render).not.toHaveBeenCalled() + }) + + it('preserves the abort reason when direct next rejects during abort', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const reason = new Error('request disconnected') + const cancel = vi.fn() + const ssrResponse = makeStreamResponse(router, cancel) + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(({ next }) => next()), + createMiddleware().server(async ({ next }) => { + const result = await next() + requestController.abort(reason) + throw result.response + }), + createMiddleware().server(() => ssrResponse as any), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + expect(response.status).toBe(500) + await vi.waitFor(() => { + expect(dispose).toHaveBeenCalledWith(reason) + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(reason) + }) + expect(render).not.toHaveBeenCalled() + }) + + it('preserves aborts that race with a fulfilled direct next promise', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const reason = new Error('request disconnected') + const observedErrors: Array = [] + const afterNext = vi.fn() + const cancel = vi.fn() + const ssrResponse = makeStreamResponse(router, cancel) + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + try { + const result = await next() + afterNext() + return result + } catch (error) { + observedErrors.push(error) + throw error + } + }), + createMiddleware().server(({ next }) => { + const pending = next() + void Promise.resolve(pending).then(() => + requestController.abort(reason), + ) + return pending + }), + createMiddleware().server(() => ssrResponse as any), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + expect(response.status).toBe(500) + await vi.waitFor(() => expect(observedErrors).toEqual([reason])) + await vi.waitFor(() => { + expect(dispose).toHaveBeenCalledWith(reason) + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(reason) + }) + expect(afterNext).not.toHaveBeenCalled() + expect(render).not.toHaveBeenCalled() + }) + + it('disposes a tagged final response when abort wins handoff', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const reason = new Error('request disconnected') + const cancel = vi.fn() + const ssrResponse = makeStreamResponse(router, cancel) + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + queueMicrotask(() => { + queueMicrotask(() => requestController.abort(reason)) + }) + return ssrResponse as any + }), + ] + const render = vi.fn(() => new Response('must not render')) + const handler = createTestStartHandler(render) + + const response = await handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + expect(response.status).toBe(500) + await vi.waitFor(() => { + expect(dispose).toHaveBeenCalledWith(reason) + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(reason) + }) + expect(router.serverSsr).toBeUndefined() + expect(render).not.toHaveBeenCalled() + }) + + it('keeps late same-body disposal idempotent after abort', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const reason = new Error('request disconnected') + let notifyResponseCaptured!: () => void + const responseCaptured = new Promise((resolve) => { + notifyResponseCaptured = resolve + }) + let releaseMiddleware!: () => void + const middlewareRelease = new Promise((resolve) => { + releaseMiddleware = resolve + }) + let notifyLateResultDelivered!: () => void + const lateResultDelivered = new Promise((resolve) => { + notifyLateResultDelivered = resolve + }) + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + const wrapped = new Response(result.response.body, result.response) + notifyResponseCaptured() + await middlewareRelease + queueMicrotask(() => { + queueMicrotask(notifyLateResultDelivered) + }) + return wrapped + }), + ] + const sourceCancel = vi.fn() + const response = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('stream')) + }, + cancel: sourceCancel, + }), + ) + let ssrResponse!: ReturnType + const render = vi.fn(({ router: requestRouter }) => { + ssrResponse = createSsrStreamResponse(requestRouter, response) + return ssrResponse + }) + const handler = createTestStartHandler(render) + const result = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await responseCaptured + const dispose = vi.spyOn(ssrResponse as any, 'dispose') + requestController.abort(reason) + + expect((await result).status).toBe(500) + releaseMiddleware() + await lateResultDelivered + await vi.waitFor(() => { + expect(dispose).toHaveBeenCalledWith(reason) + expect(sourceCancel).toHaveBeenCalledOnce() + expect(sourceCancel).toHaveBeenCalledWith(reason) + }) + expect(router.serverSsr).toBeUndefined() + }) + + it('cancels a piped body that middleware returns after abort', async () => { + const router = makeRouter() + startMocks.router = router + const requestController = new AbortController() + const reason = new Error('request disconnected') + let notifyResponseCaptured!: () => void + const responseCaptured = new Promise((resolve) => { + notifyResponseCaptured = resolve + }) + let releaseMiddleware!: () => void + const middlewareRelease = new Promise((resolve) => { + releaseMiddleware = resolve + }) + let derivedBody!: ReadableStream + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + const derived = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + derivedBody = derived.body! + notifyResponseCaptured() + await middlewareRelease + return derived + }), + ] + const sourceCancel = vi.fn() + const response = new Response( + new ReadableStream({ cancel: sourceCancel }), + ) + const handler = createTestStartHandler(({ router: requestRouter }) => + createSsrStreamResponse(requestRouter, response), + ) + const result = handler( + new Request('http://localhost/', { + signal: requestController.signal, + }), + {}, + ) + + await responseCaptured + const derivedCancel = vi.spyOn(derivedBody, 'cancel') + requestController.abort(reason) + + expect((await result).status).toBe(500) + expect(sourceCancel).not.toHaveBeenCalled() + releaseMiddleware() + await vi.waitFor(() => { + expect(derivedCancel).toHaveBeenCalledWith(reason) + expect(sourceCancel).toHaveBeenCalledOnce() + expect(sourceCancel).toHaveBeenCalledWith(reason) + }) + expect(router.serverSsr).toBeUndefined() + }) +}) + describe('createStartHandler inlineCss option', () => { const request = new Request('https://example.com/') @@ -381,9 +4836,208 @@ describe('createStartHandler inlineCss option', () => { }) it('returns a static inline CSS default only for non-callback options', () => { - expect(getStaticHandlerInlineCssDefault(undefined)).toBe(true) - expect(getStaticHandlerInlineCssDefault(true)).toBe(true) - expect(getStaticHandlerInlineCssDefault(false)).toBe(false) - expect(getStaticHandlerInlineCssDefault(() => true)).toBe(undefined) + expect(getStaticInlineCss(undefined, undefined)).toBe(true) + expect(getStaticInlineCss(undefined, true)).toBe(true) + expect(getStaticInlineCss(undefined, false)).toBe(false) + expect(getStaticInlineCss(undefined, () => true)).toBe(undefined) + expect(getStaticInlineCss(false, () => true)).toBe(false) + expect(getStaticInlineCss(true, false)).toBe(true) + }) +}) + +describe('setResponseHeaders', () => { + it('should set a single header via Headers object', async () => { + const headers = new Headers() + headers.set('X-Custom-Header', 'test-value') + + const handler = createResponseHandler(() => { + setResponseHeaders(headers) + const responseHeaders = getResponseHeaders() + expect(responseHeaders.get('X-Custom-Header')).toBe('test-value') + return new Response('OK') + }) + + const request = new Request('http://localhost:3000/test') + await handler(request, {}) + }) + + it('should set multiple headers via Headers object', async () => { + const headers = new Headers() + headers.set('X-Custom-Header', 'test-value') + headers.set('X-Another-Header', 'another-value') + headers.set('Content-Type', 'application/json') + + const handler = createResponseHandler(() => { + setResponseHeaders(headers) + const responseHeaders = getResponseHeaders() + expect(responseHeaders.get('X-Custom-Header')).toBe('test-value') + expect(responseHeaders.get('X-Another-Header')).toBe('another-value') + expect(responseHeaders.get('Content-Type')).toBe('application/json') + return new Response('OK') + }) + + const request = new Request('http://localhost:3000/test') + await handler(request, {}) + }) + + it('should handle empty Headers object', async () => { + const handler = createResponseHandler(() => { + const headers = new Headers() + setResponseHeaders(headers) + const responseHeaders = getResponseHeaders() + expect(responseHeaders).toBeDefined() + expect(Array.from(responseHeaders.entries()).length).toEqual(0) + return new Response('OK') + }) + + const request = new Request('http://localhost:3000/test') + await handler(request, {}) + }) + + it('should preserve response header values when a snapshot is passed back', async () => { + const cookies = ['session=abc123; Path=/', 'user=john; Path=/'] + const handler = createResponseHandler(() => { + setResponseHeader('set-cookie', cookies) + setResponseHeader('x-custom', 'keep') + const headers = getResponseHeaders() + const entries = Array.from(headers) + + setResponseHeaders(headers) + + expect(Array.from(getResponseHeaders())).toEqual(entries) + expect(Array.from(headers)).toEqual(entries) + expect(headers.getSetCookie()).toEqual(cookies) + return new Response('OK') + }) + + const response = await handler( + new Request('http://localhost:3000/test'), + {}, + ) + expect(response.headers.getSetCookie()).toEqual(cookies) + expect(response.headers.get('x-custom')).toBe('keep') + }) + + it('should replace existing headers with the same name', async () => { + const handler = createResponseHandler(() => { + setResponseHeaders( + new Headers({ + 'X-Custom-Header': 'old-value', + }), + ) + expect(getResponseHeader('X-Custom-Header')).toEqual('old-value') + setResponseHeaders( + new Headers({ + 'X-Custom-Header': 'new-value', + }), + ) + expect(getResponseHeader('X-Custom-Header')).toEqual('new-value') + + return new Response('OK') + }) + + const request = new Request('http://localhost:3000/test') + await handler(request, {}) + }) + + it('should handle multiple headers with the same name added via headers.append()', async () => { + const headers = new Headers() + headers.append('Set-Cookie', 'session=abc123; Path=/; HttpOnly') + headers.append('Set-Cookie', 'user=john; Path=/; Secure') + + const handler = createResponseHandler(() => { + setResponseHeaders(headers) + + // Set-Cookie values remain separate during Headers iteration. + const setCookieValue = getResponseHeader('Set-Cookie') + + expect(setCookieValue).toBeDefined() + + // Both cookie values should be present in the result + expect(setCookieValue).toContain('session=abc123') + expect(setCookieValue).toContain('user=john') + expect(getResponseHeaders().getSetCookie()).toEqual([ + 'session=abc123; Path=/; HttpOnly', + 'user=john; Path=/; Secure', + ]) + + return new Response('OK') + }) + + const request = new Request('http://localhost:3000/test') + await handler(request, {}) + }) + + it.each(['constructor', '__proto__'])( + 'should replace the %s header', + async (name) => { + const handler = createResponseHandler(() => { + setResponseHeader(name, 'old-value') + setResponseHeaders(new Headers([[name, 'new-value']])) + expect(getResponseHeader(name)).toBe('new-value') + return new Response('OK') + }) + + await handler(new Request('http://localhost:3000/test'), {}) + }, + ) + + it('should replace cookies on each call while preserving unrelated headers', async () => { + const cookies = [ + 'session=new; Expires=Wed, 21 Oct 2030 07:28:00 GMT; Path=/', + 'user=john; Path=/', + 'user=john; Path=/', + ] as const + const headers = new Headers([ + ['X-Last', 'last'], + ['Set-Cookie', cookies[0]], + ['X-First', 'first'], + ['set-cookie', cookies[1]], + ['SET-COOKIE', cookies[2]], + ]) + const handler = createResponseHandler(() => { + setResponseHeader('set-cookie', ['old=1', 'old=2']) + setResponseHeader('x-keep', 'keep') + setResponseHeaders(headers) + + expect(getResponseHeaders().getSetCookie()).toEqual(cookies) + expect(headers.getSetCookie()).toEqual(cookies) + expect(getResponseHeader('x-first')).toBe('first') + expect(getResponseHeader('x-last')).toBe('last') + expect(getResponseHeader('x-keep')).toBe('keep') + + setResponseHeaders(new Headers({ 'set-cookie': 'next=1' })) + expect(getResponseHeaders().getSetCookie()).toEqual(['next=1']) + expect(getResponseHeader('x-keep')).toBe('keep') + + setResponseHeaders(new Headers()) + expect(getResponseHeaders().getSetCookie()).toEqual(['next=1']) + return new Response('OK') + }) + + const response = await handler( + new Request('http://localhost:3000/test'), + {}, + ) + expect(response.headers.getSetCookie()).toEqual(['next=1']) + expect(response.headers.get('x-keep')).toBe('keep') + }) + + it('should replace combined values for ordinary headers', async () => { + const handler = createResponseHandler(() => { + setResponseHeader('x-custom', 'old-value') + setResponseHeaders( + new Headers([ + ['X-Custom', 'first'], + ['x-custom', 'second'], + ['x-empty', ''], + ]), + ) + expect(getResponseHeader('x-custom')).toBe('first, second') + expect(getResponseHeaders().get('x-empty')).toBe('') + return new Response('OK') + }) + + await handler(new Request('http://localhost:3000/test'), {}) }) }) diff --git a/packages/start-server-core/tests/early-hints.test.ts b/packages/start-server-core/tests/early-hints.test.ts index d56824a828..22366eba0d 100644 --- a/packages/start-server-core/tests/early-hints.test.ts +++ b/packages/start-server-core/tests/early-hints.test.ts @@ -76,18 +76,24 @@ describe('early hints', () => { }, } - expect( - collectStaticHintsFromManifest(manifest, [ - { id: '__root__' }, - { id: '/posts' }, - ] as Array), - ).toEqual([ - { href: '/assets/root.js', rel: 'modulepreload', as: 'script' }, + const hints = collectStaticHintsFromManifest(manifest, [ + { id: '__root__' }, + { id: '/posts' }, + ] as Array) + + expect(hints).toEqual([ + { + href: '/assets/root.js', + rel: 'modulepreload', + as: 'script', + fetchPriority: 'low', + }, { href: '/assets/shared.js', rel: 'modulepreload', as: 'script', crossOrigin: 'anonymous', + fetchPriority: 'low', }, { href: '/assets/root.css', @@ -95,9 +101,21 @@ describe('early hints', () => { as: 'style', crossOrigin: 'use-credentials', }, - { href: '/assets/posts.js', rel: 'modulepreload', as: 'script' }, + { + href: '/assets/posts.js', + rel: 'modulepreload', + as: 'script', + fetchPriority: 'low', + }, { href: '/assets/posts.css', rel: 'preload', as: 'style' }, ]) + expect(hints.map(serializeEarlyHint)).toEqual([ + '; rel=modulepreload; as=script; fetchpriority=low', + '; rel=modulepreload; as=script; crossorigin=anonymous; fetchpriority=low', + '; rel=preload; as=style; crossorigin=use-credentials', + '; rel=modulepreload; as=script; fetchpriority=low', + '; rel=preload; as=style', + ]) }) it('skips static stylesheet hints when inline CSS is enabled', () => { @@ -120,7 +138,12 @@ describe('early hints', () => { { id: '/posts' }, ] as Array), ).toEqual([ - { href: '/assets/posts.js', rel: 'modulepreload', as: 'script' }, + { + href: '/assets/posts.js', + rel: 'modulepreload', + as: 'script', + fetchPriority: 'low', + }, ]) }) @@ -149,7 +172,12 @@ describe('early hints', () => { { id: '/posts' }, ] as Array), ).toEqual([ - { href: '/assets/posts.js', rel: 'modulepreload', as: 'script' }, + { + href: '/assets/posts.js', + rel: 'modulepreload', + as: 'script', + fetchPriority: 'low', + }, ]) }) @@ -171,12 +199,18 @@ describe('early hints', () => { { id: '/posts' }, ] as Array), ).toEqual([ - { href: '/assets/posts.js', rel: 'preload', as: 'script' }, + { + href: '/assets/posts.js', + rel: 'preload', + as: 'script', + fetchPriority: 'low', + }, { href: '/assets/shared.js', rel: 'preload', as: 'script', crossOrigin: 'anonymous', + fetchPriority: 'low', }, ]) }) @@ -395,7 +429,7 @@ describe('early hints', () => { expect(events).toHaveLength(2) expect(headers.get('Link')).toBe( - '; rel=modulepreload; as=script', + '; rel=modulepreload; as=script; fetchpriority=low', ) }) diff --git a/packages/start-server-core/tests/error-entry-isolation.test.ts b/packages/start-server-core/tests/error-entry-isolation.test.ts new file mode 100644 index 0000000000..6eb2feab5e --- /dev/null +++ b/packages/start-server-core/tests/error-entry-isolation.test.ts @@ -0,0 +1,550 @@ +// @vitest-environment node + +import { afterEach, describe, expect, it, vi } from 'vitest' +import { createMiddleware } from '@tanstack/start-client-core' +import { createStartHandler } from '../src/createStartHandler' +import { + appendResponseHeader, + clearResponseHeaders, + createServerEntry, + getRequest, + getRequestHeader, + getResponseHeader, + handleStartError, + removeResponseHeader, + setCookie, + setResponseHeader, + setResponseStatus, +} from '../src/request-response' + +const startMocks = vi.hoisted(() => ({ + requestMiddleware: [] as Array, +})) + +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ + requestMiddleware: startMocks.requestMiddleware, + serializationAdapters: [], + }), + }, +})) + +vi.mock('#tanstack-router-entry', () => ({ + getRouter: () => { + throw new Error('These middleware responses do not render a router') + }, +})) + +function createHandler() { + return createStartHandler(() => new Response('unused')) +} + +function request(marker: string, method = 'GET') { + return new Request('http://localhost/', { + method, + headers: { 'x-request-marker': marker }, + }) +} + +function setRequestResponseState() { + setResponseStatus(418, 'Example Error') + setResponseHeader('x-response-marker', getRequestHeader('x-request-marker')!) +} + +afterEach(() => { + startMocks.requestMiddleware = [] +}) + +describe('generic error response finalization', () => { + it.each(['cookie', 'status', 'bodyless'] as const)( + 'includes %s helper writes made by a lazy error headers getter', + async (effect) => { + const error = Object.assign(new Error('refresh required'), { + status: 401, + }) + Object.defineProperty(error, 'headers', { + get() { + setCookie('refresh', 'value') + if (effect === 'status') { + setResponseStatus(429, 'Retry Later') + } else if (effect === 'bodyless') { + setResponseStatus(204) + } + return new Headers({ 'www-authenticate': 'Bearer' }) + }, + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + throw error + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const response = await entry.fetch(request(effect)) + + // A bodyless helper status does not describe the failure, so the + // error's own status applies. + const status = effect === 'status' ? 429 : 401 + expect(response.status).toBe(status) + expect(response.headers.get('www-authenticate')).toBe('Bearer') + expect(response.headers.getSetCookie()).toEqual(['refresh=value; Path=/']) + expect(await response.json()).toMatchObject({ + status, + statusText: effect === 'status' ? 'Retry Later' : '', + }) + }, + ) + + it('does not evaluate error statusText when a helper already supplies it', async () => { + const error = Object.assign(new Error('handled'), { status: 409 }) + const statusText = vi.fn(() => { + throw new Error('The overridden metadata must not be read') + }) + Object.defineProperty(error, 'statusText', { get: statusText }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setResponseStatus(418, 'Helper Status') + throw error + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const response = await entry.fetch(request('status text')) + + expect(statusText).not.toHaveBeenCalled() + expect(response.status).toBe(418) + expect(response.statusText).toBe('Helper Status') + expect(await response.json()).toMatchObject({ statusText: 'Helper Status' }) + }) + + it('includes synchronous helper writes made while reporting an error', async () => { + const error = new Error('reported failure') + const report = vi.spyOn(console, 'error').mockImplementation(() => { + setResponseStatus(503, 'Reported Failure') + setCookie('reported', 'yes') + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + throw error + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + try { + const response = await entry.fetch(request('reporting')) + + expect(report).toHaveBeenCalledExactlyOnceWith(error) + expect(response.status).toBe(503) + expect(response.headers.getSetCookie()).toEqual(['reported=yes; Path=/']) + expect(await response.json()).toMatchObject({ + status: 503, + statusText: 'Reported Failure', + }) + } finally { + report.mockRestore() + } + }) + + it.each(['clear', 'remove', 'empty'] as const)( + 'preserves the %s Content-Type helper operation on a generic error', + async (operation) => { + const errorHeaders = new Headers({ + 'content-type': 'application/problem+json', + }) + const error = Object.assign(new Error('private error message'), { + status: 418, + statusText: 'Teapot', + headers: errorHeaders, + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + if (operation === 'clear') { + clearResponseHeaders() + } else if (operation === 'remove') { + removeResponseHeader('content-type') + } else { + setResponseHeader('content-type', '') + } + setResponseHeader('x-response-marker', 'preserved') + throw error + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const response = await entry.fetch(request(operation)) + + expect(response.status).toBe(418) + expect(response.statusText).toBe('Teapot') + expect(response.headers.get('content-type')).toBe( + operation === 'empty' ? '' : null, + ) + expect(response.headers.get('x-response-marker')).toBe('preserved') + expect(await response.json()).toEqual({ + status: 418, + statusText: 'Teapot', + unhandled: true, + message: 'HTTPError', + }) + expect(errorHeaders.get('content-type')).toBe('application/problem+json') + }, + ) + + it('applies helper appends once when a converted error returns through middleware', async () => { + const error = Object.assign(new Error('handled'), { + status: 409, + headers: { vary: 'Accept-Encoding' }, + }) + startMocks.requestMiddleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + expect(getResponseHeader('vary')).toBe( + 'Accept-Encoding, Origin, User-Agent', + ) + return result + }), + createMiddleware().server(() => { + appendResponseHeader('vary', 'Origin') + const response = handleStartError(error) + expect(getResponseHeader('vary')).toBe('Accept-Encoding, Origin') + appendResponseHeader('vary', 'User-Agent') + return response + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const response = await entry.fetch(request('appends')) + + expect(response.headers.get('vary')).toBe( + 'Accept-Encoding, Origin, User-Agent', + ) + expect(await response.json()).toMatchObject({ status: 409 }) + }) + + it.each([204, 205, 304])( + 'ignores bodyless helper status %i for an uncaught error', + async (status) => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setResponseStatus(status) + setResponseHeader('x-response-marker', 'bodyless') + throw new Error('bodyless failure') + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + try { + const response = await entry.fetch(request('bodyless')) + + expect(response.status).toBe(500) + expect(response.headers.get('x-response-marker')).toBe('bodyless') + expect(await response.json()).toMatchObject({ status: 500 }) + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }, + ) + + it('keeps shared error headers and cookies isolated from each invocation', async () => { + const errorHeaders = new Headers([ + ['vary', 'Accept-Encoding'], + ['set-cookie', 'session=original; Path=/'], + ['set-cookie', 'independent=preserved; Path=/'], + ]) + const error = Object.assign(new Error('shared failure'), { + status: 409, + headers: errorHeaders, + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + const marker = getRequestHeader('x-request-marker')! + appendResponseHeader('vary', marker) + setCookie('session', marker, { path: '/' }) + throw error + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const responses = await Promise.all([ + entry.fetch(request('first')), + entry.fetch(request('second')), + ]) + + for (const [index, marker] of ['first', 'second'].entries()) { + const response = responses[index]! + expect(response.headers.get('vary')).toBe(`Accept-Encoding, ${marker}`) + expect(response.headers.getSetCookie()).toEqual([ + 'independent=preserved; Path=/', + `session=${marker}; Path=/`, + ]) + expect(await response.json()).toMatchObject({ status: 409 }) + } + expect(errorHeaders.get('vary')).toBe('Accept-Encoding') + expect(errorHeaders.getSetCookie()).toEqual([ + 'session=original; Path=/', + 'independent=preserved; Path=/', + ]) + }) +}) + +describe('server entry request ownership', () => { + it.each(['GET', 'HEAD'])( + 'finalizes a primitive error in the %s request context', + async (method) => { + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw 'example failure' + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const response = await entry.fetch(request('primitive', method)) + + expect(response.status).toBe(418) + expect(response.statusText).toBe('Example Error') + expect(response.headers.get('x-response-marker')).toBe('primitive') + if (method === 'HEAD') { + expect(response.body).toBeNull() + } else { + expect(await response.json()).toMatchObject({ status: 418 }) + } + }, + ) + + it('preserves the original rejection from the raw Start handler', async () => { + const error = new Error('example failure') + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw error + }), + ] + + await expect(createHandler()(request('raw'))).rejects.toBe(error) + }) + + it('removes a thrown Response body for HEAD without a helper write', async () => { + const cancel = vi.fn() + const body = new ReadableStream({ cancel }) + const entry = createServerEntry({ + fetch() { + throw new Response(body, { status: 400 }) + }, + }) + + const response = await entry.fetch(request('response failure', 'HEAD')) + + expect(response.status).toBe(400) + expect(response.body).toBeNull() + expect(cancel).toHaveBeenCalledOnce() + }) + + it.each(['handleStartError', 'rethrow'])( + 'keeps a reporting catch in the request context with %s', + async (conversion) => { + const error = new Error('example failure') + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw error + }), + ] + const handler = createHandler() + let caught: unknown + let caughtRequest: Request | undefined + const entry = createServerEntry({ + async fetch(input, opts) { + setResponseHeader('x-entry-marker', 'entry') + try { + return await handler(input, opts) + } catch (value) { + caught = value + caughtRequest = getRequest() + if (conversion === 'rethrow') { + throw value + } + return handleStartError(value) + } + }, + }) + const input = request('custom') + + const response = await entry.fetch(input) + + expect(caught).toBe(error) + expect(caughtRequest).toBe(input) + expect(response.status).toBe(418) + expect(response.headers.get('x-entry-marker')).toBe('entry') + expect(response.headers.get('x-response-marker')).toBe('custom') + }, + ) + + it('allows a custom catch to replace the response without Start helper state', async () => { + const error = new Error('example failure') + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw error + }), + ] + const handler = createHandler() + let caught: unknown + const replacement = new Response('custom response', { status: 202 }) + const entry = createServerEntry({ + async fetch(input, opts) { + try { + return await handler(input, opts) + } catch (value) { + caught = value + return replacement + } + }, + }) + + const response = await entry.fetch(request('custom replacement')) + + expect(caught).toBe(error) + expect(response).toBe(replacement) + expect(response.status).toBe(202) + expect(response.headers.get('x-response-marker')).toBeNull() + expect(await response.text()).toBe('custom response') + }) + + it('finalizes each overlapping invocation in its own context', async () => { + const error = new Error('shared example failure') + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw error + }), + ] + const handler = createHandler() + let caughtCount = 0 + let release!: () => void + const bothCaught = new Promise((resolve) => { + release = resolve + }) + const entry = createServerEntry({ + async fetch(input, opts) { + try { + return await handler(input, opts) + } catch (value) { + caughtCount++ + if (caughtCount === 2) { + release() + } + await bothCaught + return handleStartError(value) + } + }, + }) + + const responses = await Promise.all([ + entry.fetch(request('first')), + entry.fetch(request('second')), + ]) + + expect(responses.map((response) => response.status)).toEqual([418, 418]) + expect( + responses.map((response) => response.headers.get('x-response-marker')), + ).toEqual(['first', 'second']) + }) + + it.each(['return', 'throw'])( + 'does not mutate a reusable bodyless Response when middleware uses %s', + async (result) => { + const source = new Response(null, { + headers: { 'x-source-marker': 'source' }, + }) + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setResponseHeader( + 'x-response-marker', + getRequestHeader('x-request-marker')!, + ) + if (result === 'throw') { + throw source + } + return source + }), + ] + const entry = createServerEntry({ fetch: createHandler() }) + + const first = await entry.fetch(request('first')) + const second = await entry.fetch(request('second')) + + expect(first.headers.get('x-response-marker')).toBe('first') + expect(second.headers.get('x-response-marker')).toBe('second') + expect(first.headers.get('x-source-marker')).toBe('source') + expect(second.headers.get('x-source-marker')).toBe('source') + expect(source.headers.get('x-response-marker')).toBeNull() + expect(source.headers.get('x-source-marker')).toBe('source') + }, + ) + + it('isolates overlapping top-level entry invocations that reuse the same Request', async () => { + let invocationCount = 0 + let release!: () => void + const bothStarted = new Promise((resolve) => { + release = resolve + }) + const entry = createServerEntry({ + async fetch() { + invocationCount++ + setResponseStatus(418) + setResponseHeader('x-invocation-marker', String(invocationCount)) + if (invocationCount === 2) { + release() + } + await bothStarted + throw 'example failure' + }, + }) + const input = request('shared input') + + const responses = await Promise.all([ + entry.fetch(input), + entry.fetch(input), + ]) + + expect(responses.map((response) => response.status)).toEqual([418, 418]) + expect( + responses.map((response) => response.headers.get('x-invocation-marker')), + ).toEqual(['1', '2']) + }) + + it('restores the outer request context after a nested entry handles another request', async () => { + startMocks.requestMiddleware = [ + createMiddleware().server(() => { + setRequestResponseState() + throw 'example failure' + }), + ] + const handler = createHandler() + const inner = createServerEntry({ fetch: handler }) + let innerResponse: Response | undefined + let restoredRequest: Request | undefined + const outer = createServerEntry({ + async fetch(input, opts) { + setResponseHeader('x-outer-marker', 'outer') + innerResponse = await inner.fetch(request('inner')) + restoredRequest = getRequest() + return handler(input, opts) + }, + }) + const input = request('outer') + + const outerResponse = await outer.fetch(input) + + expect(restoredRequest).toBe(input) + expect(innerResponse?.headers.get('x-response-marker')).toBe('inner') + expect(innerResponse?.headers.get('x-outer-marker')).toBeNull() + expect(outerResponse.headers.get('x-response-marker')).toBe('outer') + expect(outerResponse.headers.get('x-outer-marker')).toBe('outer') + }) +}) diff --git a/packages/start-server-core/tests/external-sessions.test.ts b/packages/start-server-core/tests/external-sessions.test.ts new file mode 100644 index 0000000000..b4a32bb6b1 --- /dev/null +++ b/packages/start-server-core/tests/external-sessions.test.ts @@ -0,0 +1,174 @@ +// @vitest-environment node + +import { afterEach, describe, expect, it, vi } from 'vitest' +import { createMiddleware } from '@tanstack/start-client-core' +import { getIronSession } from 'iron-session' +import { createStartHandler } from '../src/createStartHandler' +import * as server from '../src/request-response' + +const startMocks = vi.hoisted(() => ({ + requestMiddleware: [] as Array, +})) +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ + requestMiddleware: startMocks.requestMiddleware, + serializationAdapters: [], + }), + }, +})) +vi.mock('#tanstack-router-entry', () => ({ + getRouter: () => { + throw new Error('The request middleware must handle the request') + }, +})) + +function handler(run: (request: Request) => Promise) { + startMocks.requestMiddleware = [ + createMiddleware().server(({ request }) => run(request)), + ] + return createStartHandler(() => { + throw new Error('The request middleware must return a response') + }) +} + +function request(cookie?: string, path = '/') { + return new Request(`https://start.example${path}`, { + headers: cookie ? { cookie } : undefined, + }) +} + +function cookies(response: Response) { + return response.headers + .getSetCookie() + .map((c) => c.split(';', 1)[0]) + .join('; ') +} + +const password = 'external-session-test-password-at-least-32-characters' +function iron(name = 'iron') { + return getIronSession<{ user?: string; visits?: number }>( + { read: server.getCookie, write: server.setCookie }, + { cookieName: name, password, ttl: 3600 }, + ) +} + +afterEach(() => { + startMocks.requestMiddleware = [] +}) + +describe('external sessions through public Start request middleware', () => { + it('leaves session ownership to the application', () => { + for (const name of [ + 'defineSession', + 'useSession', + 'getSession', + 'updateSession', + 'clearSession', + 'sealSession', + 'unsealSession', + ]) { + expect(server).not.toHaveProperty(name) + } + }) + + it('loads, saves and destroys an iron-session with the public cookie helpers', async () => { + const app = handler(async (req) => { + const session = await iron() + if (req.url.endsWith('/login')) { + session.user = 'alice' + await session.save() + } else if (req.url.endsWith('/logout')) { + session.destroy() + } + return Response.json({ user: session.user ?? null }) + }) + const anonymous = await app(request(), {}) + expect(anonymous.headers.getSetCookie()).toEqual([]) + const login = await app(request(undefined, '/login'), {}) + expect(login.headers.getSetCookie()[0]).toMatch(/HttpOnly/i) + expect(login.headers.getSetCookie()[0]).toMatch(/Secure/i) + expect(await (await app(request(cookies(login)), {})).json()).toEqual({ + user: 'alice', + }) + const logout = await app(request(cookies(login), '/logout'), {}) + expect(logout.headers.getSetCookie()[0]).toMatch(/Max-Age=0/i) + expect(await (await app(request(cookies(logout)), {})).json()).toEqual({ + user: null, + }) + }) + + it('keeps each request and each separately named iron-session independent', async () => { + const app = handler(async (req) => { + const [auth, preferences] = await Promise.all([ + iron(), + iron('preferences'), + ]) + auth.user = new URL(req.url).searchParams.get('user')! + preferences.visits = 3 + await Promise.all([auth.save(), preferences.save()]) + return Response.json({ user: auth.user }) + }) + const [alice, bob] = await Promise.all([ + app(request(undefined, '/?user=alice'), {}), + app(request(undefined, '/?user=bob'), {}), + ]) + expect(alice.headers.getSetCookie()).toHaveLength(2) + expect(bob.headers.getSetCookie()).toHaveLength(2) + const read = handler(async () => Response.json({ ...(await iron()) })) + expect(await (await read(request(cookies(alice)), {})).json()).toEqual({ + user: 'alice', + }) + expect(await (await read(request(cookies(bob)), {})).json()).toEqual({ + user: 'bob', + }) + }) + + it('keeps the last cookie write when a session is saved and then destroyed', async () => { + const app = handler(async () => { + const session = await iron() + session.user = 'alice' + await session.save() + session.destroy() + server.setCookie('other', 'value') + return new Response('logged out') + }) + const response = await app(request(), {}) + expect(response.headers.getSetCookie()).toHaveLength(2) + expect( + response.headers.getSetCookie().find((c) => c.startsWith('iron=')), + ).toMatch(/Max-Age=0/i) + }) + + it('preserves committed external cookies and response metadata on error responses', async () => { + const app = handler(async () => { + const session = await iron() + session.user = 'alice' + await session.save() + server.setResponseHeader('x-session-test', 'retained') + return new Response('validation failed', { status: 422 }) + }) + const response = await app(request(), {}) + expect(response.status).toBe(422) + expect(response.headers.get('x-session-test')).toBe('retained') + expect(response.headers.getSetCookie()).toHaveLength(1) + const read = handler(async () => Response.json({ ...(await iron()) })) + expect(await (await read(request(cookies(response)), {})).json()).toEqual({ + user: 'alice', + }) + }) + + it('preserves a committed cookie through the default thrown-error conversion', async () => { + const app = handler(async () => { + const session = await iron() + session.visits = 1 + await session.save() + throw new Error('application failure') + }) + const response = await server + .createServerEntry({ fetch: app }) + .fetch(request(), {}) + expect(response.status).toBe(500) + expect(response.headers.getSetCookie()).toHaveLength(1) + }) +}) diff --git a/packages/start-server-core/tests/finalManifest.test.ts b/packages/start-server-core/tests/finalManifest.test.ts index dabcb19a3d..a41f64b576 100644 --- a/packages/start-server-core/tests/finalManifest.test.ts +++ b/packages/start-server-core/tests/finalManifest.test.ts @@ -135,6 +135,51 @@ describe('final manifest resolver', () => { expect(transformAssets).toHaveBeenCalledTimes(1) }) + it('returns a settled cached manifest without a promise', async () => { + const getBaseManifest = vi.fn(async () => baseManifest) + const resolver = createFinalManifestResolver({ cacheCreateTransform: true }) + const request = new Request('http://localhost/') + + const first = await resolver.resolveCached({ + request, + requestInlineCss: undefined, + getBaseManifest, + }) + const second = resolver.resolveCached({ + request, + requestInlineCss: undefined, + getBaseManifest, + }) + + expect(second).toBe(first) + expect(getBaseManifest).toHaveBeenCalledTimes(1) + }) + + it('resolves each request when inline CSS is decided per request', async () => { + const getBaseManifest = vi.fn(async () => baseManifest) + const inlineCss = vi.fn(() => false) + const resolver = createFinalManifestResolver({ + cacheCreateTransform: true, + inlineCss, + }) + const request = new Request('http://localhost/') + + const first = await resolver.resolveCached({ + request, + requestInlineCss: undefined, + getBaseManifest, + }) + const second = resolver.resolveCached({ + request, + requestInlineCss: undefined, + getBaseManifest, + }) + + expect(second).toBeInstanceOf(Promise) + await expect(second).resolves.toBe(first) + expect(inlineCss).toHaveBeenCalledTimes(2) + }) + it('does not warm up when the inline CSS default is request-dependent', () => { const getBaseManifest = vi.fn(async () => baseManifest) const transformAssets: TransformAssetsFn = ({ url }) => url diff --git a/packages/start-server-core/tests/frame-protocol.test.ts b/packages/start-server-core/tests/frame-protocol.test.ts index 380f3a8351..dd9f41cf4e 100644 --- a/packages/start-server-core/tests/frame-protocol.test.ts +++ b/packages/start-server-core/tests/frame-protocol.test.ts @@ -1,137 +1,150 @@ -import { describe, expect, it } from 'vitest' +import { describe, expect, it, vi } from 'vitest' import { FRAME_HEADER_SIZE, - FrameType, - createMultiplexedStream, - encodeChunkFrame, - encodeEndFrame, - encodeErrorFrame, - encodeFrame, - encodeJSONFrame, + FRAME_TYPE_CHUNK, + FRAME_TYPE_END, + FRAME_TYPE_ERROR, + FRAME_TYPE_JSON, + MAX_FRAME_PAYLOAD_SIZE, +} from '@tanstack/start-client-core/client-rpc' +import { createMultiplexedStream } from '../src/frame-protocol' +import type { + LateStreamRegistration, + MultiplexedStreamRecord, } from '../src/frame-protocol' +function createRecord( + json: string, + rawStreams: Array = [], +): MultiplexedStreamRecord { + return { json: new TextEncoder().encode(json), rawStreams } +} + +function createRecordStream( + records: Array, +): ReadableStream { + return new ReadableStream({ + start(controller) { + for (const record of records) { + controller.enqueue(record) + } + controller.close() + }, + }) +} + +async function readFrames(stream: ReadableStream) { + const reader = stream.getReader() + const frames: Array = [] + for (;;) { + const { done, value } = await reader.read() + if (done) { + return frames + } + frames.push(value) + } +} + describe('frame-protocol', () => { - describe('encodeFrame', () => { - it('should encode frame with header and payload', () => { + describe('frame encoding', () => { + it('should encode JSON, chunk, and end frames', async () => { const payload = new Uint8Array([1, 2, 3, 4]) - const frame = encodeFrame(FrameType.CHUNK, 42, payload) + const rawStream = new ReadableStream({ + start(controller) { + controller.enqueue(payload) + controller.close() + }, + }) + const frames = await readFrames( + createMultiplexedStream( + createRecordStream([ + createRecord('{"result":"ok"}', [{ id: 42, stream: rawStream }]), + ]), + ), + ) - expect(frame.length).toBe(FRAME_HEADER_SIZE + payload.length) + expect(frames).toHaveLength(3) + const jsonView = new DataView(frames[0]!.buffer, frames[0]!.byteOffset) + expect(jsonView.getUint8(0)).toBe(FRAME_TYPE_JSON) + expect(jsonView.getUint32(1, false)).toBe(0) - // Check header - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.CHUNK) - expect(view.getUint32(1, false)).toBe(42) // streamId big-endian - expect(view.getUint32(5, false)).toBe(4) // length big-endian + const chunkView = new DataView(frames[1]!.buffer, frames[1]!.byteOffset) + expect(frames[1]!.length).toBe(FRAME_HEADER_SIZE + payload.length) + expect(chunkView.getUint8(0)).toBe(FRAME_TYPE_CHUNK) + expect(chunkView.getUint32(1, false)).toBe(42) + expect(chunkView.getUint32(5, false)).toBe(payload.length) + expect(frames[1]!.slice(FRAME_HEADER_SIZE)).toEqual(payload) - // Check payload - expect(frame.slice(FRAME_HEADER_SIZE)).toEqual(payload) + const endView = new DataView(frames[2]!.buffer, frames[2]!.byteOffset) + expect(frames[2]!.length).toBe(FRAME_HEADER_SIZE) + expect(endView.getUint8(0)).toBe(FRAME_TYPE_END) + expect(endView.getUint32(1, false)).toBe(42) + expect(endView.getUint32(5, false)).toBe(0) }) - it('should handle empty payload', () => { - const frame = encodeFrame(FrameType.END, 1, new Uint8Array(0)) - - expect(frame.length).toBe(FRAME_HEADER_SIZE) - - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.END) - expect(view.getUint32(5, false)).toBe(0) // length is 0 - }) - }) - - describe('encodeJSONFrame', () => { - it('should encode JSON string as frame type 0 with streamId 0', () => { - const json = '{"hello":"world"}' - const frame = encodeJSONFrame(json) - - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.JSON) - expect(view.getUint32(1, false)).toBe(0) // streamId always 0 for JSON - - const encoder = new TextEncoder() - const expectedPayload = encoder.encode(json) - expect(view.getUint32(5, false)).toBe(expectedPayload.length) - - const payload = frame.slice(FRAME_HEADER_SIZE) - expect(new TextDecoder().decode(payload)).toBe(json) - }) - }) - - describe('encodeChunkFrame', () => { - it('should encode binary chunk with frame type CHUNK', () => { - const chunk = new Uint8Array([0xff, 0xfe, 0xfd]) - const frame = encodeChunkFrame(123, chunk) - - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.CHUNK) - expect(view.getUint32(1, false)).toBe(123) - expect(view.getUint32(5, false)).toBe(3) - - expect(frame.slice(FRAME_HEADER_SIZE)).toEqual(chunk) - }) - }) - - describe('encodeEndFrame', () => { - it('should encode end frame with empty payload', () => { - const frame = encodeEndFrame(456) - - expect(frame.length).toBe(FRAME_HEADER_SIZE) - - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.END) - expect(view.getUint32(1, false)).toBe(456) - expect(view.getUint32(5, false)).toBe(0) - }) - }) - - describe('encodeErrorFrame', () => { - it('should encode Error message', () => { - const frame = encodeErrorFrame(789, new Error('Something went wrong')) - - const view = new DataView(frame.buffer) - expect(view.getUint8(0)).toBe(FrameType.ERROR) + it.each([ + [new Error('Something went wrong'), 'Something went wrong'], + ['string error', 'string error'], + [undefined, 'Unknown error'], + ])('should encode raw stream error payload %j', async (error, message) => { + const errorStream = new ReadableStream({ + start(controller) { + controller.error(error) + }, + }) + const frames = await readFrames( + createMultiplexedStream( + createRecordStream([ + createRecord('{}', [{ id: 789, stream: errorStream }]), + ]), + ), + ) + const frame = frames.find((value) => value[0] === FRAME_TYPE_ERROR)! + const view = new DataView(frame.buffer, frame.byteOffset) + expect(view.getUint8(0)).toBe(FRAME_TYPE_ERROR) expect(view.getUint32(1, false)).toBe(789) - - const payload = frame.slice(FRAME_HEADER_SIZE) - expect(new TextDecoder().decode(payload)).toBe('Something went wrong') + expect(new TextDecoder().decode(frame.slice(FRAME_HEADER_SIZE))).toBe( + message, + ) }) - it('should handle non-Error values', () => { - const frame = encodeErrorFrame(1, 'string error') - + it('should bound oversized raw-stream error messages', async () => { + const errorStream = new ReadableStream({ + start(controller) { + controller.error(new Error('x'.repeat(MAX_FRAME_PAYLOAD_SIZE + 1))) + }, + }) + const frames = await readFrames( + createMultiplexedStream( + createRecordStream([ + createRecord('{}', [{ id: 1, stream: errorStream }]), + ]), + ), + ) + const frame = frames.find((value) => value[0] === FRAME_TYPE_ERROR)! const payload = frame.slice(FRAME_HEADER_SIZE) - expect(new TextDecoder().decode(payload)).toBe('string error') - }) - - it('should handle undefined error', () => { - const frame = encodeErrorFrame(1, undefined) - - const payload = frame.slice(FRAME_HEADER_SIZE) - expect(new TextDecoder().decode(payload)).toBe('Unknown error') + expect(payload.byteLength).toBeLessThan(MAX_FRAME_PAYLOAD_SIZE) + expect(new TextDecoder().decode(payload)).toMatch(/…$/) }) }) describe('createMultiplexedStream', () => { it('should multiplex JSON stream only', async () => { - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{"data":1}') - controller.enqueue('{"data":2}') - controller.close() - }, - }) - const multiplexed = createMultiplexedStream( - jsonStream, - new Map(), // no raw streams + createRecordStream([ + createRecord('{"data":1}'), + createRecord('{"data":2}'), + ]), ) const reader = multiplexed.getReader() const chunks: Array = [] - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -140,18 +153,11 @@ describe('frame-protocol', () => { // Both should be JSON frames for (const chunk of chunks) { const view = new DataView(chunk.buffer, chunk.byteOffset) - expect(view.getUint8(0)).toBe(FrameType.JSON) + expect(view.getUint8(0)).toBe(FRAME_TYPE_JSON) } }) it('should multiplex JSON and raw streams', async () => { - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{"result":"ok"}') - controller.close() - }, - }) - const rawStream = new ReadableStream({ start(controller) { controller.enqueue(new Uint8Array([1, 2, 3])) @@ -159,17 +165,20 @@ describe('frame-protocol', () => { }, }) - const rawStreams = new Map>() - rawStreams.set(5, rawStream) - - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"result":"ok"}', [{ id: 5, stream: rawStream }]), + ]), + ) const reader = multiplexed.getReader() const chunks: Array = [] - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -181,51 +190,349 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types).toContain(FrameType.JSON) - expect(types).toContain(FrameType.CHUNK) - expect(types).toContain(FrameType.END) + expect(types).toEqual([FRAME_TYPE_JSON, FRAME_TYPE_CHUNK, FRAME_TYPE_END]) + }) + + it('splits raw chunks at the wire payload limit', async () => { + const payload = new Uint8Array(MAX_FRAME_PAYLOAD_SIZE + 1) + const rawStream = new ReadableStream({ + start(controller) { + controller.enqueue(payload) + controller.close() + }, + }) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"ref":1}', [{ id: 1, stream: rawStream }]), + ]), + ) + const reader = multiplexed.getReader() + const frames: Array = [] + for (;;) { + const { done, value } = await reader.read() + if (done) { + break + } + frames.push(value) + } + + expect(frames.map((frame) => frame[0])).toEqual([ + FRAME_TYPE_JSON, + FRAME_TYPE_CHUNK, + FRAME_TYPE_CHUNK, + FRAME_TYPE_END, + ]) + expect(frames[1]!.byteLength - FRAME_HEADER_SIZE).toBe( + MAX_FRAME_PAYLOAD_SIZE, + ) + expect(frames[2]!.byteLength - FRAME_HEADER_SIZE).toBe(1) + }) + + it('bounds upstream reads and copies chunks only when output has demand', async () => { + const first = new Uint8Array([1]) + const second = new Uint8Array([2]) + const chunks = [first, second] + let pullCount = 0 + let chunkIndex = 0 + const rawStream = new ReadableStream( + { + pull(controller) { + pullCount++ + const chunk = chunks[chunkIndex++] + if (chunk) { + controller.enqueue(chunk) + } else { + controller.close() + } + }, + }, + { highWaterMark: 0 }, + ) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"ref":1}', [{ id: 1, stream: rawStream }]), + ]), + ) + + // Let every currently runnable pump microtask settle without consuming + // the output. One chunk is queued and one is held unencoded by its pump. + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(pullCount).toBe(1) + + // The second frame must copy its payload only after the first frame is + // consumed and output capacity becomes available. + second[0] = 9 + const reader = multiplexed.getReader() + const jsonFrame = (await reader.read()).value! + expect(new DataView(jsonFrame.buffer).getUint8(0)).toBe(FRAME_TYPE_JSON) + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(pullCount).toBe(2) + const firstFrame = (await reader.read()).value! + const secondFrame = (await reader.read()).value! + expect(firstFrame.slice(FRAME_HEADER_SIZE)).toEqual(new Uint8Array([1])) + expect(secondFrame.slice(FRAME_HEADER_SIZE)).toEqual(new Uint8Array([9])) + + const endFrame = (await reader.read()).value! + expect(new DataView(endFrame.buffer).getUint8(0)).toBe(FRAME_TYPE_END) + await expect(reader.read()).resolves.toEqual({ + done: true, + value: undefined, + }) + }) + + it('bounds concurrent pumps while a late record waits for output demand', async () => { + const sources = Array.from({ length: 5 }, (_, index) => { + const chunks: Array = [] + const cancel = vi.fn() + const stream = new ReadableStream( + { + pull(controller) { + const chunk = new Uint8Array([index + 1, 1]) + chunks.push(chunk) + controller.enqueue(chunk) + }, + cancel, + }, + { highWaterMark: 0 }, + ) + return { id: index + 1, stream, chunks, cancel } + }) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"refs":[1,2,3,4]}', sources.slice(0, 4)), + createRecord('{"ref":5}', [sources[4]!]), + ]), + ) + const reader = multiplexed.getReader() + + // The first JSON frame fills the output. Each active pump holds one + // unencoded chunk; the late stream waits for its own JSON admission. + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(sources.map(({ chunks }) => chunks.length)).toEqual([ + 1, 1, 1, 1, 0, + ]) + expect((await reader.read()).value![0]).toBe(FRAME_TYPE_JSON) + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(sources.map(({ chunks }) => chunks.length)).toEqual([ + 2, 1, 1, 1, 0, + ]) + + // Only the first raw frame has been copied into the output queue. + for (const source of sources.slice(0, 4)) { + source.chunks[0]![1] = 9 + } + for (let streamId = 1; streamId <= 4; streamId++) { + const frame = (await reader.read()).value! + expect(frame[0]).toBe(FRAME_TYPE_CHUNK) + expect(frame.slice(FRAME_HEADER_SIZE)).toEqual( + new Uint8Array([streamId, streamId === 1 ? 1 : 9]), + ) + } + expect((await reader.read()).value![0]).toBe(FRAME_TYPE_JSON) + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(sources[4]!.chunks).toHaveLength(1) + + const reason = new Error('client disconnected') + await reader.cancel(reason) + await new Promise((resolve) => setTimeout(resolve, 0)) + for (const { stream, cancel } of sources) { + expect(cancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(stream.locked).toBe(false) + } + }) + + it.each(['cancel', 'abort'] as const)( + 'releases active and unadmitted raw streams on %s while output is full', + async (mode) => { + const reason = new Error('request ended') + const abortController = new AbortController() + const sources = Array.from({ length: 3 }, (_, index) => { + const cancel = vi.fn(() => new Promise(() => {})) + const pull = vi.fn( + (controller: ReadableStreamDefaultController) => { + controller.enqueue(new Uint8Array([index])) + }, + ) + const stream = new ReadableStream( + { pull, cancel }, + { highWaterMark: 0 }, + ) + return { id: index + 1, stream, pull, cancel } + }) + const recordCancel = vi.fn(() => new Promise(() => {})) + const records = new ReadableStream({ + start(controller) { + controller.enqueue( + createRecord('{"refs":[1,2]}', sources.slice(0, 2)), + ) + controller.enqueue(createRecord('{"ref":3}', [sources[2]!])) + }, + cancel: recordCancel, + }) + const reader = createMultiplexedStream(records, { + signal: abortController.signal, + }).getReader() + + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(sources.map(({ pull }) => pull.mock.calls.length)).toEqual([ + 1, 1, 0, + ]) + if (mode === 'abort') { + abortController.abort(reason) + await expect(reader.read()).rejects.toBe(reason) + } else { + await reader.cancel(reason) + } + await new Promise((resolve) => setTimeout(resolve, 0)) + + expect(recordCancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(records.locked).toBe(false) + for (const { stream, cancel } of sources) { + expect(cancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(stream.locked).toBe(false) + } + expect(sources.map(({ pull }) => pull.mock.calls.length)).toEqual([ + 1, 1, 0, + ]) + }, + ) + + it('does not let a ready frame overtake one waiting for demand', async () => { + let secondController: ReadableStreamDefaultController + const firstRawStream = new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([1])) + controller.close() + }, + }) + const secondRawStream = new ReadableStream({ + start(controller) { + secondController = controller + }, + }) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"refs":[1,2]}', [ + { id: 1, stream: firstRawStream }, + { id: 2, stream: secondRawStream }, + ]), + ]), + ) + const reader = multiplexed.getReader() + + // The JSON frame fills the output queue. The first raw frame then waits + // for demand while the second raw-stream read remains pending. + await new Promise((resolve) => setTimeout(resolve, 0)) + secondController!.enqueue(new Uint8Array([2])) + secondController!.close() + + // Fulfilling the second read is already queued when consuming the JSON + // creates demand. It must not bypass the first frame's admission. + const jsonFrame = (await reader.read()).value! + expect(jsonFrame[0]).toBe(FRAME_TYPE_JSON) + const firstFrame = (await reader.read()).value! + const secondFrame = (await reader.read()).value! + expect(firstFrame[0]).toBe(FRAME_TYPE_CHUNK) + expect(secondFrame[0]).toBe(FRAME_TYPE_CHUNK) + expect( + new DataView(firstFrame.buffer, firstFrame.byteOffset).getUint32( + 1, + false, + ), + ).toBe(1) + expect( + new DataView(secondFrame.buffer, secondFrame.byteOffset).getUint32( + 1, + false, + ), + ).toBe(2) + + await reader.cancel() }) it('should handle cancel without errors', async () => { - // Create slow streams that won't complete before cancel - let jsonCancelled = false + let recordStreamCancelled = false let rawCancelled = false - const jsonStream = new ReadableStream({ - async start(controller) { - await new Promise((r) => setTimeout(r, 100)) - controller.enqueue('{}\n') - controller.close() - }, - cancel() { - jsonCancelled = true - }, - }) - const rawStream = new ReadableStream({ - async start(controller) { - await new Promise((r) => setTimeout(r, 100)) - controller.enqueue(new Uint8Array([1, 2, 3])) - controller.close() + pull() { + return new Promise(() => {}) }, cancel() { rawCancelled = true + return new Promise(() => {}) }, }) - const rawStreams = new Map>() - rawStreams.set(1, rawStream) + const recordStream = new ReadableStream({ + start(controller) { + controller.enqueue(createRecord('{}', [{ id: 1, stream: rawStream }])) + }, + cancel() { + recordStreamCancelled = true + return new Promise(() => {}) + }, + }) - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() - // Cancel immediately before streams complete - // Should not throw ERR_INVALID_STATE + await reader.read() + + // Output cancellation must not adopt a user cancellation promise that + // is allowed to remain pending forever. await reader.cancel() - // Underlying reader.cancel should propagate to sources - expect(jsonCancelled).toBe(true) + expect(recordStreamCancelled).toBe(true) expect(rawCancelled).toBe(true) + expect(recordStream.locked).toBe(false) + expect(rawStream.locked).toBe(false) + }) + + it('cancels raw streams from a record fulfilled as the request aborts', async () => { + const reason = new Error('request aborted') + let cancelReason: unknown + let cancelCount = 0 + const rawStream = new ReadableStream({ + cancel(value) { + cancelCount++ + cancelReason = value + }, + }) + const abortController = new AbortController() + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{}', [{ id: 1, stream: rawStream }]), + ]), + { signal: abortController.signal }, + ) + + // The record read is already fulfilled, but its pump has not resumed. + abortController.abort(reason) + + await expect(multiplexed.getReader().read()).rejects.toBe(reason) + expect(cancelCount).toBe(1) + expect(cancelReason).toBe(reason) + expect(rawStream.locked).toBe(false) + }) + + it('cancels a stream source for an already-aborted request', async () => { + const reason = new Error('request already aborted') + const cancel = vi.fn() + const recordStream = new ReadableStream({ + cancel, + }) + const abortController = new AbortController() + abortController.abort(reason) + + const multiplexed = createMultiplexedStream(recordStream, { + signal: abortController.signal, + }) + + await expect(multiplexed.getReader().read()).rejects.toBe(reason) + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(reason) + expect(recordStream.locked).toBe(false) }) it('should interleave multiple raw streams correctly', async () => { @@ -235,13 +542,6 @@ describe('frame-protocol', () => { const gate1 = new Promise((r) => (resolve1 = r)) const gate2 = new Promise((r) => (resolve2 = r)) - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{"streams":[1,2]}') - controller.close() - }, - }) - const rawStream1 = new ReadableStream({ async start(controller) { controller.enqueue(new Uint8Array([0x11])) @@ -260,19 +560,25 @@ describe('frame-protocol', () => { }, }) - const rawStreams = new Map>() - rawStreams.set(1, rawStream1) - rawStreams.set(2, rawStream2) - - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{"streams":[1,2]}', [ + { id: 1, stream: rawStream1 }, + { id: 2, stream: rawStream2 }, + ]), + ]), + ) const reader = multiplexed.getReader() const chunks: Array = [] // Read first batch (JSON + first chunks from both streams) for (let i = 0; i < 3; i++) { - const { value } = await reader.read() - if (value) chunks.push(value) + const next = await reader.read() + if (next.done) { + break + } + chunks.push(next.value) } // Release gates to let streams continue @@ -280,9 +586,11 @@ describe('frame-protocol', () => { resolve2!() // Read remaining chunks - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -295,63 +603,50 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types.filter((t) => t === FrameType.JSON).length).toBe(1) - expect(types.filter((t) => t === FrameType.CHUNK).length).toBe(4) - expect(types.filter((t) => t === FrameType.END).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_JSON).length).toBe(1) + expect(types.filter((t) => t === FRAME_TYPE_CHUNK).length).toBe(4) + expect(types.filter((t) => t === FRAME_TYPE_END).length).toBe(2) }) it('should handle late stream registration', async () => { - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{"ref":99}') - controller.close() - }, - }) - - // Late stream source that emits a registration after a delay - // (ensures framed protocol doesn't miss late-stream messages) + // The record containing the late reference is emitted after a delay. let resolveGate: () => void const gate = new Promise((r) => (resolveGate = r)) - const lateStreamSource = new ReadableStream<{ - id: number - stream: ReadableStream - }>({ + const recordStream = new ReadableStream({ async start(controller) { await gate - controller.enqueue({ - id: 99, - stream: new ReadableStream({ - start(c) { - c.enqueue(new Uint8Array([0xaa, 0xbb])) - c.close() + controller.enqueue( + createRecord('{"ref":99}', [ + { + id: 99, + stream: new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array([0xaa, 0xbb])) + c.close() + }, + }), }, - }), - }) + ]), + ) controller.close() }, }) - const multiplexed = createMultiplexedStream( - jsonStream, - new Map(), - lateStreamSource, - ) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() const chunks: Array = [] - // Read JSON frame first - const { value: jsonChunk } = await reader.read() - if (jsonChunk) chunks.push(jsonChunk) - // Release gate to let late stream arrive resolveGate!() // Read remaining frames - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -363,7 +658,7 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types).toEqual([FrameType.JSON, FrameType.CHUNK, FrameType.END]) + expect(types).toEqual([FRAME_TYPE_JSON, FRAME_TYPE_CHUNK, FRAME_TYPE_END]) // Verify late stream data const chunkFrame = chunks[1]! @@ -378,49 +673,41 @@ describe('frame-protocol', () => { let startJson: () => void const jsonGate = new Promise((r) => (startJson = r)) - const jsonStream = new ReadableStream({ + const recordStream = new ReadableStream({ async start(controller) { await jsonGate - controller.enqueue('{"ref":1}') - controller.close() - }, - }) - - // Late stream registers immediately (before JSON starts) - const lateStreamSource = new ReadableStream<{ - id: number - stream: ReadableStream - }>({ - start(controller) { - controller.enqueue({ - id: 1, - stream: new ReadableStream({ - start(c) { - c.enqueue(new Uint8Array([0x01])) - c.close() + controller.enqueue( + createRecord('{"ref":1}', [ + { + id: 1, + stream: new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array([0x01])) + c.close() + }, + }), }, - }), - }) + ]), + ) controller.close() }, }) - const multiplexed = createMultiplexedStream( - jsonStream, - new Map(), - lateStreamSource, - ) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() const chunks: Array = [] - // Allow late stream to run before JSON + // The stream exists before its delayed JSON record, but the mux must not + // start it until after that record is admitted. await Promise.resolve() startJson!() - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -429,27 +716,13 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - // Order is not strictly guaranteed, but all frames must be present. - expect(types.filter((t) => t === FrameType.JSON).length).toBe(1) - expect(types.filter((t) => t === FrameType.CHUNK).length).toBe(1) - expect(types.filter((t) => t === FrameType.END).length).toBe(1) + expect(types).toEqual([FRAME_TYPE_JSON, FRAME_TYPE_CHUNK, FRAME_TYPE_END]) }) it('should handle multiple late stream registrations', async () => { - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{}') - controller.close() - }, - }) - - const lateStreamSource = new ReadableStream<{ - id: number - stream: ReadableStream - }>({ - start(controller) { - // Register two streams - controller.enqueue({ + const recordStream = createRecordStream([ + createRecord('{}', [ + { id: 10, stream: new ReadableStream({ start(c) { @@ -457,8 +730,8 @@ describe('frame-protocol', () => { c.close() }, }), - }) - controller.enqueue({ + }, + { id: 20, stream: new ReadableStream({ start(c) { @@ -466,23 +739,20 @@ describe('frame-protocol', () => { c.close() }, }), - }) - controller.close() - }, - }) + }, + ]), + ]) - const multiplexed = createMultiplexedStream( - jsonStream, - new Map(), - lateStreamSource, - ) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() const chunks: Array = [] - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -495,24 +765,15 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types.filter((t) => t === FrameType.JSON).length).toBe(1) - expect(types.filter((t) => t === FrameType.CHUNK).length).toBe(2) - expect(types.filter((t) => t === FrameType.END).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_JSON).length).toBe(1) + expect(types.filter((t) => t === FRAME_TYPE_CHUNK).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_END).length).toBe(2) }) it('should interleave initial and late streams', async () => { let resolveJson: () => void const jsonGate = new Promise((r) => (resolveJson = r)) - const jsonStream = new ReadableStream({ - async start(controller) { - controller.enqueue('{"first":true}') - await jsonGate - controller.enqueue('{"second":true}') - controller.close() - }, - }) - // Initial raw stream const initialRaw = new ReadableStream({ start(controller) { @@ -521,51 +782,52 @@ describe('frame-protocol', () => { }, }) - const rawStreams = new Map>() - rawStreams.set(1, initialRaw) - - // Late stream arrives after first JSON - const lateStreamSource = new ReadableStream<{ - id: number - stream: ReadableStream - }>({ - start(controller) { - controller.enqueue({ - id: 2, - stream: new ReadableStream({ - start(c) { - c.enqueue(new Uint8Array([2])) - c.close() + const recordStream = new ReadableStream({ + async start(controller) { + controller.enqueue( + createRecord('{"first":true}', [{ id: 1, stream: initialRaw }]), + ) + await jsonGate + controller.enqueue( + createRecord('{"second":true}', [ + { + id: 2, + stream: new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array([2])) + c.close() + }, + }), }, - }), - }) + ]), + ) controller.close() }, }) - const multiplexed = createMultiplexedStream( - jsonStream, - rawStreams, - lateStreamSource, - ) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() const chunks: Array = [] - // Read a few frames - for (let i = 0; i < 4; i++) { + // Read the first record and its stream. + for (let i = 0; i < 3; i++) { const { value, done } = await reader.read() - if (done) break - if (value) chunks.push(value) + if (done) { + break + } + chunks.push(value) } // Release JSON to complete resolveJson!() // Read remaining - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -577,36 +839,32 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types.filter((t) => t === FrameType.JSON).length).toBe(2) - expect(types.filter((t) => t === FrameType.CHUNK).length).toBe(2) - expect(types.filter((t) => t === FrameType.END).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_JSON).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_CHUNK).length).toBe(2) + expect(types.filter((t) => t === FRAME_TYPE_END).length).toBe(2) }) it('should handle raw stream error', async () => { - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{}') - controller.close() - }, - }) - const errorStream = new ReadableStream({ start(controller) { controller.error(new Error('Stream failed')) }, }) - const rawStreams = new Map>() - rawStreams.set(10, errorStream) - - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{}', [{ id: 10, stream: errorStream }]), + ]), + ) const reader = multiplexed.getReader() const chunks: Array = [] - while (true) { + for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) { + break + } chunks.push(value) } @@ -616,13 +874,13 @@ describe('frame-protocol', () => { return view.getUint8(0) }) - expect(types).toContain(FrameType.JSON) - expect(types).toContain(FrameType.ERROR) + expect(types).toContain(FRAME_TYPE_JSON) + expect(types).toContain(FRAME_TYPE_ERROR) // Find ERROR frame and check content const errorFrame = chunks.find((chunk) => { const view = new DataView(chunk.buffer, chunk.byteOffset) - return view.getUint8(0) === FrameType.ERROR + return view.getUint8(0) === FRAME_TYPE_ERROR }) expect(errorFrame).toBeDefined() @@ -631,11 +889,10 @@ describe('frame-protocol', () => { }) it('should propagate JSON stream error to output (fatal)', async () => { - let errorController: ReadableStreamDefaultController - const jsonStream = new ReadableStream({ + let errorController: ReadableStreamDefaultController + const recordStream = new ReadableStream({ start(controller) { errorController = controller - controller.enqueue('{"first":true}') }, }) @@ -648,17 +905,18 @@ describe('frame-protocol', () => { }, }) - const rawStreams = new Map>() - rawStreams.set(1, rawStream) + errorController!.enqueue( + createRecord('{"first":true}', [{ id: 1, stream: rawStream }]), + ) - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream(recordStream) const reader = multiplexed.getReader() // Should be able to read first JSON frame const { value: firstChunk } = await reader.read() expect(firstChunk).toBeDefined() const view = new DataView(firstChunk!.buffer, firstChunk!.byteOffset) - expect(view.getUint8(0)).toBe(FrameType.JSON) + expect(view.getUint8(0)).toBe(FRAME_TYPE_JSON) // Now error the JSON stream errorController!.error(new Error('JSON serialization failed')) @@ -669,13 +927,6 @@ describe('frame-protocol', () => { it('should not hang when raw stream never ends', async () => { // This tests the fix for hanging requests - const jsonStream = new ReadableStream({ - start(controller) { - controller.enqueue('{}') - controller.close() - }, - }) - let rawStreamCancelled = false const neverEndingStream = new ReadableStream({ start(controller) { @@ -687,10 +938,11 @@ describe('frame-protocol', () => { }, }) - const rawStreams = new Map>() - rawStreams.set(1, neverEndingStream) - - const multiplexed = createMultiplexedStream(jsonStream, rawStreams) + const multiplexed = createMultiplexedStream( + createRecordStream([ + createRecord('{}', [{ id: 1, stream: neverEndingStream }]), + ]), + ) const reader = multiplexed.getReader() // Read first two frames (JSON and CHUNK) diff --git a/packages/start-server-core/tests/header-contracts.test-d.ts b/packages/start-server-core/tests/header-contracts.test-d.ts new file mode 100644 index 0000000000..6db9aaef5e --- /dev/null +++ b/packages/start-server-core/tests/header-contracts.test-d.ts @@ -0,0 +1,70 @@ +import { expectTypeOf, test } from 'vitest' +import { + createServerEntry, + getResponseHeaders, + setResponseHeaders, +} from '../src/request-response' +import type { ReadonlyResponseHeaders } from '../src/request-response' +import type { RequestHandler } from '../src/request-handler' + +function checkSnapshot(headers: ReturnType) { + expectTypeOf(headers).toEqualTypeOf() + expectTypeOf(headers.get('content-type')).toExtend() + expectTypeOf(headers.getSetCookie()).toEqualTypeOf>() + expectTypeOf(Array.from(headers)).toEqualTypeOf>() + setResponseHeaders(headers) + + // @ts-expect-error A snapshot cannot change outgoing response headers. + headers.set('vary', 'Origin') + // @ts-expect-error Use appendResponseHeader for outgoing appends. + headers.append('vary', 'Origin') + // @ts-expect-error Use removeResponseHeader for outgoing removals. + headers.delete('vary') + + headers.forEach((_value, _name, parent) => { + expectTypeOf(parent).toEqualTypeOf() + // @ts-expect-error The callback does not expose mutable outgoing headers. + parent.set('vary', 'Origin') + }) +} + +test('response header snapshots expose read methods and explicit copy-back', () => { + expectTypeOf(checkSnapshot).toBeFunction() +}) + +type RequiredContextRegister = { + server: { requestContext: { tenantId: string } } +} + +function checkRequiredEntryContext( + handler: RequestHandler, + request: Request, +) { + const entry = createServerEntry({ fetch: handler }) + expectTypeOf(entry.fetch).toEqualTypeOf< + RequestHandler + >() + entry.fetch(request, { context: { tenantId: 'example' } }) + // @ts-expect-error The wrapped handler still requires request options. + entry.fetch(request) + // @ts-expect-error The wrapped handler still requires its request context. + entry.fetch(request, {}) + // @ts-expect-error The wrapped handler still requires the tenant identifier. + entry.fetch(request, { context: {} }) +} + +function checkOptionalEntryContext( + handler: RequestHandler, + request: Request, +) { + const entry = createServerEntry({ fetch: handler }) + expectTypeOf(entry.fetch).toEqualTypeOf>() + entry.fetch(request) + entry.fetch(request, {}) + entry.fetch(request, { context: { nonce: 'example' } }) +} + +test('server entries preserve inferred required and optional request context', () => { + expectTypeOf(checkRequiredEntryContext).toBeFunction() + expectTypeOf(checkOptionalEntryContext).toBeFunction() +}) diff --git a/packages/start-server-core/tests/header-contracts.test.ts b/packages/start-server-core/tests/header-contracts.test.ts new file mode 100644 index 0000000000..446ff084b3 --- /dev/null +++ b/packages/start-server-core/tests/header-contracts.test.ts @@ -0,0 +1,547 @@ +// @vitest-environment node + +import { afterEach, describe, expect, it, vi } from 'vitest' +import { createMiddleware } from '@tanstack/start-client-core' +import { createStartHandler } from '../src/createStartHandler' +import { + appendResponseHeader, + clearResponseHeaders, + getRequestHost, + getRequestUrl, + getResponseHeader, + getResponseHeaders, + getResponseStatus, + removeResponseHeader, + setCookie, + setResponseHeader, + setResponseStatus, +} from '../src/request-response' +import type { AnyRequestMiddleware } from '@tanstack/start-client-core' + +const startMocks = vi.hoisted(() => ({ + requestMiddleware: [] as Array, +})) +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ + requestMiddleware: startMocks.requestMiddleware, + serializationAdapters: [], + }), + }, +})) +vi.mock('#tanstack-router-entry', () => ({ + getRouter: () => { + throw new Error('The request middleware must handle the request') + }, +})) + +function handler(...middleware: Array) { + startMocks.requestMiddleware = middleware + return createStartHandler(() => { + throw new Error('The request middleware must return a response') + }) +} + +function returnedHeader(value = 'Accept-Encoding') { + return createMiddleware().server(() => { + return new Response(null, { headers: { vary: value } }) + }) +} + +afterEach(() => { + startMocks.requestMiddleware = [] +}) + +describe('response helpers through public Start request middleware', () => { + it('keeps append intent when an invalid replacement value is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + expect(() => setResponseHeader('vary', 'invalid\r\nvalue')).toThrow( + TypeError, + ) + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe('Accept-Encoding, Origin') + }) + + it('keeps removal intent when an invalid replacement value is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + removeResponseHeader('vary') + expect(() => setResponseHeader('vary', 'invalid\r\nvalue')).toThrow( + TypeError, + ) + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBeNull() + }) + + it('keeps cookie merging when an invalid replacement value is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + setCookie('helper', '1') + expect(() => + setResponseHeader('set-cookie', 'invalid\r\nvalue'), + ).toThrow(TypeError) + return next() + }), + createMiddleware().server(() => { + return new Response(null, { + headers: { 'set-cookie': 'returned=2; Path=/' }, + }) + }), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.getSetCookie()).toEqual([ + 'returned=2; Path=/', + 'helper=1; Path=/', + ]) + }) + + it('keeps an earlier cookie when an invalid serialized-cookie append is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + appendResponseHeader('set-cookie', 'helper=1; Path=/') + expect(() => + appendResponseHeader('set-cookie', 'helper=invalid\r\nvalue; Path=/'), + ).toThrow(TypeError) + return next() + }), + createMiddleware().server(() => { + return new Response(null, { + headers: { 'set-cookie': 'returned=2; Path=/' }, + }) + }), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.getSetCookie()).toEqual([ + 'returned=2; Path=/', + 'helper=1; Path=/', + ]) + }) + + it('keeps cookie removal when an invalid serialized-cookie append is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + removeResponseHeader('set-cookie') + expect(() => + appendResponseHeader('set-cookie', 'helper=invalid\r\nvalue; Path=/'), + ).toThrow(TypeError) + return next() + }), + createMiddleware().server(() => { + return new Response(null, { + headers: { 'set-cookie': 'returned=2; Path=/' }, + }) + }), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.getSetCookie()).toEqual([]) + }) + + it('does not retain a removal for an invalid header name after the error is caught', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + expect(() => removeResponseHeader('invalid name')).toThrow(TypeError) + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.status).toBe(200) + expect(response.headers.get('vary')).toBe('Accept-Encoding') + }) + + it.each(['before', 'after'])( + 'appends to a returned header %s next without duplicating at outer boundaries', + async (timing) => { + const reads: Array = [] + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + reads.push(getResponseHeader('vary')) + reads.push(getResponseHeaders().get('vary')) + return result + }), + createMiddleware().server(async ({ next }) => { + if (timing === 'before') { + appendResponseHeader('vary', 'Origin') + } + const result = await next() + if (timing === 'after') { + appendResponseHeader('vary', 'Origin') + } + reads.push(getResponseHeader('vary')) + reads.push(getResponseHeaders().get('vary')) + return result + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe('Accept-Encoding, Origin') + expect(reads).toEqual(Array(4).fill('Accept-Encoding, Origin')) + }, + ) + + it('preserves direct appends and only applies newly added helper values', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + result.response.headers.append('vary', 'Accept-Language') + appendResponseHeader('vary', 'User-Agent') + expect(getResponseHeader('vary')).toBe( + 'Accept-Encoding, Origin, Accept-Language, User-Agent', + ) + return result + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe( + 'Accept-Encoding, Origin, Accept-Language, User-Agent', + ) + }) + + it('preserves helper writes when middleware pipes the response body', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + setResponseHeader('x-response-marker', 'helper') + const result = await next() + return new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + }), + createMiddleware().server(() => new Response('stream body')), + ) + + const response = await app(new Request('https://start.example/'), {}) + + expect(response.headers.get('x-response-marker')).toBe('helper') + expect(await response.text()).toBe('stream body') + }) + + it('applies append intent to a replacement response without copying its old base', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + await next() + return new Response(null, { headers: { vary: 'Accept-Language' } }) + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe('Accept-Language, Origin') + }) + + it('treats application copies of materialized headers as explicit replacement input', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + return new Response(null, { headers: result.response.headers }) + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe('Accept-Encoding, Origin, Origin') + }) + + it('keeps deliberate repeated values exactly once per helper append', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + appendResponseHeader('vary', 'Origin') + return result + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', ['Origin', 'Origin']) + return next() + }), + returnedHeader('Origin'), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe('Origin, Origin, Origin, Origin') + }) + + it('preserves append ownership when a status change reconstructs a response', async () => { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + setResponseStatus(201) + return result + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.status).toBe(201) + expect(response.headers.get('vary')).toBe('Accept-Encoding, Origin') + }) + + it('applies an append once when stripping a HEAD response body', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app( + new Request('https://start.example/', { method: 'HEAD' }), + {}, + ) + expect(response.body).toBeNull() + expect(response.headers.get('vary')).toBe('Accept-Encoding, Origin') + }) + + it('appends to immutable response headers once', async () => { + const app = handler( + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + createMiddleware().server(() => + Response.redirect('https://start.example/login'), + ), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.status).toBe(302) + expect(response.headers.get('vary')).toBe('Origin') + expect(response.headers.get('location')).toBe('https://start.example/login') + }) + + it.each(['set', 'remove', 'clear'])( + 'respects an explicit %s before a later append', + async (operation) => { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + if (operation === 'set') { + setResponseHeader('vary', 'User-Agent') + } else if (operation === 'remove') { + removeResponseHeader('vary') + } else { + clearResponseHeaders() + } + appendResponseHeader('vary', 'Accept-Language') + return result + }), + createMiddleware().server(({ next }) => { + appendResponseHeader('vary', 'Origin') + return next() + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.get('vary')).toBe( + operation === 'set' ? 'User-Agent, Accept-Language' : 'Accept-Language', + ) + }, + ) + + it.each(['remove', 'clear'])( + 'keeps an append after %s before next across outer boundaries', + async (operation) => { + const reads: Array = [] + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + reads.push(result.response.headers.get('vary')) + return result + }), + createMiddleware().server(async ({ next }) => { + if (operation === 'remove') { + removeResponseHeader('vary') + } else { + clearResponseHeaders() + } + appendResponseHeader('vary', 'Origin') + const result = await next() + reads.push(result.response.headers.get('vary')) + return result + }), + returnedHeader(), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(reads).toEqual(['Origin', 'Origin']) + expect(response.headers.get('vary')).toBe('Origin') + }, + ) + + it('reads the same merged cookie values from both response header getters', async () => { + const reads: Array = [] + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + setCookie('helper', 'new') + reads.push(getResponseHeader('set-cookie')) + reads.push(getResponseHeaders().get('set-cookie')) + return result + }), + createMiddleware().server(() => { + return new Response(null, { + headers: { + 'set-cookie': + 'returned=1; Expires=Wed, 21 Oct 2030 07:28:00 GMT; Path=/', + }, + }) + }), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(response.headers.getSetCookie()).toEqual([ + 'returned=1; Expires=Wed, 21 Oct 2030 07:28:00 GMT; Path=/', + 'helper=new; Path=/', + ]) + expect(reads).toEqual(Array(2).fill(response.headers.get('set-cookie'))) + }) + + it('reads the effective returned status before an explicit helper override', async () => { + const statuses: Array = [] + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + statuses.push(getResponseStatus()) + setResponseStatus(202) + statuses.push(getResponseStatus()) + return result + }), + createMiddleware().server(() => new Response(null, { status: 404 })), + ) + const response = await app(new Request('https://start.example/'), {}) + expect(statuses).toEqual([404, 202]) + expect(response.status).toBe(202) + }) + + it.each(['set', 'append', 'delete'] as const)( + 'warns when the getResponseHeaders() snapshot is changed with %s', + async (method) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const app = handler( + createMiddleware().server(async ({ next }) => { + const result = await next() + setCookie('helper', 'one') + const snapshot = getResponseHeaders() as unknown as Headers + expect(snapshot.getSetCookie()).toEqual([ + 'returned=1; Path=/', + 'helper=one; Path=/', + ]) + expect(warnSpy).not.toHaveBeenCalled() + if (method === 'delete') { + snapshot.delete('vary') + } else { + snapshot[method]('x-snapshot', 'changed') + } + expect(warnSpy).toHaveBeenCalledOnce() + expect(warnSpy.mock.calls[0]![0]).toContain( + `getResponseHeaders().${method}()`, + ) + return result + }), + createMiddleware().server(() => { + return new Response(null, { + headers: [ + ['vary', 'Accept-Encoding'], + ['set-cookie', 'returned=1; Path=/'], + ], + }) + }), + ) + + const response = await app(new Request('https://start.example/'), {}) + + expect(response.headers.get('x-snapshot')).toBeNull() + expect(response.headers.get('vary')).toBe('Accept-Encoding') + } finally { + warnSpy.mockRestore() + } + }, + ) + + it('does not warn about getResponseHeaders() snapshot changes in production', async () => { + vi.stubEnv('NODE_ENV', 'production') + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + const app = handler( + createMiddleware().server(() => { + const snapshot = getResponseHeaders() as unknown as Headers + snapshot.set('x-snapshot', 'changed') + return new Response('ok') + }), + ) + + const response = await app(new Request('https://start.example/'), {}) + + expect(response.headers.get('x-snapshot')).toBeNull() + expect(warnSpy).not.toHaveBeenCalled() + } finally { + warnSpy.mockRestore() + vi.unstubAllEnvs() + } + }) +}) + +describe('forwarded request URL helpers', () => { + it.each([ + ['https://start.example:8443/path?search=1', {}], + ['https://[::1]:8443/path?search=1', { 'x-forwarded-host': '' }], + ])( + 'keeps the request URL host when proxy and Host headers are absent: %s', + async (url, headers) => { + const app = handler( + createMiddleware().server(() => + Response.json({ + host: getRequestHost({ xForwardedHost: true }), + url: getRequestUrl({ xForwardedHost: true }).href, + }), + ), + ) + const response = await app(new Request(url, { headers }), {}) + expect(await response.json()).toEqual({ host: new URL(url).host, url }) + }, + ) + + it('uses the first forwarded host and drops an internal port when no external port is provided', async () => { + const app = handler( + createMiddleware().server(() => + Response.json({ + url: getRequestUrl({ xForwardedHost: true }).href, + }), + ), + ) + const response = await app( + new Request('http://internal.example:3000/path', { + headers: { + host: 'origin.example:4000', + 'x-forwarded-host': 'public.example, proxy.example', + 'x-forwarded-proto': 'https', + }, + }), + {}, + ) + expect(await response.json()).toEqual({ + url: 'https://public.example/path', + }) + }) +}) diff --git a/packages/start-server-core/tests/redirect-protocol-reconciliation.test.ts b/packages/start-server-core/tests/redirect-protocol-reconciliation.test.ts new file mode 100644 index 0000000000..95c5f2fa23 --- /dev/null +++ b/packages/start-server-core/tests/redirect-protocol-reconciliation.test.ts @@ -0,0 +1,664 @@ +// @vitest-environment node + +import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' +import { createMemoryHistory } from '@tanstack/history' +import { + BaseRootRoute, + BaseRoute, + RawStream, + RouterCore, + createNonReactiveMutableStore, + createNonReactiveReadonlyStore, + isRedirect, + notFound, + redirect, +} from '@tanstack/router-core' +import { createMiddleware } from '@tanstack/start-client-core' +import { serverFnFetcher } from '../../start-client-core/dist/esm/client-rpc/serverFnFetcher.js' +import { createStartHandler } from '../src/createStartHandler' +import { + appendResponseHeader, + clearResponseHeaders, + removeResponseHeader, + getResponseHeader, + setCookie, + setResponseHeader, + setResponseStatus, +} from '../src/request-response' + +const mocks = vi.hoisted(() => { + const previousServerFnBase = process.env.TSS_SERVER_FN_BASE + process.env.TSS_SERVER_FN_BASE = '/_serverFn/' + return { + previousServerFnBase, + middleware: [] as Array, + action: undefined as undefined | (() => unknown), + } +}) + +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ + requestMiddleware: mocks.middleware, + serializationAdapters: [], + }), + }, +})) +vi.mock('#tanstack-router-entry', () => ({ + getRouter: () => makeRouter(), +})) +vi.mock('#tanstack-start-server-fn-resolver', () => ({ + getServerFnById: () => mocks.action, +})) +// This test runs the client decoder in Node without the compiler's browser +// replacement for the isomorphic Start-options accessor. +vi.mock('../../start-client-core/dist/esm/getStartOptions.js', () => ({ + getStartOptions: () => undefined, +})) + +function makeRouter() { + const root = new BaseRootRoute({}) + const index = new BaseRoute({ + getParentRoute: () => root, + path: '/', + component: () => null, + }) + return new RouterCore( + { + history: createMemoryHistory({ initialEntries: ['/'] }), + routeTree: root.addChildren([index]), + isServer: true, + }, + () => ({ + createMutableStore: createNonReactiveMutableStore, + createReadonlyStore: createNonReactiveReadonlyStore, + batch: (fn: () => void) => fn(), + }), + ) +} + +function app() { + return createStartHandler(() => { + throw new Error('This request should not render HTML') + }) +} + +async function callServerFn() { + const handler = app() + return serverFnFetcher( + '/_serverFn/test', + [{ method: 'GET' }], + async (url: string, init: RequestInit) => + handler(new Request(new URL(url, 'https://start.example'), init), {}), + ) +} + +afterEach(() => { + mocks.middleware = [] + mocks.action = undefined +}) + +afterAll(() => { + if (mocks.previousServerFnBase === undefined) { + Reflect.deleteProperty(process.env, 'TSS_SERVER_FN_BASE') + } else { + process.env.TSS_SERVER_FN_BASE = mocks.previousServerFnBase + } +}) + +describe('Router redirects through public request middleware', () => { + it.each([ + { target: 'to', throws: false, status: 302, statusText: undefined }, + { target: 'to', throws: true, status: 302, statusText: undefined }, + { target: 'to', throws: false, status: 307, statusText: 'Continue' }, + { target: 'to', throws: true, status: 307, statusText: 'Continue' }, + { target: 'href', throws: false, status: 302, statusText: undefined }, + { target: 'href', throws: true, status: 307, statusText: 'Continue' }, + ] as const)( + 'resolves $target redirects with throws=$throws and helper status $status/$statusText', + async ({ target, throws, status, statusText }) => { + mocks.middleware = [ + createMiddleware().server(() => { + setResponseStatus(status, statusText) + setCookie('session', 'committed') + const response = redirect({ [target]: '/login' }) + if (throws) { + throw response + } + return response + }), + ] + + const response = await app()(new Request('https://start.example'), {}) + + expect(response.status).toBe(status) + if (statusText !== undefined) { + expect(response.statusText).toBe(statusText) + } + expect(response.headers.get('location')).toBe('/login') + expect(response.headers.getSetCookie()).toEqual([ + 'session=committed; Path=/', + ]) + }, + ) + + it.each([false, true])( + 'keeps the server-function redirect envelope when throws=%s and helper status changes', + async (throws) => { + mocks.middleware = [ + createMiddleware().server(({ next }) => { + setResponseStatus(302, 'Continue') + return next() + }), + ] + mocks.action = () => { + const response = redirect({ to: '/login', statusCode: 303 }) + if (throws) { + throw response + } + return { result: response } + } + + await expect(callServerFn()).rejects.toSatisfy((value: unknown) => { + return ( + isRedirect(value) && + value.options.href === '/login' && + value.status === 303 + ) + }) + }, + ) +}) + +const mutations = [ + { + name: 'a different content type', + run: () => setResponseHeader('content-type', 'text/plain'), + }, + { name: 'cleared headers', run: () => clearResponseHeaders() }, + { + name: 'the raw response marker', + run: () => setResponseHeader('x-tss-raw', 'true'), + }, + { + name: 'the serialized marker', + run: () => setResponseHeader('x-tss-serialized', 'true'), + }, +] + +describe('server-function protocol headers through public request middleware', () => { + it.each(['constructor', 'toString', '__proto__'])( + 'allows helpers to write and clear the %s header on protocol responses', + async (name) => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + expect(result.response.headers.get(name)).toBe('from-helper') + expect(getResponseHeader(name)).toBe('from-helper') + clearResponseHeaders() + expect(getResponseHeader(name)).toBeUndefined() + return result + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + setResponseHeader(name, 'from-helper') + expect(getResponseHeader(name)).toBe('from-helper') + return result + }), + ] + mocks.action = () => ({ + result: new Response('raw result', { + headers: [[name, 'from-response']], + }), + }) + + const response = await callServerFn() + expect(response).toBeInstanceOf(Response) + expect(response.headers.get(name)).toBeNull() + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(await response.text()).toBe('raw result') + }, + ) + + it('restores direct protocol header mutations as the response leaves the pipeline', async () => { + const mutateHeaders = (response: Response) => { + response.headers.set('content-type', 'text/plain') + response.headers.delete('x-tss-serialized') + response.headers.append('x-tss-raw', 'true') + } + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + // Outer middleware sees an inner middleware's direct change until + // Start sends the response. + expect(result.response.headers.get('content-type')).toBe('text/plain') + expect(result.response.headers.get('x-tss-serialized')).toBeNull() + mutateHeaders(result.response) + return result + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + mutateHeaders(result.response) + return result + }), + ] + mocks.action = () => ({ result: { answer: 42 } }) + + await expect(callServerFn()).resolves.toEqual({ result: { answer: 42 } }) + }) + + it('restores a raw response marker directly removed by middleware as the response leaves the pipeline', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + expect(result.response.headers.get('x-tss-raw')).toBeNull() + result.response.headers.delete('x-tss-raw') + return result + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + result.response.headers.delete('x-tss-raw') + return result + }), + ] + mocks.action = () => ({ result: new Response('raw result') }) + + const response = await callServerFn() + expect(response).toBeInstanceOf(Response) + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(await response.text()).toBe('raw result') + }) + + it('wraps raw responses without changing their headers or duplicating their body', async () => { + const cancel = vi.fn() + const source = new Response(new ReadableStream({ cancel }), { + status: 201, + statusText: 'Created', + headers: [ + ['content-type', 'application/octet-stream'], + ['set-cookie', 'session=one; Path=/'], + ['set-cookie', 'session=two; Path=/admin'], + ], + }) + mocks.action = () => ({ result: source }) + + const response = await callServerFn() + expect(response).toBeInstanceOf(Response) + expect(response).not.toBe(source) + expect(response.body).toBe(source.body) + expect(response.status).toBe(201) + expect(response.statusText).toBe('Created') + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(source.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.getSetCookie()).toEqual([ + 'session=one; Path=/', + 'session=two; Path=/admin', + ]) + response.headers.set('content-type', 'text/plain') + expect(source.headers.get('content-type')).toBe('application/octet-stream') + + const reason = new Error('client disconnected') + await response.body!.cancel(reason) + expect(cancel).toHaveBeenCalledExactlyOnceWith(reason) + }) + + it('marks raw responses with immutable headers without modifying their source', async () => { + const source = Response.redirect('https://start.example/login', 303) + mocks.action = () => ({ result: source }) + + const response = await callServerFn() + + expect(response).toBeInstanceOf(Response) + expect(response.status).toBe(303) + expect(response.body).toBeNull() + expect(response.headers.get('location')).toBe('https://start.example/login') + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(source.headers.get('x-tss-raw')).toBeNull() + }) + + it('keeps Location absent from RPC redirect JSON despite a helper override', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + setResponseStatus(302) + setResponseHeader('location', '/middleware-target') + return result + }), + ] + mocks.action = () => ({ result: redirect({ href: '/login' }) }) + + const response = await app()( + new Request('https://start.example/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + + expect(response.status).toBe(302) + expect(response.headers.get('location')).toBeNull() + expect(await response.json()).toMatchObject({ + href: '/login', + isSerializedRedirect: true, + }) + }) + + it.each(mutations)( + 'decodes redirects despite $name before or after next()', + async ({ run }) => { + for (const afterNext of [false, true]) { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + if (!afterNext) { + run() + } + const result = await next() + if (afterNext) { + run() + } + return result + }), + ] + mocks.action = () => ({ result: redirect({ href: '/login' }) }) + + await expect(callServerFn()).rejects.toSatisfy((value: unknown) => { + return isRedirect(value) && value.options.href === '/login' + }) + } + }, + ) + + it.each(mutations)( + 'decodes serialized values despite $name', + async ({ run }) => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + run() + return result + }), + ] + mocks.action = () => ({ result: { answer: 42 } }) + + await expect(callServerFn()).resolves.toEqual({ + result: { answer: 42 }, + }) + }, + ) + + // Setting the serialized marker cannot break a serialized reply, so that + // mutation would pass without the protection this test covers. + it.each(mutations.filter(({ name }) => name !== 'the serialized marker'))( + 'decodes serialized values wrapped in a same-body response despite $name', + async ({ run }) => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + run() + return result + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + // An ordinary wrapper that keeps the body stream and response init. + return new Response(result.response.body, result.response) + }), + ] + mocks.action = () => ({ result: { answer: 42 } }) + + await expect(callServerFn()).resolves.toEqual({ + result: { answer: 42 }, + }) + }, + ) + + it('keeps a raw result raw when a same-body wrapper loses its marker', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + removeResponseHeader('x-tss-raw') + return result + }), + createMiddleware().server(async ({ next }) => { + const result = await next() + const headers = new Headers(result.response.headers) + headers.delete('x-tss-raw') + return new Response(result.response.body, { + status: result.response.status, + headers, + }) + }), + ] + mocks.action = () => ({ result: new Response('raw result') }) + + const response = await callServerFn() + expect(response).toBeInstanceOf(Response) + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(await response.text()).toBe('raw result') + }) + + it('decodes framed RawStream results despite a raw response marker', async () => { + mocks.middleware = [ + createMiddleware().server(({ next }) => { + setResponseHeader('x-tss-raw', 'true') + return next() + }), + ] + mocks.action = () => ({ + result: new RawStream( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('stream result')) + controller.close() + }, + }), + ), + }) + + const decoded = await callServerFn() + expect(decoded).not.toBeInstanceOf(Response) + expect(await new Response(decoded.result).text()).toBe('stream result') + }) + + it('decodes action errors despite a raw response marker', async () => { + mocks.middleware = [ + createMiddleware().server(({ next }) => { + setResponseHeader('x-tss-raw', 'true') + return next() + }), + ] + mocks.action = () => { + setResponseStatus(409) + throw new Error('Session update conflict') + } + + await expect(callServerFn()).resolves.toEqual({ + error: new Error('Session update conflict'), + }) + }) + + it('decodes not-found results despite a raw response marker', async () => { + mocks.middleware = [ + createMiddleware().server(({ next }) => { + setResponseHeader('x-tss-raw', 'true') + return next() + }), + ] + mocks.action = () => { + throw notFound({ data: 'missing' }) + } + + await expect(callServerFn()).rejects.toMatchObject({ + isNotFound: true, + data: 'missing', + }) + }) + + it('owns protocol markers supplied in redirect headers', async () => { + mocks.action = () => ({ + result: redirect({ + href: '/login', + headers: { 'x-tss-raw': 'true', 'x-tss-serialized': 'true' }, + }), + }) + + await expect(callServerFn()).rejects.toSatisfy((value: unknown) => { + return isRedirect(value) && value.options.href === '/login' + }) + }) + + it('owns protocol markers supplied in error headers', async () => { + mocks.action = () => { + throw Object.assign(new Error('Session update conflict'), { + status: 409, + headers: { 'x-tss-raw': 'true' }, + }) + } + + await expect(callServerFn()).resolves.toEqual({ + error: new Error('Session update conflict'), + }) + }) + + it('owns protocol markers supplied in not-found headers', async () => { + mocks.action = () => { + throw notFound({ + data: 'missing', + headers: { 'x-tss-raw': 'true', 'x-tss-serialized': 'true' }, + }) + } + + await expect(callServerFn()).rejects.toMatchObject({ + isNotFound: true, + data: 'missing', + }) + }) + + it('keeps an explicitly returned response raw after middleware clears headers', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + clearResponseHeaders() + setResponseHeader('x-tss-serialized', 'true') + return result + }), + ] + mocks.action = () => ({ result: new Response('raw result') }) + + const response = await callServerFn() + expect(response).toBeInstanceOf(Response) + expect(await response.text()).toBe('raw result') + }) +}) + +it('preserves protocol requirements when request middleware rejects a HEAD RPC', async () => { + mocks.middleware = [ + createMiddleware().server(() => { + setResponseHeader('content-type', 'text/plain') + setResponseHeader('x-tss-raw', 'true') + appendResponseHeader('vary', 'Origin') + throw Object.assign(new Error('HEAD request rejected'), { status: 401 }) + }), + ] + const response = await app()( + new Request('https://start.example/_serverFn/test', { + method: 'HEAD', + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + expect(response.status).toBe(401) + expect(response.body).toBeNull() + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('vary')).toBe('Origin') +}) + +it('unwinds aborted request middleware error serialization', async () => { + let resolvePending!: () => void + const pending = new Promise((resolve) => { + resolvePending = resolve + }) + let serializationStarted!: () => void + const started = new Promise((resolve) => { + serializationStarted = resolve + }) + const failure = { + status: 500, + get pending() { + serializationStarted() + return pending + }, + } + mocks.middleware = [ + createMiddleware().server(() => { + throw failure + }), + ] + const controller = new AbortController() + const reason = new Error('request disconnected') + let outcome: { response: Response } | { error: unknown } | undefined + const request = app()( + new Request('https://start.example/_serverFn/test', { + signal: controller.signal, + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + const settled = Promise.resolve(request).then( + (response) => { + outcome = { response } + }, + (error) => { + outcome = { error } + }, + ) + + await started + controller.abort(reason) + try { + // Abort propagation is promise work. Drain this turn without imposing a + // timing deadline or resolving the application-owned pending value. + await new Promise((resolve) => setImmediate(resolve)) + expect(outcome).toEqual({ error: reason }) + } finally { + resolvePending() + await settled + } +}) + +it('keeps RPC protocol metadata through a same-body wrapper', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + setResponseHeader('content-type', 'text/plain') + const result = await next() + return new Response(result.response.body, result.response) + }), + ] + mocks.action = () => ({ result: 'still serialized' }) + + await expect(callServerFn()).resolves.toEqual({ result: 'still serialized' }) +}) + +it('applies helper appends to the fresh headers of a same-body wrapper', async () => { + mocks.middleware = [ + createMiddleware().server(async ({ next }) => { + appendResponseHeader('vary', 'Origin') + const result = await next() + return new Response(result.response.body, { + headers: { vary: 'Accept-Language' }, + }) + }), + ] + mocks.action = () => ({ result: 'still serialized' }) + + const response = await app()( + new Request('https://start.example/_serverFn/test', { + headers: { 'x-tsr-serverFn': 'true' }, + }), + {}, + ) + expect(response.headers.get('vary')).toBe('Accept-Language, Origin') + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + await response.body?.cancel() +}) diff --git a/packages/start-server-core/tests/request-response.test.ts b/packages/start-server-core/tests/request-response.test.ts new file mode 100644 index 0000000000..913407be36 --- /dev/null +++ b/packages/start-server-core/tests/request-response.test.ts @@ -0,0 +1,48 @@ +import { describe, expect, it, vi } from 'vitest' +import { createServerEntry, getRequestUrl } from '../src/request-response' + +describe('server entry pathname validation', () => { + it.each([ + '/malformed/%E0%A4', + '/malformed/%80', + '/malformed/%FF', + '/malformed/%', + '/malformed/%2', + '/malformed/%GG', + ])('rejects %s before calling the entry', async (pathname) => { + const fetch = vi.fn(() => new Response('unused')) + const entry = createServerEntry({ fetch }) + + const response = await entry.fetch( + new Request(`http://localhost${pathname}`), + ) + + expect(response.status).toBe(400) + expect(response.statusText).toBe('Bad Request') + expect(response.body).toBeNull() + expect(fetch).not.toHaveBeenCalled() + }) + + it.each([ + '/plain', + '/%2Fdocs', + '/%25', + '/%5Cdocs', + '/%E2%9C%93', + '/%252Fdocs', + '/%2Fdocs?searchParam=%E0%A4', + '/plain?searchParam=%GG', + ])('preserves the pathname and search of %s', async (path) => { + const fetch = vi.fn(() => { + const url = getRequestUrl() + return new Response(url.pathname + url.search) + }) + const entry = createServerEntry({ fetch }) + + const response = await entry.fetch(new Request(`http://localhost${path}`)) + + expect(response.status).toBe(200) + await expect(response.text()).resolves.toBe(path) + expect(fetch).toHaveBeenCalledTimes(1) + }) +}) diff --git a/packages/start-server-core/tests/response-reconciliation.bench.md b/packages/start-server-core/tests/response-reconciliation.bench.md new file mode 100644 index 0000000000..a9a6c09172 --- /dev/null +++ b/packages/start-server-core/tests/response-reconciliation.bench.md @@ -0,0 +1,40 @@ +# Response reconciliation benchmarks + +Run this local Vitest suite separately from the historical built-app SSR +benchmarks. It does not enable CodSpeed instrumentation: + +```sh +CI=1 NX_DAEMON=false pnpm nx run @tanstack/start-server-core:test:perf --outputStyle=stream --skipRemoteCache -- --run +``` + +These cases call the public Start handler, middleware, and response helpers. Only +the compiler's virtual entry modules and server-function resolver are supplied by +the fixture. Request dispatch, CSRF, serialization, and reconciliation use their +real implementations. Workspace dependencies are built by Nx; this package's +source is loaded through its existing Vitest aliases. + +Each case runs assertions before measurement, then dispatches 160 deterministic +GET requests per batch with eight workers and drains every response body. The +cases cover unchanged protocol headers, repairs in two middleware layers, helper +set/append/cookie writes before and after `next()`, and raw responses with three +separate cookies and 0, 4, or 20 extra headers. Each raw size runs with both +unchanged and repaired protocol headers, so an optimization that scans all +headers cannot hide its cost behind the repair cases' early exit. + +Two additional cases throw the public `notFound()` error, with and without +supplied headers, through the same handler and protocol-repair middleware. The +supplied-header case reuses caller-owned headers with a normal header, incorrect +transport headers, and three cookies. Assertions before measurement check the +404 status, JSON body, transport normalization, cookie preservation, and caller +header immutability. Timed batches validate the 404 status and drain each body, +using the same request count, concurrency, and seed as the existing nine cases. + +Copy the same benchmark and config to both revisions for a comparison. Keep the +Node version, V8 flags, batch size, and case names unchanged; compare against the +unoptimized response-reconciliation branch to measure these newly introduced +mechanisms. These focused source benchmarks supplement the production SSR app +suite; they do not replace its cross-framework or CodSpeed results. + +Use `--reporter=json --outputFile=/tmp/response-baseline.json` and a separate +candidate output file to preserve both runs' timing statistics; each test case +in the JSON report carries its `benchmarks` results. diff --git a/packages/start-server-core/tests/response-reconciliation.bench.ts b/packages/start-server-core/tests/response-reconciliation.bench.ts new file mode 100644 index 0000000000..389b6af847 --- /dev/null +++ b/packages/start-server-core/tests/response-reconciliation.bench.ts @@ -0,0 +1,391 @@ +import { afterAll, describe, expect, test, vi } from 'vitest' +import { fromCrossJSON } from 'seroval' +import { notFound, redirect } from '@tanstack/router-core' +import { + createCsrfMiddleware, + createMiddleware, +} from '@tanstack/start-client-core' +import { runRequestLoop } from '../../../benchmarks/ssr/bench-utils' +import { createStartHandler } from '../src/createStartHandler' +import { + appendResponseHeader, + setCookie, + setResponseHeader, + setResponseStatus, +} from '../src/request-response' + +const fixture = vi.hoisted(() => { + const previousServerFnBase = process.env.TSS_SERVER_FN_BASE + process.env.TSS_SERVER_FN_BASE = '/_serverFn/' + return { previousServerFnBase } +}) + +// Supply the compiler's virtual entries while keeping the real request, +// server-function transport, serialization, and reconciliation implementations. +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ requestMiddleware, serializationAdapters: [] }), + }, +})) +vi.mock('#tanstack-router-entry', () => ({ + getRouter: () => { + throw new Error('Server-function requests should not create a router') + }, +})) +vi.mock('#tanstack-start-server-fn-resolver', () => ({ + getServerFnById: (id: string) => { + const action = actions.get(id) + if (!action) { + throw new Error(`Unknown benchmark function: ${id}`) + } + return action + }, +})) + +function responseMiddleware(layer: string) { + return createMiddleware().server(async ({ request, next }) => { + const helpers = request.url.includes('/serialized-helpers?') + if (helpers) { + setResponseHeader('x-helper', layer) + appendResponseHeader('x-steps', `${layer}-before`) + setCookie(layer, 'before') + } + + const result = await next() + + if (helpers) { + appendResponseHeader('x-steps', `${layer}-after`) + setCookie(layer, 'after') + } + if (request.url.includes('/raw-')) { + if (!request.url.includes('/raw-unchanged-')) { + result.response.headers.delete('x-tss-raw') + } + } else if (!request.url.includes('/serialized-unchanged?')) { + result.response.headers.set('content-type', 'text/plain') + result.response.headers.delete('x-tss-serialized') + result.response.headers.set('x-tss-raw', 'true') + } + + return result + }) +} + +const requestMiddleware = [ + createCsrfMiddleware(), + responseMiddleware('outer'), + responseMiddleware('inner'), +] +const cookies = [ + 'first=one; Path=/', + 'second=two; Path=/', + 'third=three; Path=/', +] +const result = { answer: 42, label: 'response-reconciliation' } +const scenarios = [ + { + id: 'serialized-unchanged', + name: 'serialized response with unchanged protocol headers', + extraHeaders: undefined, + action: () => ({ result }), + }, + { + id: 'serialized-repaired', + name: 'serialized response with two protocol repairs', + extraHeaders: undefined, + action: () => ({ result }), + }, + { + id: 'serialized-helpers', + name: 'serialized response with two protocol repairs and helper writes', + extraHeaders: undefined, + action: () => ({ result }), + }, + { + id: 'serialized-protected-helpers', + name: 'serialized response with two protocol repairs and only protected helper writes', + extraHeaders: undefined, + action: () => { + // These writes create helper state but cannot change the JSON transport. + // Compare with serialized-repaired to expose needless header allocation + // while preserving every established middleware path and workload. + setResponseHeader('content-type', 'text/plain') + setResponseHeader('x-tss-serialized', 'false') + setResponseHeader('x-tss-raw', 'true') + return { result } + }, + }, + ...[0, 4, 20].flatMap((extraHeaders) => + [false, true].map((repair) => ({ + id: `raw-${repair ? 'repaired' : 'unchanged'}-${extraHeaders}`, + name: `raw response with ${repair ? 'two protocol repairs' : 'unchanged protocol headers'}, ${extraHeaders} extra headers and three cookies`, + extraHeaders, + action: () => { + const headers = new Headers({ 'content-type': 'text/plain' }) + for (let index = 0; index < extraHeaders; index++) { + headers.set(`x-extra-${index}`, `value-${index}`) + } + for (const cookie of cookies) { + headers.append('set-cookie', cookie) + } + return { result: new Response('raw-response', { headers }) } + }, + })), + ), +] +const notFoundHeaders = new Headers({ + 'content-type': 'text/plain', + 'x-tss-serialized': 'true', + 'x-tss-raw': 'true', + 'x-not-found': 'preserved', +}) +for (const cookie of cookies) { + notFoundHeaders.append('set-cookie', cookie) +} +const originalNotFoundHeaders = Array.from(notFoundHeaders) +const notFoundScenarios = [ + { + id: 'not-found-without-headers', + name: 'not-found response without supplied headers', + headers: undefined, + action: () => { + throw notFound() + }, + }, + { + id: 'not-found-with-headers', + name: 'not-found response with supplied headers and three cookies', + headers: notFoundHeaders, + action: () => { + throw notFound({ headers: notFoundHeaders }) + }, + }, +] +const redirectHref = '/redirect-target' +const redirectHeaders = new Headers({ + 'content-type': 'text/plain', + 'x-tss-serialized': 'true', + 'x-tss-raw': 'true', + 'x-redirect': 'preserved', + 'x-helper': 'caller', + 'x-steps': 'source', +}) +for (const cookie of cookies) { + redirectHeaders.append('set-cookie', cookie) +} +const originalRedirectHeaders = Array.from(redirectHeaders) +const redirectScenarios = [ + { + id: 'redirect-without-helpers', + name: 'RPC href redirect without helper writes', + status: 200, + statusText: '', + headers: undefined, + action: () => { + throw redirect({ href: redirectHref }) + }, + }, + { + id: 'redirect-with-headers-and-helpers', + name: 'RPC href redirect with supplied headers, three cookies and helper writes', + status: 202, + statusText: 'Accepted', + headers: redirectHeaders, + action: () => { + // Keep these writes out of the shared middleware so the established + // eleven workloads remain unchanged. + setResponseStatus(202, 'Accepted') + setResponseHeader('x-helper', 'complete') + setResponseHeader('content-type', 'text/plain') + setResponseHeader('location', '/ignored') + setResponseHeader('x-tss-serialized', 'true') + setResponseHeader('x-tss-raw', 'true') + appendResponseHeader('x-steps', 'before') + appendResponseHeader('x-steps', 'after') + setCookie('first', 'updated') + setCookie('helper', 'added') + throw redirect({ href: redirectHref, headers: redirectHeaders }) + }, + }, +] +const actions = new Map( + [...scenarios, ...notFoundScenarios, ...redirectScenarios].map((scenario) => [ + scenario.id, + scenario.action, + ]), +) + +const fetch = createStartHandler(() => { + throw new Error('Server-function requests should not render HTML') +}) +const handler = { fetch: (request: Request) => fetch(request, {}) } +const requestHeaders = { + 'x-tsr-serverFn': 'true', + 'sec-fetch-site': 'same-origin', + accept: 'application/json', +} + +function requestFor(id: string, sample: number) { + return new Request(`http://localhost/_serverFn/${id}?sample=${sample}`, { + headers: requestHeaders, + }) +} + +// Assertions run once before timed batches. The hot loops only dispatch and +// drain responses; they never decode JSON or run assertion-library matchers. +for (const scenario of scenarios) { + const response = await handler.fetch(requestFor(scenario.id, 0)) + expect(response.status).toBe(200) + if (scenario.extraHeaders === undefined) { + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(fromCrossJSON(await response.json(), {})).toEqual({ result }) + if (scenario.id === 'serialized-helpers') { + expect(response.headers.get('x-helper')).toBe('inner') + expect(response.headers.get('x-steps')).toBe( + 'outer-before, inner-before, inner-after, outer-after', + ) + expect(response.headers.getSetCookie().sort()).toEqual([ + 'inner=after; Path=/', + 'outer=after; Path=/', + ]) + } + } else { + expect(response.headers.get('content-type')).toBe('text/plain') + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(response.headers.get('x-tss-serialized')).toBeNull() + expect(response.headers.getSetCookie()).toEqual(cookies) + for (let index = 0; index < scenario.extraHeaders; index++) { + expect(response.headers.get(`x-extra-${index}`)).toBe(`value-${index}`) + } + expect(await response.text()).toBe('raw-response') + } +} + +for (const scenario of notFoundScenarios) { + const response = await handler.fetch(requestFor(scenario.id, 0)) + expect(response.status).toBe(404) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBeNull() + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('x-not-found')).toBe( + scenario.headers ? 'preserved' : null, + ) + expect(response.headers.getSetCookie()).toEqual( + scenario.headers ? cookies : [], + ) + expect(Array.from(notFoundHeaders)).toEqual(originalNotFoundHeaders) + expect(await response.json()).toEqual({ isNotFound: true }) +} + +for (const scenario of redirectScenarios) { + const response = await handler.fetch(requestFor(scenario.id, 0)) + expect(response.status).toBe(scenario.status) + expect(response.statusText).toBe(scenario.statusText) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('location')).toBeNull() + expect(response.headers.get('x-tss-serialized')).toBeNull() + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('x-redirect')).toBe( + scenario.headers ? 'preserved' : null, + ) + expect(response.headers.get('x-helper')).toBe( + scenario.headers ? 'complete' : null, + ) + expect(response.headers.get('x-steps')).toBe( + scenario.headers ? 'source, before, after' : null, + ) + expect(response.headers.getSetCookie()).toEqual( + scenario.headers + ? [ + 'second=two; Path=/', + 'third=three; Path=/', + 'first=updated; Path=/', + 'helper=added; Path=/', + ] + : [], + ) + expect(Array.from(redirectHeaders)).toEqual(originalRedirectHeaders) + expect(await response.json()).toEqual({ + href: redirectHref, + statusCode: 307, + isSerializedRedirect: true, + }) +} + +function validateNotFoundResponse(response: Response) { + if (response.status !== 404) { + throw new Error(`Expected not-found response, received ${response.status}`) + } +} + +afterAll(() => { + if (fixture.previousServerFnBase === undefined) { + Reflect.deleteProperty(process.env, 'TSS_SERVER_FN_BASE') + } else { + process.env.TSS_SERVER_FN_BASE = fixture.previousServerFnBase + } +}) + +describe('response reconciliation', () => { + for (const scenario of scenarios) { + test(scenario.name, async ({ bench }) => { + await bench(scenario.name, () => + runRequestLoop(handler, { + seed: 0xdecafbad, + concurrency: 8, + totalRequests: 160, + buildRequest: (random) => + requestFor(scenario.id, Math.floor(random() * 1_000_000)), + }), + ).run({ + warmupIterations: 100, + time: 5_000, + throws: true, + }) + }) + } + for (const scenario of notFoundScenarios) { + test(scenario.name, async ({ bench }) => { + await bench(scenario.name, () => + runRequestLoop(handler, { + seed: 0xdecafbad, + concurrency: 8, + totalRequests: 160, + buildRequest: (random) => + requestFor(scenario.id, Math.floor(random() * 1_000_000)), + validateResponse: validateNotFoundResponse, + }), + ).run({ + warmupIterations: 100, + time: 5_000, + throws: true, + }) + }) + } + for (const scenario of redirectScenarios) { + test(scenario.name, async ({ bench }) => { + await bench(scenario.name, () => + runRequestLoop(handler, { + seed: 0xdecafbad, + concurrency: 8, + totalRequests: 160, + buildRequest: (random) => + requestFor(scenario.id, Math.floor(random() * 1_000_000)), + validateResponse: (response) => { + if (response.status !== scenario.status) { + throw new Error( + `Expected redirect envelope status ${scenario.status}, received ${response.status}`, + ) + } + }, + }), + ).run({ + warmupIterations: 100, + time: 5_000, + throws: true, + }) + }) + } +}) diff --git a/packages/start-server-core/tests/server-functions-handler.test.ts b/packages/start-server-core/tests/server-functions-handler.test.ts new file mode 100644 index 0000000000..434a06efca --- /dev/null +++ b/packages/start-server-core/tests/server-functions-handler.test.ts @@ -0,0 +1,554 @@ +// @vitest-environment node + +import { beforeEach, expect, test, vi } from 'vitest' +import { createStream, fromCrossJSON } from 'seroval' +import { + TSS_CONTENT_TYPE_FRAMED_VERSIONED, + X_TSS_SERIALIZED, +} from '@tanstack/start-client-core' +import { + FRAME_HEADER_SIZE, + FRAME_TYPE_CHUNK, + FRAME_TYPE_JSON, + MAX_FRAMED_STREAMS, +} from '@tanstack/start-client-core/client-rpc' +import { RawStream } from '@tanstack/router-core' +import { defaultSerovalDeserializerPlugins } from '@tanstack/router-core/ssr/server' +import { + DeferredResponse, + handleServerAction, +} from '../src/server-functions-handler' +import { createServerEntry, setResponseStatus } from '../src/request-response' +import { getStartEvent } from '../src/internal-request-response' +import type * as StartClientCore from '@tanstack/start-client-core' + +const mocks = vi.hoisted(() => ({ + action: vi.fn(), +})) + +vi.mock('../src/getServerFnById', () => ({ + getServerFnById: () => mocks.action, +})) + +vi.mock('@tanstack/start-client-core', async (importOriginal) => { + const actual = await importOriginal() + const { defaultSerovalDeserializerPlugins } = + await import('@tanstack/router-core/ssr/server') + return { + ...actual, + getSerovalPlugins: () => defaultSerovalDeserializerPlugins, + } +}) + +beforeEach(() => { + mocks.action.mockReset() +}) + +function callServerAction(options: Parameters[0]) { + return createServerEntry({ + fetch: async () => { + const result = await handleServerAction(options) + return result instanceof DeferredResponse + ? result.createResponse(getStartEvent()) + : result + }, + }).fetch(options.request) +} + +async function readFrames(response: Response) { + const frames: Array<{ type: number; payload: Uint8Array }> = [] + const reader = response.body!.getReader() + for (;;) { + const { done, value } = await reader.read() + if (done) { + return frames + } + frames.push({ + type: value[0]!, + payload: value.slice(FRAME_HEADER_SIZE), + }) + } +} + +function expectRawReferenceBeforeChunk( + frames: Array<{ type: number; payload: Uint8Array }>, +) { + const chunkIndex = frames.findIndex( + (frame) => frame.type === FRAME_TYPE_CHUNK, + ) + const referenceIndex = frames.findIndex( + (frame) => + frame.type === FRAME_TYPE_JSON && + new TextDecoder().decode(frame.payload).includes('tss/RawStream'), + ) + expect(referenceIndex).toBeGreaterThanOrEqual(0) + expect(chunkIndex).toBeGreaterThan(referenceIndex) +} + +test.each([false, 0, '', null])( + 'preserves the direct server-function result %j', + async (result) => { + mocks.action.mockResolvedValue({ result }) + + await expect( + handleServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + }), + serverFnId: 'test', + }), + ).resolves.toBe(result) + }, +) + +test('serializes a complete direct JSON record without LF', async () => { + mocks.action.mockResolvedValue({ result: { value: 'complete' } }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + const encoded = await response.text() + const parsed = JSON.parse(encoded) + expect(encoded).toBe(JSON.stringify(parsed)) + expect(encoded).not.toContain('\n') +}) + +test('cancelling a framed response disposes its serializer', async () => { + const cancel = vi.fn() + const source = new ReadableStream({ + cancel, + }) + mocks.action.mockResolvedValue({ result: source }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expect(source.locked).toBe(true) + await response.body!.cancel('client disconnected') + expect(cancel).toHaveBeenCalledOnce() + expect(source.locked).toBe(false) +}) + +test('aborting the request disposes a handed-off framed response', async () => { + const abortController = new AbortController() + const reason = new Error('request aborted') + const cancel = vi.fn() + const source = new ReadableStream({ cancel }) + mocks.action.mockResolvedValue({ result: new RawStream(source) }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + signal: abortController.signal, + }), + serverFnId: 'test', + }) + + await vi.waitFor(() => { + expect(source.locked).toBe(true) + }) + abortController.abort(reason) + await vi.waitFor(() => { + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(reason) + expect(source.locked).toBe(false) + }) + await expect(response.body!.getReader().read()).rejects.toBe(reason) +}) + +test('cancels synchronous RawStreams without pulling when the request is already aborted', async () => { + const abortController = new AbortController() + const reason = new Error('request already aborted') + abortController.abort(reason) + const sources = Array.from({ length: 3 }, () => { + const cancel = vi.fn(() => new Promise(() => {})) + const pull = vi.fn() + const stream = new ReadableStream( + { pull, cancel }, + { highWaterMark: 0 }, + ) + return { stream, pull, cancel } + }) + mocks.action.mockResolvedValue({ + result: sources.map(({ stream }) => new RawStream(stream)), + }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + signal: abortController.signal, + }), + serverFnId: 'test', + }) + + await expect(response.body!.getReader().read()).rejects.toBe(reason) + await new Promise((resolve) => setTimeout(resolve, 0)) + for (const { stream, pull, cancel } of sources) { + expect(pull).not.toHaveBeenCalled() + expect(cancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(stream.locked).toBe(false) + } +}) + +test('bounds and cancels synchronous RawStreams when their response remains unread', async () => { + const sources = Array.from({ length: 3 }, () => { + const cancel = vi.fn() + const pull = vi.fn( + (controller: ReadableStreamDefaultController) => { + controller.enqueue(new Uint8Array(64 * 1024)) + }, + ) + const stream = new ReadableStream( + { pull, cancel }, + { highWaterMark: 0 }, + ) + return { stream, pull, cancel } + }) + mocks.action.mockResolvedValue({ + result: sources.map(({ stream }) => new RawStream(stream)), + }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(sources.map(({ pull }) => pull.mock.calls.length)).toEqual([1, 1, 1]) + const reason = new Error('client disconnected') + await response.body!.cancel(reason) + await new Promise((resolve) => setTimeout(resolve, 0)) + for (const { stream, pull, cancel } of sources) { + expect(pull).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledExactlyOnceWith(reason) + expect(stream.locked).toBe(false) + } +}) + +test('a synchronous serialization failure cancels registered raw streams', async () => { + const cancel = vi.fn() + const source = new ReadableStream({ cancel }) + mocks.action.mockResolvedValue({ + result: { + raw: new RawStream(source), + unsupported: () => {}, + }, + }) + const consoleInfo = vi.spyOn(console, 'info').mockImplementation(() => {}) + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + + try { + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expect(cancel).toHaveBeenCalledOnce() + expect(cancel).toHaveBeenCalledWith(expect.any(Error)) + expect(source.locked).toBe(false) + expect(response.headers.get(X_TSS_SERIALIZED)).toBe('true') + expect(response.headers.get('content-type')).toBe('application/json') + expect( + fromCrossJSON<{ error: unknown }>(await response.json(), { + plugins: defaultSerovalDeserializerPlugins, + }).error, + ).toBeInstanceOf(Error) + } finally { + consoleInfo.mockRestore() + consoleError.mockRestore() + } +}) + +test('admits replayed nested RawStream references before their chunks', async () => { + const source = new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([1])) + controller.close() + }, + }) + const replayed = createStream() + replayed.next(new RawStream(source)) + replayed.return(undefined) + mocks.action.mockResolvedValue({ result: { replayed } }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expectRawReferenceBeforeChunk(await readFrames(response)) +}) + +test('frames every record from a synchronously replayed Seroval stream', async () => { + const replayed = createStream() + replayed.next(1) + replayed.return(undefined) + mocks.action.mockResolvedValue({ result: { replayed } }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expect(response.headers.get('content-type')).toBe( + TSS_CONTENT_TYPE_FRAMED_VERSIONED, + ) + const frames = await readFrames(response) + expect(frames.every((frame) => frame.type === FRAME_TYPE_JSON)).toBe(true) + expect(frames.length).toBeGreaterThan(1) + + const refs = new Map() + let result: any + for (let index = 0; index < frames.length; index++) { + const encoded = new TextDecoder().decode(frames[index]!.payload) + const parsed = JSON.parse(encoded) + expect(encoded).toBe(JSON.stringify(parsed)) + expect(encoded).not.toContain('\n') + const value = fromCrossJSON(parsed, { + refs, + plugins: defaultSerovalDeserializerPlugins, + }) + if (index === 0) { + result = value + } + } + + const events: Array<[string, unknown]> = [] + result.result.replayed.on({ + next(value: unknown) { + events.push(['next', value]) + }, + throw(error: unknown) { + events.push(['throw', error]) + }, + return(value: unknown) { + events.push(['return', value]) + }, + }) + expect(events).toEqual([ + ['next', 1], + ['return', undefined], + ]) +}) + +test('keeps work discovered after a transient synchronous completion', async () => { + const replayed = createStream() + replayed.return(undefined) + let resolveLate!: (value: RawStream) => void + const late = new Promise((resolve) => { + resolveLate = resolve + }) + mocks.action.mockResolvedValue({ result: { replayed, late } }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + resolveLate( + new RawStream( + new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([1])) + controller.close() + }, + }), + ), + ) + + expectRawReferenceBeforeChunk(await readFrames(response)) +}) + +test('bounds synchronously replayed Seroval records before framing', async () => { + const replayed = createStream() + for (let index = 0; index < 1025; index++) { + replayed.next(index) + } + replayed.return(undefined) + mocks.action.mockResolvedValue({ result: { replayed } }) + const consoleInfo = vi.spyOn(console, 'info').mockImplementation(() => {}) + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + + try { + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + const { error } = fromCrossJSON<{ error: unknown }>(await response.json(), { + plugins: defaultSerovalDeserializerPlugins, + }) + expect(error).toBeInstanceOf(Error) + expect((error as Error).message).toContain('pending output limit') + } finally { + consoleInfo.mockRestore() + consoleError.mockRestore() + } +}) + +test('admits late RawStream references before their chunks', async () => { + let resolveRawStream!: (value: RawStream) => void + const lateRawStream = new Promise((resolve) => { + resolveRawStream = resolve + }) + mocks.action.mockResolvedValue({ result: { lateRawStream } }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + resolveRawStream( + new RawStream( + new ReadableStream({ + start(controller) { + controller.enqueue(new Uint8Array([2])) + controller.close() + }, + }), + ), + ) + + expectRawReferenceBeforeChunk(await readFrames(response)) +}) + +test('rejects a non-ASCII JSON record larger than the wire limit', async () => { + const cancel = vi.fn() + const source = new ReadableStream({ cancel }) + mocks.action.mockResolvedValue({ + result: { + // UTF-16 length is within the old limit, but UTF-8 is over 16 MiB. + value: 'é'.repeat(8 * 1024 * 1024), + raw: new RawStream(source), + }, + }) + + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expect(cancel).toHaveBeenCalledOnce() + expect(source.locked).toBe(false) + // Nothing reached the client yet, so the whole call fails. + expect(response.status).toBe(500) + expect(response.headers.get('content-type')).toBe('application/json') + expect(await response.text()).toContain('pending output limit') +}) + +test.each(['RawStream', 'ReadableStream'])( + 'serializes %s results despite a bodyless helper status', + async (kind) => { + const cancel = vi.fn() + const source = new ReadableStream({ cancel }) + mocks.action.mockImplementation(() => { + setResponseStatus(204, 'No Content') + return { + result: kind === 'RawStream' ? new RawStream(source) : source, + } + }) + const consoleInfo = vi.spyOn(console, 'info').mockImplementation(() => {}) + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + const consoleWarn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + try { + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + // Serialized replies always carry a body for the client to decode. + expect(response.status).toBe(200) + expect(response.statusText).toBe('') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(consoleWarn).toHaveBeenCalledOnce() + const reason = new Error('client disconnected') + await response.body!.cancel(reason) + await vi.waitFor(() => expect(cancel).toHaveBeenCalledOnce()) + } finally { + consoleInfo.mockRestore() + consoleError.mockRestore() + consoleWarn.mockRestore() + } + }, +) + +test('rejects excess RawStreams before starting their readers', async () => { + let pullCount = 0 + let cancelCount = 0 + const sources = Array.from( + { length: MAX_FRAMED_STREAMS + 1 }, + () => + new ReadableStream( + { + pull() { + pullCount++ + }, + cancel() { + cancelCount++ + }, + }, + { highWaterMark: 0 }, + ), + ) + mocks.action.mockResolvedValue({ + result: sources.map((source) => new RawStream(source)), + }) + const consoleInfo = vi.spyOn(console, 'info').mockImplementation(() => {}) + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + + try { + const response = await callServerAction({ + request: new Request('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'x-tsr-serverFn': 'true' }, + }), + serverFnId: 'test', + }) + + expect(response.headers.get('content-type')).toBe('application/json') + expect(pullCount).toBe(0) + expect(cancelCount).toBe(MAX_FRAMED_STREAMS + 1) + expect(sources.every((source) => !source.locked)).toBe(true) + } finally { + consoleInfo.mockRestore() + consoleError.mockRestore() + } +}) diff --git a/packages/start-server-core/tests/server-functions-reconciliation.test.ts b/packages/start-server-core/tests/server-functions-reconciliation.test.ts new file mode 100644 index 0000000000..a924fa96e4 --- /dev/null +++ b/packages/start-server-core/tests/server-functions-reconciliation.test.ts @@ -0,0 +1,1588 @@ +// @vitest-environment node + +import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' +import { fromCrossJSON, toJSON } from 'seroval' +import { + RawStream, + isNotFound, + isRedirect, + notFound, + redirect, +} from '@tanstack/router-core' +import { + TSS_FORMDATA_CONTEXT, + TSS_CONTENT_TYPE_FRAMED_VERSIONED, + createCsrfMiddleware, + createMiddleware, + createServerFn, +} from '@tanstack/start-client-core' +import { createStartHandler } from '../src/createStartHandler' +import { + FRAME_HEADER_SIZE, + FRAME_TYPE_CHUNK, + FRAME_TYPE_END, + FRAME_TYPE_JSON, + createClientRpc, +} from '@tanstack/start-client-core/client-rpc' +import { + appendResponseHeader, + getRequestUrl, + getResponseHeader, + setCookie, + setResponseHeader, + setResponseStatus, +} from '../src/request-response' +import { createServerRpc } from '../src/createServerRpc' +import { createSsrRpc } from '../src/createSsrRpc' +import { ServerFunctionSerializationAdapter } from '../src/serializer/ServerFunctionSerializationAdapter' +import type { AnyFunctionMiddleware } from '@tanstack/start-client-core' + +const serverFnMocks = vi.hoisted(() => { + const previousServerFnBase = process.env.TSS_SERVER_FN_BASE + process.env.TSS_SERVER_FN_BASE = '/_serverFn/' + return { + previousServerFnBase, + middleware: [] as Array, + action: undefined as + | undefined + | (ReturnType & { method: string }), + } +}) + +vi.mock('#tanstack-start-entry', () => ({ + startInstance: { + getOptions: () => ({ + requestMiddleware: serverFnMocks.middleware, + serializationAdapters: [], + }), + }, +})) + +vi.mock('../src/getServerFnById', () => ({ + getServerFnById: () => serverFnMocks.action, +})) + +// Run the public client RPC in Node without the compiler's browser replacement. +vi.mock('../../start-client-core/dist/esm/getStartOptions.js', () => ({ + getStartOptions: () => undefined, +})) + +function createServerFunctionRequest( + input = 'http://localhost/_serverFn/test', + init?: RequestInit, +) { + const headers = new Headers(init?.headers) + headers.set('x-tsr-serverFn', 'true') + return new Request(input, { ...init, headers }) +} + +function createAction(method = 'GET') { + return Object.assign(vi.fn(), { method }) +} + +function createHandler() { + return createStartHandler(() => { + throw new Error('Server function requests should not render HTML') + }) +} + +type CallServerFn = (opts?: { + data?: unknown + fetch?: (input: string, init: RequestInit) => Promise +}) => Promise +type AttachHandler = (...args: Array) => CallServerFn & { + __executeServer: (opts: unknown) => Promise +} + +// Calls server function `test` through the client stub a compiled GET call +// site uses, which rethrows failed calls. +function callClientServerFn( + fetch: (input: string, init: RequestInit) => Promise, +) { + return (createServerFn().handler as unknown as AttachHandler)( + createClientRpc('test'), + )({ fetch }) +} + +// Compiled shape of a server function: the provider module registers the +// RPC entry, and callers get a client or server-side stub with the same +// middleware. +function defineServerFn( + method: 'GET' | 'POST', + handler: () => unknown, + middleware: Array = [], +) { + const attach = (extractedFn: unknown, serverFn?: unknown) => + ( + createServerFn({ method }).middleware(middleware) + .handler as unknown as AttachHandler + )(extractedFn, serverFn) + const rpc = createServerRpc( + { id: 'test', name: 'test', filename: 'test.ts' }, + (opts: unknown) => provider.__executeServer(opts), + ) + const provider = attach(rpc, handler) + serverFnMocks.action = rpc as unknown as typeof serverFnMocks.action + const client = attach(createClientRpc('test')) + const onServer = attach(createSsrRpc('test')) + let response: Response | undefined + + return { + call: (data?: unknown) => + client({ + data, + fetch: async (input, init) => { + response = await createHandler()( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + return response + }, + }), + onServer, + response: () => response!, + } +} + +async function readFrames(response: Response) { + const reader = response.body!.getReader() + const frames: Array<{ + type: number + streamId: number + payload: Uint8Array + }> = [] + + while (true) { + const { done, value } = await reader.read() + if (done) { + break + } + const view = new DataView(value.buffer, value.byteOffset) + const length = view.getUint32(5, false) + frames.push({ + type: view.getUint8(0), + streamId: view.getUint32(1, false), + payload: value.slice(FRAME_HEADER_SIZE, FRAME_HEADER_SIZE + length), + }) + } + + return frames +} + +async function settle(promise: Promise) { + try { + return { resolved: await promise } + } catch (rejected) { + return { rejected } + } +} + +afterEach(() => { + serverFnMocks.action = undefined + serverFnMocks.middleware = [] +}) + +afterAll(() => { + if (serverFnMocks.previousServerFnBase === undefined) { + Reflect.deleteProperty(process.env, 'TSS_SERVER_FN_BASE') + } else { + process.env.TSS_SERVER_FN_BASE = serverFnMocks.previousServerFnBase + } +}) + +describe('server function response reconciliation', () => { + it.each(['GET', 'POST'] as const)( + 'preserves request middleware context through the %s RPC terminal', + async (method) => { + const requestContext = Object.freeze({ nonce: 'request' }) + const globalContext = Object.freeze({ + trusted: 'server', + global: 'yes', + }) + const clientContext = Object.freeze({ + trusted: 'client', + client: 'yes', + }) + const events: Array = [] + let resumedContext: unknown + serverFnMocks.middleware = [ + createMiddleware().server(async ({ next }) => { + events.push('outer before') + const result = await next({ context: globalContext }) + resumedContext = result.context + events.push('outer after') + appendResponseHeader('x-steps', 'outer after') + return result + }), + createMiddleware().server(({ next }) => { + events.push('inner') + return next({ context: { inner: 'yes' } }) + }), + ] + // A real server function merges the client context with the trusted + // server context, which wins. + defineServerFn(method, (({ context }: { context: unknown }) => { + events.push('action') + appendResponseHeader('x-steps', 'action') + return context + }) as () => unknown) + const payload = JSON.stringify(toJSON({ context: clientContext })) + const request = createServerFunctionRequest( + method === 'GET' + ? `http://localhost/_serverFn/test?payload=${encodeURIComponent(payload)}` + : 'http://localhost/_serverFn/test', + method === 'GET' + ? undefined + : { + method, + headers: { 'content-type': 'application/json' }, + body: payload, + }, + ) + + const response = await createHandler()(request, { + context: requestContext, + }) + + expect(response.status).toBe(200) + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-steps')).toBe('action, outer after') + expect(fromCrossJSON(await response.json(), {})).toEqual({ + result: { + nonce: 'request', + trusted: 'server', + global: 'yes', + client: 'yes', + inner: 'yes', + }, + }) + expect(resumedContext).toEqual({ + nonce: 'request', + trusted: 'server', + global: 'yes', + inner: 'yes', + }) + expect(events).toEqual(['outer before', 'inner', 'action', 'outer after']) + expect(requestContext).toEqual({ nonce: 'request' }) + expect(globalContext).toEqual({ trusted: 'server', global: 'yes' }) + expect(clientContext).toEqual({ trusted: 'client', client: 'yes' }) + }, + ) + + it.each([202, 204, 205, 304])( + 'includes helper writes made while serializing a synchronous result with status %s', + async (status) => { + const serialized = vi.fn(() => { + setResponseStatus(status, 'Serialized status') + setResponseHeader('x-serialized', 'yes') + appendResponseHeader('x-steps', 'serialized') + setCookie('session', 'serialized', { path: '/' }) + setResponseHeader('content-type', 'text/plain') + setResponseHeader('x-tss-raw', 'true') + return 'serialized value' + }) + const action = createAction() + action.mockReturnValue({ + result: { + get value() { + return serialized() + }, + }, + }) + serverFnMocks.action = action + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(serialized).toHaveBeenCalledOnce() + // A serialized reply always carries a body, so a bodyless helper status + // is ignored together with its status text. + expect(response.status).toBe(status === 202 ? 202 : 200) + expect(response.statusText).toBe( + status === 202 ? 'Serialized status' : '', + ) + expect(response.headers.get('x-serialized')).toBe('yes') + expect(response.headers.get('x-steps')).toBe('serialized') + expect(response.headers.getSetCookie()).toEqual([ + 'session=serialized; Path=/', + ]) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(fromCrossJSON(await response.json(), {})).toEqual({ + result: { value: 'serialized value' }, + }) + }, + ) + + it('keeps a returned fallback when the action it abandoned completes while an outer middleware awaits', async () => { + let releaseAction!: () => void + const actionCanFinish = new Promise((resolve) => { + releaseAction = resolve + }) + let pendingAction: Promise | undefined + const cancelFallback = vi.fn() + const fallback = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('fallback')) + controller.close() + }, + cancel: cancelFallback, + }), + { status: 504 }, + ) + serverFnMocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + releaseAction() + await pendingAction + return result + }), + createMiddleware().server(({ next }) => { + pendingAction = Promise.resolve(next()) + return fallback + }), + ] + const action = createAction() + action.mockImplementation(async () => { + await actionCanFinish + appendResponseHeader('x-steps', 'action') + return { result: 'completed' } + }) + serverFnMocks.action = action + + try { + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(action).toHaveBeenCalledOnce() + expect(cancelFallback).not.toHaveBeenCalled() + expect(response.status).toBe(504) + expect(response.headers.get('x-tss-serialized')).toBeNull() + // Helper writes belong to the request, so the abandoned action's + // writes still apply to the response that replaced its result. + expect(response.headers.get('x-steps')).toBe('action') + await expect(response.text()).resolves.toBe('fallback') + } finally { + releaseAction() + await pendingAction + } + }) + + it('keeps an early middleware response readable after a late JSON action completes', async () => { + let releaseAction!: () => void + const actionCanFinish = new Promise((resolve) => { + releaseAction = resolve + }) + let pendingAction: Promise | undefined + const cancelFallback = vi.fn() + const fallback = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('fallback')) + controller.close() + }, + cancel: cancelFallback, + }), + { status: 504, headers: { 'x-fallback': 'yes' } }, + ) + serverFnMocks.middleware = [ + createMiddleware().server(({ next }) => { + pendingAction = Promise.resolve(next()) + return fallback + }), + ] + const action = createAction() + action.mockImplementation(async () => { + await actionCanFinish + return { result: 'late' } + }) + serverFnMocks.action = action + + try { + const response = await createHandler()(createServerFunctionRequest(), {}) + expect(response.status).toBe(504) + + releaseAction() + await pendingAction + + expect(action).toHaveBeenCalledOnce() + expect(cancelFallback).not.toHaveBeenCalled() + expect(response.headers.get('x-fallback')).toBe('yes') + expect(response.headers.get('x-tss-serialized')).toBeNull() + await expect(response.text()).resolves.toBe('fallback') + } finally { + releaseAction() + await pendingAction + } + }) + + it('does not publish late JSON after a pending request is aborted', async () => { + const controller = new AbortController() + const reason = new Error('Request disconnected') + let releaseAction!: () => void + const actionCanFinish = new Promise((resolve) => { + releaseAction = resolve + }) + let actionStarted!: () => void + const started = new Promise((resolve) => { + actionStarted = resolve + }) + let observeResponse!: (value: string | undefined) => void + const observedResponse = new Promise((resolve) => { + observeResponse = resolve + }) + const serialized = vi.fn(() => { + // Observe the request after all late promise continuations have settled. + setImmediate(() => observeResponse(getResponseHeader('x-tss-serialized'))) + return 'late' + }) + const action = createAction() + action.mockImplementation(async () => { + actionStarted() + await actionCanFinish + return { + result: { + get value() { + return serialized() + }, + }, + } + }) + serverFnMocks.action = action + const pending = createHandler()( + createServerFunctionRequest('http://localhost/_serverFn/test', { + signal: controller.signal, + }), + {}, + ) + const rejected = expect(pending).rejects.toBe(reason) + try { + await started + controller.abort(reason) + await rejected + releaseAction() + await expect(observedResponse).resolves.toBeUndefined() + expect(serialized).toHaveBeenCalledOnce() + } finally { + releaseAction() + } + }) + + it('decodes a serialized reply that middleware pipes through a transform', async () => { + const action = createAction() + action.mockReturnValue({ result: 'delegated' }) + serverFnMocks.action = action + serverFnMocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + const response = new Response( + result.response.body!.pipeThrough(new TransformStream()), + result.response, + ) + response.headers.set('x-delegated', 'yes') + appendResponseHeader('x-steps', 'delegated') + return response + }), + ] + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-delegated')).toBe('yes') + expect(response.headers.get('x-steps')).toBe('delegated') + expect(fromCrossJSON(await response.json(), {})).toEqual({ + result: 'delegated', + }) + }) + + it('repairs protocol mutations attached to a directly returned next promise', async () => { + const action = createAction() + action.mockReturnValue({ result: 'completed' }) + serverFnMocks.action = action + serverFnMocks.middleware = [ + createMiddleware().server(({ next }) => { + const pending = next() + void Promise.resolve(pending).then((result) => { + result.response.headers.set('content-type', 'text/plain') + result.response.headers.delete('x-tss-serialized') + result.response.headers.set('x-tss-raw', 'true') + appendResponseHeader('x-steps', 'after-next') + }) + return pending + }), + ] + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(response.headers.get('x-steps')).toBe('after-next') + expect(fromCrossJSON(await response.json(), {})).toEqual({ + result: 'completed', + }) + }) + + it('round-trips GET input without normalizing the original query encoding', async () => { + const data = { + spaces: 'one two three', + plus: 'one+two', + tilde: 'one~two', + unicode: 'Grüße 🌍', + percent: '100%', + } + const action = createAction() + action.mockImplementation((payload) => ({ + result: { data: payload.data, requestUrl: getRequestUrl().href }, + })) + serverFnMocks.action = action + const handler = createHandler() + let originalUrl = '' + + const result = await createClientRpc('test')({ + method: 'GET', + data, + fetch: async (input: string, init: RequestInit) => { + const url = new URL(input, 'http://localhost') + const payload = url.searchParams.get('payload')! + // Mix equivalent space encodings and retain literal ~. URLSearchParams + // serialization would canonicalize these even though decoding must not. + const encoded = encodeURIComponent(payload).replace('%20', '+') + const request = new Request( + `http://localhost/_serverFn/test?payload=${encoded}&space=a%20b+c&plus=%2b&tilde=~&unicode=%e2%98%83&percent=%25`, + init, + ) + originalUrl = request.url + return handler(request, {}) + }, + }) + + expect(action).toHaveBeenCalledOnce() + expect(action.mock.calls[0]?.[0].data).toEqual(data) + expect(result).toEqual({ result: { data, requestUrl: originalUrl } }) + }) + + it('does not execute the action when an async CSRF matcher allows an aborted request', async () => { + const controller = new AbortController() + const reason = new Error('Request disconnected') + let resolveMatcher!: (allowed: boolean) => void + let matcherStarted!: () => void + const started = new Promise((resolve) => { + matcherStarted = resolve + }) + const matching = new Promise((resolve) => { + resolveMatcher = resolve + }) + const matcher = vi.fn(() => { + matcherStarted() + return matching + }) + serverFnMocks.middleware = [createCsrfMiddleware({ origin: matcher })] + const action = createAction() + action.mockReturnValue({ result: 'must not execute' }) + serverFnMocks.action = action + + const pending = createHandler()( + createServerFunctionRequest('http://localhost/_serverFn/test', { + signal: controller.signal, + headers: { Origin: 'http://localhost' }, + }), + {}, + ) + const rejected = expect(pending).rejects.toBe(reason) + + try { + await started + expect(action).not.toHaveBeenCalled() + controller.abort(reason) + await rejected + resolveMatcher(true) + // Let the late matcher continuation attempt to enter the next middleware. + await new Promise((resolve) => setImmediate(resolve)) + + expect(matcher).toHaveBeenCalledOnce() + expect(action).not.toHaveBeenCalled() + } finally { + resolveMatcher(true) + } + }) + + it('preserves HTTP-style action error metadata', async () => { + const action = createAction() + const error = Object.assign(new Error('conflict'), { + status: 409, + statusText: 'Conflict', + headers: { 'x-error': 'yes' }, + }) + action.mockImplementation(() => { + throw error + }) + serverFnMocks.action = action + const handler = createHandler() + + const response = await handler(createServerFunctionRequest(), {}) + + expect(response.status).toBe(409) + expect(response.statusText).toBe('Conflict') + expect(response.headers.get('x-error')).toBe('yes') + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe('true') + }) + + it('does not copy upstream Response cause framing or cookies onto serialized errors', async () => { + const action = createAction() + serverFnMocks.middleware = [ + createMiddleware().server(() => { + throw new Error('upstream failed', { + cause: new Response('

upstream

', { + status: 502, + headers: { + 'content-encoding': 'gzip', + 'content-length': '999', + 'content-type': 'text/html', + 'set-cookie': 'upstream=1; Path=/', + 'x-upstream': 'yes', + }, + }), + }) + }), + ] + serverFnMocks.action = action + const handler = createHandler() + let response: Response | undefined + + const call = callClientServerFn(async (input, init) => { + response = await handler( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + return response + }) + + await expect(call).rejects.toThrow('upstream failed') + expect(action).not.toHaveBeenCalled() + expect(response!.status).toBe(502) + expect(response!.headers.get('x-upstream')).toBeNull() + expect(response!.headers.get('content-type')).toBe('application/json') + expect(response!.headers.get('content-encoding')).toBeNull() + expect(response!.headers.get('content-length')).toBeNull() + expect(response!.headers.getSetCookie()).toEqual([]) + }) + + describe('keeps Location off serialized replies', () => { + async function callWithResponse() { + let response: Response | undefined + const call = callClientServerFn(async (input, init) => { + response = await createHandler()( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + return response + }) + return { call, response: () => response! } + } + + it('for JSON results with a helper redirect status', async () => { + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(302) + setResponseHeader('location', '/elsewhere') + return { result: { ok: true } } + }) + serverFnMocks.action = action + + const { call, response } = await callWithResponse() + + await expect(call).resolves.toEqual({ ok: true }) + expect(response().status).toBe(302) + expect(response().headers.get('location')).toBeNull() + }) + + it('for framed results with a helper redirect status', async () => { + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(303) + setResponseHeader('location', '/elsewhere') + return { result: { stream: new RawStream(new ReadableStream()) } } + }) + serverFnMocks.action = action + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.headers.get('content-type')).toBe( + TSS_CONTENT_TYPE_FRAMED_VERSIONED, + ) + expect(response.headers.get('location')).toBeNull() + await response.body!.cancel() + }) + + it('for errors that carry a redirect status and Location', async () => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + serverFnMocks.action = createAction() + serverFnMocks.middleware = [ + createMiddleware().server(() => { + throw Object.assign(new Error('moved'), { + status: 302, + headers: { location: 'https://evil.example/' }, + }) + }), + ] + + try { + const { call, response } = await callWithResponse() + + await expect(call).rejects.toThrow('moved') + expect(response().headers.get('location')).toBeNull() + } finally { + consoleError.mockRestore() + } + }) + + it('for not-found envelopes', async () => { + serverFnMocks.action = createAction() + serverFnMocks.middleware = [ + createMiddleware().server(() => { + setResponseStatus(302) + setResponseHeader('location', '/helper') + throw notFound({ headers: { location: '/not-found' } }) + }), + ] + + const { call, response } = await callWithResponse() + + await expect(call).rejects.toSatisfy((value: unknown) => + isNotFound(value), + ) + expect(response().headers.get('location')).toBeNull() + }) + }) + + it('does not let a helper success status hide a request middleware crash', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + serverFnMocks.action = createAction() + serverFnMocks.middleware = [ + createMiddleware().server(() => { + setResponseStatus(201, 'Created') + throw new TypeError('middleware crashed') + }), + ] + let response: Response | undefined + + try { + await expect( + callClientServerFn(async (input, init) => { + response = await createHandler()( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + return response + }), + ).rejects.toThrow('middleware crashed') + expect(response!.status).toBe(500) + expect(response!.statusText).toBe('') + expect(consoleError).toHaveBeenCalledOnce() + } finally { + consoleError.mockRestore() + } + }) + + it('applies helper headers to serialized action errors', async () => { + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(500) + setResponseHeader('x-error-header', 'yes') + throw new Error('server function failed') + }) + serverFnMocks.action = action + const handler = createHandler() + + const response = await handler(createServerFunctionRequest(), {}) + + expect(response.status).toBe(500) + expect(response.headers.get('x-error-header')).toBe('yes') + expect(response.headers.get('x-tss-serialized')).toBe('true') + }) + + it('protects not-found transport headers from helper overrides', async () => { + const action = createAction() + action.mockImplementation(() => { + setResponseHeader('content-type', 'text/plain') + setResponseHeader('x-tss-serialized', 'true') + throw { isNotFound: true, data: 'missing' } + }) + serverFnMocks.action = action + const handler = createHandler() + + const response = await handler(createServerFunctionRequest(), {}) + + expect(response.status).toBe(404) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe(null) + await expect(response.json()).resolves.toEqual({ + isNotFound: true, + data: 'missing', + }) + }) + + it('preserves caller not-found headers and cookies while normalizing transport headers', async () => { + const cookies = [ + 'session=one; Path=/; Expires=Wed, 21 Oct 2030 07:28:00 GMT', + 'preferences=two; Path=/', + ] + const headers = new Headers({ + 'content-type': 'text/plain', + 'x-tss-serialized': 'true', + 'x-tss-raw': 'true', + 'x-not-found': 'preserved', + }) + for (const cookie of cookies) { + headers.append('set-cookie', cookie) + } + const originalHeaders = Array.from(headers) + const action = createAction() + action.mockImplementation(() => { + setResponseHeader('x-helper', 'also preserved') + throw notFound({ data: 'missing', headers }) + }) + serverFnMocks.action = action + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.status).toBe(404) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-serialized')).toBe(null) + expect(response.headers.get('x-tss-raw')).toBe(null) + expect(response.headers.get('x-not-found')).toBe('preserved') + expect(response.headers.get('x-helper')).toBe('also preserved') + expect(response.headers.getSetCookie()).toEqual(cookies) + expect(Array.from(headers)).toEqual(originalHeaders) + await expect(response.json()).resolves.toEqual({ + isNotFound: true, + data: 'missing', + }) + }) + + it('captures not-found headers before serializing data', async () => { + const headers = new Headers({ 'x-snapshot': 'original' }) + const action = createAction() + action.mockImplementation(() => { + throw notFound({ + headers, + data: { + toJSON() { + headers.set('x-snapshot', 'changed during serialization') + setResponseHeader('x-helper', 'written during serialization') + setResponseHeader('content-type', 'text/plain') + setResponseHeader('x-tss-raw', 'true') + return 'missing' + }, + }, + }) + }) + serverFnMocks.action = action + + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.status).toBe(404) + expect(response.headers.get('x-snapshot')).toBe('original') + expect(response.headers.get('x-helper')).toBe( + 'written during serialization', + ) + expect(response.headers.get('content-type')).toBe('application/json') + expect(response.headers.get('x-tss-raw')).toBeNull() + expect(headers.get('x-snapshot')).toBe('changed during serialization') + await expect(response.json()).resolves.toEqual({ + isNotFound: true, + data: 'missing', + }) + }) + + it.each([204, 205, 304])( + 'keeps serialized success bodies when a helper selects %s', + async (status) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(status) + return { result: { ok: true } } + }) + serverFnMocks.action = action + const handler = createHandler() + let response: Response | undefined + + try { + const result = await createClientRpc('test')({ + method: 'GET', + fetch: async (input: string, init: RequestInit) => { + response = await handler( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + return response + }, + }) + + expect(result).toEqual({ result: { ok: true } }) + expect(response!.status).toBe(200) + expect(response!.headers.get('x-tss-serialized')).toBe('true') + expect(warnSpy).toHaveBeenCalledOnce() + expect(warnSpy.mock.calls[0]![0]).toContain( + `setResponseStatus(${status})`, + ) + } finally { + warnSpy.mockRestore() + } + }, + ) + + it('applies a bodyless helper status to a raw Response result without a warning', async () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(204) + return { result: new Response('raw body') } + }) + serverFnMocks.action = action + + try { + const response = await createHandler()(createServerFunctionRequest(), {}) + + expect(response.status).toBe(204) + expect(response.body).toBeNull() + expect(response.headers.get('x-tss-raw')).toBe('true') + expect(warnSpy).not.toHaveBeenCalled() + } finally { + warnSpy.mockRestore() + } + }) + + it.each([204, 205, 304])( + 'keeps serialized redirect and not-found envelopes when a helper selects %s', + async (status) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const fetchResponse = async (input: string, init: RequestInit) => + createHandler()( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + + try { + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(status) + throw redirect({ href: '/login' }) + }) + serverFnMocks.action = action + await expect( + createClientRpc('test')({ method: 'GET', fetch: fetchResponse }), + ).rejects.toSatisfy( + (value: unknown) => + isRedirect(value) && value.options.href === '/login', + ) + + serverFnMocks.middleware = [ + createMiddleware().server(() => { + setResponseStatus(status) + throw notFound({ data: 'missing' }) + }), + ] + await expect( + createClientRpc('test')({ method: 'GET', fetch: fetchResponse }), + ).rejects.toSatisfy((value: unknown) => isNotFound(value)) + } finally { + warnSpy.mockRestore() + } + }, + ) + + it('converts oversized GET payload errors', async () => { + const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + const action = createAction() + serverFnMocks.action = action + const handler = createHandler() + + try { + const response = await handler( + createServerFunctionRequest( + `http://localhost/_serverFn/test?payload=${'x'.repeat(1_000_001)}`, + ), + {}, + ) + + expect(response.status).toBe(500) + expect(response.headers.get('x-tss-serialized')).toBe('true') + expect(action).not.toHaveBeenCalled() + } finally { + consoleError.mockRestore() + } + }) + + it('falls back to default context for malformed FormData context', async () => { + let receivedContext: unknown + defineServerFn('POST', (({ context }: { context: unknown }) => { + receivedContext = context + return { ok: true } + }) as () => unknown) + const handler = createHandler() + const formData = new FormData() + formData.set(TSS_FORMDATA_CONTEXT, '{not json') + formData.set('field', 'value') + + const response = await handler( + createServerFunctionRequest('http://localhost/_serverFn/test', { + method: 'POST', + body: formData, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(receivedContext).toEqual({}) + }) + + it('streams RawStreams discovered after initial serialization', async () => { + const action = createAction() + action.mockImplementation(() => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode('late')) + controller.close() + }, + }) + return { + result: { + stream: Promise.resolve(new RawStream(stream)), + }, + } + }) + serverFnMocks.action = action + const handler = createHandler() + + const response = await handler(createServerFunctionRequest(), {}) + const frames = await readFrames(response) + const chunkFrame = frames.find((frame) => frame.type === FRAME_TYPE_CHUNK) + + expect(response.headers.get('content-type')).toBe( + TSS_CONTENT_TYPE_FRAMED_VERSIONED, + ) + expect(frames.some((frame) => frame.type === FRAME_TYPE_JSON)).toBe(true) + expect(chunkFrame).toBeDefined() + expect(new TextDecoder().decode(chunkFrame?.payload)).toBe('late') + expect( + frames.some( + (frame) => + frame.type === FRAME_TYPE_END && + frame.streamId === chunkFrame?.streamId, + ), + ).toBe(true) + }) + + it.each([204, 205, 304])( + 'keeps serialized error bodies when a helper or the error selects %s', + async (status) => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + const fetchResponse = async (input: string, init: RequestInit) => { + const response = await createHandler()( + new Request(new URL(input, 'http://localhost'), init), + {}, + ) + expect(response.status).toBe(500) + return response + } + + try { + const action = createAction() + action.mockImplementation(() => { + setResponseStatus(status) + throw new Error('helper status error') + }) + serverFnMocks.action = action + await expect(callClientServerFn(fetchResponse)).rejects.toThrow( + 'helper status error', + ) + + action.mockImplementation(() => { + throw Object.assign(new Error('error status error'), { status }) + }) + await expect(callClientServerFn(fetchResponse)).rejects.toThrow( + 'error status error', + ) + } finally { + warnSpy.mockRestore() + consoleError.mockRestore() + } + }, + ) +}) + +describe('server function throws reach the caller', () => { + // Calls the server function from inside its own handler, as a nested + // server-side call would, and records how the inner call settled. + async function settleOnServer(throwInner: () => never) { + let outcome: { resolved?: unknown; rejected?: unknown } | undefined + let nested = false + const { call, onServer } = defineServerFn('POST', async () => { + if (nested) { + throwInner() + } + nested = true + outcome = await settle(onServer()) + return { ok: true } + }) + + await expect(call()).resolves.toEqual({ ok: true }) + return outcome! + } + + const falsyValues = [undefined, null, 0, '', false, Number.NaN, BigInt(0)] + + describe.each(['GET', 'POST'] as const)('falsy throws over %s', (method) => { + it.each(falsyValues)('rejects with a thrown %s', async (value) => { + const { call } = defineServerFn(method, () => { + throw value + }) + + const outcome = await settle(call()) + + expect(outcome).toHaveProperty('rejected') + expect(Object.is(outcome.rejected, value)).toBe(true) + }) + + it.each(falsyValues)( + 'rejects with %s thrown by function middleware and lets outer middleware catch it', + async (value) => { + let caught: { value: unknown } | undefined + const { call } = defineServerFn(method, () => ({ ok: true }), [ + createMiddleware({ type: 'function' }).server(async ({ next }) => { + try { + return await next() + } catch (error) { + caught = { value: error } + throw error + } + }), + createMiddleware({ type: 'function' }).server(() => { + throw value + }), + ]) + + const outcome = await settle(call()) + + expect(outcome).toHaveProperty('rejected') + expect(Object.is(outcome.rejected, value)).toBe(true) + expect(caught).toBeDefined() + expect(Object.is(caught!.value, value)).toBe(true) + }, + ) + + it('still resolves with a returned undefined', async () => { + const { call } = defineServerFn(method, () => undefined) + + await expect(call()).resolves.toBeUndefined() + }) + }) + + it.each(['GET', 'POST'] as const)( + 'ignores error and result keys a client adds to the %s payload', + async (method) => { + let received: unknown + defineServerFn(method, ((opts: { data: unknown }) => { + received = opts.data + return { ok: true } + }) as () => unknown) + const payload = JSON.stringify( + toJSON({ data: 'input', error: 'crafted', result: 'crafted' }), + ) + + const response = await createHandler()( + method === 'GET' + ? createServerFunctionRequest( + `http://localhost/_serverFn/test?payload=${encodeURIComponent(payload)}`, + ) + : createServerFunctionRequest('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: payload, + }), + {}, + ) + + expect(response.status).toBe(200) + expect(received).toBe('input') + expect(await response.text()).not.toContain('crafted') + }, + ) + + it('rejects a server function received as data when its call fails', async () => { + let outcome: { resolved?: unknown; rejected?: unknown } | undefined + let nested = false + const receivedFn = ServerFunctionSerializationAdapter.fromSerializable({ + functionId: 'test', + }) as unknown as (opts: { data: unknown }) => Promise + const { call } = defineServerFn('POST', async () => { + if (nested) { + throw 0 + } + nested = true + outcome = await settle(receivedFn({ data: 1 })) + return { ok: true } + }) + + await expect(call()).resolves.toEqual({ ok: true }) + expect(outcome).toEqual({ rejected: 0 }) + }) + + it('rejects a server-side call with a thrown 0', async () => { + const outcome = await settleOnServer(() => { + throw 0 + }) + + expect(outcome).toEqual({ rejected: 0 }) + }) + describe.each(['GET', 'POST'] as const)( + 'thrown Responses over %s', + (method) => { + it('rejects with a thrown Response and keeps its status and body', async () => { + const { call, response } = defineServerFn(method, () => { + throw new Response('teapot', { status: 418 }) + }) + + const outcome = await settle(call()) + + expect(outcome.rejected).toBeInstanceOf(Response) + const thrown = outcome.rejected as Response + expect(thrown.status).toBe(418) + await expect(thrown.text()).resolves.toBe('teapot') + expect(response().status).toBe(418) + }) + + it('rejects with a Response thrown by function middleware', async () => { + const { call } = defineServerFn(method, () => ({ ok: true }), [ + createMiddleware({ type: 'function' }).server(() => { + throw Response.json({ denied: true }, { status: 403 }) + }), + ]) + + const outcome = await settle(call()) + + expect(outcome.rejected).toBeInstanceOf(Response) + const thrown = outcome.rejected as Response + expect(thrown.status).toBe(403) + await expect(thrown.json()).resolves.toEqual({ denied: true }) + }) + + it('still resolves with a returned Response', async () => { + const { call } = defineServerFn( + method, + () => new Response('returned', { status: 202 }), + ) + + const outcome = await settle(call()) + + expect(outcome.resolved).toBeInstanceOf(Response) + const returned = outcome.resolved as Response + expect(returned.status).toBe(202) + await expect(returned.text()).resolves.toBe('returned') + }) + }, + ) + + it('rejects a server-side call with a thrown Response', async () => { + const outcome = await settleOnServer(() => { + throw new Response('server-side', { status: 409 }) + }) + + expect(outcome.rejected).toBeInstanceOf(Response) + expect((outcome.rejected as Response).status).toBe(409) + }) + describe('from global request middleware', () => { + function throwFromRequestMiddleware(value: unknown) { + serverFnMocks.middleware = [ + createMiddleware().server(() => { + throw value + }), + ] + return defineServerFn('POST', () => ({ handler: 'ran' })) + } + + it.each([ + ['a string', 'boom'], + ['a plain object', { code: 'E_DENIED' }], + ['an object shaped like a result', { result: 'looks-like-success' }], + ['an object shaped like an error envelope', { error: 'inner' }], + ['zero', 0], + ['undefined', undefined], + ])('rejects with %s', async (_, value) => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + try { + const { call, response } = throwFromRequestMiddleware(value) + + const outcome = await settle(call()) + + expect(outcome).toHaveProperty('rejected') + expect(outcome.rejected).toEqual(value) + expect(response().status).toBe(500) + expect(response().headers.get('x-tss-serialized')).toBe('true') + } finally { + consoleError.mockRestore() + } + }) + + it('rejects with the serialization error for a value that cannot be sent', async () => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + try { + const { call, response } = throwFromRequestMiddleware({ + notSerializable: () => 1, + }) + + const outcome = await settle(call()) + + expect(outcome.rejected).toBeInstanceOf(Error) + expect(response().status).toBe(500) + expect(response().headers.get('x-tss-serialized')).toBe('true') + } finally { + consoleError.mockRestore() + } + }) + + it('re-sends the reply of next() when request middleware throws it', async () => { + serverFnMocks.middleware = [ + createMiddleware().server(async ({ next }) => { + const result = await next() + throw result.response + }), + ] + const { call } = defineServerFn('POST', () => ({ handler: 'ran' })) + + await expect(call()).resolves.toEqual({ handler: 'ran' }) + }) + + it('rejects with an Error and keeps its message', async () => { + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + try { + const { call } = throwFromRequestMiddleware(new Error('denied')) + + await expect(call()).rejects.toThrow('denied') + } finally { + consoleError.mockRestore() + } + }) + + it.each([ + ['text', () => new Response('nope', { status: 403 })], + ['JSON', () => Response.json({ nope: true }, { status: 403 })], + ])('rejects with a thrown %s Response', async (_, createResponse) => { + const { call, response } = throwFromRequestMiddleware(createResponse()) + + const outcome = await settle(call()) + + expect(outcome.rejected).toBeInstanceOf(Response) + expect((outcome.rejected as Response).status).toBe(403) + expect(response().status).toBe(403) + }) + }) +}) + +describe('function middleware', () => { + it('passes data and context between client middleware, server middleware and the handler', async () => { + let clientContext: unknown + let serverResult: unknown + const { call } = defineServerFn( + 'POST', + (({ data, context }: { data: unknown; context: object }) => ({ + data, + context: { ...context }, + })) as () => unknown, + [ + createMiddleware({ type: 'function' }) + .validator((data: number) => data + 1) + .client(async ({ next }) => { + const result = await next({ + context: { local: 'client' }, + sendContext: { sent: 'client' }, + }) + clientContext = { ...result.context } + return result + }) + .server(async ({ next }) => { + const result = await next({ + context: { added: 'server' }, + sendContext: { sent: 'server' }, + }) + serverResult = { + context: { ...result.context }, + sendContext: { ...result.sendContext }, + } + return result + }), + ], + ) + + await expect(call(1)).resolves.toEqual({ + data: 2, + context: { sent: 'client', added: 'server' }, + }) + expect(serverResult).toEqual({ + context: { sent: 'client', added: 'server' }, + sendContext: { sent: 'server' }, + }) + expect(clientContext).toEqual({ local: 'client', sent: 'server' }) + }) + + it.each([ + ['leaves out context without sendContext', [], { result: 'ok' }], + [ + 'sends back sendContext as context', + [ + createMiddleware({ type: 'function' }).server(({ next }) => + next({ sendContext: { sent: 'server' } }), + ), + ], + { result: 'ok', context: { sent: 'server' } }, + ], + ])('%s in a reply', async (_, middleware, reply) => { + defineServerFn('POST', () => 'ok', middleware) + + const response = await createHandler()( + createServerFunctionRequest('http://localhost/_serverFn/test', { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify(toJSON({ data: 'input' })), + }), + {}, + ) + + const received = fromCrossJSON(await response.json(), {}) + expect(Object.keys(received)).toEqual(Object.keys(reply)) + expect(received).toEqual(reply) + }) + + it('runs the validator of middleware that has no server function', async () => { + const { call } = defineServerFn( + 'POST', + (({ data }: { data: unknown }) => data) as () => unknown, + [ + createMiddleware({ type: 'function' }) + .validator((data: number) => data * 10) + .client(({ next }) => next()), + ], + ) + + await expect(call(2)).resolves.toBe(20) + }) + + it('skips middleware that already ran as request middleware', async () => { + const runs: Array = [] + const shared = createMiddleware().server(({ next }) => { + runs.push('shared') + return next() + }) + serverFnMocks.middleware = [shared] + const { call } = defineServerFn('POST', () => 'ok', [ + shared as unknown as AnyFunctionMiddleware, + createMiddleware({ type: 'function' }) + .middleware([shared]) + .server(({ next }) => { + runs.push('function') + return next() + }), + ]) + + await expect(call()).resolves.toBe('ok') + expect(runs).toEqual(['shared', 'function']) + }) + + it('resolves with a Response that server middleware returns', async () => { + const handler = vi.fn(() => 'unused') + const { call } = defineServerFn('POST', handler, [ + createMiddleware({ type: 'function' }).server(async ({ next }) => next()), + createMiddleware({ type: 'function' }).server( + (() => new Response('from middleware', { status: 202 })) as never, + ), + ]) + + const outcome = await settle(call()) + + expect(outcome.resolved).toBeInstanceOf(Response) + const returned = outcome.resolved as Response + expect(returned.status).toBe(202) + await expect(returned.text()).resolves.toBe('from middleware') + expect(handler).not.toHaveBeenCalled() + }) + + it('rejects with a redirect that server middleware returns', async () => { + let caught: unknown + const { call } = defineServerFn('POST', () => 'unused', [ + createMiddleware({ type: 'function' }).server(async ({ next }) => { + try { + return await next() + } catch (error) { + caught = error + throw error + } + }), + createMiddleware({ type: 'function' }).server((() => + redirect({ href: '/login' })) as never), + ]) + + const outcome = await settle(call()) + + expect(isRedirect(caught)).toBe(true) + expect(outcome.rejected).toSatisfy( + (value: unknown) => isRedirect(value) && value.options.href === '/login', + ) + }) + + it('lets outer middleware recover from a failure in inner middleware', async () => { + const { call } = defineServerFn('POST', () => 'unused', [ + createMiddleware({ type: 'function' }).server((async ({ + next, + }: { + next: () => Promise + }) => { + try { + return await next() + } catch (error) { + return { result: `recovered from ${(error as Error).message}` } + } + }) as never), + createMiddleware({ type: 'function' }).server(() => { + throw new Error('inner') + }), + ]) + + await expect(call()).resolves.toBe('recovered from inner') + }) + + it('resolves with the handler result even when middleware passed a result to next()', async () => { + const { call } = defineServerFn('POST', () => undefined, [ + createMiddleware({ type: 'function' }).server(({ next }) => + next({ result: 'from middleware' } as never), + ), + ]) + + await expect(call()).resolves.toBeUndefined() + }) + + it('rejects when server middleware returns undefined', async () => { + const { call } = defineServerFn('POST', () => 'unused', [ + createMiddleware({ type: 'function' }).server((() => undefined) as never), + ]) + + await expect(call()).rejects.toThrow( + 'User middleware returned undefined. You must call next() or return a result in your middlewares.', + ) + }) +}) diff --git a/packages/start-server-core/tsconfig.json b/packages/start-server-core/tsconfig.json index ac28a482bf..b142331a03 100644 --- a/packages/start-server-core/tsconfig.json +++ b/packages/start-server-core/tsconfig.json @@ -9,6 +9,7 @@ "src", "tests", "vite.config.ts", + "vitest.bench.config.ts", "../start-client-core/src/start-entry.d.ts" ] } diff --git a/packages/start-server-core/vite.config.ts b/packages/start-server-core/vite.config.ts index 36325350e4..09e3bf9539 100644 --- a/packages/start-server-core/vite.config.ts +++ b/packages/start-server-core/vite.config.ts @@ -24,6 +24,12 @@ const fakeRouterEntry = fileURLToPath( const fakeStartManifest = fileURLToPath( new URL('./tests/fixtures/start-manifest.ts', import.meta.url), ) +const fakePluginAdapters = fileURLToPath( + new URL('./src/empty-plugin-adapters.ts', import.meta.url), +) +const fakeServerFnResolver = fileURLToPath( + new URL('./src/fake-start-server-fn-resolver.ts', import.meta.url), +) export default mergeConfig( config, @@ -36,11 +42,13 @@ export default mergeConfig( './src/createServerRpc.ts', './src/createSsrRpc.ts', './src/request-response.ts', + './src/constants.ts', './src/virtual-modules.ts', './src/fake-start-server-fn-resolver.ts', './src/empty-plugin-adapters.ts', ], externalDeps: [ + 'cookie-es', ...Object.values(VIRTUAL_MODULES), '#tanstack-start-entry', '#tanstack-router-entry', @@ -54,6 +62,8 @@ export default mergeConfig( alias: { '#tanstack-start-entry': fakeStartEntry, '#tanstack-router-entry': fakeRouterEntry, + '#tanstack-start-plugin-adapters': fakePluginAdapters, + '#tanstack-start-server-fn-resolver': fakeServerFnResolver, 'tanstack-start-manifest:v': fakeStartManifest, }, }, diff --git a/packages/start-server-core/vitest.bench.config.ts b/packages/start-server-core/vitest.bench.config.ts new file mode 100644 index 0000000000..e3152437cc --- /dev/null +++ b/packages/start-server-core/vitest.bench.config.ts @@ -0,0 +1,17 @@ +import { defineConfig, mergeConfig } from 'vitest/config' +import { cpuSimulationExecArgv } from '../../benchmarks/cpu-simulation' +import config from './vite.config' + +export default mergeConfig( + config, + defineConfig({ + test: { + environment: 'node', + execArgv: cpuSimulationExecArgv(), + fileParallelism: false, + benchmark: { + include: ['tests/response-reconciliation.bench.ts'], + }, + }, + }), +) diff --git a/packages/start-static-server-functions/CHANGELOG.md b/packages/start-static-server-functions/CHANGELOG.md index 27584fb74f..9e64280e30 100644 --- a/packages/start-static-server-functions/CHANGELOG.md +++ b/packages/start-static-server-functions/CHANGELOG.md @@ -1,5 +1,254 @@ # @tanstack/start-static-server-functions +## 1.167.44 + +### Patch Changes + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/react-start@1.169.4 + - @tanstack/solid-start@1.169.4 + - @tanstack/start-client-core@1.170.39 + +## 1.167.43 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.38 + - @tanstack/react-start@1.169.3 + - @tanstack/solid-start@1.169.3 + +## 1.167.42 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-start@1.169.1 + - @tanstack/solid-start@1.169.1 + - @tanstack/start-client-core@1.170.37 + +## 1.167.41 + +### Patch Changes + +- Updated dependencies [[`550f478`](https://github.com/TanStack/router/commit/550f47881070c0558a87e1acce7f38fbc85b9549), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`f243c61`](https://github.com/TanStack/router/commit/f243c61e95dae64fe04da4499c0c4ec44f26abae), [`f243c61`](https://github.com/TanStack/router/commit/f243c61e95dae64fe04da4499c0c4ec44f26abae)]: + - @tanstack/start-client-core@1.170.36 + - @tanstack/react-start@1.169.0 + - @tanstack/solid-start@1.169.0 + +## 1.167.40 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.35 + - @tanstack/react-start@1.168.61 + - @tanstack/solid-start@1.168.58 + +## 1.167.39 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-start@1.168.60 + - @tanstack/solid-start@1.168.57 + - @tanstack/start-client-core@1.170.34 + +## 1.167.38 + +### Patch Changes + +- [#8297](https://github.com/TanStack/router/pull/8297) [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f) - Update `seroval` and `seroval-plugins` from 1.6.2 to 1.6.7. This picks up the typed array length guard, the `maxBase64Length` and `compactArrayBufferViews` options, and the `isStream` export. + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`76a7c0b`](https://github.com/TanStack/router/commit/76a7c0bfadb42d5f7fe7b9e1748acc7333178c91)]: + - @tanstack/start-client-core@1.170.33 + - @tanstack/react-start@1.168.59 + - @tanstack/solid-start@1.168.56 + +## 1.167.37 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.32 + - @tanstack/react-start@1.168.56 + - @tanstack/solid-start@1.168.54 + +## 1.167.36 + +### Patch Changes + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26)]: + - @tanstack/start-client-core@1.170.31 + - @tanstack/react-start@1.168.55 + - @tanstack/solid-start@1.168.53 + +## 1.167.35 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.30 + - @tanstack/react-start@1.168.53 + - @tanstack/solid-start@1.168.51 + +## 1.167.34 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.29 + - @tanstack/react-start@1.168.51 + - @tanstack/solid-start@1.168.49 + +## 1.167.33 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.28 + - @tanstack/react-start@1.168.50 + - @tanstack/solid-start@1.168.48 + +## 1.167.32 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.27 + - @tanstack/solid-start@1.168.47 + - @tanstack/react-start@1.168.49 + +## 1.167.31 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.26 + - @tanstack/react-start@1.168.48 + - @tanstack/solid-start@1.168.46 + +## 1.167.30 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-start@1.168.47 + - @tanstack/solid-start@1.168.45 + - @tanstack/start-client-core@1.170.25 + +## 1.167.29 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.24 + - @tanstack/react-start@1.168.46 + - @tanstack/solid-start@1.168.44 + +## 1.167.28 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-start@1.168.45 + - @tanstack/start-client-core@1.170.23 + - @tanstack/solid-start@1.168.43 + +## 1.167.27 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.22 + - @tanstack/react-start@1.168.43 + - @tanstack/solid-start@1.168.42 + +## 1.167.26 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.21 + - @tanstack/react-start@1.168.42 + - @tanstack/solid-start@1.168.41 + +## 1.167.25 + +### Patch Changes + +- Updated dependencies [[`c59788c`](https://github.com/TanStack/router/commit/c59788ca20f2d2e7f264a859ebe01b7646ba3154)]: + - @tanstack/start-client-core@1.170.20 + - @tanstack/react-start@1.168.41 + - @tanstack/solid-start@1.168.40 + +## 1.167.24 + +### Patch Changes + +- Updated dependencies [[`2fbc99f`](https://github.com/TanStack/router/commit/2fbc99f2c262b057cb957e6ebba1ee073c655186), [`6bede65`](https://github.com/TanStack/router/commit/6bede65d7074dcd83455151b66b4574268bc782c)]: + - @tanstack/start-client-core@1.170.19 + - @tanstack/react-start@1.168.40 + - @tanstack/solid-start@1.168.39 + +## 1.167.23 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/react-start@1.168.39 + - @tanstack/start-client-core@1.170.18 + - @tanstack/solid-start@1.168.38 + +## 1.167.22 + +### Patch Changes + +- Updated dependencies [[`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b)]: + - @tanstack/start-client-core@1.170.17 + - @tanstack/react-start@1.168.38 + - @tanstack/solid-start@1.168.37 + +## 1.167.21 + +### Patch Changes + +- [#7962](https://github.com/TanStack/router/pull/7962) [`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5) - Update Seroval dependencies to version 1.6.2. + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/start-client-core@1.170.16 + - @tanstack/react-start@1.168.37 + - @tanstack/solid-start@1.168.36 + +## 1.167.20 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.15 + - @tanstack/react-start@1.168.36 + - @tanstack/solid-start@1.168.35 + ## 1.167.19 ### Patch Changes diff --git a/packages/start-static-server-functions/package.json b/packages/start-static-server-functions/package.json index d5f54bec0a..603d7524fb 100644 --- a/packages/start-static-server-functions/package.json +++ b/packages/start-static-server-functions/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/start-static-server-functions", - "version": "1.167.19", + "version": "1.167.44", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -30,12 +30,12 @@ "test:unit:dev": "vitest --watch", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -60,11 +60,17 @@ }, "dependencies": { "@tanstack/start-client-core": "workspace:*", - "seroval": "^1.5.4" + "seroval": "^1.6.7" }, "devDependencies": { "vite": "*", - "@types/node": ">=20" + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "@tanstack/react-start": "workspace:^", diff --git a/packages/start-static-server-functions/src/staticFunctionMiddleware.ts b/packages/start-static-server-functions/src/staticFunctionMiddleware.ts index e6681fce1d..ff20ab1ba2 100644 --- a/packages/start-static-server-functions/src/staticFunctionMiddleware.ts +++ b/packages/start-static-server-functions/src/staticFunctionMiddleware.ts @@ -2,7 +2,9 @@ import fs from 'node:fs/promises' import path from 'node:path' import { createMiddleware, + defaultSerovalDeserializerPlugins, getDefaultSerovalPlugins, + getSerovalPlugins, } from '@tanstack/start-client-core' import { fromJSON, toJSONAsync } from 'seroval' @@ -69,9 +71,6 @@ const jsonToFilenameSafeString = (json: any) => { .replace(/\s+/g, '_') // Optionally replace whitespace with underscores } -const staticClientCache = - typeof document !== 'undefined' ? new Map() : null - async function addItemToCache({ functionId, data, @@ -81,27 +80,25 @@ async function addItemToCache({ data: any response: StaticCachedResult }): Promise { - { - const hash = jsonToFilenameSafeString(data) - const url = await getStaticCacheUrl({ functionId, hash }) - const clientUrl = process.env.TSS_CLIENT_OUTPUT_DIR! - const filePath = path.join(clientUrl, url) + const hash = jsonToFilenameSafeString(data) + const url = await getStaticCacheUrl({ functionId, hash }) + const clientUrl = process.env.TSS_CLIENT_OUTPUT_DIR! + const filePath = path.join(clientUrl, url) - // Ensure the directory exists - await fs.mkdir(path.dirname(filePath), { recursive: true }) + // Ensure the directory exists + await fs.mkdir(path.dirname(filePath), { recursive: true }) - // Store the result with fs - const stringifiedResult = JSON.stringify( - await toJSONAsync( - { - result: response.result, - context: response.context.sendContext, - }, - { plugins: getDefaultSerovalPlugins() }, - ), - ) - await fs.writeFile(filePath, stringifiedResult, 'utf-8') - } + // Store the result with fs + const stringifiedResult = JSON.stringify( + await toJSONAsync( + { + result: response.result, + context: response.context.sendContext, + }, + { plugins: getDefaultSerovalPlugins() }, + ), + ) + await fs.writeFile(filePath, stringifiedResult, 'utf-8') } const fetchItem = async ({ @@ -114,15 +111,16 @@ const fetchItem = async ({ const hash = jsonToFilenameSafeString(data) const url = await getStaticCacheUrl({ functionId, hash }) - let result: any = staticClientCache?.get(url) - - result = await fetch(url, { + return fetch(url, { method: 'GET', }) .then((r) => r.json()) - .then((d) => fromJSON(d, { plugins: getDefaultSerovalPlugins() })) - - return result + .then((d) => + fromJSON(d, { + // Cached responses may carry RawStream nodes. + plugins: getSerovalPlugins(defaultSerovalDeserializerPlugins), + }), + ) } export const staticFunctionMiddleware = createMiddleware({ type: 'function' }) diff --git a/packages/start-storage-context/CHANGELOG.md b/packages/start-storage-context/CHANGELOG.md index d569880484..c8669ed975 100644 --- a/packages/start-storage-context/CHANGELOG.md +++ b/packages/start-storage-context/CHANGELOG.md @@ -1,5 +1,179 @@ # @tanstack/start-storage-context +## 1.167.41 + +### Patch Changes + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + +## 1.167.40 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + +## 1.167.39 + +### Patch Changes + +- [#8451](https://github.com/TanStack/router/pull/8451) [`740b0ce`](https://github.com/TanStack/router/commit/740b0ce17737d1f7398740136acdbeabe80df7d8) - Skip request middleware bookkeeping when no request middleware is configured, and stop copying serialization adapters when the router adds none. + + Server route handlers and route middleware now receive the router's decoded pathname, the same one used for route matching. Characters that would change how the path is read, such as `%2F`, `%3F`, and `%23`, stay encoded. + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + +## 1.167.38 + +### Patch Changes + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Reduce per-request work in Start: `getNormalizedURL` reads a `URL` input without cloning it, and `runWithStartContext` returns the callback's own result instead of wrapping it in a promise, so a synchronous throw from the callback now propagates synchronously. + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + +## 1.167.37 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/router-core@1.171.35 + +## 1.167.36 + +### Patch Changes + +- Updated dependencies [[`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/router-core@1.171.34 + +## 1.167.35 + +### Patch Changes + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/router-core@1.171.33 + +## 1.167.34 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + +## 1.167.33 + +### Patch Changes + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + +## 1.167.32 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + +## 1.167.31 + +### Patch Changes + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + +## 1.167.30 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + +## 1.167.29 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + +## 1.167.28 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + +## 1.167.27 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + +## 1.167.26 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + +## 1.167.25 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/router-core@1.171.23 + +## 1.167.24 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13)]: + - @tanstack/router-core@1.171.22 + +## 1.167.23 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + +## 1.167.22 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + +## 1.167.21 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + +## 1.167.20 + +### Patch Changes + +- Updated dependencies [[`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/router-core@1.171.18 + +## 1.167.19 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + +## 1.167.18 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + ## 1.167.17 ### Patch Changes diff --git a/packages/start-storage-context/package.json b/packages/start-storage-context/package.json index 0d33fe8d8f..083facb749 100644 --- a/packages/start-storage-context/package.json +++ b/packages/start-storage-context/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/start-storage-context", - "version": "1.167.17", + "version": "1.167.41", "description": "Modern and scalable routing for React applications", "author": "Tanner Linsley", "license": "MIT", @@ -30,12 +30,12 @@ "test:unit:dev": "vitest --watch", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -63,6 +63,12 @@ }, "devDependencies": { "vite": "*", - "@types/node": ">=20" + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" } } diff --git a/packages/start-storage-context/src/async-local-storage.ts b/packages/start-storage-context/src/async-local-storage.ts index 21aabd6cdf..bbde704629 100644 --- a/packages/start-storage-context/src/async-local-storage.ts +++ b/packages/start-storage-context/src/async-local-storage.ts @@ -16,7 +16,7 @@ export interface StartStorageContext { contextAfterGlobalMiddlewares: any // Track middlewares that have already executed in the request phase // to prevent duplicate execution - executedRequestMiddlewares: Set + executedRequestMiddlewares?: Set // Type of handler processing this request handlerType: StartHandlerType @@ -42,10 +42,10 @@ if (!globalObj[GLOBAL_STORAGE_KEY]) { const startStorage = globalObj[GLOBAL_STORAGE_KEY] -export async function runWithStartContext( +export function runWithStartContext( context: StartStorageContext, - fn: () => T | Promise, -): Promise { + fn: () => T, +): T { return startStorage.run(context, fn) } diff --git a/packages/valibot-adapter/package.json b/packages/valibot-adapter/package.json index a1831967a3..f59bec55a4 100644 --- a/packages/valibot-adapter/package.json +++ b/packages/valibot-adapter/package.json @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --typecheck", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -64,13 +64,21 @@ "node": ">=20.19" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.2.0", + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", "@tanstack/react-router": "workspace:*", "valibot": "1.0.0-beta.15", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "vite": "*" + "react": "catalog:", + "react-dom": "catalog:", + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "valibot": "^1.0.0 || ^1.0.0-beta.5 || ^1.0.0-rc", diff --git a/packages/valibot-adapter/tests/index.test.tsx b/packages/valibot-adapter/tests/index.test.tsx index 327de3093e..b59c29d075 100644 --- a/packages/valibot-adapter/tests/index.test.tsx +++ b/packages/valibot-adapter/tests/index.test.tsx @@ -9,7 +9,6 @@ import { import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, expect, test, vi } from 'vitest' import { valibotValidator } from '../src' -import '@testing-library/jest-dom/vitest' afterEach(() => { vi.resetAllMocks() diff --git a/packages/valibot-adapter/tests/jest-dom.setup.ts b/packages/valibot-adapter/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/packages/valibot-adapter/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/packages/valibot-adapter/vite.config.ts b/packages/valibot-adapter/vite.config.ts index 8c8c0c519f..8d553e0a59 100644 --- a/packages/valibot-adapter/vite.config.ts +++ b/packages/valibot-adapter/vite.config.ts @@ -9,6 +9,7 @@ const config = defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, + setupFiles: ['./tests/jest-dom.setup.ts'], }, }) diff --git a/packages/virtual-file-routes/package.json b/packages/virtual-file-routes/package.json index af2a4d8d30..5d682e1db2 100644 --- a/packages/virtual-file-routes/package.json +++ b/packages/virtual-file-routes/package.json @@ -58,6 +58,12 @@ "node": ">=20.19" }, "devDependencies": { - "vite": "*" + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" } } diff --git a/packages/virtual-file-routes/skills/_artifacts/domain_map.yaml b/packages/virtual-file-routes/skills/_artifacts/domain_map.yaml index db82f87ec0..0841238c5e 100644 --- a/packages/virtual-file-routes/skills/_artifacts/domain_map.yaml +++ b/packages/virtual-file-routes/skills/_artifacts/domain_map.yaml @@ -1,12 +1,12 @@ # domain_map.yaml # Library: @tanstack/virtual-file-routes -# Version: 1.161.4 +# Version: 1.162.0 # Date: 2026-03-08 # Status: reviewed library: name: '@tanstack/virtual-file-routes' - version: '1.161.4' + version: '1.162.0' repository: 'https://github.com/TanStack/router' description: >- Programmatic route tree building as an alternative to filesystem @@ -63,4 +63,11 @@ skills: priority: MEDIUM status: active + - mistake: 'Creating duplicate effective paths or physical mounts' + mechanism: >- + Virtual nodes and mounted physical subtrees can resolve to the same + path or ID. Regenerate and inspect the full tree after every refactor. + priority: HIGH + status: active + gaps: [] diff --git a/packages/virtual-file-routes/skills/_artifacts/skill_spec.md b/packages/virtual-file-routes/skills/_artifacts/skill_spec.md index 834294f8f6..02f2942727 100644 --- a/packages/virtual-file-routes/skills/_artifacts/skill_spec.md +++ b/packages/virtual-file-routes/skills/_artifacts/skill_spec.md @@ -12,13 +12,14 @@ Programmatic route tree building as an alternative to filesystem conventions. Pr | Skill | Type | Domain | What it covers | Failure modes | | ------------------- | ---- | -------------------- | ---------------------------------------------------------- | ------------- | -| virtual-file-routes | core | virtual-route-config | rootRoute, index, route, layout, physical, subtree configs | 2 | +| virtual-file-routes | core | virtual-route-config | rootRoute, index, route, layout, physical, subtree configs | 3 | ## Failure Mode Inventory -### virtual-file-routes (2 failure modes) +### virtual-file-routes (3 failure modes) -| # | Mistake | Priority | Source | -| --- | --------------------------------------- | -------- | ----------- | -| 1 | Forgetting rootRoute wrapper | HIGH | source/docs | -| 2 | Using physical() path outside routesDir | MEDIUM | source/docs | +| # | Mistake | Priority | Source | +| --- | -------------------------------------------- | -------- | ----------------- | +| 1 | Forgetting rootRoute wrapper | HIGH | source/docs | +| 2 | Using physical() path outside routesDir | MEDIUM | source/docs | +| 3 | Creating duplicate effective paths or mounts | HIGH | consistency audit | diff --git a/packages/virtual-file-routes/skills/_artifacts/skill_tree.yaml b/packages/virtual-file-routes/skills/_artifacts/skill_tree.yaml index f615e46c8f..7d8b510ca9 100644 --- a/packages/virtual-file-routes/skills/_artifacts/skill_tree.yaml +++ b/packages/virtual-file-routes/skills/_artifacts/skill_tree.yaml @@ -1,6 +1,6 @@ library: name: '@tanstack/virtual-file-routes' - version: '1.161.4' + version: '1.162.0' repository: 'https://github.com/TanStack/router' description: >- Programmatic route tree building as an alternative to filesystem diff --git a/packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md b/packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md index 093d73c0ba..8e2c497fa2 100644 --- a/packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md +++ b/packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md @@ -5,9 +5,10 @@ description: >- conventions: rootRoute, index, route, layout, physical, defineVirtualSubtreeConfig. Use with TanStack Router plugin's virtualRouteConfig option. -type: core -library: tanstack-router -library_version: '1.161.4' +metadata: + type: core + library: tanstack-router + library_version: '1.162.0' sources: - TanStack/router:packages/virtual-file-routes/src - TanStack/router:docs/router/routing/virtual-file-routes.md @@ -17,6 +18,8 @@ sources: Build route trees programmatically instead of relying on filesystem conventions. Useful when you want explicit control over route structure, need to mix virtual and physical routes, or want to define route subtrees within file-based routing directories. +Use this skill only when the project config contains `virtualRouteConfig`, a virtual route config file, or `__virtual.ts`. Ordinary file-route changes belong to Router Core and the Router Plugin. + > **CRITICAL**: Types are FULLY INFERRED. Never cast, never annotate inferred values. ## Install @@ -216,3 +219,13 @@ layout('dashboardLayout.tsx', [route('/dashboard', 'dashboard.tsx')]) // The URL is /dashboard, and dashboardLayout.tsx wraps it ``` + +## Refactor Audit + +After changing a virtual tree: + +1. Confirm there is exactly one `rootRoute` and that every referenced file exists relative to `routesDirectory`. +2. Check each `route`, `layout`, and `physical` node for duplicate effective paths or IDs. +3. Confirm each `physical()` directory is mounted once at the intended path prefix and does not overlap a virtual child. +4. Regenerate `routeTree.gen.ts` and inspect parentage, full paths, and imports. Do not edit generated output. +5. Update links, redirects, params, and `from` narrowing, then run generator tests, type tests, and a production build. diff --git a/packages/vue-router-devtools/CHANGELOG.md b/packages/vue-router-devtools/CHANGELOG.md index 2c444eeaa3..ff72e56c32 100644 --- a/packages/vue-router-devtools/CHANGELOG.md +++ b/packages/vue-router-devtools/CHANGELOG.md @@ -1,5 +1,30 @@ # @tanstack/vue-router-devtools +## 1.167.3 + +### Patch Changes + +- Updated dependencies [[`bbf9b75`](https://github.com/TanStack/router/commit/bbf9b75808d8eee497a6dd1663f0cf08426512e0)]: + - @tanstack/router-devtools-core@1.168.3 + +## 1.167.2 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`cb8749e`](https://github.com/TanStack/router/commit/cb8749e9fcd32d2290bf6c957b2701c3c0a14da5), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/vue-router@1.170.33 + - @tanstack/router-devtools-core@1.168.2 + +## 1.167.1 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/vue-router@1.170.18 + - @tanstack/router-devtools-core@1.168.1 + ## 1.167.0 ### Minor Changes diff --git a/packages/vue-router-devtools/README.md b/packages/vue-router-devtools/README.md index f88118caa5..4ee1f0f38b 100644 --- a/packages/vue-router-devtools/README.md +++ b/packages/vue-router-devtools/README.md @@ -1,5 +1,22 @@ +
+ + + + TanStack Vue Router + +
# TanStack Vue Router Devtools See https://tanstack.com/router/latest/docs/framework/vue/devtools diff --git a/packages/vue-router-devtools/package.json b/packages/vue-router-devtools/package.json index 7bfd075319..411dd289be 100644 --- a/packages/vue-router-devtools/package.json +++ b/packages/vue-router-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-router-devtools", - "version": "1.167.0", + "version": "1.167.3", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -61,9 +61,14 @@ "vite": "*" }, "devDependencies": { - "@vitejs/plugin-vue-jsx": "^4.1.2", - "vue": "^3.5.13", - "@types/node": ">=20" + "@vitejs/plugin-vue-jsx": "catalog:", + "vue": "catalog:", + "@types/node": ">=20", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "@tanstack/vue-router": "workspace:^", diff --git a/packages/vue-router-ssr-query/CHANGELOG.md b/packages/vue-router-ssr-query/CHANGELOG.md index 0d063edf7e..a85b193dd8 100644 --- a/packages/vue-router-ssr-query/CHANGELOG.md +++ b/packages/vue-router-ssr-query/CHANGELOG.md @@ -1,5 +1,39 @@ # @tanstack/vue-router-ssr-query +## 1.167.3 + +### Patch Changes + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26)]: + - @tanstack/router-ssr-query-core@1.169.3 + +## 1.167.2 + +### Patch Changes + +- Updated dependencies [[`79e3533`](https://github.com/TanStack/router/commit/79e35335b4bb1c3b5e2275a8df5181aa05036628)]: + - @tanstack/router-ssr-query-core@1.169.2 + ## 1.167.1 ### Patch Changes diff --git a/packages/vue-router-ssr-query/README.md b/packages/vue-router-ssr-query/README.md index a0c0b4928c..8629d6abf3 100644 --- a/packages/vue-router-ssr-query/README.md +++ b/packages/vue-router-ssr-query/README.md @@ -1,3 +1,20 @@ +
+ + + + TanStack Vue Router + +
# @tanstack/vue-router-ssr-query SSR Query integration for TanStack Vue Router. diff --git a/packages/vue-router-ssr-query/package.json b/packages/vue-router-ssr-query/package.json index 5e43e5a22d..73e6dd1cc3 100644 --- a/packages/vue-router-ssr-query/package.json +++ b/packages/vue-router-ssr-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-router-ssr-query", - "version": "1.167.1", + "version": "1.167.3", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "exit 0; vitest", "test:unit:dev": "pnpm run test:unit --watch", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -63,14 +63,19 @@ }, "devDependencies": { "@tanstack/vue-router": "workspace:*", - "@vitejs/plugin-vue-jsx": "^4.1.2", + "@vitejs/plugin-vue-jsx": "catalog:", "vite": "*", - "vue": "^3.5.25" + "vue": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { - "@tanstack/query-core": ">=5.90.0", - "@tanstack/vue-query": ">=5.90.0", - "@tanstack/vue-router": ">=1.127.0", + "@tanstack/query-core": ">=5.102.0", + "@tanstack/vue-query": ">=5.102.0", + "@tanstack/vue-router": ">=1.170.30", "vue": "^3.3.0" } } diff --git a/packages/vue-router-ssr-query/src/index.tsx b/packages/vue-router-ssr-query/src/index.tsx index c9b666acad..42a97b7df1 100644 --- a/packages/vue-router-ssr-query/src/index.tsx +++ b/packages/vue-router-ssr-query/src/index.tsx @@ -31,6 +31,13 @@ export function setupRouterSsrQueryIntegration( if (OGWrap) { return Vue.h(OGWrap, null, () => children) } + + // Returning the slot array creates an implicit Vue Fragment around the + // document. Preserve its sole VNode so `` remains the outer root. + if (children?.length === 1) { + return children[0] + } + return children } }, diff --git a/packages/vue-router/CHANGELOG.md b/packages/vue-router/CHANGELOG.md index 1638058127..a9cdeb2b70 100644 --- a/packages/vue-router/CHANGELOG.md +++ b/packages/vue-router/CHANGELOG.md @@ -1,5 +1,306 @@ # @tanstack/vue-router +## 1.170.42 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + +## 1.170.41 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + +## 1.170.40 + +### Patch Changes + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + +## 1.170.39 + +### Patch Changes + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + +## 1.170.38 + +### Patch Changes + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Links of a route that the pending navigation leaves skip deriving the destination location, and clicks and preloads follow the href a Link displays. `buildLocation` now builds `mask` and `routeMasks` locations from the same `_fromLocation` as the destination. + +- [#8579](https://github.com/TanStack/router/pull/8579) [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b) - Cancel pending link preload timers when starting navigation to avoid redundant preloading while the destination is loading. + +- [#8602](https://github.com/TanStack/router/pull/8602) [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb) - Solid and Vue Links reuse the router's built destination across navigations and derive their state through fewer reactive nodes. Solid Links call a user `ref` once per element and create no reactive nodes on the server. + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/history@1.162.5 + - @tanstack/router-core@1.171.35 + +## 1.170.37 + +### Patch Changes + +- [#8568](https://github.com/TanStack/router/pull/8568) [`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949) - Update TanStack Store to 0.11.2 to prevent unrelated atom reads inside subscription observers from triggering extra notifications. + +- Updated dependencies [[`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/router-core@1.171.34 + +## 1.170.36 + +### Patch Changes + +- [#8436](https://github.com/TanStack/router/pull/8436) [`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676) - Skip unused Link preload cleanup when preloading is disabled and ignore queued viewport notifications after their effect has been cleaned up. + +- Updated dependencies [[`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/router-core@1.171.33 + +## 1.170.35 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + +## 1.170.34 + +### Patch Changes + +- [#8418](https://github.com/TanStack/router/pull/8418) [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387) - `deepEqual` now takes its flags as positional arguments — `deepEqual(a, b, partial?, explicitUndefined?)` — instead of an options object. The router's hot callers (Link option stabilization and active-state checks, `matchRoute`) no longer allocate an options object per comparison, and the comparator reads two booleans instead of a polymorphic object. `explicitUndefined` replaces `ignoreUndefined: false`. `deepEqual` is an internal helper; it stays exported for compatibility of two-argument calls. + +- [#8419](https://github.com/TanStack/router/pull/8419) [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd) - `resolvePath` (internal helper) now takes positional arguments — `resolvePath(base, to, trailingSlash?, cache?)` — so `buildLocation` and `matchRoute` no longer allocate an options object per path resolution. + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + +## 1.170.33 + +### Patch Changes + +- [#8326](https://github.com/TanStack/router/pull/8326) [`cb8749e`](https://github.com/TanStack/router/commit/cb8749e9fcd32d2290bf6c957b2701c3c0a14da5) - Remove an unnecessary match Fragment to reduce VNode allocation and transient JIT compilation memory while preserving route content and scroll restoration. + +- [#8318](https://github.com/TanStack/router/pull/8318) [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8) - Allow active and inactive Link props to override base element props in React and Solid while preserving class/style merging. Keep React's `href`, `target`, and `disabled` values controlled by routing options. Preserve Vue object and nested-array class bindings, including reactive updates and server rendering, without mutating cached bindings during VNode normalization. + +- [#8327](https://github.com/TanStack/router/pull/8327) [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef) - Make `pathParamsAllowedCharacters` initialization-only. Configure it when creating the router; changing allowed characters requires a new router instance. Remove decoder-update bookkeeping and decoder-change checks from route-owned path caches. + +- [#8370](https://github.com/TanStack/router/pull/8370) [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5) - Stop exporting the internal `isPlainObject` and `isPlainArray` helpers. + +- [#8318](https://github.com/TanStack/router/pull/8318) [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8) - Reduce Link bundle size by sharing exact/fuzzy active-path checks and resolving only the selected active or inactive props. Avoid unnecessary class/style allocations while preserving reactive style updates, server rendering, and each framework's prop-override behavior. + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`8fff7fa`](https://github.com/TanStack/router/commit/8fff7fa1f2e6f061916b0bf5e0ec486b2e732f94), [`f021f6d`](https://github.com/TanStack/router/commit/f021f6d1c6dce6c9b54d70766f1d636d8fd9e184), [`ae68535`](https://github.com/TanStack/router/commit/ae68535929043607d4ee9438f8ae401f3a064862), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/history@1.162.4 + +## 1.170.32 + +### Patch Changes + +- [#7824](https://github.com/TanStack/router/pull/7824) [`8c43c71`](https://github.com/TanStack/router/commit/8c43c712523fc63dc3a814f3a19617e270ce8ed1) - Upgrade TanStack Store to 0.11 and migrate router subscriptions to useSelector, preserving selector comparisons and Vue subscription cleanup. + +## 1.170.31 + +### Patch Changes + +- [#8308](https://github.com/TanStack/router/pull/8308) [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8) - Validate navigation and redirect destinations, keep ambiguous relative URLs on the current origin, and constrain prerender requests and output paths. Prevent redirect headers from appearing in serialized server function response bodies. + + Preserve native form HTTP redirects, route error handling and masks for document redirects, and per-navigation destinations for shared loader redirects. Avoid redundant origin parsing and reduce link styling and server-rendering work. Configured origins must already be normalized. + + Keep blocked-link inactive props consistent during React hydration, honor explicit redirect Location headers before checking route options, and refresh Vue link state when destinations become internal. Reuse the protocol-relative URL check while parsing redirect schemes once. + + Reduce React link bundle size by sharing pathname comparisons, state-prop selection, and element creation. + + Share normalized pathname comparisons in Solid and Vue links to reduce bundle size. + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/history@1.162.3 + +## 1.170.30 + +### Patch Changes + +- [#8165](https://github.com/TanStack/router/pull/8165) [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2) - Exclude structural descendants below error and not-found boundaries from route lifecycle callbacks. Preserve lifecycle membership through invalidation, hydration, background reloads, and superseded navigation publication. + +- [#8209](https://github.com/TanStack/router/pull/8209) [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f) - Preserve falsy thrown values in React and Vue error boundaries. Type React and Vue boundary error components and `onCatch` callbacks as `unknown`. Solid boundary errors remain typed as `Error`; SSR now wraps non-`Error` loader errors to match Solid’s native boundary behavior, preserving the original value in `cause`. Router state and loader `onError` values are unchanged. + + When upgrading React or Vue, narrow boundary errors (for example, with `error instanceof Error`) before reading `message` or `stack`. `ErrorComponentProps` remains available for values narrowed to a specific error type. Route `onError` types are unchanged. + +- [#8161](https://github.com/TanStack/router/pull/8161) [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96) - Retain successful not-found matches as terminal shared boundaries during client navigation, preserving route context while the destination loads. + +- [#8251](https://github.com/TanStack/router/pull/8251) [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b) - Use URL.canParse for absolute URL checks in links, navigation, redirects, and build configuration. Preserve a URL constructor fallback for older browsers. + +- [#8169](https://github.com/TanStack/router/pull/8169) [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5) - Fix route-scoped `useMatch`, `useSearch`, and `useParams` APIs to forward the `shouldThrow` option and preserve optional return types when `shouldThrow: false`. + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`9035abc`](https://github.com/TanStack/router/commit/9035abc41163d83409ef582f7743a3c7be57dd93), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/history@1.162.2 + +## 1.170.29 + +### Patch Changes + +- [#8132](https://github.com/TanStack/router/pull/8132) [`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c) - Build client preload locations on demand and remove the prebuilt-location argument used by framework links. + +- [#8130](https://github.com/TanStack/router/pull/8130) [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b) - preserve context during reloads + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + +## 1.170.28 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + +## 1.170.27 + +### Patch Changes + +- [#8084](https://github.com/TanStack/router/pull/8084) [`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175) - preserve pending UI across retained routes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + +## 1.170.26 + +### Patch Changes + +- [#8073](https://github.com/TanStack/router/pull/8073) [`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720) - inline isCtrlKey inside Link component for byte shaving + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + +## 1.170.25 + +### Patch Changes + +- [#8054](https://github.com/TanStack/router/pull/8054) [`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90) - Reuse resolved lazy route components when revisiting code-split routes, preventing unnecessary pending UI. + +- [#8002](https://github.com/TanStack/router/pull/8002) [`3848503`](https://github.com/TanStack/router/commit/38485038c52ff898777cabeeeb2eaaa29c93f789) - Keep active route components mounted by default when route params change. + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90)]: + - @tanstack/router-core@1.171.23 + +## 1.170.24 + +### Patch Changes + +- [#8045](https://github.com/TanStack/router/pull/8045) [`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3) - Warn when an Outlet is rendered inside a pending, error, or not-found component. + +- [#8043](https://github.com/TanStack/router/pull/8043) [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1) - remove the undocumented Link `isTransitioning` state and `data-transitioning` attribute + +- [#8044](https://github.com/TanStack/router/pull/8044) [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e) - Apply `preloadDelay` to viewport link preloading and cancel pending preloads when links leave the viewport. + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13)]: + - @tanstack/router-core@1.171.22 + +## 1.170.23 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + +## 1.170.22 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + +## 1.170.21 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + +## 1.170.20 + +### Patch Changes + +- [#7970](https://github.com/TanStack/router/pull/7970) [`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf) - createFileRoute does not rely on FileRoute class + +- [#7985](https://github.com/TanStack/router/pull/7985) [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b) - perf: compact private bundle boundaries- [#7975](https://github.com/TanStack/router/issues/7975) + +- [#7971](https://github.com/TanStack/router/pull/7971) [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7) - clean intersection observer options in link component + +- [#7967](https://github.com/TanStack/router/pull/7967) [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c) - Preserve path params in their raw string form while matching routes so structured values returned by `params.parse` produce stable match IDs and do not reuse stale loader data. + + `RouterCore.getMatchedRoutes()` now returns `[matchedRoutes, rawParams, foundRoute]` instead of an object. + +- Updated dependencies [[`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/router-core@1.171.18 + - @tanstack/history@1.162.1 + +## 1.170.19 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + +## 1.170.18 + +### Patch Changes + +- [#7805](https://github.com/TanStack/router/pull/7805) [`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd) - Rewrite match loading around a lane-based scheduler that tracks each navigation, preload, and background reload as an ordered unit of work. This fixes pending/redirect/retry state leaking between overlapping navigations, restores correct SSR status codes for redirects, errors, and not-found responses, and closes hydration gaps where the client re-ran work the server had already completed. + - Invalidation now retires matching active preloads so older speculative loader results cannot become fresh cache data after invalidation. + - Route `headers()` now only runs on the server, matching the documented behavior — it is no longer invoked during client-side asset projection. + - The documented default `gcTime` and `preloadGcTime` now match the existing runtime default of 5 minutes (`300_000`). + + **Removed / changed exported internals** + - `RouterState` no longer includes `loadedAt`, `isTransitioning`, `statusCode`, or `redirect`. Use `match.updatedAt` in place of `loadedAt`; subscribe to `router.state.status` / `router.state.isLoading` in place of `isTransitioning`; server response status and redirect handling are now internal to the server loader and are no longer exposed on `router.state`. + - `RouteMatch.fetchCount` has been removed, with no replacement — it was purely informational. + - `RouteMatch.status` no longer includes `'redirected'` (it remains `'pending' | 'success' | 'error' | 'notFound'`) — redirected matches are dropped from the match list instead of being rendered. + - `RouteMatch.globalNotFound` has been renamed and privatized to the internal `_notFound` field. Use `match.status === 'notFound'` instead. + - The exported React, Solid, and Vue `Match` components now accept `routeId` instead of `matchId`. + - The exported `RouterStores` adapter contract now uses route-keyed presentation stores: `matchesId` is replaced by `ids`, `matchStores` by `byRoute`, and `getRouteMatchStore()` by `getMatchStore()`. The separate `loadedAt`, `isLoading`, `isTransitioning`, `statusCode`, and `redirect` stores have been removed, along with the pending/cache stores and their setters. `StoreConfig.init` has also been removed. Read application-facing state from `router.state`; preload and cache coordination are now internal. + - Removed `RouterCore` members `getMatch()`, `updateMatch()`, `cancelMatch()`, and `cancelMatches()` — read matches from `router.state.matches` (e.g. `router.state.matches.find((m) => m.id === id)`); there is no replacement for mutating or cancelling an individual in-flight match from outside the router. + - Removed `RouterCore.hasNotFoundMatch()` — use `router.state.matches.some((m) => m.status === 'notFound')`. + - Removed `RouterCore.looseRoutesById` — use `routesById`. + - Removed `RouterCore.isPrerendering()`, `RouterCore.isViewTransitionTypesSupported`, and `RouterCore.viewTransitionPromise`, with no replacement. + - Removed `RouterCore.getParsedLocationHref()` and `RouterCore.clearExpiredCache()`, with no replacement — expired cache entries are now reconciled automatically as part of match commit. + - Removed `RouterCore.latestLoadPromise` and `RouterCore.beforeLoad()`, with no replacement. + - `RouterCore.commitLocationPromise` and `RouterCore.pendingBuiltLocation` have been replaced by the internal `_commitPromise` and `_pendingLocation` fields. + - Removed the exported `GetMatchFn` and `UpdateMatchFn` types, along with the methods they typed. + - Removed the standalone `getMatchedRoutes()` export from `@tanstack/router-core` — use the `router.getMatchedRoutes()` instance method instead. + - `RouterCore.loadRouteChunk()` no longer accepts an array of component types as its second argument. One-argument usage is unchanged; the optional second argument is now `'errorComponent'`, `'notFoundComponent'`, or `false` for internal boundary loading. + - Removed `Redirect.redirectHandled`, which was internal redirect bookkeeping. + - `MatchRoutesOpts.preload` and `MatchRoutesOpts.dest` have been removed. + - `StartTransitionFn` is now `(fn, expected) => Promise` (previously `(fn) => void`). This only affects custom framework adapters that implement `startTransition`. + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + ## 1.170.17 ### Patch Changes diff --git a/packages/vue-router/README.md b/packages/vue-router/README.md index 383a15d84d..4c71e74654 100644 --- a/packages/vue-router/README.md +++ b/packages/vue-router/README.md @@ -2,7 +2,21 @@ # TanStack Vue Router -![TanStack Router Header](https://raw.githubusercontent.com/TanStack/router/main/media/header_router.png) + + + + TanStack Vue Router + 🤖 Type-safe router w/ built-in caching & URL state management for Vue! diff --git a/packages/vue-router/package.json b/packages/vue-router/package.json index 96dc3fde40..93ae8fdeed 100644 --- a/packages/vue-router/package.json +++ b/packages/vue-router/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-router", - "version": "1.170.17", + "version": "1.170.42", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -75,19 +75,26 @@ "dependencies": { "@tanstack/history": "workspace:*", "@tanstack/router-core": "workspace:*", - "@tanstack/vue-store": "^0.9.3", + "@tanstack/vue-store": "^0.11.2", "@vue/runtime-dom": "^3.5.25", - "isbot": "^5.1.22" + "isbot": "catalog:" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", + "@testing-library/jest-dom": "catalog:", "@testing-library/vue": "^8.1.0", "@types/node": ">=20", - "@vitejs/plugin-vue-jsx": "^4.1.2", - "combinate": "^1.1.11", + "@vitejs/plugin-vue-jsx": "catalog:", + "combinate": "catalog:", "vite": "*", - "vue": "^3.5.25", - "zod": "^4.4.3" + "vue": "catalog:", + "zod": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@vitest/ui": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "vue": "^3.3.0" diff --git a/packages/vue-router/skills/vue-router/SKILL.md b/packages/vue-router/skills/vue-router/SKILL.md index 17108957aa..61c13bef1f 100644 --- a/packages/vue-router/skills/vue-router/SKILL.md +++ b/packages/vue-router/skills/vue-router/SKILL.md @@ -8,10 +8,11 @@ description: >- Outlet, CatchBoundary, ErrorComponent, Html, Body. Vue-specific patterns with Ref returns, defineComponent, h() render functions, provide/inject, and computed refs. -type: framework -library: tanstack-router -library_version: '1.166.2' -framework: vue +metadata: + type: framework + library: tanstack-router + library_version: '1.166.2' + framework: vue requires: - router-core sources: @@ -20,7 +21,7 @@ sources: # Vue Router (`@tanstack/vue-router`) -This skill builds on router-core. Read [router-core](../../../router-core/skills/router-core/SKILL.md) first for foundational concepts. +This skill builds on router-core. Read `@tanstack/router-core#router-core` first for foundational concepts. This skill covers the Vue-specific bindings, components, composables, and setup for TanStack Router. @@ -389,4 +390,4 @@ Must set `target: 'vue'` in the router plugin config. Default is `'react'`. ## Cross-References -- [router-core/SKILL.md](../../../router-core/skills/router-core/SKILL.md) — all sub-skills for domain-specific patterns (search params, data loading, navigation, auth, SSR, etc.) +- `@tanstack/router-core#router-core` — all sub-skills for domain-specific patterns (search params, data loading, navigation, auth, SSR, etc.) diff --git a/packages/vue-router/src/CatchBoundary.tsx b/packages/vue-router/src/CatchBoundary.tsx index 5d75de8d6d..2b4f66e78f 100644 --- a/packages/vue-router/src/CatchBoundary.tsx +++ b/packages/vue-router/src/CatchBoundary.tsx @@ -1,43 +1,39 @@ import * as Vue from 'vue' +import { renderInNonRouteComponentContext } from './nonRouteComponentContext' import type { ErrorRouteComponent } from './route' -interface ErrorComponentProps { - error: Error - reset: () => void -} - type CatchBoundaryProps = { - getResetKey: () => number | string + getResetKey: () => unknown children: Vue.VNode errorComponent?: ErrorRouteComponent | Vue.Component - onCatch?: (error: Error) => void + onCatch?: (error: unknown) => void } const VueErrorBoundary = Vue.defineComponent({ name: 'VueErrorBoundary', props: { onError: Function, - resetKey: [String, Number], + resetKey: [String, Number, Object], + children: null, + errorComponent: null, }, - emits: ['catch'], - setup(props, { slots }) { - const error = Vue.ref(null) - const resetFn = Vue.ref<(() => void) | null>(null) + setup(props) { + const error = Vue.shallowRef<[unknown] | 0>(0) const reset = () => { - error.value = null + error.value = 0 } Vue.watch( () => props.resetKey, - (newKey, oldKey) => { - if (newKey !== oldKey && error.value) { + () => { + if (error.value) { reset() } }, ) - Vue.onErrorCaptured((err: Error) => { + Vue.onErrorCaptured((err: unknown) => { if ( err instanceof Promise || (err && typeof (err as any).then === 'function') @@ -45,8 +41,7 @@ const VueErrorBoundary = Vue.defineComponent({ return false } - error.value = err - resetFn.value = reset + error.value = [err] if (props.onError) { props.onError(err) @@ -56,60 +51,42 @@ const VueErrorBoundary = Vue.defineComponent({ }) return () => { - if (error.value && slots.fallback) { - const fallbackContent = slots.fallback({ - error: error.value, - reset, - }) - return Array.isArray(fallbackContent) && fallbackContent.length === 1 - ? fallbackContent[0] - : fallbackContent + if (!error.value) { + return props.children as Vue.VNode } - const defaultContent = slots.default && slots.default() - return Array.isArray(defaultContent) && defaultContent.length === 1 - ? defaultContent[0] - : defaultContent - } - }, -}) + const errorComponent = props.errorComponent ?? ErrorComponent + const errorProps = { + error: error.value[0], + reset, + } -const CatchBoundaryWrapper = Vue.defineComponent({ - name: 'CatchBoundary', - inheritAttrs: false, - props: ['getResetKey', 'children', 'errorComponent', 'onCatch'] as any, - setup(props: CatchBoundaryProps) { - const resetKey = Vue.computed(() => props.getResetKey()) - - return () => { - return Vue.h( - VueErrorBoundary, - { - resetKey: resetKey.value, - onError: props.onCatch, - }, - { - default: () => props.children, - fallback: ({ error, reset }: ErrorComponentProps) => { - if (props.errorComponent) { - return Vue.h(props.errorComponent, { error, reset }) - } - return Vue.h(ErrorComponent, { error, reset }) - }, - }, - ) + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + errorComponent, + errorProps, + 'errorComponent', + ) + : Vue.h(errorComponent, errorProps) } }, }) export function CatchBoundary(props: CatchBoundaryProps) { - return Vue.h(CatchBoundaryWrapper, props as any) + return Vue.h(VueErrorBoundary, { + resetKey: props.getResetKey() as any, + onError: props.onCatch, + children: props.children, + errorComponent: props.errorComponent, + }) } +CatchBoundary.inheritAttrs = false +CatchBoundary.props = ['getResetKey', 'children', 'errorComponent', 'onCatch'] export const ErrorComponent = Vue.defineComponent({ name: 'ErrorComponent', props: { - error: Object, + error: null as unknown as Vue.PropType, reset: Function, }, setup(props) { @@ -163,8 +140,12 @@ export const ErrorComponent = Vue.defineComponent({ }, }, [ - props.error?.message - ? Vue.h('code', {}, props.error.message) + (props.error as { message?: string } | null)?.message + ? Vue.h( + 'code', + {}, + (props.error as { message: string }).message, + ) : null, ], ), diff --git a/packages/vue-router/src/Match.tsx b/packages/vue-router/src/Match.tsx index 44e9aca0cd..0c3ff40f1d 100644 --- a/packages/vue-router/src/Match.tsx +++ b/packages/vue-router/src/Match.tsx @@ -1,32 +1,25 @@ import * as Vue from 'vue' -import { - createControlledPromise, - getLocationChangeInfo, - invariant, - isNotFound, - isRedirect, - rootRouteId, -} from '@tanstack/router-core' +import { isNotFound, rootRouteId } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' -import { useStore } from '@tanstack/vue-store' -import { CatchBoundary, ErrorComponent } from './CatchBoundary' +import { useSelector } from '@tanstack/vue-store' +import { CatchBoundary } from './CatchBoundary' import { ClientOnly } from './ClientOnly' import { useRouter } from './useRouter' import { CatchNotFound } from './not-found' -import { - matchContext, - pendingMatchContext, - routeIdContext, -} from './matchContext' +import { provideLinkLocation, routeIdContext } from './matchContext' import { renderRouteNotFound } from './renderRouteNotFound' import { ScrollRestoration } from './scroll-restoration' +import { + nonRouteComponentContext, + renderInNonRouteComponentContext, +} from './nonRouteComponentContext' import type { VNode } from 'vue' import type { AnyRoute, RootRouteOptions } from '@tanstack/router-core' export const Match = Vue.defineComponent({ name: 'Match', props: { - matchId: { + routeId: { type: String, required: true, }, @@ -34,127 +27,58 @@ export const Match = Vue.defineComponent({ setup(props) { const router = useRouter() - // Derive routeId from initial props.matchId — stable for this component's - // lifetime. The routeId never changes for a given route position in the - // tree, even when matchId changes (loaderDepsHash, etc). - const routeId = router.stores.matchStores.get(props.matchId)?.routeId + const routeId = props.routeId - if (!routeId) { - if (process.env.NODE_ENV !== 'production') { - throw new Error( - `Invariant failed: Could not find routeId for matchId "${props.matchId}". Please file an issue!`, - ) - } - - invariant() - } - - // Static route-tree check: is this route a direct child of the root? - // parentRoute is set at build time, so no reactive tracking needed. - const isChildOfRoot = - (router.routesById[routeId] as AnyRoute)?.parentRoute?.id === rootRouteId - - // Single stable store subscription — getRouteMatchStore returns a - // cached computed store that resolves routeId → current match state - // through the signal graph. No bridge needed. - const activeMatch = useStore( - router.stores.getRouteMatchStore(routeId), + const activeMatch = useSelector( + router.stores.getMatchStore(routeId), (value) => value, + { compare: Object.is }, ) - const isPendingMatchRef = useStore( - router.stores.pendingRouteIds, - (pendingRouteIds) => Boolean(pendingRouteIds[routeId]), - { equal: Object.is }, - ) - const loadedAt = useStore(router.stores.loadedAt, (value) => value) - - const matchData = Vue.computed(() => { - const match = activeMatch.value - if (!match) { - return null - } - - return { - matchId: match.id, - routeId, - loadedAt: loadedAt.value, - ssr: match.ssr, - _displayPending: match._displayPending, - } - }) - - const route = Vue.computed(() => - matchData.value ? router.routesById[matchData.value.routeId] : null, - ) - - const PendingComponent = Vue.computed( - () => - route.value?.options?.pendingComponent ?? - router?.options?.defaultPendingComponent, - ) - - const pendingElement = Vue.computed(() => - PendingComponent.value ? Vue.h(PendingComponent.value) : undefined, - ) - - const routeErrorComponent = Vue.computed( - () => - route.value?.options?.errorComponent ?? - router?.options?.defaultErrorComponent, - ) - - const routeOnCatch = Vue.computed( - () => route.value?.options?.onCatch ?? router?.options?.defaultOnCatch, - ) - - const routeNotFoundComponent = Vue.computed(() => - route.value?.isRoot - ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component - (route.value?.options?.notFoundComponent ?? - router?.options?.notFoundRoute?.options?.component) - : route.value?.options?.notFoundComponent, - ) - - const hasShellComponent = Vue.computed(() => { - if (!route.value?.isRoot) return false - return !!(route.value.options as RootRouteOptions).shellComponent - }) - - const ShellComponent = Vue.computed(() => - hasShellComponent.value - ? ((route.value!.options as RootRouteOptions).shellComponent as any) - : null, - ) - // Provide routeId context (stable string) for children. // MatchInner, Outlet, and useMatch all consume this. Vue.provide(routeIdContext, routeId) - - // Provide reactive nearest-match context for hooks that slice the active - // matches array relative to the current match. - const matchIdRef = Vue.computed( - () => activeMatch.value?.id ?? props.matchId, - ) - Vue.provide(matchContext, matchIdRef) - - Vue.provide(pendingMatchContext, isPendingMatchRef) + // This match's links hold their location while a navigation leaves it. + // Server links read the live location. + if (!(isServer ?? router.isServer)) { + provideLinkLocation(router, routeId) + } return (): VNode => { - const actualMatchId = matchData.value?.matchId ?? props.matchId - - const resolvedNoSsr = - matchData.value?.ssr === false || matchData.value?.ssr === 'data-only' - const shouldClientOnly = - resolvedNoSsr || !!matchData.value?._displayPending + const match = activeMatch.value + const route = match ? (router.routesById[routeId] as AnyRoute) : undefined + const PendingComponent = + route?.options.pendingComponent ?? + router.options.defaultPendingComponent + const pendingElement = PendingComponent + ? process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + PendingComponent, + undefined, + 'pendingComponent', + ) + : Vue.h(PendingComponent) + : undefined + const routeErrorComponent = + route?.options.errorComponent ?? router.options.defaultErrorComponent + const routeOnCatch = + route?.options.onCatch ?? router.options.defaultOnCatch + const routeNotFoundComponent = route?.isRoot + ? (route.options.notFoundComponent ?? + router.options.notFoundRoute?.options.component) + : route?.options.notFoundComponent + const ShellComponent = route?.isRoot + ? ((route.options as RootRouteOptions).shellComponent as any) + : undefined + const resolvedNoSsr = match?.ssr === false || match?.ssr === 'data-only' const renderMatchContent = (): VNode => { - const matchInner = Vue.h(MatchInner, { matchId: actualMatchId }) + const matchInner = Vue.h(MatchInner) - let content: VNode = shouldClientOnly + let content: VNode = resolvedNoSsr ? Vue.h( ClientOnly, { - fallback: pendingElement.value, + fallback: pendingElement, }, { default: () => matchInner, @@ -163,73 +87,64 @@ export const Match = Vue.defineComponent({ : matchInner // Wrap in NotFound boundary if needed - if (routeNotFoundComponent.value) { + if (routeNotFoundComponent) { content = Vue.h(CatchNotFound, { fallback: (error: any) => { - error.routeId ??= matchData.value?.routeId + error.routeId ??= routeId - // If the current not found handler doesn't exist or it has a - // route ID which doesn't match the current route, rethrow the error - if ( - !routeNotFoundComponent.value || - (error.routeId && error.routeId !== matchData.value?.routeId) || - (!error.routeId && route.value && !route.value.isRoot) - ) + if (error.routeId !== routeId) { throw error + } - return Vue.h(routeNotFoundComponent.value, error) + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + routeNotFoundComponent, + error, + 'notFoundComponent', + ) + : Vue.h(routeNotFoundComponent, error) }, children: content, }) } // Wrap in error boundary if needed - if (routeErrorComponent.value) { + if (routeErrorComponent) { content = CatchBoundary({ - getResetKey: () => matchData.value?.loadedAt ?? 0, - errorComponent: routeErrorComponent.value || ErrorComponent, - onCatch: (error: Error) => { + getResetKey: () => activeMatch.value, + errorComponent: routeErrorComponent, + onCatch: (error: unknown) => { // Forward not found errors (we don't want to show the error component for these) if (isNotFound(error)) { - error.routeId ??= matchData.value?.routeId + error.routeId ??= routeId throw error } if (process.env.NODE_ENV !== 'production') { - console.warn(`Warning: Error in route match: ${actualMatchId}`) + console.warn(`Warning: Error in route match: ${match?.id}`) } - routeOnCatch.value?.(error) + routeOnCatch?.(error) }, children: content, }) } - // Add scroll restoration if needed - const withScrollRestoration: Array = [ - content, - isChildOfRoot - ? Vue.h(Vue.Fragment, null, [ - Vue.h(OnRendered), - router.options.scrollRestoration && - (isServer ?? router.isServer) - ? Vue.h(ScrollRestoration) - : null, - ]) - : null, - ].filter(Boolean) as Array - - // Return single child directly to avoid Fragment wrapper that causes hydration mismatch - if (withScrollRestoration.length === 1) { - return withScrollRestoration[0]! + if (route?.parentRoute?.id !== rootRouteId) { + return content } - return Vue.h(Vue.Fragment, null, withScrollRestoration) + return Vue.h(Vue.Fragment, null, [ + content, + (isServer ?? router.isServer) && router.options.scrollRestoration + ? Vue.h(ScrollRestoration) + : null, + ]) } - if (!hasShellComponent.value) { + if (!ShellComponent) { return renderMatchContent() } - return Vue.h(ShellComponent.value, null, { + return Vue.h(ShellComponent, null, { // Important: return a fresh VNode on each slot invocation so that shell // components can re-render without reusing a cached VNode instance. default: () => renderMatchContent(), @@ -239,65 +154,14 @@ export const Match = Vue.defineComponent({ }) // On Rendered can't happen above the root layout because it actually -// renders a dummy dom element to track the rendered state of the app. -// We render a script tag with a key that changes based on the current -// location state.__TSR_key. Also, because it's below the root layout, it -// allows us to fire onRendered events even after a hydration mismatch -// error that occurred above the root layout (like bad head/link tags, -// which is common). -const OnRendered = Vue.defineComponent({ - name: 'OnRendered', - setup() { - const router = useRouter() - - const location = useStore( - router.stores.resolvedLocation, - (resolvedLocation) => resolvedLocation?.state.__TSR_key, - ) - - let prevHref: string | undefined - - Vue.watch( - location, - () => { - if (location.value) { - const currentHref = router.latestLocation.href - if (prevHref === undefined || prevHref !== currentHref) { - router.emit({ - type: 'onRendered', - ...getLocationChangeInfo( - router.stores.location.get(), - router.stores.resolvedLocation.get(), - ), - }) - prevHref = currentHref - } - } - }, - { immediate: true }, - ) - - return () => null - }, -}) - export const MatchInner = Vue.defineComponent({ name: 'MatchInner', - props: { - matchId: { - type: String, - required: true, - }, - }, - setup(props) { + setup() { const router = useRouter() // Use routeId from context (provided by parent Match) — stable string. const routeId = Vue.inject(routeIdContext)! - const activeMatch = useStore( - router.stores.getRouteMatchStore(routeId), - (value) => value, - ) + const activeMatch = useSelector(router.stores.getMatchStore(routeId)) // Combined selector for match state AND remount key // This ensures both are computed in the same selector call with consistent data @@ -315,156 +179,80 @@ export const MatchInner = Vue.defineComponent({ (router.routesById[matchRouteId] as AnyRoute).options.remountDeps ?? router.options.defaultRemountDeps - let remountKey: string | undefined - if (remountFn) { - const remountDeps = remountFn({ - routeId: matchRouteId, - loaderDeps: match.loaderDeps, - params: match._strictParams, - search: match._strictSearch, - }) - remountKey = remountDeps ? JSON.stringify(remountDeps) : undefined - } + const remountKey = remountFn + ? JSON.stringify( + remountFn({ + routeId: matchRouteId, + loaderDeps: match.loaderDeps, + params: match._strictParams, + search: match._strictSearch, + }), + ) + : undefined - return { - routeId: matchRouteId, - match: { - id: match.id, - status: match.status, - error: match.error, - ssr: match.ssr, - _forcePending: match._forcePending, - _displayPending: match._displayPending, - _nonReactive: match._nonReactive, - }, - remountKey, - } + return [match, remountKey] as const }) - const route = Vue.computed(() => { - if (!combinedState.value) return null - return router.routesById[combinedState.value.routeId]! - }) - - const match = Vue.computed(() => combinedState.value?.match) - const remountKey = Vue.computed(() => combinedState.value?.remountKey) - - const getMatchPromise = ( - match: { - id: string - _nonReactive: { - displayPendingPromise?: Promise - minPendingPromise?: Promise - loadPromise?: Promise - } - }, - key: 'displayPendingPromise' | 'minPendingPromise' | 'loadPromise', - ) => { - return ( - router.getMatch(match.id)?._nonReactive[key] ?? match._nonReactive[key] - ) - } - return (): VNode | null => { // If match doesn't exist, return null (component is being unmounted or not ready) - if (!combinedState.value || !match.value || !route.value) return null + const state = combinedState.value + if (!state) { + return null + } + const [match, remountKey] = state + const route = router.routesById[match.routeId]! // Handle different match statuses - if (match.value._displayPending) { - const PendingComponent = - route.value.options.pendingComponent ?? - router.options.defaultPendingComponent - - return PendingComponent ? Vue.h(PendingComponent) : null + if (match.status === 'notFound') { + return renderRouteNotFound(router, route, match.error) } - if (match.value._forcePending) { - const PendingComponent = - route.value.options.pendingComponent ?? - router.options.defaultPendingComponent - - return PendingComponent ? Vue.h(PendingComponent) : null - } - - if (match.value.status === 'notFound') { - if (!isNotFound(match.value.error)) { - if (process.env.NODE_ENV !== 'production') { - throw new Error('Invariant failed: Expected a notFound error') - } - - invariant() - } - return renderRouteNotFound(router, route.value, match.value.error) - } - - if (match.value.status === 'redirected') { - if (!isRedirect(match.value.error)) { - if (process.env.NODE_ENV !== 'production') { - throw new Error('Invariant failed: Expected a redirect error') - } - - invariant() - } - throw getMatchPromise(match.value, 'loadPromise') - } - - if (match.value.status === 'error') { + if (match.status === 'error') { // Check if this route or any parent has an error component const RouteErrorComponent = - route.value.options.errorComponent ?? - router.options.defaultErrorComponent + route.options.errorComponent ?? router.options.defaultErrorComponent // If this route has an error component, render it directly // This is more reliable than relying on Vue's error boundary if (RouteErrorComponent) { - return Vue.h(RouteErrorComponent, { - error: match.value.error, + const errorProps = { + error: match.error, reset: () => { router.invalidate() }, info: { componentStack: '', }, - }) + } + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + RouteErrorComponent, + errorProps, + 'errorComponent', + ) + : Vue.h(RouteErrorComponent, errorProps) } // If there's no error component for this route, throw the error // so it can bubble up to the nearest parent with an error component - throw match.value.error + throw match.error } - if (match.value.status === 'pending') { - const pendingMinMs = - route.value.options.pendingMinMs ?? router.options.defaultPendingMinMs - - const routerMatch = router.getMatch(match.value.id) - if ( - pendingMinMs && - routerMatch && - !routerMatch._nonReactive.minPendingPromise - ) { - // Create a promise that will resolve after the minPendingMs - if (!(isServer ?? router.isServer)) { - const minPendingPromise = createControlledPromise() - - routerMatch._nonReactive.minPendingPromise = minPendingPromise - - setTimeout(() => { - minPendingPromise.resolve() - // We've handled the minPendingPromise, so we can delete it - routerMatch._nonReactive.minPendingPromise = undefined - }, pendingMinMs) - } - } - + if (match.status === 'pending') { // In Vue, we render the pending component directly instead of throwing a promise // because Vue's Suspense doesn't catch thrown promises like React does const PendingComponent = - route.value.options.pendingComponent ?? + route.options.pendingComponent ?? router.options.defaultPendingComponent if (PendingComponent) { - return Vue.h(PendingComponent) + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + PendingComponent, + undefined, + 'pendingComponent', + ) + : Vue.h(PendingComponent) } // If no pending component, return null while loading @@ -472,16 +260,19 @@ export const MatchInner = Vue.defineComponent({ } // Success status - render the component with remount key - const Comp = - route.value.options.component ?? router.options.defaultComponent - const key = remountKey.value - + const Comp = route.options.component ?? router.options.defaultComponent if (Comp) { // Pass key as a prop - Vue.h properly handles 'key' as a special prop - return Vue.h(Comp, key !== undefined ? { key } : undefined) + return Vue.h( + Comp, + remountKey !== undefined ? { key: remountKey } : undefined, + ) } - return Vue.h(Outlet, key !== undefined ? { key } : undefined) + return Vue.h( + Outlet, + remountKey !== undefined ? { key: remountKey } : undefined, + ) } }, }) @@ -489,67 +280,48 @@ export const MatchInner = Vue.defineComponent({ export const Outlet = Vue.defineComponent({ name: 'Outlet', setup() { - const router = useRouter() - const parentRouteId = Vue.inject(routeIdContext) - - if (!parentRouteId) { - return (): VNode | null => null + if (process.env.NODE_ENV !== 'production') { + const nonRouteComponent = Vue.inject(nonRouteComponentContext!, undefined) + if (nonRouteComponent) { + Vue.watch( + nonRouteComponent, + (component) => { + console.warn( + `Warning: An was rendered inside a ${component}. should only be rendered inside a route component.`, + ) + }, + { immediate: true }, + ) + } } - // Parent state via stable routeId store — single subscription - const parentMatch = useStore( - router.stores.getRouteMatchStore(parentRouteId), - (v) => v, - ) + const router = useRouter() + const parentRouteId = Vue.inject(routeIdContext)! - const route = Vue.computed(() => - parentMatch.value - ? router.routesById[parentMatch.value.routeId as string]! - : undefined, - ) + const parentMatch = useSelector(router.stores.getMatchStore(parentRouteId)) - const parentGlobalNotFound = Vue.computed( - () => parentMatch.value?.globalNotFound ?? false, - ) + const route = router.routesById[parentRouteId]! - // Child match lookup: read the child matchId from the shared derived - // map (one reactive node for the whole tree), then grab match state - // directly from the pool. - const childMatchIdMap = useStore( - router.stores.childMatchIdByRouteId, - (v) => v, - ) - - const childMatchData = Vue.computed(() => { - const childId = childMatchIdMap.value[parentRouteId] - if (!childId) return null - const child = router.stores.matchStores.get(childId)?.get() - if (!child) return null - - return { - id: child.id, - // Key based on routeId + params only (not loaderDeps) - // This ensures component recreates when params change, - // but NOT when only loaderDeps change - paramsKey: child.routeId + JSON.stringify(child._strictParams), - } + const childRouteId = useSelector(router.stores.matches, (matches) => { + const index = matches.findIndex( + (match) => match.routeId === parentRouteId, + ) + return matches[index + 1]?.routeId }) return (): VNode | null => { - if (parentGlobalNotFound.value) { - if (!route.value) { - return null - } - return renderRouteNotFound(router, route.value, undefined) + if (parentMatch.value?._notFound) { + return renderRouteNotFound(router, route, parentMatch.value.error) } - if (!childMatchData.value) { + const child = childRouteId.value + if (!child) { return null } const nextMatch = Vue.h(Match, { - matchId: childMatchData.value.id, - key: childMatchData.value.paramsKey, + routeId: child, + key: child, }) // Note: We intentionally do NOT wrap in Suspense here. diff --git a/packages/vue-router/src/Matches.tsx b/packages/vue-router/src/Matches.tsx index da8220db29..a22ec82e82 100644 --- a/packages/vue-router/src/Matches.tsx +++ b/packages/vue-router/src/Matches.tsx @@ -1,11 +1,12 @@ import * as Vue from 'vue' import { isServer } from '@tanstack/router-core/isServer' -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { CatchBoundary } from './CatchBoundary' import { useRouter } from './useRouter' import { useTransitionerSetup } from './Transitioner' -import { matchContext } from './matchContext' +import { routeIdContext } from './matchContext' import { Match } from './Match' +import { renderInNonRouteComponentContext } from './nonRouteComponentContext' import type { AnyRouter, DeepPartial, @@ -32,51 +33,37 @@ declare module '@tanstack/router-core' { } } -// Create a component that renders MatchesInner with Transitioner's setup logic inlined. -// This is critical for proper hydration - we call useTransitionerSetup() as a composable -// rather than rendering it as a component, which avoids Fragment/element mismatches. -const MatchesContent = Vue.defineComponent({ - name: 'MatchesContent', - setup() { - // IMPORTANT: We need to ensure Transitioner's setup() runs. - // Transitioner sets up critical functionality: - // - router.startTransition - // - History subscription via router.history.subscribe(router.load) - // - Watchers for router events - // - // We inline Transitioner's setup logic here. Since Transitioner returns null, - // we can call its setup function directly without affecting the render tree. - // This is done by importing and calling useTransitionerSetup. - useTransitionerSetup() - - return () => Vue.h(MatchesInner) - }, -}) - export const Matches = Vue.defineComponent({ name: 'Matches', setup() { const router = useRouter() + useTransitionerSetup() return () => { - const pendingElement = router?.options?.defaultPendingComponent - ? Vue.h(router.options.defaultPendingComponent) + const pendingElement = router.options.defaultPendingComponent + ? process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + router.options.defaultPendingComponent, + undefined, + 'pendingComponent', + ) + : Vue.h(router.options.defaultPendingComponent) : null // Do not render a root Suspense during SSR or hydrating from SSR const inner = - (isServer ?? router?.isServer ?? false) || - (typeof document !== 'undefined' && router?.ssr) - ? Vue.h(MatchesContent) + (isServer ?? router.isServer) || + (typeof document !== 'undefined' && router.ssr) + ? Vue.h(MatchesInner) : Vue.h( Vue.Suspense, { fallback: pendingElement }, { - default: () => Vue.h(MatchesContent), + default: () => Vue.h(MatchesInner), }, ) - return router?.options?.InnerWrap + return router.options.InnerWrap ? Vue.h(router.options.InnerWrap, null, { default: () => inner }) : inner } @@ -89,7 +76,12 @@ const errorComponentFn: ErrorRouteComponentType = ( ) => { return Vue.h('div', { class: 'error' }, [ Vue.h('h1', null, 'Error'), - Vue.h('p', null, props.error.message || String(props.error)), + Vue.h( + 'p', + null, + (props.error as { message?: string } | null)?.message || + String(props.error), + ), Vue.h('button', { onClick: props.reset }, 'Try Again'), ]) } @@ -99,19 +91,13 @@ const MatchesInner = Vue.defineComponent({ setup() { const router = useRouter() - const matchId = useStore(router.stores.firstId, (id) => id) - const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt) - - // Create a ref for the match id to provide - const matchIdRef = Vue.computed(() => matchId.value) - - // Provide the matchId for child components using the InjectionKey - Vue.provide(matchContext, matchIdRef) + const matches = useSelector(router.stores.matches) + const routeId = Vue.computed(() => matches.value[0]?.routeId) return () => { - // Generate a placeholder element if matchId.value is not present - const childElement = matchId.value - ? Vue.h(Match, { matchId: matchId.value }) + // Generate a placeholder element if routeId.value is not present + const childElement = routeId.value + ? Vue.h(Match, { routeId: routeId.value }) : Vue.h('div') // If disableGlobalCatchBoundary is true, don't wrap in CatchBoundary @@ -120,15 +106,15 @@ const MatchesInner = Vue.defineComponent({ } return Vue.h(CatchBoundary, { - getResetKey: () => resetKey.value, + getResetKey: () => matches.value, errorComponent: errorComponentFn, onCatch: process.env.NODE_ENV !== 'production' - ? (error: Error) => { + ? (error: unknown) => { console.warn( `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`, ) - console.warn(`Warning: ${error.message || error.toString()}`) + console.warn('Warning:', error) } : undefined, children: childElement, @@ -152,7 +138,12 @@ export type UseMatchRouteOptions< export function useMatchRoute() { const router = useRouter() - const routerState = useStore(router.stores.matchRouteDeps, (value) => value) + const location = useSelector(router.stores.location, (value) => value.href) + const resolvedLocation = useSelector( + router.stores.resolvedLocation, + (value) => value?.href, + ) + const status = useSelector(router.stores.status) return < const TFrom extends string = string, @@ -164,12 +155,11 @@ export function useMatchRoute() { ): Vue.Ref< false | ResolveRoute['types']['allParams'] > => { - const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts - const matchRoute = Vue.computed(() => { - // Access routerState to establish dependency - - routerState.value + location.value + resolvedLocation.value + status.value + const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts return router.matchRoute(rest as any, { pending, caseSensitive, @@ -248,27 +238,20 @@ export const MatchRoute = Vue.defineComponent({ }, }, setup(props, { slots }) { - const router = useRouter() - const status = useStore( - router.stores.matchRouteDeps, - (value) => value.status, - ) + const params = useMatchRoute()(props) return () => { - if (!status.value) return null - - const matchRoute = useMatchRoute() - const params = matchRoute(props).value as boolean + const match = params.value as boolean // Create a component that renders the slot in a reactive manner - if (!params || !slots.default) { + if (!match || !slots.default) { return null } // For function slots, pass the params if (typeof slots.default === 'function') { // Use h to create a wrapper component that will call the slot function - return Vue.h(Vue.Fragment, null, slots.default(params)) + return Vue.h(Vue.Fragment, null, slots.default(match)) } // For normal slots, just render them @@ -293,7 +276,7 @@ export function useMatches< opts?: UseMatchesBaseOptions, ): Vue.Ref> { const router = useRouter() - return useStore(router.stores.matches, (matches) => { + return useSelector(router.stores.matches, (matches) => { return opts?.select ? opts.select(matches as Array>) : (matches as any) @@ -306,15 +289,13 @@ export function useParentMatches< >( opts?: UseMatchesBaseOptions, ): Vue.Ref> { - // Use matchContext with proper type - const contextMatchId = Vue.inject>(matchContext) - const safeMatchId = Vue.computed(() => contextMatchId?.value || '') + const contextRouteId = Vue.inject(routeIdContext) return useMatches({ select: (matches: Array>) => { matches = matches.slice( 0, - matches.findIndex((d) => d.id === safeMatchId.value), + matches.findIndex((d) => d.routeId === contextRouteId), ) return opts?.select ? opts.select(matches) : matches }, @@ -327,14 +308,12 @@ export function useChildMatches< >( opts?: UseMatchesBaseOptions, ): Vue.Ref> { - // Use matchContext with proper type - const contextMatchId = Vue.inject>(matchContext) - const safeMatchId = Vue.computed(() => contextMatchId?.value || '') + const contextRouteId = Vue.inject(routeIdContext) return useMatches({ select: (matches: Array>) => { matches = matches.slice( - matches.findIndex((d) => d.id === safeMatchId.value) + 1, + matches.findIndex((d) => d.routeId === contextRouteId) + 1, ) return opts?.select ? opts.select(matches) : matches }, diff --git a/packages/vue-router/src/RouterProvider.tsx b/packages/vue-router/src/RouterProvider.tsx index 3a4fe63261..874a24fef0 100644 --- a/packages/vue-router/src/RouterProvider.tsx +++ b/packages/vue-router/src/RouterProvider.tsx @@ -1,6 +1,8 @@ import * as Vue from 'vue' +import { isServer } from '@tanstack/router-core/isServer' import { Matches } from './Matches' import { provideRouter } from './routerContext' +import { provideLinkLocation } from './matchContext' import type { AnyRouter, RegisteredRouter, @@ -21,20 +23,24 @@ export const RouterContextProvider = Vue.defineComponent({ const router = props.router as AnyRouter const restAttrs = attrs - // Allow the router to update options on the router instance - router.update({ - ...router.options, - ...restAttrs, - context: { - ...router.options.context, - ...(restAttrs.context || {}), - }, - }) - // Provide router to all child components provideRouter(router) + // Links outside every match follow the live location. + if (!(isServer ?? router.isServer)) { + provideLinkLocation(router) + } return () => { + // Allow the router to update options on the router instance + router.update({ + ...router.options, + ...restAttrs, + context: { + ...router.options.context, + ...(restAttrs.context || {}), + }, + }) + // Get child content const childContent = slots.default?.() @@ -90,10 +96,7 @@ export const RouterProvider = Vue.defineComponent({ } & Record, ): Vue.VNode new (): { - $props: { - router: AnyRouter - routeTree?: AnyRouter['routeTree'] - } + $props: RouterProps } } @@ -108,7 +111,7 @@ export type RouterProps< TRouter['history'], TDehydrated >, - 'context' + 'context' | 'pathParamsAllowedCharacters' > & { router: TRouter context?: Partial< diff --git a/packages/vue-router/src/Scripts.tsx b/packages/vue-router/src/Scripts.tsx index 32c9eef8b5..729441d28c 100644 --- a/packages/vue-router/src/Scripts.tsx +++ b/packages/vue-router/src/Scripts.tsx @@ -1,70 +1,27 @@ import * as Vue from 'vue' -import { useStore } from '@tanstack/vue-store' +import { + composeSsrBodyScripts, + getSsrBodyScriptParts, +} from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' +import { useSelector } from '@tanstack/vue-store' import { Asset } from './Asset' import { useRouter } from './useRouter' import type { RouterManagedTag } from '@tanstack/router-core' -type ScriptsRenderState = { - scripts: Array - assetScripts: Array - mounted: boolean - nonce?: string -} - +/** + * During streaming SSR, `` marks where late hydration scripts may + * begin to be inserted. + */ export const Scripts = Vue.defineComponent({ name: 'Scripts', setup() { const router = useRouter() const nonce = router.options.ssr?.nonce - const matches = useStore(router.stores.matches, (value) => value) + const matches = useSelector(router.stores.matches, (value) => value) - const getAssetScripts = (matches: Array) => { - const assetScripts: Array = [] - const manifest = router.ssr?.manifest - - if (!manifest) { - return [] - } - - matches.forEach((match) => { - const routeManifest = manifest.routes[match.routeId] - - routeManifest?.scripts?.forEach((asset) => { - assetScripts.push({ - tag: 'script', - attrs: { ...asset.attrs, nonce }, - children: asset.children, - }) - }) - }) - - return assetScripts - } - - const getScripts = (matches: Array): Array => - ( - matches - .map((match) => match.scripts!) - .flat(1) - .filter(Boolean) as Array - ).map( - ({ children, ...script }) => - ({ - tag: 'script', - attrs: { - ...script, - nonce, - }, - children, - }) satisfies RouterManagedTag, - ) - - const assetScripts = Vue.computed>(() => - getAssetScripts(matches.value), - ) - const scripts = Vue.computed>(() => - getScripts(matches.value), + const scripts = Vue.computed(() => + getSsrBodyScriptParts(matches.value, router.ssr?.manifest, nonce), ) const mounted = Vue.ref(false) @@ -72,27 +29,29 @@ export const Scripts = Vue.defineComponent({ mounted.value = true }) - return () => - renderScripts(router, { - scripts: scripts.value, - assetScripts: assetScripts.value, - mounted: mounted.value, - nonce, - }) + return () => { + return renderScripts(router, scripts.value, mounted.value, nonce) + } }, }) function renderScripts( router: ReturnType, - { scripts, assetScripts, mounted, nonce }: ScriptsRenderState, + scriptParts: ReturnType, + mounted: boolean, + nonce?: string, ) { const allScripts: Array = [] + let streamBoundary: RouterManagedTag | undefined + const [scripts, assetScripts] = scriptParts if ((isServer ?? router.isServer) && router.serverSsr) { - const serverBufferedScript = router.serverSsr.takeBufferedScripts() - if (serverBufferedScript) { - allScripts.push(serverBufferedScript) - } + const initialHydrationScripts = + router.serverSsr.takeInitialHydrationScriptTags() + allScripts.push( + ...composeSsrBodyScripts(scriptParts, initialHydrationScripts), + ) + return renderScriptTags(allScripts) } else if (router.ssr && !mounted) { allScripts.push({ tag: 'script', @@ -100,15 +59,14 @@ function renderScripts( children: '', } satisfies RouterManagedTag) - allScripts.push({ + streamBoundary = { tag: 'script', attrs: { nonce, - id: '$tsr-stream-barrier', 'data-allow-mismatch': true, }, children: '', - } satisfies RouterManagedTag) + } satisfies RouterManagedTag for (const asset of assetScripts) { allScripts.push({ @@ -124,10 +82,18 @@ function renderScripts( allScripts.push(...scripts) - if (mounted || ((isServer ?? router.isServer) && router.serverSsr)) { + if (mounted) { allScripts.push(...assetScripts) } + if (streamBoundary) { + allScripts.push(streamBoundary) + } + + return renderScriptTags(allScripts) +} + +function renderScriptTags(allScripts: Array) { return ( <> {allScripts.map((asset, i) => ( diff --git a/packages/vue-router/src/Transitioner.tsx b/packages/vue-router/src/Transitioner.tsx index b0133d965c..9f177184a2 100644 --- a/packages/vue-router/src/Transitioner.tsx +++ b/packages/vue-router/src/Transitioner.tsx @@ -1,109 +1,25 @@ import * as Vue from 'vue' import { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' -import { batch, useStore } from '@tanstack/vue-store' import { useRouter } from './useRouter' -import { usePrevious } from './utils' +import type { AnyRouteMatch } from '@tanstack/router-core' -// Track mount state per router to avoid double-loading -let mountLoadForRouter = { router: null as any, mounted: false } - -/** - * Composable that sets up router transition logic. - * This is called from MatchesContent to set up: - * - router.startTransition - * - router.startViewTransition - * - History subscription - * - Router event watchers - * - * Must be called during component setup phase. - */ export function useTransitionerSetup() { const router = useRouter() - - // Skip on server - no transitions needed if (isServer ?? router.isServer) { return } - const isLoading = useStore(router.stores.isLoading, (value) => value) - - // Track if we're in a transition - using a ref to track async transitions - const isTransitioning = Vue.ref(false) - - // Track pending state changes - const hasPending = useStore(router.stores.hasPending, (value) => value) - - const previousIsLoading = usePrevious(() => isLoading.value) - - const isAnyPending = Vue.computed( - () => isLoading.value || isTransitioning.value || hasPending.value, - ) - const previousIsAnyPending = usePrevious(() => isAnyPending.value) - - const isPagePending = Vue.computed(() => isLoading.value || hasPending.value) - const previousIsPagePending = usePrevious(() => isPagePending.value) - - // Implement startTransition similar to React/Solid - // Vue doesn't have a native useTransition like React 18, so we simulate it - // We also update the router state's isTransitioning flag so useMatch can check it - router.startTransition = (fn: () => void | Promise) => { - isTransitioning.value = true - // Also update the router state so useMatch knows we're transitioning - try { - router.stores.isTransitioning.set(true) - } catch { - // Ignore errors if component is unmounted - } - - // Helper to end the transition - const endTransition = () => { - // Use nextTick to ensure Vue has processed all reactive updates - Vue.nextTick(() => { - try { - isTransitioning.value = false - router.stores.isTransitioning.set(false) - } catch { - // Ignore errors if component is unmounted - } - }) - } - - // Execute the function synchronously - // The function internally may call startViewTransition which schedules async work - // via document.startViewTransition, but we don't need to wait for it here - // because Vue's reactivity will trigger re-renders when state changes + let transitionOwner: Array | undefined + router.startTransition = async (fn, expected) => { + transitionOwner = expected fn() - - // End the transition on next tick to allow Vue to process reactive updates - endTransition() + await Vue.nextTick() + return transitionOwner === expected } - // Vue updates DOM asynchronously (next tick). The View Transitions API expects the - // update callback promise to resolve only after the DOM has been updated. - // Wrap the router-core implementation to await a Vue flush before resolving. - const originalStartViewTransition: - | undefined - | ((fn: () => Promise) => void) = - (router as any).__tsrOriginalStartViewTransition ?? - router.startViewTransition - - ;(router as any).__tsrOriginalStartViewTransition = - originalStartViewTransition - - router.startViewTransition = (fn: () => Promise) => { - return originalStartViewTransition?.(async () => { - await fn() - await Vue.nextTick() - }) - } - - // Subscribe to location changes - // and try to load the new location - let unsubscribe: (() => void) | undefined - Vue.onMounted(() => { - unsubscribe = router.history.subscribe(router.load) + Vue.onUnmounted(router.history.subscribe(router.load)) const nextLocation = router.buildLocation({ to: router.latestLocation.pathname, @@ -114,130 +30,34 @@ export function useTransitionerSetup() { _includeValidateSearch: true, }) - // Check if the current URL matches the canonical form. - // Compare publicHref (browser-facing URL) for consistency with - // the server-side redirect check in router.beforeLoad. if ( trimPathRight(router.latestLocation.publicHref) !== trimPathRight(nextLocation.publicHref) ) { - router.commitLocation({ ...nextLocation, replace: true }) - } - }) - - // Track if component is mounted to prevent updates after unmount - const isMounted = Vue.ref(false) - - Vue.onMounted(() => { - isMounted.value = true - if (!isAnyPending.value) { - if (router.stores.status.get() === 'pending') { - batch(() => { - router.stores.status.set('idle') - router.stores.resolvedLocation.set(router.stores.location.get()) - }) - } - } - }) - - Vue.onUnmounted(() => { - isMounted.value = false - if (unsubscribe) { - unsubscribe() - } - }) - - // Try to load the initial location - Vue.onMounted(() => { - if ( - (typeof window !== 'undefined' && router.ssr) || - (mountLoadForRouter.router === router && mountLoadForRouter.mounted) - ) { + router.commitLocation({ + ...nextLocation, + replace: true, + ignoreBlocker: true, + }) return } - mountLoadForRouter = { router, mounted: true } - const tryLoad = async () => { - try { - await router.load() - } catch (err) { - console.error(err) - } - } - tryLoad() - }) - // Setup watchers for emitting events - // All watchers check isMounted to prevent updates after unmount - Vue.watch( - () => isLoading.value, - (newValue) => { - if (!isMounted.value) return - try { - if (previousIsLoading.value.previous && !newValue) { - router.emit({ - type: 'onLoad', - ...getLocationChangeInfo( - router.stores.location.get(), - router.stores.resolvedLocation.get(), - ), - }) - } - } catch { - // Ignore errors if component is unmounted - } - }, - ) - - Vue.watch(isPagePending, (newValue) => { - if (!isMounted.value) return - try { - // emit onBeforeRouteMount - if (previousIsPagePending.value.previous && !newValue) { - router.emit({ - type: 'onBeforeRouteMount', - ...getLocationChangeInfo( - router.stores.location.get(), - router.stores.resolvedLocation.get(), - ), - }) - } - } catch { - // Ignore errors if component is unmounted - } - }) - - Vue.watch(isAnyPending, (newValue) => { - if (!isMounted.value) return - try { - if (!newValue && router.stores.status.get() === 'pending') { - batch(() => { - router.stores.status.set('idle') - router.stores.resolvedLocation.set(router.stores.location.get()) - }) - } - - // The router was pending and now it's not - if (previousIsAnyPending.value.previous && !newValue) { - const changeInfo = getLocationChangeInfo( - router.stores.location.get(), - router.stores.resolvedLocation.get(), - ) - router.emit({ - type: 'onResolved', - ...changeInfo, - }) - } - } catch { - // Ignore errors if component is unmounted + const resolvedLocation = router.stores.resolvedLocation.get() + if ( + resolvedLocation?.href === router.latestLocation.href && + resolvedLocation.state.__TSR_key === router.latestLocation.state.__TSR_key + ) { + router.emit({ + type: 'onRendered', + ...getLocationChangeInfo(resolvedLocation, resolvedLocation), + }) + } else if (!router._tx) { + router.load().catch(console.error) } }) } -/** - * @deprecated Use useTransitionerSetup() composable instead. - * This component is kept for backwards compatibility but the setup logic - * has been moved to useTransitionerSetup() for better SSR hydration. - */ +/** @deprecated Use useTransitionerSetup() instead. */ export const Transitioner = Vue.defineComponent({ name: 'Transitioner', setup() { diff --git a/packages/vue-router/src/awaited.tsx b/packages/vue-router/src/awaited.tsx index ca20035c7d..136d7bbc6e 100644 --- a/packages/vue-router/src/awaited.tsx +++ b/packages/vue-router/src/awaited.tsx @@ -9,7 +9,7 @@ export type AwaitOptions = { export function useAwaited({ promise: _promise, -}: AwaitOptions): [T, DeferredPromise] { +}: AwaitOptions): [data: T, promise: DeferredPromise] { const promise = defer(_promise) if (promise[TSR_DEFERRED_PROMISE].status === 'pending') { diff --git a/packages/vue-router/src/fileRoute.ts b/packages/vue-router/src/fileRoute.ts index 672328b560..69334b79ee 100644 --- a/packages/vue-router/src/fileRoute.ts +++ b/packages/vue-router/src/fileRoute.ts @@ -43,11 +43,14 @@ export function createFileRoute< TFullPath extends RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath'], >( + // eslint-disable-next-line unused-imports/no-unused-vars path?: TFilePath, ): FileRoute['createRoute'] { - return new FileRoute(path, { - silent: true, - }).createRoute + return (options) => { + const route = createRoute(options as any) + ;(route as any).isRoot = false + return route as any + } } /** @@ -205,10 +208,7 @@ export class LazyRoute { } useMatch: UseMatchRoute = (opts) => { - return useMatch({ - select: opts?.select, - from: this.options.id, - } as any) as any + return useMatch({ ...opts, from: this.options.id } as any) as any } useRouteContext: UseRouteContextRoute = (opts) => { @@ -216,17 +216,11 @@ export class LazyRoute { } useSearch: UseSearchRoute = (opts) => { - return useSearch({ - select: opts?.select, - from: this.options.id, - } as any) as any + return useSearch({ ...opts, from: this.options.id } as any) } useParams: UseParamsRoute = (opts) => { - return useParams({ - select: opts?.select, - from: this.options.id, - } as any) as any + return useParams({ ...opts, from: this.options.id } as any) } useLoaderDeps: UseLoaderDepsRoute = (opts) => { diff --git a/packages/vue-router/src/headContentUtils.tsx b/packages/vue-router/src/headContentUtils.tsx index 1f1f8ff973..b597d74c0c 100644 --- a/packages/vue-router/src/headContentUtils.tsx +++ b/packages/vue-router/src/headContentUtils.tsx @@ -1,12 +1,13 @@ import * as Vue from 'vue' import { + _getAssetMatches, appendUniqueUserTags, escapeHtml, getAssetCrossOrigin, getScriptPreloadAttrs, resolveManifestCssLink, } from '@tanstack/router-core' -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' import type { AssetCrossOriginConfig, @@ -15,132 +16,16 @@ import type { export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => { const router = useRouter() - const matches = useStore(router.stores.matches, (value) => value) + const matches = useSelector(router.stores.matches, _getAssetMatches) - const meta = Vue.computed>(() => { - const resultMeta: Array = [] - const metaByAttribute: Record = {} - let title: RouterManagedTag | undefined - ;[...matches.value.map((match) => match.meta!).filter(Boolean)] - .reverse() - .forEach((metas) => { - ;[...metas].reverse().forEach((m) => { - if (!m) return - - if (m.title) { - if (!title) { - title = { - tag: 'title', - children: m.title, - } - } - } else if ('script:ld+json' in m) { - // Handle JSON-LD structured data - // Content is HTML-escaped to prevent XSS when injected via innerHTML - try { - const json = JSON.stringify(m['script:ld+json']) - resultMeta.push({ - tag: 'script', - attrs: { - type: 'application/ld+json', - }, - children: escapeHtml(json), - }) - } catch { - // Skip invalid JSON-LD objects - } - } else { - const attribute = m.name ?? m.property - if (attribute) { - if (metaByAttribute[attribute]) { - return - } else { - metaByAttribute[attribute] = true - } - } - - resultMeta.push({ - tag: 'meta', - attrs: { - ...m, - }, - }) - } - }) - }) - - if (title) { - resultMeta.push(title) - } - - resultMeta.reverse() - - return resultMeta - }) - - const links = Vue.computed>( - () => - matches.value - .map((match) => match.links!) - .filter(Boolean) - .flat(1) - .map((link) => ({ - tag: 'link', - attrs: { - ...link, - }, - })) as Array, - ) - - const preloadMeta = Vue.computed>(() => { - const preloadMeta: Array = [] - - matches.value.forEach((match) => { - router.ssr?.manifest?.routes[match.routeId]?.preloads - ?.filter(Boolean) - .forEach((preload) => { - preloadMeta.push({ - tag: 'link', - attrs: { - ...getScriptPreloadAttrs( - router.ssr?.manifest, - preload, - assetCrossOrigin, - ), - }, - }) - }) - }) - - return preloadMeta - }) - - const headScripts = Vue.computed>(() => - ( - matches.value - .map((match) => match.headScripts!) - .flat(1) - .filter(Boolean) as Array - ).map(({ children, ...script }) => ({ - tag: 'script', - attrs: { - ...script, - }, - children, - })), - ) - - const manifestAssets = Vue.computed>(() => { + const tags = Vue.computed>(() => { + const currentMatches = matches.value + const tags: Array = [] const manifest = router.ssr?.manifest - - const assets: Array = [] - - matches.value.forEach((match) => { - const routeManifest = manifest?.routes[match.routeId] - - routeManifest?.css?.forEach((link) => { + for (const match of currentMatches) { + for (const link of manifest?.routes[match.routeId]?.css ?? []) { const resolvedLink = resolveManifestCssLink(link) - assets.push({ + tags.push({ tag: 'link', attrs: { rel: 'stylesheet', @@ -150,11 +35,10 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => { resolvedLink.crossOrigin, }, }) - }) - }) - + } + } if (manifest?.inlineStyle) { - assets.push({ + tags.push({ tag: 'style', attrs: manifest.inlineStyle.attrs, children: manifest.inlineStyle.children, @@ -162,16 +46,97 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => { }) } - return assets - }) + const resultMeta: Array = [] + const metaByAttribute: Record = {} + let title: RouterManagedTag | undefined + for (let i = currentMatches.length - 1; i >= 0; i--) { + const metas = currentMatches[i]!.meta + if (!metas) { + continue + } + for (let j = metas.length - 1; j >= 0; j--) { + const m = metas[j] + if (!m) { + continue + } - return () => { - const tags: Array = [] - tags.push(...manifestAssets.value) - appendUniqueUserTags(tags, meta.value) - tags.push(...preloadMeta.value) - appendUniqueUserTags(tags, links.value) - appendUniqueUserTags(tags, headScripts.value) + if (m.title) { + if (!title) { + title = { + tag: 'title', + children: m.title, + } + } + } else if ('script:ld+json' in m) { + // Content is HTML-escaped to prevent XSS when injected via innerHTML. + try { + resultMeta.push({ + tag: 'script', + attrs: { type: 'application/ld+json' }, + children: escapeHtml(JSON.stringify(m['script:ld+json'])), + }) + } catch { + // Skip invalid JSON-LD objects. + } + } else { + const attribute = m.name ?? m.property + if (attribute) { + if (metaByAttribute[attribute]) { + continue + } else { + metaByAttribute[attribute] = true + } + } + resultMeta.push({ + tag: 'meta', + attrs: { + ...m, + }, + }) + } + } + } + + if (title) { + resultMeta.push(title) + } + resultMeta.reverse() + appendUniqueUserTags(tags, resultMeta) + + const preloads: Array = [] + const links: Array = [] + const headScripts: Array = [] + for (const match of currentMatches) { + for (const preload of manifest?.routes[match.routeId]?.preloads ?? []) { + if (preload) { + preloads.push({ + tag: 'link', + attrs: { + ...getScriptPreloadAttrs(manifest, preload, assetCrossOrigin), + }, + }) + } + } + for (const link of match.links ?? []) { + if (link) { + links.push({ tag: 'link', attrs: { ...link } }) + } + } + for (const script of match.headScripts ?? []) { + if (script) { + const { children, ...attrs } = script + headScripts.push({ + tag: 'script', + attrs: { ...attrs }, + children: children as string | undefined, + }) + } + } + } + tags.push(...preloads) + appendUniqueUserTags(tags, links) + appendUniqueUserTags(tags, headScripts) return tags - } + }) + return () => tags.value } diff --git a/packages/vue-router/src/index.tsx b/packages/vue-router/src/index.tsx index 29a03b07de..f63a763e25 100644 --- a/packages/vue-router/src/index.tsx +++ b/packages/vue-router/src/index.tsx @@ -15,8 +15,6 @@ export { stringifySearchWith, functionalUpdate, replaceEqualDeep, - isPlainObject, - isPlainArray, deepEqual, createControlledPromise, retainSearchParams, @@ -148,9 +146,6 @@ export type { AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, - NativeNavigateOptions, - StackBehavior, - StackMatch, ToOptions, ToMaskOptions, ToSubOptions, @@ -169,7 +164,6 @@ export type { ResolveFullSearchSchemaInput, RouteIds, NavigateFn, - BackFn, BuildLocationFn, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, @@ -178,7 +172,6 @@ export type { AnyRouteWithContext, AnyRouterWithContext, CommitLocationOptions, - BackOptions, MatchLocation, UseNavigateResult, AnyRedirect, @@ -204,7 +197,6 @@ export type { RegisteredRouter, RouterContextOptions, ControllablePromise, - InjectedHtmlEntry, RouterOptions, RouterState, ListenerFn, diff --git a/packages/vue-router/src/lazyRouteComponent.tsx b/packages/vue-router/src/lazyRouteComponent.tsx index 77a2233573..3137e15ba4 100644 --- a/packages/vue-router/src/lazyRouteComponent.tsx +++ b/packages/vue-router/src/lazyRouteComponent.tsx @@ -44,9 +44,13 @@ export function lazyRouteComponent< // Use existing promise or create new one if (!loadPromise) { + error = undefined loadPromise = importer() .then((res) => { - loadPromise = undefined + if (typeof document !== 'undefined') { + loadPromise = undefined + ;(lazyComp as any).preload = undefined + } comp = res[exportName ?? 'default'] return comp }) @@ -65,7 +69,6 @@ export function lazyRouteComponent< return loadPromise } - // Create a lazy component wrapper using defineComponent so it works in Vue SFC templates const lazyComp = Vue.defineComponent({ name: 'LazyRouteComponent', diff --git a/packages/vue-router/src/link.tsx b/packages/vue-router/src/link.tsx index 7123ef9899..34666743e3 100644 --- a/packages/vue-router/src/link.tsx +++ b/packages/vue-router/src/link.tsx @@ -1,7 +1,7 @@ import * as Vue from 'vue' import { deepEqual, - exactPathTest, + getUrlScheme, hasKeys, isDangerousProtocol, preloadWarning, @@ -9,8 +9,8 @@ import { } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' -import { useStore } from '@tanstack/vue-store' import { useRouter } from './useRouter' +import { linkLocationContext } from './matchContext' import { useIntersectionObserver } from './utils' import type { @@ -29,8 +29,6 @@ import type { type EventHandler = (e: TEvent) => void -const timeoutMap = new WeakMap>() - type DataAttributes = { [K in `data-${string}`]?: unknown } @@ -58,6 +56,17 @@ type VueStyleLinkEventHandlers = { onTouchstart?: EventHandler } +type LinkEventHandlers = { + onClick: EventHandler + onBlur: EventHandler + onFocus: EventHandler + onMouseenter: EventHandler + onMouseleave: EventHandler + onMouseover: EventHandler + onMouseout: EventHandler + onTouchstart: EventHandler +} + interface StyledProps { class?: LinkHTMLAttributes['class'] style?: LinkHTMLAttributes['style'] @@ -73,7 +82,9 @@ type PropsOfComponent = ? P : Record -type AnyLinkPropsOptions = UseLinkPropsOptions +type AnyLinkPropsOptions = UseLinkPropsOptions & { + _asChild?: unknown +} type LinkEventOptions = AnyLinkPropsOptions & Partial export function useLinkProps< @@ -84,207 +95,233 @@ export function useLinkProps< TMaskTo extends string = '', >( options: UseLinkPropsOptions, +): LinkHTMLAttributes { + return useLinkPropsImpl(() => options as AnyLinkPropsOptions) +} + +function useLinkPropsImpl( + getOptions: () => AnyLinkPropsOptions, ): LinkHTMLAttributes { const router = useRouter() - const isTransitioning = Vue.ref(false) - let hasRenderFetched = false + let renderFetchedHref: string | undefined // Ensure router is defined before proceeding if (!router) { console.warn('useRouter must be used inside a component!') - return Vue.computed(() => ({})) as unknown as LinkHTMLAttributes - } - - // Determine if the link is external or internal - const type = Vue.computed(() => { - try { - new URL(`${options.to}`) - return 'external' - } catch { - return 'internal' - } - }) - - const ref = Vue.ref(null) - const eventHandlers = getLinkEventHandlers(options as LinkEventOptions) - - if (type.value === 'external') { - // Block dangerous protocols like javascript:, blob:, data: - if (isDangerousProtocol(options.to as string, router.protocolAllowlist)) { - if (process.env.NODE_ENV !== 'production') { - console.warn(`Blocked Link with dangerous protocol: ${options.to}`) - } - // Return props without href to prevent navigation - const safeProps: Record = { - ...getPropsSafeToSpread(options as AnyLinkPropsOptions), - ref, - // No href attribute - blocks the dangerous protocol - target: options.target, - disabled: options.disabled, - style: options.style, - class: options.class, - onClick: options.onClick, - onBlur: options.onBlur, - onFocus: options.onFocus, - onMouseenter: eventHandlers.onMouseenter, - onMouseleave: eventHandlers.onMouseleave, - onMouseover: eventHandlers.onMouseover, - onMouseout: eventHandlers.onMouseout, - onTouchstart: eventHandlers.onTouchstart, - } - - // Remove undefined values - Object.keys(safeProps).forEach((key) => { - if (safeProps[key] === undefined) { - delete safeProps[key] - } - }) - - return Vue.computed( - () => safeProps as LinkHTMLAttributes, - ) as unknown as LinkHTMLAttributes - } - - // External links just have simple props - const externalProps: Record = { - ...getPropsSafeToSpread(options as AnyLinkPropsOptions), - ref, - href: options.to, - target: options.target, - disabled: options.disabled, - style: options.style, - class: options.class, - onClick: options.onClick, - onBlur: options.onBlur, - onFocus: options.onFocus, - onMouseenter: eventHandlers.onMouseenter, - onMouseleave: eventHandlers.onMouseleave, - onMouseover: eventHandlers.onMouseover, - onMouseout: eventHandlers.onMouseout, - onTouchstart: eventHandlers.onTouchstart, - } - - // Remove undefined values - Object.keys(externalProps).forEach((key) => { - if (externalProps[key] === undefined) { - delete externalProps[key] - } - }) - - return Vue.computed( - () => externalProps as LinkHTMLAttributes, - ) as unknown as LinkHTMLAttributes + return {} } // During SSR we render exactly once and do not need reactivity. // Avoid store subscriptions, effects and observers on the server. if (isServer ?? router.isServer) { + const options = getOptions() + if (getUrlScheme(`${options.to}`)) { + return Vue.shallowRef( + getExternalLinkProps(options, router), + ) as unknown as LinkHTMLAttributes + } + const next = router.buildLocation(options as any) - const href = getHref({ - options: options as AnyLinkPropsOptions, - router, - nextLocation: next, - }) + const href = getHref(options, router, next) - const isActive = getIsActive({ - loc: router.stores.location.get(), - nextLoc: next, - activeOptions: options.activeOptions, - router, - }) + const isActive = + !options.disabled && (href === undefined || !!getUrlScheme(href)) + ? false + : getIsActive( + router.stores.location.get(), + next, + options.activeOptions, + router, + ) - const { - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, - resolvedStyle, - } = resolveStyleProps({ - options: options as AnyLinkPropsOptions, + const { resolvedProps, resolvedClass, resolvedStyle } = resolveStyleProps( + options, isActive, - }) + ) const result = combineResultProps({ href, - options: options as AnyLinkPropsOptions, + options, isActive, - isTransitioning: false, - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, + resolvedProps, + resolvedClass, resolvedStyle, }) - return Vue.ref( + return Vue.shallowRef( result as LinkHTMLAttributes, ) as unknown as LinkHTMLAttributes } - const currentLocation = useStore(router.stores.location, (l) => l, { - equal: (prev, next) => prev.href === next.href, - }) + const ref = Vue.ref(null) - const next = Vue.computed(() => { - // Rebuild when inherited search/hash or the current route context changes. + const isExternal = () => !!getUrlScheme(`${getOptions().to}`) - const opts = { _fromLocation: currentLocation.value, ...options } - return router.buildLocation(opts) - }) + // Links build from the location their match presents, or the router's live + // one outside every match. External links never read it. + const source = Vue.inject(linkLocationContext)! - const preload = Vue.computed(() => { - if (options.reloadDocument) { - return false + // Rebuild only when the href moves. + const currentLocation = Vue.computed((prev?: ParsedLocation) => + prev?.href === source.value.href ? prev : source.value, + ) + + // The Link's own destination options, replaced only when a navigation + // option changes identity: the router reuses a location built from the same + // object without reading the current location. A reactive value changes in + // place, so a reactive option value (checked one level deep, not nested) + // gets a fresh object per location instead, re-read at each navigation. A + // mask holds destination options of its own, so its values are checked too. + const dest = Vue.computed((prev?: Record) => { + const options = getOptions() as Record + const dest: Record = {} + let same = !!prev + for (const key of NAVIGATION_KEYS) { + const value = (dest[key] = options[key]) + if ( + Vue.isProxy(value) || + (key === 'mask' && value && Object.values(value).some(Vue.isProxy)) + ) { + // Track the location: a reactive value is re-read at each one. + same = !currentLocation.value + } + same &&= prev![key] === value } - return options.preload ?? router.options.defaultPreload + return same ? prev! : dest }) - const preloadDelay = Vue.computed( - () => options.preloadDelay ?? router.options.defaultPreloadDelay ?? 0, - ) + // Clicks and preloads build from the latest location the Link's match + // presents. + const navigateOptions = () => { + const options = dest.value + options._fromLocation = source.value + return options as any + } - const isActive = Vue.computed(() => - getIsActive({ - activeOptions: options.activeOptions, - loc: currentLocation.value, - nextLoc: next.value, - router, - }), - ) + // [href, active] of an internal Link, derived in one computation. An + // unchanged result keeps its identity, so a navigation that leaves the Link + // as it was notifies nothing downstream. + const state = Vue.computed((prev?: LinkState): LinkState => { + const options = getOptions() + const destOptions = dest.value + // Rebuild when inherited search/hash or the current route context changes. + destOptions._fromLocation = currentLocation.value + const next = router.buildLocation(destOptions as any) + const href = getHref(options, router, next) + const isActive = + !options.disabled && (href === undefined || !!getUrlScheme(href)) + ? false + : getIsActive( + currentLocation.value, + next, + options.activeOptions, + router, + ) + return prev && + prev[0 /* href */] === href && + prev[1 /* isActive */] === isActive + ? prev + : [href, isActive] + }) - const doPreload = () => - router - .preloadRoute({ ...options, _builtLocation: next.value } as any) - .catch((err: any) => { - console.warn(err) - console.warn(preloadWarning) - }) + // The requested mode does not depend on the location, so the preload + // effects do not run on navigations. + const preloadMode = Vue.computed(() => { + const options = getOptions() + return ( + !isExternal() && + !options.reloadDocument && + !options.disabled && + (options.preload ?? router.options.defaultPreload) + ) + }) + const preload = () => { + const href = !isExternal() && state.value[0 /* href */] + return !!href && !getUrlScheme(href) && preloadMode.value + } - const preloadViewportIoCallback = ( - entry: IntersectionObserverEntry | undefined, + const preloadDelay = () => + getOptions().preloadDelay ?? router.options.defaultPreloadDelay ?? 0 + + const doPreload = () => { + return router.preloadRoute(navigateOptions()).catch((err: any) => { + console.warn(err) + console.warn(preloadWarning) + }) + } + + let pendingPreload: 'intent' | 'viewport' | undefined + let preloadTimeout: ReturnType | undefined + const cancelPreload = () => { + clearTimeout(preloadTimeout) + preloadTimeout = pendingPreload = undefined + } + + const enqueuePreload = ( + e?: MouseEvent | FocusEvent | IntersectionObserverEntry, ) => { - if (entry?.isIntersecting) { + if (!e) { + cancelPreload() + return + } + + const isIntersecting = (e as IntersectionObserverEntry).isIntersecting + const preloadMode = isIntersecting === undefined ? 'intent' : 'viewport' + if (preload() !== preloadMode || isIntersecting === false) { + if (isIntersecting === false && pendingPreload === 'viewport') { + cancelPreload() + } + return + } + + if (!preloadDelay()) { doPreload() + return + } + + if (!preloadTimeout) { + const scheduledHref = state.value[0 /* href */] + pendingPreload = preloadMode + preloadTimeout = setTimeout(() => { + preloadTimeout = pendingPreload = undefined + if ( + preload() === preloadMode && + state.value[0 /* href */] === scheduledHref + ) { + doPreload() + } + }, preloadDelay()) } } useIntersectionObserver( ref, - preloadViewportIoCallback, - { rootMargin: '100px' }, - { disabled: () => !!options.disabled || !(preload.value === 'viewport') }, + enqueuePreload, + () => preloadMode.value !== 'viewport', + // Intent preloading still needs timer cleanup without an observer. + () => !!preloadMode.value, ) - Vue.effect(() => { - if (hasRenderFetched) { + Vue.watchEffect(() => { + if (preloadMode.value !== 'render' || !preload()) { return } - if (!options.disabled && preload.value === 'render') { + + const nextHref = state.value[0 /* href */] + if (nextHref && renderFetchedHref !== nextHref) { + renderFetchedHref = nextHref doPreload() - hasRenderFetched = true } }) // The click handler const handleClick = (e: PointerEvent): void => { + const options = getOptions() + const href = !isExternal() && state.value[0 /* href */] + if (!options.disabled && (!href || getUrlScheme(href))) { + return + } + // Check actual element's target attribute as fallback const elementTarget = ( e.currentTarget as HTMLAnchorElement | SVGAElement @@ -294,7 +331,7 @@ export function useLinkProps< if ( !options.disabled && - !isCtrlEvent(e) && + !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === '_self') && e.button === 0 @@ -305,142 +342,83 @@ export function useLinkProps< } e.preventDefault() - - isTransitioning.value = true - - const unsub = router.subscribe('onResolved', () => { - unsub() - isTransitioning.value = false - }) + enqueuePreload() // All is well? Navigate! - router.navigate({ - ...options, - replace: options.replace, - resetScroll: options.resetScroll, - hashScrollIntoView: options.hashScrollIntoView, - startTransition: options.startTransition, - viewTransition: options.viewTransition, - ignoreBlocker: options.ignoreBlocker, - }) + router.navigate(navigateOptions()) } } - const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => { - if (options.disabled || preload.value !== 'intent') return - - if (!preloadDelay.value) { + const handleTouchStart = () => { + if (preload() === 'intent') { doPreload() - return - } - - const eventTarget = e.currentTarget || e.target - - if (!eventTarget || timeoutMap.has(eventTarget)) return - - timeoutMap.set( - eventTarget, - setTimeout(() => { - timeoutMap.delete(eventTarget) - doPreload() - }, preloadDelay.value), - ) - } - - const handleTouchStart = (_: TouchEvent) => { - if (options.disabled || preload.value !== 'intent') return - doPreload() - } - - const handleLeave = (e: MouseEvent | FocusEvent) => { - if (options.disabled) return - const eventTarget = e.currentTarget || e.target - - if (eventTarget) { - const id = timeoutMap.get(eventTarget) - clearTimeout(id) - timeoutMap.delete(eventTarget) } } - // Helper to compose event handlers - with explicit return type and better type handling + const handleLeave = () => { + if (pendingPreload === 'intent') { + cancelPreload() + } + } + function composeEventHandlers( - handlers: Array | undefined>, + getUserHandler: () => EventHandler | undefined, + handler: EventHandler, ): (e: T) => void { return (event: T) => { - for (const handler of handlers) { - if (handler) { - handler(event) - } - } + getUserHandler()?.(event) + handler(event) } } - // Get the active and inactive props - const resolvedStyleProps = Vue.computed(() => - resolveStyleProps({ - options: options as AnyLinkPropsOptions, - isActive: isActive.value, - }), - ) - - const href = Vue.computed(() => - getHref({ - options: options as AnyLinkPropsOptions, - router, - nextLocation: next.value, - }), - ) - // Create static event handlers that don't change between renders - const staticEventHandlers = { - onClick: composeEventHandlers([options.onClick, handleClick]), - onBlur: composeEventHandlers([options.onBlur, handleLeave]), - onFocus: composeEventHandlers([ - options.onFocus, - enqueueIntentPreload, - ]), - onMouseenter: composeEventHandlers([ - eventHandlers.onMouseenter, - enqueueIntentPreload, - ]), - onMouseover: composeEventHandlers([ - eventHandlers.onMouseover, - enqueueIntentPreload, - ]), - onMouseleave: composeEventHandlers([ - eventHandlers.onMouseleave, + const staticEventHandlers: LinkEventHandlers = { + onClick: composeEventHandlers(() => getOptions().onClick, handleClick), + onBlur: composeEventHandlers(() => getOptions().onBlur, handleLeave), + onFocus: composeEventHandlers(() => getOptions().onFocus, enqueuePreload), + onMouseenter: composeEventHandlers( + () => getLinkEventHandlers(getOptions() as LinkEventOptions).onMouseenter, + enqueuePreload, + ), + onMouseover: composeEventHandlers( + () => getLinkEventHandlers(getOptions() as LinkEventOptions).onMouseover, + enqueuePreload, + ), + onMouseleave: composeEventHandlers( + () => getLinkEventHandlers(getOptions() as LinkEventOptions).onMouseleave, handleLeave, - ]), - onMouseout: composeEventHandlers([ - eventHandlers.onMouseout, + ), + onMouseout: composeEventHandlers( + () => getLinkEventHandlers(getOptions() as LinkEventOptions).onMouseout, handleLeave, - ]), - onTouchstart: composeEventHandlers([ - eventHandlers.onTouchstart, + ), + onTouchstart: composeEventHandlers( + () => getLinkEventHandlers(getOptions() as LinkEventOptions).onTouchstart, handleTouchStart, - ]), + ), } // Compute all props synchronously to avoid hydration mismatches // Using Vue.computed ensures props are calculated at render time, not after const computedProps = Vue.computed(() => { - const { - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, - resolvedStyle, - } = resolvedStyleProps.value + const options = getOptions() + if (isExternal()) { + return getExternalLinkProps(options, router, ref, staticEventHandlers) + } + + const [href, isActive] = state.value + const { resolvedProps, resolvedClass, resolvedStyle } = resolveStyleProps( + options, + isActive, + ) return combineResultProps({ - href: href.value, - options: options as AnyLinkPropsOptions, + href, + options, ref, staticEventHandlers, - isActive: isActive.value, - isTransitioning: isTransitioning.value, - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, + isActive, + resolvedProps, + resolvedClass, resolvedStyle, }) }) @@ -449,67 +427,71 @@ export function useLinkProps< return computedProps as unknown as LinkHTMLAttributes } -function resolveStyleProps({ - options, - isActive, -}: { - options: AnyLinkPropsOptions - isActive: boolean -}) { - const activeProps = options.activeProps || (() => ({ class: 'active' })) - const resolvedActiveProps: StyledProps = (isActive - ? typeof activeProps === 'function' - ? activeProps() - : activeProps - : {}) || { class: undefined, style: undefined } +// [href, active] of an internal Link. +type LinkState = [href: string | undefined, isActive: boolean] - const inactiveProps = options.inactiveProps || (() => ({})) +// Options that decide where and how a Link navigates. +const NAVIGATION_KEYS = [ + 'to', + 'replace', + 'resetScroll', + 'hashScrollIntoView', + 'startTransition', + 'viewTransition', + 'ignoreBlocker', + 'params', + 'search', + 'hash', + 'state', + 'mask', + 'unsafeRelative', + 'from', + 'href', +] as const - const resolvedInactiveProps: StyledProps = (isActive - ? {} - : typeof inactiveProps === 'function' - ? inactiveProps() - : inactiveProps) || { class: undefined, style: undefined } +function resolveStyleProps(options: AnyLinkPropsOptions, isActive: boolean) { + const props = + (isActive ? options.activeProps : options.inactiveProps) || + (isActive ? STATIC_ACTIVE_PROPS : EMPTY_OBJECT) + const resolvedProps: StyledProps = + (typeof props === 'function' ? props() : props) || EMPTY_OBJECT + const baseClass = options.class + const stateClass = resolvedProps.class + const resolvedClass = baseClass + ? stateClass + ? [baseClass, stateClass] + : baseClass + : stateClass + ? stateClass + : undefined - const classes = [ - options.class, - resolvedActiveProps?.class, - resolvedInactiveProps?.class, - ].filter(Boolean) - const resolvedClassName = classes.length ? classes.join(' ') : undefined - - const result: Record = {} - - // Merge styles from all sources - if (options.style) { - Object.assign(result, options.style) + const baseStyle = options.style + const stateStyle = resolvedProps.style + let resolvedStyle: Record | undefined + if (baseStyle || stateStyle) { + // Keep a snapshot of reactive styles rather than returning their proxy. + const style: Record = {} + Object.assign(style, baseStyle, stateStyle) + if (hasKeys(style)) { + resolvedStyle = style + } } - - if (resolvedActiveProps?.style) { - Object.assign(result, resolvedActiveProps.style) - } - - if (resolvedInactiveProps?.style) { - Object.assign(result, resolvedInactiveProps.style) - } - - const resolvedStyle = hasKeys(result) ? result : undefined return { - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, + resolvedProps, + resolvedClass, resolvedStyle, } } +const STATIC_ACTIVE_PROPS = { class: 'active' } +const EMPTY_OBJECT = {} + function combineResultProps({ href, options, isActive, - isTransitioning, - resolvedActiveProps, - resolvedInactiveProps, - resolvedClassName, + resolvedProps, + resolvedClass, resolvedStyle, ref, staticEventHandlers, @@ -518,29 +500,18 @@ function combineResultProps({ href: string | undefined options: AnyLinkPropsOptions isActive: boolean - isTransitioning: boolean - resolvedActiveProps: StyledProps - resolvedInactiveProps: StyledProps - resolvedClassName?: string + resolvedProps: StyledProps + resolvedClass?: StyledProps['class'] resolvedStyle?: Record ref?: Vue.VNodeRef | undefined - staticEventHandlers?: { - onClick: any - onBlur: any - onFocus: any - onMouseenter: any - onMouseover: any - onMouseleave: any - onMouseout: any - onTouchstart: any - } + staticEventHandlers?: LinkEventHandlers }) { + const disabled = options.disabled || href === undefined const result: Record = { ...getPropsSafeToSpread(options), ref, ...staticEventHandlers, - href, - disabled: !!options.disabled, + disabled: options._asChild ? disabled : undefined, target: options.target, } @@ -548,11 +519,11 @@ function combineResultProps({ result.style = resolvedStyle } - if (resolvedClassName) { - result.class = resolvedClassName + if (resolvedClass) { + result.class = resolvedClass } - if (options.disabled) { + if (disabled) { result.role = 'link' result['aria-disabled'] = true } @@ -562,24 +533,67 @@ function combineResultProps({ result['aria-current'] = 'page' } - if (isTransitioning) { - result['data-transitioning'] = 'transitioning' - } - - for (const key of Object.keys(resolvedActiveProps)) { + for (const key of Object.keys(resolvedProps)) { if (key !== 'class' && key !== 'style') { - result[key] = resolvedActiveProps[key] + result[key] = resolvedProps[key] } } - for (const key of Object.keys(resolvedInactiveProps)) { - if (key !== 'class' && key !== 'style') { - result[key] = resolvedInactiveProps[key] - } - } + result.href = href return result } +function getExternalLinkProps( + options: AnyLinkPropsOptions, + router: AnyRouter, + ref?: Vue.Ref, + staticEventHandlers?: LinkEventHandlers, +): LinkHTMLAttributes { + const dangerous = isDangerousProtocol( + options.to as string, + router.protocolAllowlist, + ) + const disabled = options.disabled || dangerous + if (process.env.NODE_ENV !== 'production' && dangerous) { + console.warn(`Blocked Link with dangerous protocol: ${options.to}`) + } + + const eventHandlers = getLinkEventHandlers(options as LinkEventOptions) + const result: Record = { + ...getPropsSafeToSpread(options), + ref, + href: disabled ? undefined : options.to, + target: options.target, + disabled: options._asChild ? disabled : undefined, + style: options.style, + class: options.class, + onClick: staticEventHandlers?.onClick ?? options.onClick, + onBlur: staticEventHandlers?.onBlur ?? options.onBlur, + onFocus: staticEventHandlers?.onFocus ?? options.onFocus, + onMouseenter: + staticEventHandlers?.onMouseenter ?? eventHandlers.onMouseenter, + onMouseleave: + staticEventHandlers?.onMouseleave ?? eventHandlers.onMouseleave, + onMouseover: staticEventHandlers?.onMouseover ?? eventHandlers.onMouseover, + onMouseout: staticEventHandlers?.onMouseout ?? eventHandlers.onMouseout, + onTouchstart: + staticEventHandlers?.onTouchstart ?? eventHandlers.onTouchstart, + } + + if (disabled) { + result.role = 'link' + result['aria-disabled'] = true + } + + for (const key of Object.keys(result)) { + if (result[key] === undefined) { + delete result[key] + } + } + + return result as LinkHTMLAttributes +} + function getLinkEventHandlers( options: LinkEventOptions, ): VueStyleLinkEventHandlers { @@ -592,109 +606,85 @@ function getLinkEventHandlers( } } -const getPropsSafeToSpread = (options: AnyLinkPropsOptions) => { - const { - activeProps: _activeProps, - inactiveProps: _inactiveProps, - activeOptions: _activeOptions, - to: _to, - preload: _preload, - preloadDelay: _preloadDelay, - preloadIntentProximity: _preloadIntentProximity, - hashScrollIntoView: _hashScrollIntoView, - replace: _replace, - startTransition: _startTransition, - resetScroll: _resetScroll, - viewTransition: _viewTransition, - stackBehavior: _stackBehavior, - stackMatch: _stackMatch, - entryId: _entryId, - native: _native, - children: _children, - target: _target, - disabled: _disabled, - style: _style, - class: _class, - onClick: _onClick, - onBlur: _onBlur, - onFocus: _onFocus, - onMouseEnter: _onMouseEnter, - onMouseenter: _onMouseenter, - onMouseLeave: _onMouseLeave, - onMouseleave: _onMouseleave, - onMouseOver: _onMouseOver, - onMouseover: _onMouseover, - onMouseOut: _onMouseOut, - onMouseout: _onMouseout, - onTouchStart: _onTouchStart, - onTouchstart: _onTouchstart, - ignoreBlocker: _ignoreBlocker, - params: _params, - search: _search, - hash: _hash, - state: _state, - mask: _mask, - reloadDocument: _reloadDocument, - unsafeRelative: _unsafeRelative, - _asChild: __asChild, - from: _from, - additionalProps: _additionalProps, - ...propsSafeToSpread - } = options as AnyLinkPropsOptions & { - additionalProps?: unknown - children?: unknown - _asChild?: unknown - } +// Options the Link consumes; every other option is an element prop. +const LINK_OPTION_KEYS = new Set([ + ...NAVIGATION_KEYS, + 'activeProps', + 'inactiveProps', + 'activeOptions', + 'preload', + 'preloadDelay', + 'preloadIntentProximity', + 'children', + 'target', + 'disabled', + 'style', + 'class', + 'onClick', + 'onBlur', + 'onFocus', + 'onMouseEnter', + 'onMouseenter', + 'onMouseLeave', + 'onMouseleave', + 'onMouseOver', + 'onMouseover', + 'onMouseOut', + 'onMouseout', + 'onTouchStart', + 'onTouchstart', + 'reloadDocument', + '_asChild', + 'additionalProps', +]) +const getPropsSafeToSpread = (options: AnyLinkPropsOptions) => { + const propsSafeToSpread: Record = {} + for (const key in options) { + if (!LINK_OPTION_KEYS.has(key)) { + propsSafeToSpread[key] = (options as Record)[key] + } + } return propsSafeToSpread } -function getIsActive({ - activeOptions, - loc, - nextLoc, - router, -}: { - activeOptions: LinkOptions['activeOptions'] +function getIsActive( loc: { pathname: string search: any hash: string - } + }, nextLoc: { pathname: string search: any hash: string - } - router: AnyRouter -}) { - if (activeOptions?.exact) { - const testExact = exactPathTest( - loc.pathname, - nextLoc.pathname, - router.basepath, - ) - if (!testExact) { - return false - } - } else { - const currentPath = removeTrailingSlash(loc.pathname, router.basepath) - const nextPath = removeTrailingSlash(nextLoc.pathname, router.basepath) + }, + activeOptions: LinkOptions['activeOptions'], + router: AnyRouter, +) { + const currentPath = removeTrailingSlash(loc.pathname, router.basepath) + const nextPath = removeTrailingSlash(nextLoc.pathname, router.basepath) - const pathIsFuzzyEqual = - currentPath.startsWith(nextPath) && - (currentPath.length === nextPath.length || - currentPath[nextPath.length] === '/') - if (!pathIsFuzzyEqual) { - return false - } + // Both modes compare normalized paths; fuzzy matches need a segment boundary. + if ( + activeOptions?.exact + ? currentPath !== nextPath + : !( + currentPath.startsWith(nextPath) && + (currentPath.length === nextPath.length || + currentPath[nextPath.length] === '/') + ) + ) { + return false } if (activeOptions?.includeSearch ?? true) { - const searchTest = deepEqual(loc.search, nextLoc.search, { - partial: !activeOptions?.exact, - ignoreUndefined: !activeOptions?.explicitUndefined, - }) + const searchTest = deepEqual( + loc.search, + nextLoc.search, + !activeOptions?.exact, + activeOptions?.explicitUndefined, + ) if (!searchTest) { return false } @@ -706,15 +696,11 @@ function getIsActive({ return true } -function getHref({ - options, - router, - nextLocation, -}: { - options: AnyLinkPropsOptions - router: AnyRouter - nextLocation?: ParsedLocation -}) { +function getHref( + options: AnyLinkPropsOptions, + router: AnyRouter, + nextLocation?: ParsedLocation, +) { if (options.disabled) { return undefined } @@ -727,10 +713,20 @@ function getHref({ const publicHref = location?.publicHref if (!publicHref) return undefined - const external = location?.external - if (external) return publicHref + const href = location?.external + ? publicHref + : router.history.createHref(publicHref) || '/' + if ( + (location?.external || href !== publicHref) && + isDangerousProtocol(href, router.protocolAllowlist) + ) { + if (process.env.NODE_ENV !== 'production') { + console.warn(`Blocked Link with dangerous protocol: ${href}`) + } + return undefined + } - return router.history.createHref(publicHref) || '/' + return href } // Type definitions @@ -786,12 +782,7 @@ export type LinkProps< export interface LinkPropsChildren { // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns - children?: - | Vue.VNodeChild - | ((state: { - isActive: boolean - isTransitioning: boolean - }) => Vue.VNodeChild) + children?: Vue.VNodeChild | ((state: { isActive: boolean }) => Vue.VNodeChild) } type LinkComponentVueProps = TComp extends keyof HTMLElementTagNameMap @@ -862,6 +853,34 @@ export function createLink( }) as any } +function useLinkPropsSnapshot( + props: Record, + attrs: Record, +) { + const attrsSnapshot = Vue.shallowRef({ ...attrs }) + Vue.onBeforeUpdate(() => { + const keys = Object.keys(attrs) + const previous = attrsSnapshot.value + if ( + keys.length !== Object.keys(previous).length || + keys.some((key) => !Object.is(attrs[key], previous[key])) + ) { + attrsSnapshot.value = { ...attrs } + } + }) + + // Keep a plain cached snapshot so location-only updates do not repeatedly + // cross Vue's props and attrs proxies for every link computation. + const allProps = Vue.computed( + () => + ({ + ...props, + ...attrsSnapshot.value, + }) as AnyLinkPropsOptions, + ) + return () => allProps.value +} + const LinkImpl = Vue.defineComponent({ name: 'Link', inheritAttrs: false, @@ -884,10 +903,6 @@ const LinkImpl = Vue.defineComponent({ 'disabled', 'additionalProps', 'viewTransition', - 'stackBehavior', - 'stackMatch', - 'entryId', - 'native', 'resetScroll', 'startTransition', 'hashScrollIntoView', @@ -896,11 +911,12 @@ const LinkImpl = Vue.defineComponent({ 'target', ], setup(props, { attrs, slots }) { - // Call useLinkProps ONCE during setup with combined props and attrs - const allProps = { ...props, ...attrs } - const linkPropsSource = useLinkProps(allProps) as - | LinkHTMLAttributes - | Vue.ComputedRef + // The server renders once: read the props directly. + const linkPropsSource = useLinkPropsImpl( + (isServer ?? useRouter()?.isServer) + ? () => ({ ...props, ...attrs }) + : useLinkPropsSnapshot(props, attrs), + ) as LinkHTMLAttributes | Vue.ComputedRef return () => { const Component = props._asChild || 'a' @@ -908,16 +924,9 @@ const LinkImpl = Vue.defineComponent({ const linkProps = Vue.unref(linkPropsSource) const isActive = linkProps['data-status'] === 'active' - const isTransitioning = - linkProps['data-transitioning'] === 'transitioning' // Create the slot content or empty array if no default slot - const slotContent = slots.default - ? slots.default({ - isActive, - isTransitioning, - }) - : [] + const slotContent = slots.default ? slots.default({ isActive }) : [] // Special handling for SVG links - wrap an inside the SVG if (Component === 'svg') { @@ -937,8 +946,8 @@ const LinkImpl = Vue.defineComponent({ ) } - // Return the component with props and children - return Vue.h(Component, linkProps, slotContent) + // Vue normalizes class bindings in place; preserve the cached bindings. + return Vue.h(Component, { ...linkProps }, slotContent) } }, }) @@ -950,10 +959,6 @@ export const Link = LinkImpl as unknown as Vue.Component & Vue.Component & LinkComponent<'a'> -function isCtrlEvent(e: MouseEvent) { - return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) -} - export type LinkOptionsFnOptions< TOptions, TComp, diff --git a/packages/vue-router/src/matchContext.tsx b/packages/vue-router/src/matchContext.tsx index 1a8b7fb167..d46757f443 100644 --- a/packages/vue-router/src/matchContext.tsx +++ b/packages/vue-router/src/matchContext.tsx @@ -1,39 +1,39 @@ import * as Vue from 'vue' - -// Reactive nearest-match context used by hooks that work relative to the -// current match in the tree. -export const matchContext = Symbol('TanStackRouterMatch') as Vue.InjectionKey< - Vue.Ref -> - -// Pending match context for nearest-match lookups -export const pendingMatchContext = Symbol( - 'TanStackRouterPendingMatch', -) as Vue.InjectionKey> - -// Dummy pending context when nearest pending state is not needed -export const dummyPendingMatchContext = Symbol( - 'TanStackRouterDummyPendingMatch', -) as Vue.InjectionKey> +import { _isRouteDeparting } from '@tanstack/router-core' +import type { InjectionKey, Ref } from 'vue' +import type { AnyRouter, ParsedLocation } from '@tanstack/router-core' // Stable routeId context — a plain string (not reactive) that identifies // which route this component belongs to. Provided by Match, consumed by // MatchInner, Outlet, and useMatch for routeId-based store lookups. export const routeIdContext = Symbol( 'TanStackRouterRouteId', -) as Vue.InjectionKey +) as InjectionKey + +// The location the links of the nearest match, or of the router outside every +// match, build from. Provided on the client only. +export const linkLocationContext = Symbol( + 'TanStackRouterLinkLocation', +) as InjectionKey>> /** - * Retrieves nearest pending-match state from the component tree + * Provides the location the links below build from. A location publication + * whose navigation leaves `routeId` keeps the location the route still + * presents, so its links do no work: the route unmounts when that navigation + * commits, and any other outcome publishes a newer location. The store calls + * this subscription synchronously inside the publication, the only time the + * predicate is valid. Without a route the location is the live one. Links + * hand it to the router, so it stays raw rather than a readonly proxy. */ -export function injectPendingMatch(): Vue.Ref { - return Vue.inject(pendingMatchContext, Vue.ref(false)) -} - -/** - * Retrieves dummy pending-match state from the component tree - * This only exists so we can conditionally inject a value when we are not interested in the nearest pending match - */ -export function injectDummyPendingMatch(): Vue.Ref { - return Vue.inject(dummyPendingMatchContext, Vue.ref(false)) +export function provideLinkLocation(router: AnyRouter, routeId?: string) { + const store = router.stores.location + const linkLocation = Vue.shallowRef(store.get()) + Vue.onScopeDispose( + store.subscribe((location) => { + if (!_isRouteDeparting(router, routeId, location)) { + linkLocation.value = location + } + }).unsubscribe, + ) + Vue.provide(linkLocationContext, linkLocation) } diff --git a/packages/vue-router/src/nonRouteComponentContext.tsx b/packages/vue-router/src/nonRouteComponentContext.tsx new file mode 100644 index 0000000000..2111a9ef57 --- /dev/null +++ b/packages/vue-router/src/nonRouteComponentContext.tsx @@ -0,0 +1,45 @@ +import * as Vue from 'vue' + +export type NonRouteComponent = + | 'pendingComponent' + | 'errorComponent' + | 'notFoundComponent' + +export const nonRouteComponentContext = + process.env.NODE_ENV !== 'production' + ? (Symbol('nonRouteComponentContext') as Vue.InjectionKey< + Vue.ComputedRef + >) + : undefined + +const NonRouteComponentContextProvider = + process.env.NODE_ENV !== 'production' + ? Vue.defineComponent({ + name: 'NonRouteComponentContextProvider', + props: { + value: { + type: String as Vue.PropType, + required: true, + }, + }, + setup(props, { slots }) { + Vue.provide( + nonRouteComponentContext!, + Vue.computed(() => props.value), + ) + return () => slots.default?.() + }, + }) + : undefined + +export function renderInNonRouteComponentContext( + component: Vue.Component, + props: Record | undefined, + context: NonRouteComponent, +): Vue.VNode { + return Vue.h( + NonRouteComponentContextProvider!, + { value: context }, + { default: () => Vue.h(component, props) }, + ) +} diff --git a/packages/vue-router/src/not-found.tsx b/packages/vue-router/src/not-found.tsx index f676c66e99..5a6b3c160d 100644 --- a/packages/vue-router/src/not-found.tsx +++ b/packages/vue-router/src/not-found.tsx @@ -1,55 +1,64 @@ import * as Vue from 'vue' import { isNotFound } from '@tanstack/router-core' -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { CatchBoundary } from './CatchBoundary' import { useRouter } from './useRouter' import type { ErrorComponentProps, NotFoundError } from '@tanstack/router-core' -export function CatchNotFound(props: { - fallback?: (error: NotFoundError) => Vue.VNode - onCatch?: (error: Error) => void - children: Vue.VNode -}) { - const router = useRouter() - // TODO: Some way for the user to programmatically reset the not-found boundary? - const pathname = useStore( - router.stores.location, - (location) => location.pathname, - ) - const status = useStore(router.stores.status, (value) => value) +export const CatchNotFound = Vue.defineComponent({ + name: 'CatchNotFound', + inheritAttrs: false, + props: { + fallback: Function as Vue.PropType<(error: NotFoundError) => Vue.VNode>, + onCatch: Function as Vue.PropType<(error: NotFoundError) => void>, + children: { + type: Object as Vue.PropType, + required: true, + }, + }, + setup(props) { + const router = useRouter() + // TODO: Some way for the user to programmatically reset the not-found boundary? + const pathname = useSelector( + router.stores.location, + (location) => location.pathname, + ) + const status = useSelector(router.stores.status) - // Create a function that returns a VNode to match the SyncRouteComponent signature - const errorComponentFn = (componentProps: ErrorComponentProps) => { - const error = componentProps.error + // Create a function that returns a VNode to match the SyncRouteComponent signature + const errorComponentFn = (componentProps: ErrorComponentProps) => { + const error = componentProps.error - if (isNotFound(error)) { - // If a fallback is provided, use it - if (props.fallback) { - return props.fallback(error) - } - // Otherwise return a default not found message - return Vue.h('p', null, 'Not Found') - } else { - // Re-throw non-NotFound errors - throw error - } - } - - return Vue.h(CatchBoundary, { - getResetKey: () => `not-found-${pathname.value}-${status.value}`, - onCatch: (error: Error) => { if (isNotFound(error)) { - if (props.onCatch) { - props.onCatch(error) + // If a fallback is provided, use it + if (props.fallback) { + return props.fallback(error) } + // Otherwise return a default not found message + return Vue.h('p', null, 'Not Found') } else { + // Re-throw non-NotFound errors throw error } - }, - errorComponent: errorComponentFn, - children: props.children, - }) -} + } + + return () => + Vue.h(CatchBoundary, { + getResetKey: () => `not-found-${pathname.value}-${status.value}`, + onCatch: (error: unknown) => { + if (isNotFound(error)) { + if (props.onCatch) { + props.onCatch(error) + } + } else { + throw error + } + }, + errorComponent: errorComponentFn, + children: props.children, + }) + }, +}) export const DefaultGlobalNotFound = Vue.defineComponent({ name: 'DefaultGlobalNotFound', diff --git a/packages/vue-router/src/renderRouteNotFound.tsx b/packages/vue-router/src/renderRouteNotFound.tsx index 3b029070a9..104a65ab73 100644 --- a/packages/vue-router/src/renderRouteNotFound.tsx +++ b/packages/vue-router/src/renderRouteNotFound.tsx @@ -1,5 +1,6 @@ import * as Vue from 'vue' import { DefaultGlobalNotFound } from './not-found' +import { renderInNonRouteComponentContext } from './nonRouteComponentContext' import type { AnyRoute, AnyRouter } from '@tanstack/router-core' /** @@ -17,7 +18,13 @@ export function renderRouteNotFound( ): Vue.VNode { if (!route.options.notFoundComponent) { if (router.options.defaultNotFoundComponent) { - return Vue.h(router.options.defaultNotFoundComponent, data) + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + router.options.defaultNotFoundComponent, + data, + 'notFoundComponent', + ) + : Vue.h(router.options.defaultNotFoundComponent, data) } if (process.env.NODE_ENV !== 'production') { @@ -31,5 +38,11 @@ export function renderRouteNotFound( return Vue.h(DefaultGlobalNotFound) } - return Vue.h(route.options.notFoundComponent, data) + return process.env.NODE_ENV !== 'production' + ? renderInNonRouteComponentContext( + route.options.notFoundComponent, + data, + 'notFoundComponent', + ) + : Vue.h(route.options.notFoundComponent, data) } diff --git a/packages/vue-router/src/route.ts b/packages/vue-router/src/route.ts index d409d506fe..7c931ecdf9 100644 --- a/packages/vue-router/src/route.ts +++ b/packages/vue-router/src/route.ts @@ -51,7 +51,7 @@ import type { LinkComponentRoute } from './link' // Structural type for Vue SFC components (.vue files) // Uses structural matching to accept Vue components without breaking // TypeScript inference for inline function components -type VueSFC = { +export type VueSFC = { readonly __name?: string setup?: (...args: Array) => any render?: Function @@ -99,10 +99,7 @@ export class RouteApi< } useMatch: UseMatchRoute = (opts) => { - return useMatch({ - select: opts?.select, - from: this.id, - } as any) as any + return useMatch({ ...opts, from: this.id } as any) as any } useRouteContext: UseRouteContextRoute = (opts) => { @@ -110,17 +107,11 @@ export class RouteApi< } useSearch: UseSearchRoute = (opts) => { - return useSearch({ - select: opts?.select, - from: this.id, - } as any) as any + return useSearch({ ...opts, from: this.id } as any) } useParams: UseParamsRoute = (opts) => { - return useParams({ - select: opts?.select, - from: this.id, - } as any) as any + return useParams({ ...opts, from: this.id } as any) } useLoaderDeps: UseLoaderDepsRoute = (opts) => { @@ -252,10 +243,7 @@ export class Route< } useMatch: UseMatchRoute = (opts) => { - return useMatch({ - select: opts?.select, - from: this.id, - } as any) as any + return useMatch({ ...opts, from: this.id } as any) as any } useRouteContext: UseRouteContextRoute = (opts?) => { @@ -263,17 +251,11 @@ export class Route< } useSearch: UseSearchRoute = (opts) => { - return useSearch({ - select: opts?.select, - from: this.id, - } as any) as any + return useSearch({ ...opts, from: this.id } as any) } useParams: UseParamsRoute = (opts) => { - return useParams({ - select: opts?.select, - from: this.id, - } as any) as any + return useParams({ ...opts, from: this.id } as any) } useLoaderDeps: UseLoaderDepsRoute = (opts) => { @@ -494,10 +476,7 @@ export class RootRoute< } useMatch: UseMatchRoute = (opts) => { - return useMatch({ - select: opts?.select, - from: this.id, - } as any) as any + return useMatch({ ...opts, from: this.id } as any) as any } useRouteContext: UseRouteContextRoute = (opts) => { @@ -505,17 +484,11 @@ export class RootRoute< } useSearch: UseSearchRoute = (opts) => { - return useSearch({ - select: opts?.select, - from: this.id, - } as any) as any + return useSearch({ ...opts, from: this.id } as any) } useParams: UseParamsRoute = (opts) => { - return useParams({ - select: opts?.select, - from: this.id, - } as any) as any + return useParams({ ...opts, from: this.id } as any) } useLoaderDeps: UseLoaderDepsRoute = (opts) => { @@ -552,7 +525,7 @@ export type VueNode = Vue.VNode export type SyncRouteComponent = (props: TProps) => Vue.VNode export type AsyncRouteComponent = SyncRouteComponent & { - preload?: () => Promise + preload?: () => Promise | undefined } export type RouteComponent = AsyncRouteComponent diff --git a/packages/vue-router/src/router.ts b/packages/vue-router/src/router.ts index 00b55c4060..b1f56cf929 100644 --- a/packages/vue-router/src/router.ts +++ b/packages/vue-router/src/router.ts @@ -11,6 +11,7 @@ import type { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent, + VueSFC, } from './route' import type { VNode } from 'vue' @@ -22,7 +23,7 @@ declare module '@tanstack/router-core' { * @default Outlet * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property) */ - defaultComponent?: RouteComponent + defaultComponent?: RouteComponent | VueSFC /** * The default `errorComponent` a route should use if no error component is provided. * @@ -30,14 +31,14 @@ declare module '@tanstack/router-core' { * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property) * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent) */ - defaultErrorComponent?: ErrorRouteComponent + defaultErrorComponent?: ErrorRouteComponent | VueSFC /** * The default `pendingComponent` a route should use if no pending component is provided. * * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property) * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component) */ - defaultPendingComponent?: RouteComponent + defaultPendingComponent?: RouteComponent | VueSFC /** * The default `notFoundComponent` a route should use if no notFound component is provided. * @@ -45,7 +46,7 @@ declare module '@tanstack/router-core' { * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property) * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling) */ - defaultNotFoundComponent?: NotFoundRouteComponent + defaultNotFoundComponent?: NotFoundRouteComponent | VueSFC /** * A component that will be used to wrap the entire router. * @@ -69,7 +70,7 @@ declare module '@tanstack/router-core' { * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property) * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch) */ - defaultOnCatch?: (error: Error) => void + defaultOnCatch?: (error: unknown) => void } } diff --git a/packages/vue-router/src/routerStores.ts b/packages/vue-router/src/routerStores.ts index da943fe990..a7aafa0287 100644 --- a/packages/vue-router/src/routerStores.ts +++ b/packages/vue-router/src/routerStores.ts @@ -1,19 +1,9 @@ import { batch, createAtom } from '@tanstack/vue-store' -import type { - AnyRoute, - GetStoreConfig, - RouterStores, -} from '@tanstack/router-core' +import type { GetStoreConfig } from '@tanstack/router-core' import type { Readable } from '@tanstack/vue-store' declare module '@tanstack/router-core' { export interface RouterReadableStore extends Readable {} - export interface RouterStores { - /** Maps each active routeId to the matchId of its child in the match tree. */ - childMatchIdByRouteId: RouterReadableStore> - /** Maps each pending routeId to true for quick lookup. */ - pendingRouteIds: RouterReadableStore> - } } export const getStoreFactory: GetStoreConfig = (_opts) => { @@ -21,34 +11,5 @@ export const getStoreFactory: GetStoreConfig = (_opts) => { createMutableStore: createAtom, createReadonlyStore: createAtom, batch, - init: (stores: RouterStores) => { - // Single derived store: one reactive node that maps every active - // routeId to its child's matchId. Depends only on matchesId + - // the pool's routeId tags (which are set during reconciliation). - // Outlet reads the map and then does a direct pool lookup. - stores.childMatchIdByRouteId = createAtom(() => { - const ids = stores.matchesId.get() - const obj: Record = {} - for (let i = 0; i < ids.length - 1; i++) { - const parentStore = stores.matchStores.get(ids[i]!) - if (parentStore?.routeId) { - obj[parentStore.routeId] = ids[i + 1]! - } - } - return obj - }) - - stores.pendingRouteIds = createAtom(() => { - const ids = stores.pendingIds.get() - const obj: Record = {} - for (const id of ids) { - const store = stores.pendingMatchStores.get(id) - if (store?.routeId) { - obj[store.routeId] = true - } - } - return obj - }) - }, } } diff --git a/packages/vue-router/src/ssr/RouterClient.tsx b/packages/vue-router/src/ssr/RouterClient.tsx index 8ed9401669..b21f0fc9f5 100644 --- a/packages/vue-router/src/ssr/RouterClient.tsx +++ b/packages/vue-router/src/ssr/RouterClient.tsx @@ -4,7 +4,7 @@ import { HeadContent } from '../HeadContent' import { RouterProvider } from '../RouterProvider' import type { AnyRouter } from '@tanstack/router-core' -let hydrationPromise: Promise>> | undefined +let hydrationPromise: Promise | undefined export const RouterClient = Vue.defineComponent({ name: 'RouterClient', @@ -17,25 +17,14 @@ export const RouterClient = Vue.defineComponent({ setup(props) { const isHydrated = Vue.ref(false) - if (!hydrationPromise) { - if (!props.router.stores.matchesId.get().length) { - hydrationPromise = hydrate(props.router) - } else { - hydrationPromise = Promise.resolve() - } - } + hydrationPromise ??= hydrate(props.router).finally(() => window.$_TSR!.h()) Vue.onMounted(() => { - hydrationPromise!.then(() => { + return hydrationPromise!.then(() => { isHydrated.value = true }) }) - // For SSR, we're already hydrated - if (typeof window === 'undefined') { - isHydrated.value = true - } - return () => { if (!isHydrated.value) { return null diff --git a/packages/vue-router/src/ssr/defaultStreamHandler.tsx b/packages/vue-router/src/ssr/defaultStreamHandler.tsx index 5c663c8f5b..574a1edb66 100644 --- a/packages/vue-router/src/ssr/defaultStreamHandler.tsx +++ b/packages/vue-router/src/ssr/defaultStreamHandler.tsx @@ -3,8 +3,8 @@ import { renderRouterToStream } from './renderRouterToStream' import { RouterServer } from './RouterServer' export const defaultStreamHandler = defineHandlerCallback( - async ({ request, router, responseHeaders }) => - await renderRouterToStream({ + ({ request, router, responseHeaders }) => + renderRouterToStream({ request, router, responseHeaders, diff --git a/packages/vue-router/src/ssr/renderRouterToStream.tsx b/packages/vue-router/src/ssr/renderRouterToStream.tsx index efad4fc2eb..c48354546e 100644 --- a/packages/vue-router/src/ssr/renderRouterToStream.tsx +++ b/packages/vue-router/src/ssr/renderRouterToStream.tsx @@ -1,66 +1,25 @@ -import { ReadableStream as NodeReadableStream } from 'node:stream/web' import * as Vue from 'vue' -import { pipeToWebWritable, renderToString } from 'vue/server-renderer' +import { renderToString, renderToWebStream } from 'vue/server-renderer' import { isbot } from 'isbot' import { createSsrStreamResponse, + getSsrStatus, + transformHtmlStringWithRouter, transformReadableStreamWithRouter, + waitForRequest, } from '@tanstack/router-core/ssr/server' import type { AnyRouter } from '@tanstack/router-core' import type { Component } from 'vue' -const isAbortError = (request: Request, error: unknown) => - (request.signal.aborted && error === request.signal.reason) || - (error instanceof Error && error.name === 'AbortError') || - (error as any)?.code === 'ABORT_ERR' +const DOCTYPE = new TextEncoder().encode('') -function prependDoctype( - readable: globalThis.ReadableStream, -): NodeReadableStream { - const encoder = new TextEncoder() - let sentDoctype = false - let reader: ReadableStreamDefaultReader | undefined - const releaseReader = () => { - try { - reader?.releaseLock() - } catch { - // ignore - } - reader = undefined +/** The router transport needs `` as the outer root, not a fragment. */ +export function warnUnlessHtmlRoot(html: string) { + if (process.env.NODE_ENV !== 'production' && !html.startsWith(' as its outer element. A fragment or array root breaks streamed hydration scripts.', + ) } - - return new NodeReadableStream({ - start() { - reader = readable.getReader() - }, - async pull(controller) { - if (!sentDoctype) { - sentDoctype = true - controller.enqueue(encoder.encode('')) - return - } - try { - const { done, value } = await reader!.read() - if (done) { - controller.close() - releaseReader() - return - } - controller.enqueue(value) - } catch (err) { - controller.error(err) - releaseReader() - } - }, - async cancel(reason) { - try { - await reader?.cancel(reason) - } catch { - // ignore - } - releaseReader() - }, - }) } export const renderRouterToStream = async ({ @@ -74,151 +33,47 @@ export const renderRouterToStream = async ({ responseHeaders: Headers App: Component }) => { - const app = Vue.createSSRApp(App, { router }) + const signal = request.signal + if (signal.aborted) { + router.serverSsr?.cleanup() + throw signal.reason + } - if (isbot(request.headers.get('User-Agent'))) { - try { - let cleanupAbortListener: (() => void) | undefined - const abortPromise = new Promise((_, reject) => { - if (request.signal.aborted) { - reject(request.signal.reason) - return - } - const onRequestAbort = () => reject(request.signal.reason) - request.signal.addEventListener('abort', onRequestAbort, { once: true }) - cleanupAbortListener = () => { - request.signal.removeEventListener('abort', onRequestAbort) - } + try { + const app = Vue.createSSRApp(App, { router }) + + if (isbot(request.headers.get('User-Agent'))) { + let fullHtml = await waitForRequest(renderToString(app), signal) + warnUnlessHtmlRoot(fullHtml) + fullHtml = await transformHtmlStringWithRouter(router, fullHtml, { + signal, }) - - let fullHtml = await Promise.race([ - renderToString(app), - abortPromise, - ]).finally(() => cleanupAbortListener?.()) - - router.serverSsr!.setRenderFinished() - const injectedHtml = router.serverSsr!.takeBufferedHtml() - if (injectedHtml) { - fullHtml = fullHtml.replace(``, () => `${injectedHtml}`) - } - - const htmlOpenIndex = fullHtml.indexOf('') - - if (htmlOpenIndex !== -1 && htmlCloseIndex !== -1) { - fullHtml = fullHtml.slice(htmlOpenIndex, htmlCloseIndex + 7) - } else if (htmlOpenIndex !== -1) { - fullHtml = fullHtml.slice(htmlOpenIndex) - } - - return new Response(`${fullHtml}`, { - status: router.stores.statusCode.get(), + return new Response(fullHtml, { + status: getSsrStatus(router), headers: responseHeaders, }) - } finally { - router.serverSsr?.cleanup() - } - } - - const { writable, readable } = new TransformStream() - const innerWriter = writable.getWriter() - let writerDone = false - const releaseWriter = () => { - try { - innerWriter.releaseLock() - } catch { - // already released / errored - } - } - const abortVuePipe = (reason?: unknown) => { - if (writerDone) { - return } - writerDone = true - void innerWriter - .abort(reason) - .catch(() => {}) - .finally(releaseWriter) - } - const handleWriterError = (err: unknown) => { - if (isAbortError(request, err)) { - return - } - - throw err - } - const handleWriteError = (err: unknown) => { - if (writerDone || isAbortError(request, err)) { - return - } - - throw err - } - - const vueWritable = new WritableStream({ - write(chunk) { - if (writerDone) { - return - } - - return innerWriter.write(chunk).catch(handleWriteError) - }, - close() { - if (writerDone) { - return - } - - writerDone = true - return innerWriter.close().catch(handleWriterError).finally(releaseWriter) - }, - abort(reason) { - if (writerDone) { - return - } - - writerDone = true - return innerWriter - .abort(reason) - .catch(handleWriterError) - .finally(releaseWriter) - }, - }) - - // `pipeToWebWritable` returns void (see @vue/server-renderer). Pass a - // proxy writable so request aborts can abort the real TransformStream - // writer even while Vue holds a lock on the proxy writable. - try { - pipeToWebWritable(app, {}, vueWritable) - } catch (err) { - console.error('Error in Vue pipeToWebWritable:', err) - // Setup failed before any pipe was wired; abort writable so the - // readable side errors instead of hanging until the lifetime timeout. - abortVuePipe(err) - } - - if (request.signal.aborted) { - abortVuePipe(request.signal.reason) - } else { - const onRequestAbort = () => abortVuePipe(request.signal.reason) - request.signal.addEventListener('abort', onRequestAbort, { once: true }) - router.serverSsr?.onCleanup(() => { - request.signal.removeEventListener('abort', onRequestAbort) + const readable = renderToWebStream(app).pipeThrough( + new TransformStream({ + start(controller) { + controller.enqueue(DOCTYPE) + }, + }), + ) + const responseStream = transformReadableStreamWithRouter(router, readable, { + signal, }) + + return createSsrStreamResponse( + router, + new Response(responseStream, { + status: getSsrStatus(router), + headers: responseHeaders, + }), + ) + } catch (error) { + router.serverSsr?.cleanup() + throw error } - - const doctypedStream = prependDoctype(readable) - const responseStream = transformReadableStreamWithRouter( - router, - doctypedStream, - { onAbort: abortVuePipe }, - ) - - return createSsrStreamResponse( - router, - new Response(responseStream as any, { - status: router.stores.statusCode.get(), - headers: responseHeaders, - }), - ) } diff --git a/packages/vue-router/src/ssr/renderRouterToString.tsx b/packages/vue-router/src/ssr/renderRouterToString.tsx index b551dc5dfc..38681de5d8 100644 --- a/packages/vue-router/src/ssr/renderRouterToString.tsx +++ b/packages/vue-router/src/ssr/renderRouterToString.tsx @@ -1,5 +1,7 @@ import * as Vue from 'vue' import { renderToString as vueRenderToString } from 'vue/server-renderer' +import { renderSsrHtmlResponse } from '@tanstack/router-core/ssr/server' +import { warnUnlessHtmlRoot } from './renderRouterToStream' import type { AnyRouter } from '@tanstack/router-core' import type { Component } from 'vue' @@ -12,28 +14,14 @@ export const renderRouterToString = async ({ responseHeaders: Headers App: Component }) => { - try { - const app = Vue.createSSRApp(App, { router }) - - let html = await vueRenderToString(app) - router.serverSsr!.setRenderFinished() - - const injectedHtml = router.serverSsr!.takeBufferedHtml() - if (injectedHtml) { - html = html.replace(``, () => `${injectedHtml}`) - } - - return new Response(`${html}`, { - status: router.stores.statusCode.get(), - headers: responseHeaders, - }) - } catch (error) { - console.error('Render to string error:', error) - return new Response('Internal Server Error', { - status: 500, - headers: responseHeaders, - }) - } finally { - router.serverSsr?.cleanup() - } + return renderSsrHtmlResponse({ + router, + responseHeaders, + render: async () => { + const app = Vue.createSSRApp(App, { router }) + const rendered = await vueRenderToString(app) + warnUnlessHtmlRoot(rendered) + return rendered + }, + }) } diff --git a/packages/vue-router/src/useBlocker.tsx b/packages/vue-router/src/useBlocker.tsx index 4802a3e82a..17eef20f7a 100644 --- a/packages/vue-router/src/useBlocker.tsx +++ b/packages/vue-router/src/useBlocker.tsx @@ -179,21 +179,23 @@ export function useBlocker( location: HistoryLocation, ): AnyShouldBlockFnLocation { const parsedLocation = router.parseLocation(location) - const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname) - if (matchedRoutes.foundRoute === undefined) { + const [, rawParams, foundRoute] = router.getMatchedRoutes( + parsedLocation.pathname, + ) + if (foundRoute === undefined) { return { routeId: '__notFound__', fullPath: parsedLocation.pathname, pathname: parsedLocation.pathname, - params: matchedRoutes.routeParams, + params: rawParams, search: parsedLocation.search, } } return { - routeId: matchedRoutes.foundRoute.id, - fullPath: matchedRoutes.foundRoute.fullPath, + routeId: foundRoute.id, + fullPath: foundRoute.fullPath, pathname: parsedLocation.pathname, - params: matchedRoutes.routeParams, + params: rawParams, search: parsedLocation.search, } } @@ -373,21 +375,23 @@ const BlockImpl = Vue.defineComponent({ location: HistoryLocation, ): AnyShouldBlockFnLocation { const parsedLocation = router.parseLocation(location) - const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname) - if (matchedRoutes.foundRoute === undefined) { + const [, rawParams, foundRoute] = router.getMatchedRoutes( + parsedLocation.pathname, + ) + if (foundRoute === undefined) { return { routeId: '__notFound__', fullPath: parsedLocation.pathname, pathname: parsedLocation.pathname, - params: matchedRoutes.routeParams, + params: rawParams, search: parsedLocation.search, } } return { - routeId: matchedRoutes.foundRoute.id, - fullPath: matchedRoutes.foundRoute.fullPath, + routeId: foundRoute.id, + fullPath: foundRoute.fullPath, pathname: parsedLocation.pathname, - params: matchedRoutes.routeParams, + params: rawParams, search: parsedLocation.search, } } diff --git a/packages/vue-router/src/useCanGoBack.ts b/packages/vue-router/src/useCanGoBack.ts index 2149584979..007331fd5e 100644 --- a/packages/vue-router/src/useCanGoBack.ts +++ b/packages/vue-router/src/useCanGoBack.ts @@ -1,9 +1,9 @@ -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' export function useCanGoBack() { const router = useRouter() - return useStore( + return useSelector( router.stores.location, (location) => location.state.__TSR_index !== 0, ) diff --git a/packages/vue-router/src/useLocation.tsx b/packages/vue-router/src/useLocation.tsx index 2d9e4314a2..144ca8ced9 100644 --- a/packages/vue-router/src/useLocation.tsx +++ b/packages/vue-router/src/useLocation.tsx @@ -1,4 +1,4 @@ -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' import type { AnyRouter, @@ -25,7 +25,7 @@ export function useLocation< opts?: UseLocationBaseOptions, ): Vue.Ref> { const router = useRouter() - return useStore(router.stores.location, (location) => + return useSelector(router.stores.location, (location) => opts?.select ? opts.select(location) : location, ) as Vue.Ref> } diff --git a/packages/vue-router/src/useMatch.tsx b/packages/vue-router/src/useMatch.tsx index 29047e5d48..5bffc5fdcf 100644 --- a/packages/vue-router/src/useMatch.tsx +++ b/packages/vue-router/src/useMatch.tsx @@ -1,12 +1,8 @@ import * as Vue from 'vue' import { invariant } from '@tanstack/router-core' -import { useStore } from '@tanstack/vue-store' import { isServer } from '@tanstack/router-core/isServer' -import { - injectDummyPendingMatch, - injectPendingMatch, - routeIdContext, -} from './matchContext' +import { useSelector } from '@tanstack/vue-store' +import { routeIdContext } from './matchContext' import { useRouter } from './useRouter' import type { AnyRouter, @@ -34,9 +30,12 @@ export interface UseMatchBaseOptions< export type UseMatchRoute = < TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, + TThrow extends boolean = true, >( - opts?: UseMatchBaseOptions, -) => Vue.Ref> + opts?: UseMatchBaseOptions, +) => Vue.Ref< + ThrowOrOptional, TThrow> +> export type UseMatchOptions< TRouter extends AnyRouter, @@ -83,7 +82,7 @@ export function useMatch< const nearestRouteId = opts.from ? undefined : Vue.inject(routeIdContext) const matchStore = (opts.from ?? nearestRouteId) - ? router.stores.getRouteMatchStore(opts.from ?? nearestRouteId!) + ? router.stores.getMatchStore(opts.from ?? nearestRouteId!) : undefined const match = matchStore?.get() @@ -114,53 +113,37 @@ export function useMatch< > } - const hasPendingNearestMatch = opts.from - ? injectDummyPendingMatch() - : injectPendingMatch() // Set up reactive match value based on lookup strategy. let match: Readonly> + const nearestRouteId = Vue.inject(routeIdContext) if (opts.from) { - // routeId case: single subscription via per-routeId computed store. - // The store reference is stable (cached by routeId). - const matchStore = router.stores.getRouteMatchStore(opts.from) - match = useStore(matchStore, (value) => value) + // routeId case: subscribe to the stable per-route presentation atom. + const matchStore = router.stores.getMatchStore(opts.from) + match = useSelector(matchStore) } else { - // matchId case: use routeId from context for stable store lookup. + // Nearest-match case: use the routeId from context for stable lookup. // The routeId is provided by the nearest Match component and doesn't // change for the component's lifetime, so the store is stable. - const nearestRouteId = Vue.inject(routeIdContext) if (nearestRouteId) { - match = useStore( - router.stores.getRouteMatchStore(nearestRouteId), - (value) => value, - ) + match = useSelector(router.stores.getMatchStore(nearestRouteId)) } else { // No route context — will fall through to error handling below match = Vue.ref(undefined) as Readonly> } } - const hasPendingRouteMatch = opts.from - ? useStore(router.stores.pendingRouteIds, (ids) => ids) - : undefined - const isTransitioning = useStore( - router.stores.isTransitioning, - (value) => value, - { equal: Object.is }, - ) - - const result = Vue.computed(() => { - const selectedMatch = match.value + const ownsMatch = + nearestRouteId !== undefined && + (opts.from ?? nearestRouteId) === nearestRouteId + let lastOwnedMatch: any + const result = Vue.computed(() => { + if (match.value !== undefined && ownsMatch) { + lastOwnedMatch = match.value + } + const selectedMatch = match.value ?? lastOwnedMatch if (selectedMatch === undefined) { - const hasPendingMatch = opts.from - ? Boolean(hasPendingRouteMatch?.value[opts.from!]) - : hasPendingNearestMatch.value - if ( - !hasPendingMatch && - !isTransitioning.value && - (opts.shouldThrow ?? true) - ) { + if (opts.shouldThrow ?? true) { if (process.env.NODE_ENV !== 'production') { throw new Error( `Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`, diff --git a/packages/vue-router/src/useParams.tsx b/packages/vue-router/src/useParams.tsx index 5b501cc296..6891c08adc 100644 --- a/packages/vue-router/src/useParams.tsx +++ b/packages/vue-router/src/useParams.tsx @@ -33,15 +33,18 @@ export type UseParamsOptions< export type UseParamsRoute = < TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, + TThrow extends boolean = true, >( opts?: UseParamsBaseOptions< TRouter, TFrom, /* TStrict */ true, - /* TThrow */ true, + TThrow, TSelected >, -) => Vue.Ref> +) => Vue.Ref< + ThrowOrOptional, TThrow> +> export function useParams< TRouter extends AnyRouter = RegisteredRouter, diff --git a/packages/vue-router/src/useRouterState.tsx b/packages/vue-router/src/useRouterState.tsx index 13b6f85236..489b05ae91 100644 --- a/packages/vue-router/src/useRouterState.tsx +++ b/packages/vue-router/src/useRouterState.tsx @@ -1,6 +1,6 @@ import * as Vue from 'vue' import { isServer } from '@tanstack/router-core/isServer' -import { useStore } from '@tanstack/vue-store' +import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' import type { AnyRouter, @@ -39,9 +39,9 @@ export function useRouterState< // During SSR we render exactly once and do not need reactivity. // Avoid subscribing to the store on the server since the server store // implementation does not provide subscribe() semantics. - const _isServer = isServer ?? router.isServer - - if (_isServer) { + // The expression must stay inlined in the `if` so bundlers fold the + // browser-build constant `isServer = false` and drop this server block. + if (isServer ?? router.isServer) { const state = router.stores.__store.get() as RouterState< TRouter['routeTree'] > @@ -50,8 +50,10 @@ export function useRouterState< > } - return useStore(router.stores.__store, (state) => { - if (opts?.select) return opts.select(state) + return useSelector(router.stores.__store, (state) => { + if (opts?.select) { + return opts.select(state) + } return state }) as Vue.Ref> diff --git a/packages/vue-router/src/useSearch.tsx b/packages/vue-router/src/useSearch.tsx index 877a1cf876..43f61d743f 100644 --- a/packages/vue-router/src/useSearch.tsx +++ b/packages/vue-router/src/useSearch.tsx @@ -33,15 +33,18 @@ export type UseSearchOptions< export type UseSearchRoute = < TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, + TThrow extends boolean = true, >( opts?: UseSearchBaseOptions< TRouter, TFrom, /* TStrict */ true, - /* TThrow */ true, + TThrow, TSelected >, -) => Vue.Ref> +) => Vue.Ref< + ThrowOrOptional, TThrow> +> export function useSearch< TRouter extends AnyRouter = RegisteredRouter, diff --git a/packages/vue-router/src/utils.ts b/packages/vue-router/src/utils.ts index 609c4558a8..10b059c4a5 100644 --- a/packages/vue-router/src/utils.ts +++ b/packages/vue-router/src/utils.ts @@ -31,10 +31,9 @@ export const usePrevious = (fn: () => boolean) => { * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`. * * @param ref - The ref to observe - * @param intersectionObserverOptions - The options to pass to the IntersectionObserver - * @param options - The options to pass to the hook * @param callback - The callback to call when the intersection changes - * @returns The IntersectionObserver instance + * @param disabled - Whether observation is disabled + * @param cleanupWhenDisabled - Whether cleanup is needed without an observer (defaults to true) * @example * ```tsx * const MyComponent = () => { @@ -42,48 +41,49 @@ export const usePrevious = (fn: () => boolean) => { * useIntersectionObserver( * ref, * (entry) => { doSomething(entry) }, - * { rootMargin: '10px' }, - * { disabled: false } + * () => false * ) * return
* ``` */ export function useIntersectionObserver( ref: Vue.Ref, - callback: (entry: IntersectionObserverEntry | undefined) => void, - intersectionObserverOptions: IntersectionObserverInit = {}, - options: { disabled?: boolean | (() => boolean) } = {}, -): Vue.Ref { + callback: (entry?: IntersectionObserverEntry) => void, + disabled: () => boolean, + cleanupWhenDisabled?: () => boolean, +): void { const isIntersectionObserverAvailable = typeof IntersectionObserver === 'function' - const observerRef = Vue.ref(null) // Use watchEffect with cleanup to properly manage the observer lifecycle Vue.watchEffect((onCleanup) => { const r = ref.value - // Support both static boolean and function for disabled check - const isDisabled = - typeof options.disabled === 'function' - ? options.disabled() - : options.disabled - if (!r || !isIntersectionObserverAvailable || isDisabled) { + if (disabled() || !r || !isIntersectionObserverAvailable) { + if (cleanupWhenDisabled?.() ?? true) { + onCleanup(() => callback()) + } return } - const observer = new IntersectionObserver(([entry]) => { - callback(entry) - }, intersectionObserverOptions) + let active = true + const observer = new IntersectionObserver( + (entries) => { + // Queued notifications can arrive after this effect has cleaned up. + if (active) { + callback(entries.pop()) + } + }, + { rootMargin: '100px' }, + ) - observerRef.value = observer observer.observe(r) onCleanup(() => { + active = false observer.disconnect() - observerRef.value = null + callback() }) }) - - return observerRef } export function splitProps>( diff --git a/packages/vue-router/tests/Match.test.tsx b/packages/vue-router/tests/Match.test.tsx new file mode 100644 index 0000000000..0d2e7b6f15 --- /dev/null +++ b/packages/vue-router/tests/Match.test.tsx @@ -0,0 +1,107 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, fireEvent, render } from '@testing-library/vue' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +function createTestRouter( + scrollRestoration: boolean | (() => boolean), + isServer = false, +) { + const revision = Vue.ref(0) + const mounted = vi.fn() + const Child = Vue.defineComponent({ + setup() { + const count = Vue.ref(0) + Vue.onMounted(mounted) + return () => + }, + }) + const Shell = Vue.defineComponent({ + setup(_, { slots }) { + return () => ( +
+ {slots.default?.()} +
+ ) + }, + }) + const root = createRootRoute({ + shellComponent: Shell, + component: () => ( +
+ +
+ ), + }) + const child = createRoute({ + getParentRoute: () => root, + path: '/child', + component: Child, + }) + const router = createRouter({ + routeTree: root.addChildren([child]), + history: createMemoryHistory({ initialEntries: ['/child'] }), + isServer, + scrollRestoration, + ssr: { nonce: 'test-nonce' }, + }) + return { router, revision, mounted } +} + +test.each([false, true])( + 'preserves root child state through shell updates (scroll restoration: %s)', + async (scrollRestoration) => { + const { router, revision, mounted } = createTestRouter(scrollRestoration) + const app = render() + const button = await app.findByRole('button') + + await fireEvent.click(button) + revision.value++ + router.update({ scrollRestoration: !scrollRestoration }) + await router.invalidate() + await Vue.nextTick() + + expect(app.getByRole('button')).toBe(button) + expect(button).toHaveTextContent('1') + expect(mounted).toHaveBeenCalledOnce() + expect(app.getByTestId('shell')).toHaveAttribute('data-revision', '1') + }, +) + +test.each([ + ['disabled', false, false], + ['enabled', true, true], + ['skipped by selector', (): boolean => false, false], + ['enabled by selector', (): boolean => true, true], +] as const)( + 'renders root child content and the restoration script on the server (%s)', + async (_, scrollRestoration, hasScript) => { + const { router } = createTestRouter(scrollRestoration, true) + await router.load() + const html = await renderToString( + Vue.createSSRApp(() => ), + ) + const container = document.createElement('div') + container.innerHTML = html + + expect(container.querySelector('main > button')).toHaveTextContent('0') + const scripts = container.querySelectorAll('main > script') + expect(scripts).toHaveLength(hasScript ? 1 : 0) + if (hasScript) { + expect(scripts[0]).toHaveAttribute('nonce', 'test-nonce') + expect(scripts[0]?.textContent).toContain( + 'document.currentScript.remove()', + ) + } + }, +) diff --git a/packages/vue-router/tests/Matches.test.tsx b/packages/vue-router/tests/Matches.test.tsx index 4e9e9afa51..6bd1f4be38 100644 --- a/packages/vue-router/tests/Matches.test.tsx +++ b/packages/vue-router/tests/Matches.test.tsx @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from 'vitest' +import * as Vue from 'vue' import { cleanup, fireEvent, @@ -7,6 +8,7 @@ import { waitFor, } from '@testing-library/vue' import { createMemoryHistory } from '@tanstack/history' +import { createControlledPromise } from '@tanstack/router-core' import { Link, Outlet, @@ -36,38 +38,41 @@ const invoicesRoute = createRoute({ component: () => , }) -const InvoicesIndex = () => { - const matches = useMatches() +const InvoicesIndex = Vue.defineComponent({ + setup() { + const matches = useMatches() + return () => { + const loaderDataMatches = matches.value.filter((match: any) => + isMatch(match, 'loaderData.0.id'), + ) - const loaderDataMatches = matches.value.filter((match: any) => - isMatch(match, 'loaderData.0.id'), - ) + const contextMatches = matches.value.filter((match: any) => + isMatch(match, 'context.permissions'), + ) - const contextMatches = matches.value.filter((match: any) => - isMatch(match, 'context.permissions'), - ) + const incorrectMatches = matches.value.filter((match: any) => + isMatch(match, 'loaderData.6.id'), + ) - const incorrectMatches = matches.value.filter((match: any) => - isMatch(match, 'loaderData.6.id'), - ) - - return ( -
-
- Loader Matches -{' '} - {loaderDataMatches.map((match: any) => match.fullPath).join(',')} -
-
- Context Matches -{' '} - {contextMatches.map((match: any) => match.fullPath).join(',')} -
-
- Incorrect Matches -{' '} - {incorrectMatches.map((match: any) => match.fullPath).join(',')} -
-
- ) -} + return ( +
+
+ Loader Matches -{' '} + {loaderDataMatches.map((match: any) => match.fullPath).join(',')} +
+
+ Context Matches -{' '} + {contextMatches.map((match: any) => match.fullPath).join(',')} +
+
+ Incorrect Matches -{' '} + {incorrectMatches.map((match: any) => match.fullPath).join(',')} +
+
+ ) + } + }, +}) const invoicesIndexRoute = createRoute({ getParentRoute: () => invoicesRoute, @@ -134,7 +139,7 @@ test('when filtering useMatches by loaderData', async () => { // Vue Suspense requires async setup functions or top-level await to trigger fallback. // Since TanStack Router throws Promises from render (not setup), Vue doesn't show // the pending component during initial load. Navigation-triggered pending states -// DO work - see loaders.test.tsx 'cancelMatches after pending timeout'. +// DO work - see loaders.test.tsx 'navigating away from a pending route aborts its loader'. test('should show pendingComponent of root route', async () => { const root = createRootRoute({ pendingComponent: () =>
, @@ -158,6 +163,78 @@ test('should show pendingComponent of root route', async () => { expect(await rendered.findByTestId('root-content')).toBeInTheDocument() }) +test('useMatchRoute follows superseding pending locations', async () => { + const aGate = createControlledPromise() + const bGate = createControlledPromise() + + const Layout = Vue.defineComponent({ + setup() { + const matchRoute = useMatchRoute() + const pendingA = matchRoute({ to: '/a', pending: true }) + const pendingB = matchRoute({ to: '/b', pending: true }) + const resolvedB = matchRoute({ to: '/b', pending: false }) + return () => ( +
+ {String(Boolean(pendingA.value))} + {String(Boolean(pendingB.value))} + + {String(Boolean(resolvedB.value))} + + +
+ ) + }, + }) + + const root = createRootRoute({ component: Layout }) + const index = createRoute({ + getParentRoute: () => root, + path: '/', + }) + const a = createRoute({ + getParentRoute: () => root, + path: '/a', + loader: () => aGate, + }) + const b = createRoute({ + getParentRoute: () => root, + path: '/b', + loader: () => bGate, + }) + const router = createRouter({ + routeTree: root.addChildren([index, a, b]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + render() + + await waitFor(() => { + expect(screen.getByTestId('pending-a')).toHaveTextContent('false') + expect(router.stores.status.get()).toBe('idle') + expect(router.stores.resolvedLocation.get()?.pathname).toBe('/') + }) + + const navigationA = router.navigate({ to: '/a' }) + await waitFor(() => { + expect(screen.getByTestId('pending-a')).toHaveTextContent('true') + expect(screen.getByTestId('resolved-b')).toHaveTextContent('false') + }) + + const navigationB = router.navigate({ to: '/b' }) + await waitFor(() => { + expect(screen.getByTestId('pending-a')).toHaveTextContent('false') + expect(screen.getByTestId('pending-b')).toHaveTextContent('true') + expect(screen.getByTestId('resolved-b')).toHaveTextContent('false') + }) + + aGate.resolve() + bGate.resolve() + await Promise.allSettled([navigationA, navigationB]) + await waitFor(() => { + expect(screen.getByTestId('pending-b')).toHaveTextContent('false') + expect(screen.getByTestId('resolved-b')).toHaveTextContent('true') + }) +}) + describe('matching on different param types', () => { const testCases = [ { @@ -322,36 +399,38 @@ describe('matching on different param types', () => { async ({ name, path, params, matchParams, nav }) => { const rootRoute = createRootRoute() + const RouteComponent = Vue.defineComponent({ + setup() { + const routeParams = Route.useParams() + + const matchRoute = useMatchRoute() + + const matchRouteMatch = matchRoute({ + to: path, + }) + return () => ( +
+

{name}

+
+ Params{' '} + + {JSON.stringify(routeParams.value)} + + Matches{' '} + + {JSON.stringify(matchRouteMatch.value)} + +
+
+ ) + }, + }) const Route = createRoute({ getParentRoute: () => rootRoute, path, component: RouteComponent, }) - function RouteComponent() { - const routeParams = Route.useParams() - const matchRoute = useMatchRoute() - const matchRouteMatch = matchRoute({ - to: path, - }) - - return ( -
-

{name}

-
- Params{' '} - - {JSON.stringify(routeParams.value)} - - Matches{' '} - - {JSON.stringify(matchRouteMatch.value)} - -
-
- ) - } - const router = createRouter({ routeTree: rootRoute.addChildren([Route]), history: createMemoryHistory({ initialEntries: ['/'] }), diff --git a/packages/vue-router/tests/Outlet.test.tsx b/packages/vue-router/tests/Outlet.test.tsx new file mode 100644 index 0000000000..6bf904ba98 --- /dev/null +++ b/packages/vue-router/tests/Outlet.test.tsx @@ -0,0 +1,190 @@ +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, render, screen } from '@testing-library/vue' +import { createMemoryHistory } from '@tanstack/history' +import { createControlledPromise, notFound } from '@tanstack/router-core' +import { + Outlet, + RouterProvider, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +const outletWarning = ( + component: 'pendingComponent' | 'errorComponent' | 'notFoundComponent', +) => + `Warning: An was rendered inside a ${component}. should only be rendered inside a route component.` + +afterEach(() => { + cleanup() + vi.restoreAllMocks() +}) + +test('does not warn when Outlet is rendered inside a route component', async () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const rootRoute = createRootRoute({ + component: () => ( + <> + Root route + + + ), + }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => Index route, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + + expect(await screen.findByText('Index route')).toBeInTheDocument() + expect(warn).not.toHaveBeenCalled() +}) + +test('warns when Outlet is rendered inside a pendingComponent', async () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const pending = createControlledPromise() + const rootRoute = createRootRoute({ component: Outlet }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => Index route, + }) + const pendingRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/pending', + loader: () => pending, + pendingMs: 0, + pendingComponent: () => ( + <> + Pending route + + + ), + component: () => Resolved route, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, pendingRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + await screen.findByText('Index route') + + const navigation = router.navigate({ to: '/pending' }) + expect(await screen.findByText('Pending route')).toBeInTheDocument() + pending.resolve() + await navigation + + expect(warn).toHaveBeenCalledWith(outletWarning('pendingComponent')) +}) + +test('warns when Outlet is rendered inside an errorComponent', async () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const rootRoute = createRootRoute({ component: Outlet }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: () => { + throw new Error('Loader failed') + }, + errorComponent: () => ( + <> + Error route + + + ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + + expect(await screen.findByText('Error route')).toBeInTheDocument() + expect(warn).toHaveBeenCalledWith(outletWarning('errorComponent')) +}) + +test.each([new Error('Loader failed'), false, 0, '', null, undefined])( + 'warns with the current component after a fallback transition with %s', + async (error) => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const pending = createControlledPromise() + const FallbackComponent = (props: { error?: unknown }) => ( + <> + {'error' in props ? 'Error route' : 'Pending route'} + + + ) + const rootRoute = createRootRoute({ component: Outlet }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => Index route, + }) + const transitionRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/transition', + loader: () => pending, + pendingMs: 0, + pendingComponent: FallbackComponent, + errorComponent: FallbackComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, transitionRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + await screen.findByText('Index route') + + const navigation = router.navigate({ to: '/transition' }) + expect(await screen.findByText('Pending route')).toBeInTheDocument() + pending.reject(error) + await navigation + + expect(await screen.findByText('Error route')).toBeInTheDocument() + expect(warn).toHaveBeenCalledWith(outletWarning('pendingComponent')) + expect(warn).toHaveBeenCalledWith(outletWarning('errorComponent')) + }, +) + +test('warns when Outlet is rendered inside a notFoundComponent', async () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const rootRoute = createRootRoute({ component: Outlet }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => Index route, + }) + const notFoundRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/not-found', + component: () => { + throw notFound() + }, + notFoundComponent: () => ( + <> + Not found route + + + ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, notFoundRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + await screen.findByText('Index route') + await router.navigate({ to: '/not-found' }) + + expect(await screen.findByText('Not found route')).toBeInTheDocument() + expect(warn).toHaveBeenCalledWith(outletWarning('notFoundComponent')) +}) diff --git a/packages/vue-router/tests/Scripts.test.tsx b/packages/vue-router/tests/Scripts.test.tsx index 5cd2eacd4f..7336b95f4f 100644 --- a/packages/vue-router/tests/Scripts.test.tsx +++ b/packages/vue-router/tests/Scripts.test.tsx @@ -1,4 +1,4 @@ -import { afterEach, describe, expect, test } from 'vitest' +import { afterEach, describe, expect, test, vi } from 'vitest' import { cleanup, fireEvent, @@ -7,11 +7,14 @@ import { waitFor, } from '@testing-library/vue' import { Teleport } from 'vue' +import { hydrate } from '@tanstack/router-core/ssr/client' +import { dehydrateSsrMatchId } from '../../router-core/src/ssr/ssr-match-id' import { HeadContent, Link, Outlet, + RouterContextProvider, RouterProvider, createBrowserHistory, createMemoryHistory, @@ -48,6 +51,7 @@ afterEach(() => { cleanup() browserHistories.splice(0).forEach((history) => history.destroy()) window.history.replaceState(null, 'root', '/') + delete window.$_TSR }) describe('ssr scripts', () => { @@ -148,6 +152,98 @@ describe('ssr scripts', () => { }) describe('ssr HeadContent', () => { + test('renders descendant assets during a data-only hydration handoff', async () => { + const rootRoute = createRootRoute({}) + const dataOnlyRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/report', + ssr: 'data-only', + loader: () => 'report', + }) + const childRoute = createRoute({ + getParentRoute: () => dataOnlyRoute, + path: '/details', + loader: () => 'details', + head: () => ({ + meta: [{ name: 'vue-data-only-child', content: 'visible' }], + }), + scripts: () => [ + { + id: 'vue-data-only-body-script', + type: 'application/json', + children: '{"source":"body"}', + }, + ], + }) + const router = createRouter({ + history: createMemoryHistory({ + initialEntries: ['/report/details'], + }), + routeTree: rootRoute.addChildren([ + dataOnlyRoute.addChildren([childRoute]), + ]), + }) + const matches = router.matchRoutes(router.latestLocation) + window.$_TSR = { + router: { + dehydratedData: {}, + manifest: { + routes: { + [childRoute.id]: { + preloads: ['/vue-data-only-manifest.js'], + scripts: [ + { + attrs: { + id: 'vue-data-only-manifest-script', + type: 'application/json', + }, + children: '{"source":"manifest"}', + }, + ], + }, + }, + }, + matches: matches.map((match, index) => ({ + i: dehydrateSsrMatchId(match.id), + s: 'success', + ssr: index === 1 ? 'data-only' : true, + l: index ? (index === 1 ? 'report' : 'details') : undefined, + u: Date.now(), + })), + }, + h: vi.fn(), + e: vi.fn(), + c: vi.fn(), + p: vi.fn(), + buffer: [], + } + + await hydrate(router) + + expect(router.state.matches.map((match) => match.status)).toEqual([ + 'success', + 'pending', + 'success', + ]) + render( + + + + , + ) + + expect( + document.querySelector('meta[name="vue-data-only-child"]'), + ).not.toBeNull() + expect( + document.querySelector('link[href="/vue-data-only-manifest.js"]'), + ).not.toBeNull() + expect(document.querySelector('#vue-data-only-body-script')).not.toBeNull() + expect( + document.querySelector('#vue-data-only-manifest-script'), + ).not.toBeNull() + }) + test('applies assetCrossOrigin to manifest stylesheets and preloads', async () => { const history = createTestBrowserHistory() @@ -203,6 +299,11 @@ describe('ssr HeadContent', () => { .querySelector('link[rel="modulepreload"]') ?.getAttribute('crossorigin'), ).toBe('anonymous') + expect( + document.head + .querySelector('link[rel="modulepreload"]') + ?.getAttribute('fetchpriority'), + ).toBe('low') }) test('does not duplicate SSR head links and cleans up preloads on unmount', async () => { @@ -215,6 +316,7 @@ describe('ssr HeadContent', () => { const ssrPreload = document.createElement('link') ssrPreload.setAttribute('rel', 'modulepreload') ssrPreload.setAttribute('href', '/main.js') + ssrPreload.setAttribute('fetchpriority', 'low') document.head.append(ssrStylesheet, ssrPreload) @@ -301,6 +403,7 @@ describe('ssr HeadContent', () => { const ssrPreload = document.createElement('link') ssrPreload.setAttribute('rel', 'modulepreload') ssrPreload.setAttribute('href', '/index.js') + ssrPreload.setAttribute('fetchpriority', 'low') document.head.append(ssrStylesheet, ssrPreload) @@ -634,7 +737,7 @@ describe('ssr HeadContent', () => { ).toBe('.runtime{color:red}') }) - test('renders preload as script links for iife manifest preloads', async () => { + test('renders iife manifest preloads as low priority script links', async () => { const history = createTestBrowserHistory() const rootRoute = createRootRoute({ @@ -674,6 +777,11 @@ describe('ssr HeadContent', () => { }) expect(document.head.querySelector('link[rel="modulepreload"]')).toBeFalsy() + expect( + document.head + .querySelector('link[rel="preload"][as="script"]') + ?.getAttribute('fetchpriority'), + ).toBe('low') }) test('derives title, dedupes meta, and allows non-loader HeadContent', async () => { diff --git a/packages/vue-router/tests/Transitioner.test.tsx b/packages/vue-router/tests/Transitioner.test.tsx index 8fc6095f94..84adcf8af8 100644 --- a/packages/vue-router/tests/Transitioner.test.tsx +++ b/packages/vue-router/tests/Transitioner.test.tsx @@ -1,15 +1,20 @@ -import { describe, expect, it, vi } from 'vitest' -import { render, waitFor } from '@testing-library/vue' +import { afterEach, describe, expect, it, onTestFinished, vi } from 'vitest' +import { cleanup, render, waitFor } from '@testing-library/vue' import { + RouterProvider, + createControlledPromise, createMemoryHistory, createRootRoute, createRoute, createRouter, } from '../src' -import { RouterProvider } from '../src/RouterProvider' + +afterEach(() => { + cleanup() +}) describe('Transitioner', () => { - it('should call router.load() when Transitioner mounts on the client', async () => { + it('loads the initial route when the provider mounts', async () => { const loader = vi.fn() const rootRoute = createRootRoute() const indexRoute = createRoute({ @@ -27,18 +32,45 @@ describe('Transitioner', () => { }), }) - // Mock router.load() to verify it gets called - const loadSpy = vi.spyOn(router, 'load') + const view = render() - render() - await router.latestLoadPromise - - // Wait for the createRenderEffect to run and call router.load() await waitFor(() => { - expect(loadSpy).toHaveBeenCalledTimes(1) expect(loader).toHaveBeenCalledTimes(1) + expect(view.getByText('Index')).toBeInTheDocument() + }) + }) + + it('reuses a public load already in progress when the provider mounts', async () => { + const loaderGate = createControlledPromise() + const beforeLoad = vi.fn() + const loader = vi.fn(() => loaderGate) + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + beforeLoad, + loader, + component: () =>
Index
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), }) - loadSpy.mockRestore() + const load = router.load() + onTestFinished(async () => { + loaderGate.resolve() + await Promise.allSettled([load]) + }) + + await waitFor(() => expect(loader).toHaveBeenCalledTimes(1)) + + const view = render() + loaderGate.resolve() + await load + + expect(await view.findByText('Index')).toBeInTheDocument() + expect(beforeLoad).toHaveBeenCalledTimes(1) + expect(loader).toHaveBeenCalledTimes(1) }) }) diff --git a/packages/vue-router/tests/blocker.test.tsx b/packages/vue-router/tests/blocker.test.tsx index 6a58ff0cd4..fdd9fa4931 100644 --- a/packages/vue-router/tests/blocker.test.tsx +++ b/packages/vue-router/tests/blocker.test.tsx @@ -1,4 +1,4 @@ -import '@testing-library/jest-dom/vitest' +import { defineComponent } from 'vue' import { afterEach, describe, expect, test, vi } from 'vitest' import { cleanup, fireEvent, render, screen } from '@testing-library/vue' import combinate from 'combinate' @@ -29,13 +29,12 @@ interface BlockerTestOpts { async function setup({ blockerFn, disabled, ignoreBlocker }: BlockerTestOpts) { const _mockBlockerFn = vi.fn(blockerFn) const rootRoute = createRootRoute() - const indexRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', - component: function Setup() { + const Setup = defineComponent({ + setup() { const navigate = useNavigate() + useBlocker({ disabled, shouldBlockFn: _mockBlockerFn }) - return ( + return () => ( <>

Index

@@ -50,6 +49,12 @@ async function setup({ blockerFn, disabled, ignoreBlocker }: BlockerTestOpts) { }, }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: Setup, + }) + const postsRoute = createRoute({ getParentRoute: () => rootRoute, path: '/posts', diff --git a/packages/vue-router/tests/component-preload-retry.test.tsx b/packages/vue-router/tests/component-preload-retry.test.tsx new file mode 100644 index 0000000000..ca74f2ba67 --- /dev/null +++ b/packages/vue-router/tests/component-preload-retry.test.tsx @@ -0,0 +1,155 @@ +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, fireEvent, render, screen } from '@testing-library/vue' +import { createControlledPromise } from '@tanstack/router-core' +import { + Link, + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + lazyRouteComponent, + useRouter, +} from '../src' +import type { ErrorComponentProps } from '../src' + +afterEach(() => { + cleanup() + vi.restoreAllMocks() + vi.unstubAllGlobals() +}) + +test('a successful server component download is reused', async () => { + vi.stubGlobal('document', undefined) + const importer = vi.fn().mockResolvedValue({ default: () => null }) + const Page = lazyRouteComponent(importer) + + const preload = Page.preload?.() + await preload + + expect(Page.preload?.()).toBe(preload) + expect(importer).toHaveBeenCalledTimes(1) +}) + +test('a resolved client component preload is reused', async () => { + const importer = vi.fn().mockResolvedValue({ default: () => null }) + const Page = lazyRouteComponent(importer) + + await Page.preload?.() + expect(Page.preload).toBeUndefined() + expect(importer).toHaveBeenCalledTimes(1) +}) + +test('revisiting a resolved lazy component skips pending UI', async () => { + const PageContent = () =>
Page content
+ const componentImport = createControlledPromise<{ + default: typeof PageContent + }>() + const repeatedImport = createControlledPromise<{ + default: typeof PageContent + }>() + const importer = vi + .fn() + .mockImplementationOnce(() => componentImport) + .mockImplementationOnce(() => repeatedImport) + const Page = lazyRouteComponent(importer) + const PendingComponent = vi.fn(() => ( +
Loading page
+ )) + const rootRoute = createRootRoute({ + component: () => ( + <> + Home link + Page link + + + ), + }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Home content
, + }) + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + component: Page, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, pageRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 0, + defaultPendingComponent: PendingComponent, + }) + + render() + expect(await screen.findByText('Home content')).toBeInTheDocument() + + await fireEvent.click(screen.getByRole('link', { name: 'Page link' })) + expect(await screen.findByTestId('pending-component')).toHaveTextContent( + 'Loading page', + ) + componentImport.resolve({ default: PageContent }) + expect(await screen.findByText('Page content')).toBeInTheDocument() + + await fireEvent.click(screen.getByRole('link', { name: 'Home link' })) + expect(await screen.findByText('Home content')).toBeInTheDocument() + PendingComponent.mockClear() + await fireEvent.click(screen.getByRole('link', { name: 'Page link' })) + await new Promise((resolve) => setTimeout(resolve, 10)) + + expect(screen.queryByText('Page content')).toBeInTheDocument() + expect(screen.queryByTestId('pending-component')).not.toBeInTheDocument() + expect(PendingComponent).not.toHaveBeenCalled() + expect(importer).toHaveBeenCalledOnce() +}) + +test('a failed component download is retried from the route error UI', async () => { + vi.spyOn(console, 'error').mockImplementation(() => {}) + + const PageContent = () =>
Page content
+ const importer = vi + .fn<() => Promise<{ default: typeof PageContent }>>() + .mockRejectedValueOnce(new Error('component download failed')) + .mockResolvedValue({ default: PageContent }) + const Page = lazyRouteComponent(importer) + + function RouteError(props: ErrorComponentProps) { + const router = useRouter() + return ( + + ) + } + + const rootRoute = createRootRoute() + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + component: Page, + errorComponent: RouteError, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + }) + + render() + + const retryButton = await screen.findByRole('button', { name: 'Retry' }) + expect(importer).toHaveBeenCalledTimes(1) + + await fireEvent.click(retryButton) + + expect(await screen.findByText('Page content')).toBeInTheDocument() + expect(importer).toHaveBeenCalledTimes(2) +}) diff --git a/packages/vue-router/tests/disableGlobalCatchBoundary.test.tsx b/packages/vue-router/tests/disableGlobalCatchBoundary.test.tsx index 3cd92b08c0..67c7f6c63f 100644 --- a/packages/vue-router/tests/disableGlobalCatchBoundary.test.tsx +++ b/packages/vue-router/tests/disableGlobalCatchBoundary.test.tsx @@ -79,4 +79,32 @@ describe('disableGlobalCatchBoundary option', () => { ) expect(externalErrorElement).toBeInTheDocument() }) + + test('the global boundary recovers when the same match is reloaded', async () => { + vi.spyOn(console, 'warn').mockImplementation(() => {}) + let shouldThrow = true + + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => { + if (shouldThrow) { + throw new Error('Temporary error') + } + return
Recovered
+ }, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + }) + + render() + expect(await screen.findByText('Temporary error')).toBeInTheDocument() + + shouldThrow = false + await router.invalidate() + + expect(await screen.findByText('Recovered')).toBeInTheDocument() + }) }) diff --git a/packages/vue-router/tests/errorBoundary.test-d.tsx b/packages/vue-router/tests/errorBoundary.test-d.tsx new file mode 100644 index 0000000000..36db897af3 --- /dev/null +++ b/packages/vue-router/tests/errorBoundary.test-d.tsx @@ -0,0 +1,30 @@ +import { expectTypeOf, test } from 'vitest' +import { createRootRoute, createRouter } from '../src' +import type { ErrorComponentProps } from '../src' + +test('only boundary errors default to unknown', () => { + expectTypeOf().toEqualTypeOf() + expectTypeOf['error']>().toEqualTypeOf() + const routeTree = createRootRoute({ + errorComponent: ({ error }) => { + expectTypeOf(error).toEqualTypeOf() + return
+ }, + onCatch: (error) => { + expectTypeOf(error).toEqualTypeOf() + }, + onError: (error) => { + expectTypeOf(error).toBeAny() + }, + }) + createRouter({ + routeTree, + defaultErrorComponent: ({ error }) => { + expectTypeOf(error).toEqualTypeOf() + return
+ }, + defaultOnCatch: (error) => { + expectTypeOf(error).toEqualTypeOf() + }, + }) +}) diff --git a/packages/vue-router/tests/errorComponent.test.tsx b/packages/vue-router/tests/errorComponent.test.tsx index f606040f17..c5f88afa62 100644 --- a/packages/vue-router/tests/errorComponent.test.tsx +++ b/packages/vue-router/tests/errorComponent.test.tsx @@ -1,8 +1,13 @@ import { afterEach, describe, expect, test, vi } from 'vitest' import { cleanup, fireEvent, render, screen } from '@testing-library/vue' +import { defineComponent, ref } from 'vue' +import { createControlledPromise } from '@tanstack/router-core' import { + CatchBoundary, + ErrorComponent, Link, + Outlet, RouterProvider, createLazyRoute, createRootRoute, @@ -12,7 +17,11 @@ import { import type { ErrorComponentProps } from '../src' function MyErrorComponent(props: ErrorComponentProps) { - return
Error: {props.error.message}
+ return
Error: {getErrorMessage(props.error)}
+} + +function getErrorMessage(error: unknown) { + return error instanceof Error ? error.message : String(error) } async function asyncToThrowFn() { @@ -160,3 +169,220 @@ describe.each([true, false])( ) }, ) + +test('global catch boundary resets when a background child generation recovers', async () => { + const refresh = createControlledPromise() + let loaderCalls = 0 + const rootRoute = createRootRoute({ component: Outlet }) + const ChildComponent = defineComponent({ + setup() { + const revision = childRoute.useLoaderData() + return () => { + if (revision.value === 1) { + throw new Error('stale child render failed') + } + + return
Recovered child revision {revision.value}
+ } + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: { + staleReloadMode: 'background', + handler: () => (++loaderCalls === 1 ? 1 : refresh), + }, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([childRoute]), + }) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + vi.spyOn(console, 'error').mockImplementation(() => {}) + + render() + expect( + await screen.findByText('stale child render failed'), + ).toBeInTheDocument() + + const invalidation = router.invalidate() + await vi.waitFor(() => expect(loaderCalls).toBe(2)) + expect(screen.getByText('stale child render failed')).toBeInTheDocument() + expect(screen.queryByText(/Recovered child revision/)).not.toBeInTheDocument() + refresh.resolve(2) + await invalidation + + expect( + await screen.findByText('Recovered child revision 2'), + ).toBeInTheDocument() + expect( + screen.queryByText('stale child render failed'), + ).not.toBeInTheDocument() +}) + +test('ancestor route errorComponent resets when a background child generation recovers', async () => { + const refresh = createControlledPromise() + let loaderCalls = 0 + const rootRoute = createRootRoute({ + component: Outlet, + errorComponent: ({ error }) => ( +
Ancestor error: {getErrorMessage(error)}
+ ), + }) + const ChildComponent = defineComponent({ + setup() { + const revision = childRoute.useLoaderData() + return () => { + if (revision.value === 1) { + throw new Error('stale child render failed') + } + + return
Recovered child revision {revision.value}
+ } + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: { + staleReloadMode: 'background', + handler: () => (++loaderCalls === 1 ? 1 : refresh), + }, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([childRoute]), + }) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + vi.spyOn(console, 'error').mockImplementation(() => {}) + + let invalidation: Promise | undefined + try { + render() + expect( + await screen.findByText('Ancestor error: stale child render failed'), + ).toBeInTheDocument() + + invalidation = router.invalidate({ + filter: (match) => match.routeId === childRoute.id, + }) + await vi.waitFor(() => expect(loaderCalls).toBe(2)) + expect( + screen.getByText('Ancestor error: stale child render failed'), + ).toBeInTheDocument() + refresh.resolve(2) + await invalidation + + expect( + await screen.findByText('Recovered child revision 2'), + ).toBeInTheDocument() + } finally { + refresh.resolve(2) + if (invalidation) { + await Promise.allSettled([invalidation]) + } + } +}) + +test.each([ + ['false', false], + ['zero', 0], + ['negative zero', -0], + ['bigint zero', 0n], + ['empty string', ''], + ['null', null], + ['undefined', undefined], + ['NaN', NaN], +] as const)( + 'CatchBoundary renders falsy thrown value %s', + async (_, thrown) => { + vi.spyOn(console, 'error').mockImplementation(() => {}) + let caught: unknown + + function ThrowFalsy(): never { + throw thrown + } + + const rootRoute = createRootRoute({ + component: ThrowFalsy, + errorComponent: ({ error }) => ( +
{Object.is(error, thrown) ? 'Caught value' : 'Wrong value'}
+ ), + onCatch: (error) => { + caught = error + }, + }) + const router = createRouter({ routeTree: rootRoute }) + + render() + + expect(await screen.findByText('Caught value')).toBeInTheDocument() + expect(screen.queryByText('Wrong value')).not.toBeInTheDocument() + expect(Object.is(caught, thrown)).toBe(true) + }, +) + +test.each([ + [new Error('Error message'), 'Error message'], + [{ message: 'Serialized message' }, 'Serialized message'], + [{ message: 0 }, undefined], + ['Thrown string', undefined], + [false, undefined], + [0, undefined], + [0n, undefined], + ['', undefined], + [null, undefined], + [undefined, undefined], + [NaN, undefined], + [Symbol('error'), undefined], + [Object.create(null), undefined], +])('default error details render %s', (error, expected) => { + const { container } = render() + + expect(screen.getByText('Something went wrong!')).toBeInTheDocument() + expect(container.querySelector('code')?.textContent).toBe(expected) +}) + +test.each([false, 0, -0, 0n, '', null, undefined, NaN, { message: 'object' }])( + 'CatchBoundary retains the original value and resets after throwing %s', + async (thrown) => { + const shouldThrow = ref(true) + const resetKey = ref(0) + const onCatch = vi.fn() + const Child = defineComponent(() => () => { + if (shouldThrow.value) { + throw thrown + } + return
Recovered child
+ }) + const App = defineComponent(() => () => ( + resetKey.value} + onCatch={onCatch} + errorComponent={({ error, reset }: ErrorComponentProps) => ( + + )} + children={} + /> + )) + + render() + await screen.findByText('Reset') + shouldThrow.value = false + await fireEvent.click(screen.getByText('Reset')) + expect(await screen.findByText('Recovered child')).toBeInTheDocument() + + shouldThrow.value = true + await screen.findByText('Reset') + shouldThrow.value = false + resetKey.value++ + expect(await screen.findByText('Recovered child')).toBeInTheDocument() + expect(onCatch).toHaveBeenCalledTimes(2) + expect(onCatch).toHaveBeenLastCalledWith(thrown) + }, +) diff --git a/packages/vue-router/tests/fileRoute.test.ts b/packages/vue-router/tests/fileRoute.test.ts index f6b92298c8..5d459d1b7e 100644 --- a/packages/vue-router/tests/fileRoute.test.ts +++ b/packages/vue-router/tests/fileRoute.test.ts @@ -1,13 +1,38 @@ /* eslint-disable */ -import { describe, it, expect } from 'vitest' +import { afterEach, describe, it, expect, vi } from 'vitest' import { getRouteApi, createFileRoute, createLazyRoute, createLazyFileRoute, LazyRoute, + FileRoute, } from '../src' +afterEach(() => { + vi.restoreAllMocks() +}) + +describe('createFileRoute', () => { + it('creates a non-root route without a deprecation warning', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + // @ts-expect-error + const route = createFileRoute('')({}) + + expect(route.isRoot).toBe(false) + expect(warn).not.toHaveBeenCalled() + }) + + it('keeps the deprecation warning for direct FileRoute usage', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + // @ts-expect-error + const route = new FileRoute('').createRoute({}) + + expect(route.isRoot).toBe(false) + expect(warn).toHaveBeenCalledOnce() + }) +}) + describe('createFileRoute has the same hooks as getRouteApi', () => { const routeApi = getRouteApi('foo') const hookNames = Object.keys(routeApi).filter((key) => key.startsWith('use')) diff --git a/packages/vue-router/tests/hydration-capped-boundary-pending.test.tsx b/packages/vue-router/tests/hydration-capped-boundary-pending.test.tsx new file mode 100644 index 0000000000..e8e0db4b67 --- /dev/null +++ b/packages/vue-router/tests/hydration-capped-boundary-pending.test.tsx @@ -0,0 +1,153 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { afterEach, describe, expect, test, vi } from 'vitest' +import { hydrate as hydrateRouter } from '@tanstack/router-core/ssr/client' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + notFound, +} from '../src' +import { dehydrateToBootstrap } from './ssr-test-utils' +import type { TsrSsrGlobal } from '@tanstack/router-core/ssr/client' + +declare global { + interface Window { + $_TSR?: TsrSsrGlobal + } +} + +const testCleanups: Array<() => void | Promise> = [] + +afterEach(async () => { + while (testCleanups.length) { + await testCleanups.pop()!() + } + vi.restoreAllMocks() + window.$_TSR = undefined + document.body.innerHTML = '' +}) + +describe('hydrating a server-capped boundary lane', () => { + test.each([ + ['error', 'parent'], + ['notFound', 'parent'], + ['error', 'root'], + ['notFound', 'root'], + ] as const)( + 'keeps the server-rendered %s %s boundary visible through hydration', + async (outcome, boundary) => { + const childLoader = vi.fn(() => 'child data') + const makeRouteTree = () => { + const boundaryOptions = { + beforeLoad: () => { + throw outcome === 'notFound' + ? notFound() + : new Error('server route failure') + }, + pendingComponent: () => ( +
Boundary pending
+ ), + errorComponent: () => ( +
Boundary error
+ ), + notFoundComponent: () => ( +
Boundary not found
+ ), + } + const rootRoute = createRootRoute({ + component: Outlet, + ...(boundary === 'root' ? boundaryOptions : {}), + }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + component: Outlet, + ...(boundary === 'parent' ? boundaryOptions : {}), + }) + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + loader: childLoader, + component: () =>
Child
, + }) + return rootRoute.addChildren([parentRoute.addChildren([childRoute])]) + } + + const serverRouter = createRouter({ + routeTree: makeRouteTree(), + history: createMemoryHistory({ + initialEntries: ['/parent/child'], + }), + }) + serverRouter.isServer = true + testCleanups.push(() => serverRouter.serverSsr?.cleanup()) + window.$_TSR = await dehydrateToBootstrap(serverRouter) + + const serverMatches = serverRouter.stores.matches.get() + expect(serverMatches).toHaveLength(3) + const serverBoundary = serverMatches[boundary === 'root' ? 0 : 1]! + if (outcome === 'notFound' && boundary === 'root') { + expect(serverBoundary).toMatchObject({ + status: 'success', + _notFound: true, + }) + } else { + expect(serverBoundary.status).toBe(outcome) + } + + const serverApp = Vue.createSSRApp( + Vue.defineComponent({ + setup: () => () => , + }), + ) + const serverHtml = await renderToString(serverApp) + const expectedBoundary = + outcome === 'notFound' ? 'Boundary not found' : 'Boundary error' + expect(serverHtml).toContain(expectedBoundary) + + const clientRouter = createRouter({ + routeTree: makeRouteTree(), + history: createMemoryHistory({ + initialEntries: ['/parent/child'], + }), + }) + + await hydrateRouter(clientRouter) + + const container = document.createElement('div') + container.innerHTML = serverHtml + document.body.appendChild(container) + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) + const consoleWarn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const clientApp = Vue.createSSRApp( + Vue.defineComponent({ + setup: () => () => , + }), + ) + let clientAppMounted = false + testCleanups.push(() => { + if (clientAppMounted) { + clientApp.unmount() + } + container.remove() + }) + + clientApp.mount(container) + clientAppMounted = true + await Vue.nextTick() + + expect(container).toHaveTextContent(expectedBoundary) + expect(container).not.toHaveTextContent('Boundary pending') + expect( + [consoleError.mock.calls, consoleWarn.mock.calls].flat(2).join(' '), + ).not.toMatch(/hydration|mismatch/i) + expect(childLoader).not.toHaveBeenCalled() + }, + ) +}) diff --git a/packages/vue-router/tests/hydration-terminal-lane.test.tsx b/packages/vue-router/tests/hydration-terminal-lane.test.tsx new file mode 100644 index 0000000000..f24b3f2ac7 --- /dev/null +++ b/packages/vue-router/tests/hydration-terminal-lane.test.tsx @@ -0,0 +1,91 @@ +import { cleanup, render, screen } from '@testing-library/vue' +import { afterEach, describe, expect, test, vi } from 'vitest' +import { nextTick } from 'vue' +import { hydrate } from '@tanstack/router-core/ssr/client' +import { dehydrateSsrMatchId } from '../../router-core/src/ssr/ssr-match-id' +import { + RouterProvider, + createMemoryHistory, + createRootRoute, + createRouter, +} from '../src' +import type { AnyRouteMatch } from '@tanstack/router-core' +import type { TsrSsrGlobal } from '@tanstack/router-core/ssr/client' + +function bootstrap( + matches: Array<{ + match: AnyRouteMatch + status: AnyRouteMatch['status'] + ssr: AnyRouteMatch['ssr'] + data?: unknown + error?: unknown + notFound?: boolean + }>, +): void { + window.$_TSR = { + router: { + manifest: undefined, + matches: matches.map(({ match, status, ssr, data, error, notFound }) => ({ + i: dehydrateSsrMatchId(match.id), + l: data, + e: error, + s: status, + ssr, + u: Date.now(), + ...(notFound ? { g: true } : {}), + })), + }, + h: vi.fn(), + e: vi.fn(), + c: vi.fn(), + p: vi.fn(), + buffer: [], + } as TsrSsrGlobal +} + +afterEach(() => { + cleanup() + vi.useRealTimers() + delete window.$_TSR +}) + +describe('hydration terminal lane', () => { + test('keeps a hydrated pending fallback through its minimum before a terminal result', async () => { + vi.useFakeTimers() + vi.setSystemTime(0) + const rootRoute = createRootRoute({ + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
Missing page pending
, + notFoundComponent: () =>
Missing page
, + }) + const router = createRouter({ + history: createMemoryHistory({ initialEntries: ['/missing'] }), + routeTree: rootRoute, + }) + const matches = router.matchRoutes(router.state.location) + expect(matches[0]?._notFound).toBe(true) + bootstrap([ + { + match: matches[0]!, + status: 'pending', + ssr: false, + notFound: true, + }, + ]) + + await hydrate(router) + render() + await nextTick() + expect(screen.getByRole('status')).toHaveTextContent('Missing page pending') + + await vi.advanceTimersByTimeAsync(99) + await nextTick() + expect(screen.getByRole('status')).toHaveTextContent('Missing page pending') + expect(screen.queryByText('Missing page')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(5) + await nextTick() + expect(screen.getByText('Missing page')).toBeInTheDocument() + }) +}) diff --git a/packages/vue-router/tests/issue-4467-lazy-route-pending.test.tsx b/packages/vue-router/tests/issue-4467-lazy-route-pending.test.tsx new file mode 100644 index 0000000000..7c5c131783 --- /dev/null +++ b/packages/vue-router/tests/issue-4467-lazy-route-pending.test.tsx @@ -0,0 +1,87 @@ +import { cleanup, render, screen } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { nextTick } from 'vue' +import { createControlledPromise } from '@tanstack/router-core' +import { + Outlet, + RouterProvider, + createLazyRoute, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(() => { + cleanup() + vi.useRealTimers() +}) + +test('a lazy pending component does not restart an acknowledged minimum', async () => { + const loader = createControlledPromise() + const lazyPageOptions = createLazyRoute('/page')({ + pendingComponent: () =>

Loading lazy page

, + component: () =>

Page

, + }) + const lazyOptions = createControlledPromise() + const rootRoute = createRootRoute({ component: () => }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>

Index page

, + }) + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + loader: () => loader, + }).lazy(() => lazyOptions) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, pageRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 100, + defaultPendingComponent: () =>

Loading default

, + }) + + render() + expect( + await screen.findByRole('heading', { name: 'Index page' }), + ).toBeInTheDocument() + vi.useFakeTimers() + vi.setSystemTime(0) + + const navigation = router.navigate({ to: '/page' }) + let settled = false + void navigation.then(() => { + settled = true + }) + try { + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByRole('status')).toHaveTextContent('Loading default') + + await vi.advanceTimersByTimeAsync(25) + lazyOptions.resolve(lazyPageOptions) + loader.resolve() + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByRole('status')).toHaveTextContent('Loading lazy page') + + await vi.advanceTimersByTimeAsync(74) + await nextTick() + expect(screen.getByRole('status')).toHaveTextContent('Loading lazy page') + + await vi.advanceTimersByTimeAsync(5) + await Promise.resolve() + await nextTick() + expect(settled).toBe(true) + await navigation + expect(screen.getByRole('heading', { name: 'Page' })).toBeInTheDocument() + expect(Date.now()).toBeLessThan(125) + } finally { + lazyOptions.resolve(lazyPageOptions) + loader.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await navigation + } +}) diff --git a/packages/vue-router/tests/issue-7367-pending-min-redirect.test.tsx b/packages/vue-router/tests/issue-7367-pending-min-redirect.test.tsx new file mode 100644 index 0000000000..f664a08303 --- /dev/null +++ b/packages/vue-router/tests/issue-7367-pending-min-redirect.test.tsx @@ -0,0 +1,133 @@ +import { cleanup, render, screen } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { nextTick } from 'vue' +import { createControlledPromise } from '@tanstack/router-core' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + redirect, +} from '../src' + +afterEach(() => { + vi.restoreAllMocks() + cleanup() + vi.useRealTimers() +}) + +test('a compatible SPA redirect preserves the acknowledged pending minimum', async () => { + vi.useFakeTimers() + vi.setSystemTime(0) + const redirectReady = createControlledPromise() + let shouldRedirect = true + + const rootRoute = createRootRoute({ + component: () => , + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
loading
, + beforeLoad: async () => { + if (shouldRedirect) { + shouldRedirect = false + await redirectReady + throw redirect({ to: '/welcome', replace: true }) + } + }, + }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Index
, + }) + const welcomeRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/welcome', + component: () =>
Welcome
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, welcomeRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + try { + render() + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByTestId('pending')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(25) + redirectReady.resolve() + await vi.advanceTimersByTimeAsync(74) + await nextTick() + expect(screen.getByTestId('pending')).toBeInTheDocument() + expect(screen.queryByTestId('welcome-page')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(5) + await nextTick() + expect(screen.getByTestId('welcome-page')).toBeInTheDocument() + } finally { + redirectReady.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await nextTick() + } +}) + +test('an incompatible SPA redirect does not inherit the pending minimum', async () => { + const redirectReady = createControlledPromise() + const rootRoute = createRootRoute({ component: () => }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Index
, + }) + const sourceRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/source', + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
loading
, + beforeLoad: async () => { + await redirectReady + throw redirect({ to: '/welcome', replace: true }) + }, + }) + const welcomeRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/welcome', + component: () =>
Welcome
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, sourceRoute, welcomeRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + expect(await screen.findByTestId('index-page')).toBeVisible() + vi.useFakeTimers() + vi.setSystemTime(0) + + const navigation = router.navigate({ to: '/source' }) + try { + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByTestId('pending')).toBeVisible() + + await vi.advanceTimersByTimeAsync(25) + redirectReady.resolve() + await vi.advanceTimersByTimeAsync(5) + await navigation + await nextTick() + + expect(Date.now()).toBeLessThan(100) + expect(screen.getByTestId('welcome-page')).toBeVisible() + expect(screen.queryByTestId('index-page')).not.toBeInTheDocument() + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + } finally { + redirectReady.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await navigation + } +}) diff --git a/packages/vue-router/tests/issue-7986-retained-pending.test.tsx b/packages/vue-router/tests/issue-7986-retained-pending.test.tsx new file mode 100644 index 0000000000..acbabfcb29 --- /dev/null +++ b/packages/vue-router/tests/issue-7986-retained-pending.test.tsx @@ -0,0 +1,1135 @@ +import { cleanup, render, screen, waitFor } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { createControlledPromise } from '@tanstack/router-core' +import { defineComponent, nextTick } from 'vue' +import { + Outlet, + RouterProvider, + createLazyRoute, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' +import type { ControlledPromise } from '@tanstack/router-core' + +const controlledPromises = new Set>() +const pendingOperations = new Set>() + +afterEach(async () => { + try { + for (const promise of controlledPromises) { + if (promise.status === 'pending') { + promise.resolve() + } + } + if (vi.isFakeTimers()) { + await vi.runAllTimersAsync() + } + await Promise.allSettled(pendingOperations) + } finally { + controlledPromises.clear() + pendingOperations.clear() + cleanup() + vi.useRealTimers() + vi.restoreAllMocks() + } +}) + +const navigationDelay = 100 + +function controlled() { + const promise = createControlledPromise() + controlledPromises.add(promise) + return promise +} + +function track(operation: Promise) { + pendingOperations.add(operation) + return operation +} + +function setup() { + const navigationBeforeLoadStarted = controlled() + let beforeLoadCalls = 0 + + const rootRoute = createRootRoute({ component: () => }) + const layoutRoute = createRoute({ + getParentRoute: () => rootRoute, + id: 'app', + beforeLoad: async () => { + if (++beforeLoadCalls > 1) { + navigationBeforeLoadStarted.resolve() + await new Promise((resolve) => + setTimeout(resolve, navigationDelay), + ) + } + return { user: 'test' } + }, + component: () => , + }) + const Project = defineComponent({ + setup() { + const params = projectRoute.useParams() + + const search = projectRoute.useSearch() + return () => ( +
+ project={params.value.projectId} tab={search.value.tab ?? 'default'} +
+ ) + }, + }) + const projectRoute = createRoute({ + getParentRoute: () => layoutRoute, + path: '/projects/$projectId', + validateSearch: (search: Record): { tab?: string } => + typeof search.tab === 'string' ? { tab: search.tab } : {}, + component: Project, + }) + + const router = createRouter({ + routeTree: rootRoute.addChildren([layoutRoute.addChildren([projectRoute])]), + history: createMemoryHistory({ initialEntries: ['/projects/p1'] }), + defaultPendingComponent: () =>
Pending
, + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + return { router, navigationBeforeLoadStarted } +} + +test('a search-only navigation retains successful UI while beforeLoad reruns', async () => { + const { router, navigationBeforeLoadStarted } = setup() + render() + expect(await screen.findByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + const navigation = track( + router.navigate({ + to: '/projects/$projectId', + params: { projectId: 'p1' }, + search: { tab: 'files' }, + }), + ) + await navigationBeforeLoadStarted + + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(navigationDelay) + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p1 tab=files', + ) +}) + +test('a path-param navigation retains successful UI while beforeLoad reruns', async () => { + const { router, navigationBeforeLoadStarted } = setup() + render() + expect(await screen.findByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + const navigation = track( + router.navigate({ + to: '/projects/$projectId', + params: { projectId: 'p2' }, + }), + ) + await navigationBeforeLoadStarted + + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p1 tab=default', + ) + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(navigationDelay) + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toHaveTextContent( + 'project=p2 tab=default', + ) +}) + +test('a blocking reload retains the exact successful match', async () => { + const reloadStarted = controlled() + let loaderCalls = 0 + + const rootRoute = createRootRoute({ component: () => }) + const PageComponent = defineComponent({ + setup() { + const loaderData = pageRoute.useLoaderData() + + const search = pageRoute.useSearch() + return () => ( +
+ {loaderData.value} tab={search.value.tab ?? 'default'} +
+ ) + }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + validateSearch: (search: Record): { tab?: string } => + typeof search.tab === 'string' ? { tab: search.tab } : {}, + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: () => { + if (++loaderCalls === 1) { + return 'initial' + } + reloadStarted.resolve() + return new Promise((resolve) => + setTimeout(() => resolve('reloaded'), navigationDelay), + ) + }, + }, + component: PageComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + defaultPendingComponent: () =>
Pending
, + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('content')).toHaveTextContent( + 'initial tab=default', + ) + + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + const navigation = track( + router.navigate({ + to: '/page', + search: { tab: 'files' }, + }), + ) + await reloadStarted + + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent('initial tab=default') + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent('initial tab=default') + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(navigationDelay) + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toHaveTextContent('reloaded tab=files') +}) + +test('a cached success retries through pending UI when an error is mounted', async () => { + vi.spyOn(console, 'error').mockImplementation(() => {}) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const retryStarted = controlled() + const retry = controlled() + let loaderCalls = 0 + + const rootRoute = createRootRoute({ component: () => }) + const PageComponent = defineComponent({ + setup() { + const loaderData = pageRoute.useLoaderData() + return () =>
{loaderData.value}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: () => { + loaderCalls++ + if (loaderCalls === 1) { + throw new Error('initial load failed') + } + if (loaderCalls === 2) { + return 'preloaded' + } + retryStarted.resolve() + return retry.then(() => 'retried') + }, + }, + component: PageComponent, + pendingComponent: () =>
Pending
, + errorComponent: () =>
Failed
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('error')).toBeInTheDocument() + + await router.preloadRoute({ to: '/page' }) + expect(loaderCalls).toBe(2) + expect(screen.getByTestId('error')).toBeInTheDocument() + + const navigation = track(router.navigate({ to: '/page' })) + await retryStarted + await nextTick() + + expect(await screen.findByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('error')).not.toBeInTheDocument() + + retry.resolve() + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent('retried') +}) + +test('a cache-only success retries through pending UI over mounted success', async () => { + const retryStarted = controlled() + const retry = controlled() + let loaderCalls = 0 + + const rootRoute = createRootRoute({ component: () => }) + const PageComponent = defineComponent({ + setup() { + const loaderData = pageRoute.useLoaderData() + return () =>
{loaderData.value}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: () => { + const generation = ++loaderCalls + if (generation === 3) { + retryStarted.resolve() + return retry.then(() => `generation ${generation}`) + } + return `generation ${generation}` + }, + }, + component: PageComponent, + pendingComponent: () =>
Pending
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('content')).toHaveTextContent('generation 1') + + await router.preloadRoute({ to: '/page' }) + expect(loaderCalls).toBe(2) + expect(screen.getByTestId('content')).toHaveTextContent('generation 1') + + const navigation = track(router.navigate({ to: '/page' })) + await retryStarted + await nextTick() + + expect(await screen.findByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('content')).not.toBeInTheDocument() + + retry.resolve() + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toHaveTextContent('generation 3') +}) + +test('a success hidden below an error boundary retries through pending UI', async () => { + vi.spyOn(console, 'error').mockImplementation(() => {}) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const childReloadStarted = controlled() + const childReload = controlled() + let parentFails = false + let childReloads = false + + const rootRoute = createRootRoute({ component: () => }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + shouldReload: true, + loader: () => { + if (parentFails) { + throw new Error('parent failed') + } + return 'parent data' + }, + component: () => , + errorComponent: () =>
Parent failed
, + }) + const ChildComponent = defineComponent({ + setup() { + const loaderData = childRoute.useLoaderData() + return () =>
{loaderData.value}
+ }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + shouldReload: () => childReloads, + loader: { + staleReloadMode: 'blocking', + handler: () => { + if (childReloads) { + childReloadStarted.resolve() + return childReload.then(() => 'reloaded child') + } + return 'initial child' + }, + }, + component: ChildComponent, + pendingComponent: () =>
Pending child
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ initialEntries: ['/parent/child'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('content')).toHaveTextContent( + 'initial child', + ) + + parentFails = true + await track(router.navigate({ to: '/parent/child' })) + await nextTick() + expect(await screen.findByTestId('error')).toBeInTheDocument() + + parentFails = false + childReloads = true + const navigation = track(router.navigate({ to: '/parent/child' })) + await childReloadStarted + await nextTick() + + expect(await screen.findByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('error')).not.toBeInTheDocument() + + childReload.resolve() + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent('reloaded child') +}) + +test('a global not-found destination keeps pending until its terminal component is ready', async () => { + const missingStarted = controlled() + const missingLoader = controlled() + const terminalStarted = controlled() + const terminalReady = controlled() + let loaderCalls = 0 + const Missing = Object.assign( + () =>
Missing
, + { + preload: () => { + terminalStarted.resolve() + return terminalReady + }, + }, + ) + + const rootRoute = createRootRoute({ + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: () => { + if (++loaderCalls === 1) { + return 'initial root' + } + missingStarted.resolve() + return missingLoader + }, + }, + component: () => , + pendingComponent: () =>
Pending root
, + notFoundComponent: Missing, + }) + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + component: () =>
Page
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('content')).toBeInTheDocument() + + const navigation = track(router.navigate({ to: '/missing' } as any)) + await missingStarted + await nextTick() + + expect(await screen.findByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('content')).not.toBeInTheDocument() + + let settled = false + void navigation.then(() => { + settled = true + }) + missingLoader.resolve() + await terminalStarted + await nextTick() + expect(screen.getByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('missing')).not.toBeInTheDocument() + expect(settled).toBe(false) + + terminalReady.resolve() + await navigation + await nextTick() + + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() + expect(screen.getByTestId('missing')).toBeVisible() +}) + +test('a cold global not-found presents pending only while its terminal component loads', async () => { + const terminalStarted = controlled() + const terminalReady = controlled() + const Missing = Object.assign( + () =>
Missing
, + { + preload: () => { + terminalStarted.resolve() + return terminalReady + }, + }, + ) + const rootRoute = createRootRoute({ + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: () =>
Pending root
, + notFoundComponent: Missing, + }) + const router = createRouter({ + routeTree: rootRoute, + history: createMemoryHistory({ initialEntries: ['/missing'] }), + }) + + render() + await terminalStarted + expect(await screen.findByTestId('pending')).toBeVisible() + expect(screen.queryByTestId('missing')).not.toBeInTheDocument() + + terminalReady.resolve() + expect(await screen.findByTestId('missing')).toBeVisible() + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() +}) + +test('lazy fuzzy-boundary relocation retains the mounted parent', async () => { + const lazyStarted = controlled() + const lazyRoute = controlled() + const parentReloadStarted = controlled() + const parentReload = controlled() + let parentLoads = 0 + + const rootRoute = createRootRoute({ + component: () => , + notFoundComponent: () =>
Root missing
, + }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + beforeLoad: async () => { + if (++parentLoads > 1) { + parentReloadStarted.resolve() + await parentReload + } + }, + component: () => ( +
+
Parent content
+ +
+ ), + pendingComponent: () => ( +
Parent pending
+ ), + notFoundComponent: () => ( +
Parent missing
+ ), + }) + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + }).lazy(async () => { + lazyStarted.resolve() + await lazyRoute + return createLazyRoute('/parent/child')({ + notFoundComponent: () => ( +
Child missing
+ ), + }) + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ initialEntries: ['/parent'] }), + defaultPendingComponent: () => ( +
Pending
+ ), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('parent-content')).toBeVisible() + + const navigation = track( + router.navigate({ + to: '/parent/child/missing' as any, + }), + ) + await lazyStarted + await nextTick() + + expect(screen.getByTestId('parent-content')).toBeVisible() + expect(screen.queryByTestId('parent-pending')).not.toBeInTheDocument() + expect(screen.queryByTestId('parent-missing')).not.toBeInTheDocument() + + lazyRoute.resolve() + await parentReloadStarted + await nextTick() + + expect(screen.getByTestId('parent-content')).toBeVisible() + expect(screen.queryByTestId('parent-pending')).not.toBeInTheDocument() + expect(screen.queryByTestId('parent-missing')).not.toBeInTheDocument() + + parentReload.resolve() + await navigation + await nextTick() + + expect(screen.getByTestId('child-missing')).toBeVisible() + expect(screen.queryByTestId('root-missing')).not.toBeInTheDocument() + expect(screen.queryByTestId('parent-missing')).not.toBeInTheDocument() +}) + +test('a superseding navigation replaces an unrelated pending presentation', async () => { + const otherStarted = controlled() + const otherLoader = controlled() + const pageReloadStarted = controlled() + const pageReload = controlled() + let pageLoads = 0 + + const rootRoute = createRootRoute({ component: () => }) + const PageComponent = defineComponent({ + setup() { + const loaderData = pageRoute.useLoaderData() + return () =>
{loaderData.value}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: () => { + if (++pageLoads === 1) { + return 'initial page' + } + pageReloadStarted.resolve() + return pageReload.then(() => 'reloaded page') + }, + }, + component: PageComponent, + pendingComponent: () =>
Page pending
, + }) + const otherRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/other', + loader: async () => { + otherStarted.resolve() + await otherLoader + }, + pendingComponent: () => ( +
Other pending
+ ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute, otherRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 1, + }) + + render() + expect(await screen.findByTestId('content')).toHaveTextContent('initial page') + + const otherNavigation = track(router.navigate({ to: '/other' })) + await otherStarted + await nextTick() + expect(await screen.findByTestId('other-pending')).toBeVisible() + + const navigation = track(router.navigate({ to: '/page' })) + await pageReloadStarted + await nextTick() + + await waitFor(() => { + expect(screen.getByTestId('page-pending')).toBeVisible() + expect(screen.queryByTestId('other-pending')).not.toBeInTheDocument() + }) + + pageReload.resolve() + await navigation + otherLoader.resolve() + await Promise.allSettled([otherNavigation]) + await nextTick() + + expect(screen.queryByTestId('page-pending')).not.toBeInTheDocument() + expect(screen.getByTestId('content')).toBeVisible() + expect(screen.getByTestId('content')).toHaveTextContent('reloaded page') +}) + +test('a retained root publishes fresh context with a child fallback', async () => { + const retainedStarted = controlled() + const retainedReady = controlled() + const childStarted = controlled() + const childReady = controlled() + let retainedLoads = 0 + + const RootComponent = defineComponent({ + setup() { + const context = rootRoute.useRouteContext() + return () => ( +
+
{context.value.user}
+ +
+ ) + }, + }) + + const rootRoute = createRootRoute({ + validateSearch: (search: Record): { user: string } => ({ + user: typeof search.user === 'string' ? search.user : 'unknown', + }), + beforeLoad: async ({ search }) => { + if (++retainedLoads > 1) { + retainedStarted.resolve() + await retainedReady + } + return { user: search.user } + }, + component: RootComponent, + }) + const sourceRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/source', + component: () =>
Source
, + }) + const childRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/child', + loader: async () => { + childStarted.resolve() + await childReady + }, + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: () =>
Pending
, + component: () =>
Child
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([sourceRoute, childRoute]), + history: createMemoryHistory({ initialEntries: ['/source?user=Ada'] }), + }) + + render() + expect(await screen.findByTestId('source')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Ada') + await waitFor(() => expect(router.state.status).toBe('idle')) + + const navigation = track( + router.navigate({ to: '/child', search: { user: 'Grace' } }), + ) + await retainedStarted + await nextTick() + expect(screen.getByTestId('source')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Ada') + expect(screen.queryByTestId('child-pending')).not.toBeInTheDocument() + + retainedReady.resolve() + await childStarted + await nextTick() + expect(await screen.findByTestId('child-pending')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Grace') + + childReady.resolve() + await navigation + await nextTick() + expect(screen.getByTestId('child')).toBeVisible() +}) + +test('a retained prefix exposes one fresh context chain before descendant pending', async () => { + const retainedStarted = controlled() + const retainedReady = controlled() + const pendingStarted = controlled() + const pendingReady = controlled() + let retainedLoads = 0 + + const rootRoute = createRootRoute({ + beforeLoad: () => ({ rootReady: true }), + component: () => , + }) + const AComponent = defineComponent({ + setup() { + const context = aRoute.useRouteContext() + return () => ( +
+
{context.value.user}
+ +
+ ) + }, + }) + + const aRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'a', + validateSearch: (search: Record): { user: string } => ({ + user: typeof search.user === 'string' ? search.user : 'unknown', + }), + beforeLoad: async ({ search }) => { + if (++retainedLoads > 1) { + retainedStarted.resolve() + await retainedReady + } + return { user: search.user } + }, + component: AComponent, + }) + const bRoute = createRoute({ + getParentRoute: () => aRoute, + path: 'b', + component: () => , + }) + const cRoute = createRoute({ + getParentRoute: () => bRoute, + path: 'c', + component: () => , + }) + const dRoute = createRoute({ + getParentRoute: () => cRoute, + path: 'd', + component: () =>
Source
, + }) + const EComponent = defineComponent({ + setup() { + const context = eRoute.useRouteContext() + return () => ( +
+
{context.value.user}
+ +
+ ) + }, + }) + + const eRoute = createRoute({ + getParentRoute: () => aRoute, + path: 'e', + component: EComponent, + }) + const FPendingComponent = defineComponent({ + setup() { + const context = fRoute.useRouteContext() + return () => ( +
F pending for {context.value.user}
+ ) + }, + }) + + const fRoute = createRoute({ + getParentRoute: () => eRoute, + path: 'f', + loader: async () => { + pendingStarted.resolve() + await pendingReady + }, + pendingComponent: FPendingComponent, + component: () => , + }) + const gRoute = createRoute({ + getParentRoute: () => fRoute, + path: 'g', + component: () =>
G
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([ + aRoute.addChildren([ + bRoute.addChildren([cRoute.addChildren([dRoute])]), + eRoute.addChildren([fRoute.addChildren([gRoute])]), + ]), + ]), + history: createMemoryHistory({ initialEntries: ['/a/b/c/d?user=Ada'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 0, + }) + + render() + expect(await screen.findByTestId('source')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Ada') + + const navigation = track( + router.navigate({ + to: '/a/e/f/g', + search: { user: 'Grace' }, + }), + ) + await retainedStarted + await nextTick() + + expect(screen.getByTestId('source')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Ada') + expect(screen.queryByTestId('f-pending')).not.toBeInTheDocument() + + retainedReady.resolve() + await pendingStarted + await nextTick() + + expect(await screen.findByTestId('f-pending')).toBeVisible() + expect(screen.getByTestId('user')).toHaveTextContent('Grace') + expect(screen.getByTestId('e-user')).toHaveTextContent('Grace') + expect(screen.getByTestId('f-pending')).toHaveTextContent('Grace') + expect(screen.queryByTestId('source')).not.toBeInTheDocument() + expect(screen.queryByTestId('hidden-g')).not.toBeInTheDocument() + expect(router.state.matches.map((match) => match.routeId)).toContain( + gRoute.id, + ) + + pendingReady.resolve() + await navigation +}) + +test.each([false, true])( + 'retained loader and component work does not own the child fallback (parent pending: %s)', + async (parentHasPending) => { + const parentReloadStarted = controlled() + const parentReload = controlled() + const parentComponent = controlled() + const childLoader = controlled() + let parentLoads = 0 + let parentPreloads = 0 + + const rootRoute = createRootRoute({ component: () => }) + const Parent = Object.assign( + defineComponent({ + setup() { + const loaderData = parentRoute.useLoaderData() + return () => ( +
+ {loaderData.value} + +
+ ) + }, + }), + { + preload: () => (++parentPreloads === 1 ? undefined : parentComponent), + }, + ) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: 'parent', + shouldReload: true, + loader: { + staleReloadMode: 'blocking', + handler: async () => { + if (++parentLoads === 1) { + return 'initial parent' + } + parentReloadStarted.resolve() + await parentReload + return 'reloaded parent' + }, + }, + component: Parent, + ...(parentHasPending + ? { + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: () => ( +
Parent pending
+ ), + } + : {}), + }) + const sourceRoute = createRoute({ + getParentRoute: () => parentRoute, + path: 'source', + component: () =>
Source
, + }) + const childOptions = createLazyRoute('/parent/child')({ + pendingComponent: () => ( +
Child pending
+ ), + component: () =>
Child
, + }) + const childLazy = createControlledPromise() + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: 'child', + pendingMs: 0, + pendingMinMs: 0, + loader: () => childLoader, + }).lazy(() => childLazy) + const router = createRouter({ + routeTree: rootRoute.addChildren([ + parentRoute.addChildren([sourceRoute, childRoute]), + ]), + history: createMemoryHistory({ initialEntries: ['/parent/source'] }), + }) + + render() + expect(await screen.findByTestId('source')).toBeVisible() + await waitFor(() => expect(router.state.status).toBe('idle')) + + const navigation = track(router.navigate({ to: '/parent/child' })) + try { + await parentReloadStarted + parentReload.resolve() + await waitFor(() => { + expect( + router.state.matches.find((match) => match.routeId === parentRoute.id) + ?.isFetching, + ).toBe(false) + }) + + childLazy.resolve(childOptions) + expect(await screen.findByTestId('child-pending')).toBeVisible() + expect(screen.getByTestId('parent-content')).toBeVisible() + expect(screen.queryByTestId('parent-pending')).not.toBeInTheDocument() + expect(screen.queryByTestId('source')).not.toBeInTheDocument() + } finally { + parentReload.resolve() + parentComponent.resolve() + childLazy.resolve(childOptions) + childLoader.resolve() + await navigation + } + + expect(await screen.findByTestId('child')).toBeVisible() + }, +) + +test('a failure in the last retained guard suppresses descendant pending', async () => { + const guardStarted = controlled() + const guardReady = controlled() + const childReady = controlled() + let guardLoads = 0 + let childLoads = 0 + + const rootRoute = createRootRoute({ + beforeLoad: () => ({ rootReady: true }), + component: () => , + }) + const layoutRoute = createRoute({ + getParentRoute: () => rootRoute, + id: 'layout', + beforeLoad: async () => { + if (++guardLoads > 1) { + guardStarted.resolve() + await guardReady + throw new Error('blocked') + } + }, + component: () => , + errorComponent: () =>
Guard error
, + }) + const sourceRoute = createRoute({ + getParentRoute: () => layoutRoute, + path: '/source', + component: () =>
Source
, + }) + const childRoute = createRoute({ + getParentRoute: () => layoutRoute, + path: '/child', + loader: async () => { + childLoads++ + await childReady + }, + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: () =>
Pending
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([ + layoutRoute.addChildren([sourceRoute, childRoute]), + ]), + history: createMemoryHistory({ initialEntries: ['/source'] }), + }) + + render() + expect(await screen.findByTestId('source')).toBeVisible() + await waitFor(() => expect(router.state.status).toBe('idle')) + + const navigation = track(router.navigate({ to: '/child' })) + await guardStarted + await nextTick() + expect(screen.getByTestId('source')).toBeVisible() + expect(screen.queryByTestId('child-pending')).not.toBeInTheDocument() + expect(childLoads).toBe(0) + + guardReady.resolve() + await navigation + expect(await screen.findByTestId('guard-error')).toBeVisible() + expect(screen.queryByTestId('child-pending')).not.toBeInTheDocument() + expect(childLoads).toBe(0) +}) diff --git a/packages/vue-router/tests/issue-8115-context.test.tsx b/packages/vue-router/tests/issue-8115-context.test.tsx new file mode 100644 index 0000000000..a139155572 --- /dev/null +++ b/packages/vue-router/tests/issue-8115-context.test.tsx @@ -0,0 +1,887 @@ +import * as Vue from 'vue' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { hydrate } from '@tanstack/router-core/ssr/client' +import { + Outlet, + RouterProvider, + Scripts, + createControlledPromise, + createMemoryHistory, + createRootRoute, + createRootRouteWithContext, + createRoute, + createRouter, + useLocation, +} from '../src' +import { createRequestHandler, renderRouterToString } from '../src/ssr/server' +import type { AnyRouter } from '@tanstack/router-core' + +declare module '@tanstack/history' { + interface HistoryState { + issue8115Revision?: 'old' | 'new' + } +} + +afterEach(() => { + cleanup() + vi.restoreAllMocks() + delete window.$_TSR + delete (window as Window & { $R?: unknown }).$R + document.body.innerHTML = '' +}) + +test('invalidate merges fresh parent beforeLoad context with cached child context', async () => { + let generation = 0 + let childContextCalls = 0 + + const rootRoute = createRootRoute({ + beforeLoad: () => { + generation++ + return { + parentGeneration: generation, + collision: `parent-${generation}`, + } + }, + component: Outlet, + }) + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
+
+ {context.value.parentGeneration} +
+
+ {context.value.childSnapshotOfParent} +
+
{context.value.collision}
+
+ ) + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + context: ({ context }) => { + childContextCalls++ + return { + childSnapshotOfParent: context.parentGeneration, + collision: `child-snapshot-${context.parentGeneration}`, + } + }, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([childRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + + expect(await screen.findByTestId('parent-generation')).toHaveTextContent('1') + expect(screen.getByTestId('child-snapshot')).toHaveTextContent('1') + expect(screen.getByTestId('collision')).toHaveTextContent('child-snapshot-1') + expect(generation).toBe(1) + expect(childContextCalls).toBe(1) + const childMatchId = router.state.matches[1]!.id + + await router.invalidate() + await Vue.nextTick() + + // The fresh parent contribution is merged under the cached child contribution. + expect(router.state.matches[1]!.id).toBe(childMatchId) + expect(generation).toBe(2) + expect(childContextCalls).toBe(1) + expect(screen.getByTestId('parent-generation')).toHaveTextContent('2') + expect(screen.getByTestId('child-snapshot')).toHaveTextContent('1') + expect(screen.getByTestId('collision')).toHaveTextContent('child-snapshot-1') +}) + +test('a same-id child beforeLoad error observes fresh inherited context', async () => { + const childError = new Error('child beforeLoad failed') + let parentGeneration = 0 + let renderedError: unknown + + const rootRoute = createRootRoute({ component: Outlet }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + loaderDeps: () => ({ stable: true }), + beforeLoad: () => ({ generation: ++parentGeneration }), + component: Outlet, + }) + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
{context.value.generation}
+ ) + }, + }) + + const ChildErrorComponent = Vue.defineComponent({ + props: ['error'], + setup(props) { + const context = childRoute.useRouteContext() + + return () => { + renderedError = props.error + return ( +
+ {context.value.generation} +
+ ) + } + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + loaderDeps: () => ({ stable: true }), + beforeLoad: ({ context }) => { + if (context.generation === 2) { + throw childError + } + }, + component: ChildComponent, + errorComponent: ChildErrorComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ initialEntries: ['/parent/child'] }), + }) + + render() + + expect(await screen.findByTestId('child-generation')).toHaveTextContent('1') + await waitFor(() => expect(router.state.status).toBe('idle')) + const initialChildMatchId = router.state.matches.find( + (match) => match.routeId === childRoute.id, + )?.id + expect(initialChildMatchId).toBeDefined() + + await router.invalidate() + + expect( + await screen.findByTestId('child-error-generation'), + ).toBeInTheDocument() + expect(renderedError).toBe(childError) + expect( + router.state.matches.find((match) => match.routeId === childRoute.id)?.id, + ).toBe(initialChildMatchId) + expect(screen.getByTestId('child-error-generation')).toHaveTextContent('2') +}) + +test('a same-match reload merges new provider context with cached route context', async () => { + type ProviderContext = { + providerValue: string + collision: string + } + + const providerA: ProviderContext = { + providerValue: 'A', + collision: 'provider:A', + } + const providerB: ProviderContext = { + providerValue: 'B', + collision: 'provider:B', + } + const rootRoute = createRootRouteWithContext()() + const IndexComponent = Vue.defineComponent({ + setup() { + const context = indexRoute.useRouteContext() + return () => ( +
{JSON.stringify(context.value)}
+ ) + }, + }) + + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + context: ({ context }) => ({ + derivedFromProvider: `derived:${context.providerValue}`, + collision: `route-cached:${context.providerValue}`, + }), + component: IndexComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + context: providerA, + }) + const providerContext = Vue.ref(providerA) + const App = Vue.defineComponent({ + setup: () => () => ( + + ), + }) + + render(App) + expect(await screen.findByTestId('full-context')).toHaveTextContent( + JSON.stringify({ + providerValue: 'A', + collision: 'route-cached:A', + derivedFromProvider: 'derived:A', + }), + ) + + providerContext.value = providerB + await Vue.nextTick() + await router.invalidate() + await Vue.nextTick() + + expect(screen.getByTestId('full-context')).toHaveTextContent( + JSON.stringify({ + providerValue: 'B', + collision: 'route-cached:A', + derivedFromProvider: 'derived:A', + }), + ) +}) + +test('navigation merges fresh parent context with cached child preload context', async () => { + let parentBeforeLoadRuns = 0 + let childContextRuns = 0 + let childLoaderRuns = 0 + + const rootRoute = createRootRoute({ component: Outlet }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Home
, + }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + beforeLoad: ({ preload }) => { + parentBeforeLoadRuns++ + return { + parentValue: preload ? 'parent-preload' : 'parent-navigation', + } + }, + component: Outlet, + }) + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
+ {JSON.stringify({ + parentValue: context.value.parentValue, + childValue: context.value.childValue, + })} +
+ ) + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + context: ({ context, preload }) => { + childContextRuns++ + return { + childValue: `${preload ? 'child-preload' : 'child-navigation'}:${context.parentValue}`, + } + }, + loader: () => { + childLoaderRuns++ + return 'child data' + }, + preloadStaleTime: Infinity, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([ + indexRoute, + parentRoute.addChildren([childRoute]), + ]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + expect(await screen.findByText('Home')).toBeInTheDocument() + + await router.preloadRoute({ to: '/parent/child' }) + expect(parentBeforeLoadRuns).toBe(1) + expect(childContextRuns).toBe(1) + expect(childLoaderRuns).toBe(1) + + await router.navigate({ to: '/parent/child' }) + + expect(await screen.findByTestId('context')).toHaveTextContent( + JSON.stringify({ + parentValue: 'parent-navigation', + childValue: 'child-preload:parent-preload', + }), + ) + expect(parentBeforeLoadRuns).toBe(2) + expect(childContextRuns).toBe(1) + expect(childLoaderRuns).toBe(1) +}) + +test('a cached child context contribution is merged with fresh parent context', async () => { + const rootRoute = createRootRoute({ component: Outlet }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + validateSearch: (search: Record) => ({ + version: Number(search.version), + }), + loaderDeps: ({ search }) => ({ version: search.version }), + context: ({ deps }) => ({ parentVersion: `version-${deps.version}` }), + component: Outlet, + }) + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
+ Parent: {context.value.parentVersion}; cached child:{' '} + {context.value.childSnapshot} +
+ ) + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + loaderDeps: () => ({ stable: true }), + context: ({ context }) => ({ + childSnapshot: `derived-from-${context.parentVersion}`, + }), + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ + initialEntries: ['/parent/child?version=1'], + }), + }) + + render() + + expect( + await screen.findByText( + 'Parent: version-1; cached child: derived-from-version-1', + ), + ).toBeInTheDocument() + + const initialParentMatchId = router.state.matches.find( + (match) => match.routeId === parentRoute.id, + )?.id + const initialChildMatchId = router.state.matches.find( + (match) => match.routeId === childRoute.id, + )?.id + + expect(initialParentMatchId).toBeDefined() + expect(initialChildMatchId).toBeDefined() + + await router.navigate({ + to: '/parent/child', + search: { version: 2 }, + }) + await Vue.nextTick() + + expect( + screen.getByText('Parent: version-2; cached child: derived-from-version-1'), + ).toBeInTheDocument() + + const nextParentMatchId = router.state.matches.find( + (match) => match.routeId === parentRoute.id, + )?.id + const nextChildMatchId = router.state.matches.find( + (match) => match.routeId === childRoute.id, + )?.id + + expect(nextParentMatchId).not.toBe(initialParentMatchId) + expect(nextChildMatchId).toBe(initialChildMatchId) +}) + +test('#8115: hydration does not render a successful route with missing context when context reconstruction fails', async () => { + const contextError = new Error('client context reconstruction failed') + const clientSuccessRenderValues: Array = [] + let clientContextAttempts = 0 + let serverPhase = true + + const createRouteTree = () => { + const rootRoute = createRootRoute({ + component: () => ( + <> + + + + ), + }) + const IndexComponent = Vue.defineComponent({ + setup() { + const context = indexRoute.useRouteContext({ + select: (routeContext): { locale?: string } => routeContext, + }) + return () => { + if (!serverPhase) { + clientSuccessRenderValues.push(context.value.locale) + } + + return ( +
+ Locale: {context.value.locale ?? 'missing'} +
+ ) + } + }, + }) + + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + context: (): { locale: string } => { + if (serverPhase) { + return { locale: 'en' } + } + clientContextAttempts++ + throw contextError + }, + component: IndexComponent, + errorComponent: ({ error }) => ( +
+ {error instanceof Error ? error.message : String(error)} +
+ ), + }) + + return rootRoute.addChildren([indexRoute]) + } + + const ServerApp = Vue.defineComponent({ + props: { + router: { + type: Object as Vue.PropType, + required: true, + }, + }, + setup: (props) => () => ( + + + +
+ +
+ + + ), + }) + + const response = await createRequestHandler({ + request: new Request('http://localhost/'), + createRouter: () => + createRouter({ routeTree: createRouteTree(), isServer: true }), + })(({ router, responseHeaders }) => + renderRouterToString({ + router, + responseHeaders, + App: ServerApp, + }), + ) + const html = await response.text() + const serverDocument = new DOMParser().parseFromString(html, 'text/html') + + expect(serverDocument.body.textContent).toContain('Locale: en') + const currentScriptSpy = vi.spyOn(document, 'currentScript', 'get') + try { + // These scripts come exclusively from this test's renderRouterToString output. + for (const script of serverDocument.querySelectorAll('script')) { + currentScriptSpy.mockReturnValue(script) + new Function(script.textContent ?? '')() + script.remove() + } + } finally { + currentScriptSpy.mockRestore() + } + expect(window.$_TSR?.router?.matches.at(-1)?.s).toBe('success') + + serverPhase = false + const clientRouter = createRouter({ + routeTree: createRouteTree(), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + const serverContainer = serverDocument.querySelector('#__app') + expect(serverContainer).not.toBeNull() + const container = document.createElement('div') + container.id = '__app' + container.innerHTML = serverContainer!.innerHTML + document.body.appendChild(container) + const hydrationMessages: Array = [] + const originalError = console.error.bind(console) + const originalWarn = console.warn.bind(console) + const recordHydrationMessage = (...args: Array) => { + const message = args.map(String).join(' ') + if (/hydration|mismatch/i.test(message)) { + hydrationMessages.push(message) + return true + } + return false + } + vi.spyOn(console, 'error').mockImplementation((...args) => { + if (!recordHydrationMessage(...args)) { + originalError(...args) + } + }) + vi.spyOn(console, 'warn').mockImplementation((...args) => { + if (!recordHydrationMessage(...args)) { + originalWarn(...args) + } + }) + let app: Vue.App | undefined + + try { + await hydrate(clientRouter) + const ClientApp = Vue.defineComponent({ + setup: () => () => , + }) + app = Vue.createSSRApp(ClientApp) + app.mount(container) + await Vue.nextTick() + + await waitFor(() => { + expect( + container.querySelector('[data-testid="route-error"]'), + ).toHaveTextContent(contextError.message) + }) + expect(clientContextAttempts).toBeGreaterThan(0) + expect(container.querySelector('[data-testid="route-success"]')).toBeNull() + expect(clientSuccessRenderValues).not.toContain(undefined) + expect(hydrationMessages.length).toBeGreaterThan(0) + } finally { + app?.unmount() + container.remove() + } +}) + +test('a same-id child retry presents one coherent beforeLoad context generation', async () => { + const childReloadStarted = createControlledPromise() + const childReload = createControlledPromise() + let parentGeneration = 0 + let childLoads = 0 + + const rootRoute = createRootRoute({ component: Outlet }) + const ParentComponent = Vue.defineComponent({ + setup() { + const context = parentRoute.useRouteContext() + return () => ( +
+
+ Parent generation {context.value.generation} +
+ +
+ ) + }, + }) + + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + beforeLoad: () => ({ generation: ++parentGeneration }), + component: ParentComponent, + }) + const ChildPendingComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
+ Child generation {context.value.inheritedGeneration} +
+ ) + }, + }) + + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + return () => ( +
+ Child generation {context.value.inheritedGeneration} +
+ ) + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + beforeLoad: ({ context }) => ({ + inheritedGeneration: context.generation, + }), + loader: async () => { + if (++childLoads > 1) { + childReloadStarted.resolve() + await childReload + } + }, + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: ChildPendingComponent, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ initialEntries: ['/parent/child'] }), + }) + + render() + expect(await screen.findByTestId('parent-generation')).toHaveTextContent( + 'Parent generation 1', + ) + expect(await screen.findByTestId('child-generation')).toHaveTextContent( + 'Child generation 1', + ) + await waitFor(() => expect(router.state.status).toBe('idle')) + const initialChildId = router.state.matches.find( + (match) => match.routeId === childRoute.id, + )?.id + expect(initialChildId).toBeDefined() + + let invalidation: Promise | undefined + try { + invalidation = router.invalidate({ + filter: (match) => + match.routeId === parentRoute.id || match.routeId === childRoute.id, + forcePending: true, + }) + await childReloadStarted + + await waitFor(() => { + expect(screen.getByTestId('parent-generation')).toHaveTextContent( + 'Parent generation 2', + ) + expect(screen.getByTestId('child-pending-generation')).toHaveTextContent( + 'Child generation 2', + ) + }) + expect( + router.state.matches.find((match) => match.routeId === parentRoute.id), + ).toMatchObject({ + status: 'success', + context: { generation: 2 }, + }) + expect( + router.state.matches.find((match) => match.routeId === childRoute.id), + ).toMatchObject({ + id: initialChildId, + status: 'pending', + context: { generation: 2, inheritedGeneration: 2 }, + }) + } finally { + childReload.resolve() + await Promise.allSettled(invalidation ? [invalidation] : []) + } +}) + +test('a same-id navigation merges new inherited context with cached route context', async () => { + const history = createMemoryHistory({ initialEntries: ['/'] }) + history.replace('/', { issue8115Revision: 'old' }) + + const rootRoute = createRootRoute({ + beforeLoad: ({ location }) => ({ + inheritedRevision: location.state.issue8115Revision, + }), + }) + const IndexComponent = Vue.defineComponent({ + setup() { + const location = useLocation() + + const context = indexRoute.useRouteContext() + + const matchId = indexRoute.useMatch({ select: (match) => match.id }) + + const navigate = indexRoute.useNavigate() + return () => ( + <> + {matchId.value} + + location: {location.value.state.issue8115Revision}; inherited:{' '} + {context.value.inheritedRevision}; self:{' '} + {context.value.selfRevision} + + + + ) + }, + }) + + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + context: ({ location }) => ({ + selfRevision: location.state.issue8115Revision, + }), + component: IndexComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history, + }) + + render() + + expect(await screen.findByTestId('snapshot')).toHaveTextContent( + 'location: old; inherited: old; self: old', + ) + const initialMatchId = screen.getByTestId('match-id').textContent + + await fireEvent.click(screen.getByRole('button', { name: 'Update state' })) + + await waitFor(() => { + expect(screen.getByTestId('match-id').textContent).toBe(initialMatchId) + expect(screen.getByTestId('snapshot')).toHaveTextContent( + 'location: new; inherited: new; self: old', + ) + }) +}) + +test('#8115: a successful root never renders without its context while a child is pending on cold load', async () => { + let resolveChildLoader!: () => void + const childLoader = new Promise((resolve) => { + resolveChildLoader = resolve + }) + const rootRenderValues: Array = [] + + const RootComponent = Vue.defineComponent({ + setup() { + const context = rootRoute.useRouteContext() + return () => { + const locale = context.value.locale + + rootRenderValues.push(locale) + + return ( +
+

Locale: {locale ?? 'missing'}

+ +
+ ) + } + }, + }) + + const rootRoute = createRootRoute({ + context: () => ({ locale: 'en' }), + component: RootComponent, + }) + const childRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: () => childLoader, + pendingMs: 0, + pendingComponent: () =>

Loading child

, + component: () =>

Child content

, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([childRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + + try { + expect(await screen.findByRole('status')).toHaveTextContent('Loading child') + expect(screen.getByTestId('root-locale')).toHaveTextContent('Locale: en') + expect(rootRenderValues.length).toBeGreaterThan(0) + expect(rootRenderValues.every((locale) => locale === 'en')).toBe(true) + } finally { + resolveChildLoader() + await childLoader + await Vue.nextTick() + } +}) + +test('a same-id search navigation merges fresh inherited context with cached route context', async () => { + const rootRoute = createRootRoute({ component: Outlet }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + validateSearch: (search: Record) => ({ + revision: typeof search.revision === 'string' ? search.revision : 'one', + }), + loaderDeps: ({ search }) => ({ revision: search.revision }), + context: ({ deps }) => ({ inheritedRevision: deps.revision }), + component: Outlet, + }) + const ChildComponent = Vue.defineComponent({ + setup() { + const context = childRoute.useRouteContext() + + const search = childRoute.useSearch() + + const matchId = childRoute.useMatch({ select: (match) => match.id }) + return () => ( + <> +
{matchId.value}
+
{search.value.revision}
+
+ {context.value.inheritedRevision} +
+
+ {context.value.cachedSelfRevision} +
+ + ) + }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + loaderDeps: () => ({}), + context: ({ context, location }) => ({ + cachedSelfRevision: `${context.inheritedRevision}:${String((location.search as Record).revision)}`, + }), + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ + initialEntries: ['/parent/child?revision=one'], + }), + }) + + render() + + expect(await screen.findByTestId('current-search')).toHaveTextContent('one') + expect(screen.getByTestId('inherited-context')).toHaveTextContent('one') + expect(screen.getByTestId('cached-self-context')).toHaveTextContent('one:one') + const initialMatchId = screen.getByTestId('match-id').textContent + + await router.navigate({ + to: '/parent/child', + search: { revision: 'two' }, + }) + await Vue.nextTick() + + expect(await screen.findByTestId('current-search')).toHaveTextContent('two') + expect(screen.getByTestId('match-id').textContent).toBe(initialMatchId) + expect(screen.getByTestId('inherited-context')).toHaveTextContent('two') + expect(screen.getByTestId('cached-self-context')).toHaveTextContent('one:one') +}) diff --git a/packages/vue-router/tests/jest-dom.setup.ts b/packages/vue-router/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/packages/vue-router/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/packages/vue-router/tests/link-departing-scope.test.tsx b/packages/vue-router/tests/link-departing-scope.test.tsx new file mode 100644 index 0000000000..71b917bebf --- /dev/null +++ b/packages/vue-router/tests/link-departing-scope.test.tsx @@ -0,0 +1,1127 @@ +import { setFlagsFromString } from 'node:v8' +import { runInNewContext } from 'node:vm' +import * as Vue from 'vue' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/vue' +import { afterEach, describe, expect, test, vi } from 'vitest' +import { + Link, + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouteMask, + createRouter, + redirect, +} from '../src' + +afterEach(() => { + cleanup() + vi.restoreAllMocks() +}) + +type Deferred = { + promise: Promise + resolve: () => void +} + +function deferred(): Deferred { + let resolve!: () => void + const promise = new Promise((r) => (resolve = r)) + return { promise, resolve } +} + +// Lets the router run its microtask-driven load steps and Vue flush renders. +const tick = () => new Promise((resolve) => setTimeout(resolve, 0)) + +type Gates = Partial> + +function setup({ + initial = '/a', + bAfterGate, + beforeRender, +}: { + initial?: string + bAfterGate?: () => void + beforeRender?: (router: any) => void +} = {}) { + const gates: Gates = {} + const counts = { + aUpdater: 0, + aRenders: 0, + goneUpdater: 0, + listUpdater: 0, + } + // The `x` dependency of every `/a` load, preloads included. + const aLoads: Array = [] + // The `x` of every location the `a-next` link derives from. + const nextFrom: Array = [] + const hash = Vue.ref(undefined) + const extra = Vue.ref(false) + const gone = Vue.ref(false) + const renderPreload = Vue.ref(false) + const list = Vue.ref(['one', 'two']) + const controls: { + setHash: (value: string | undefined) => Promise + setExtra: (value: boolean) => Promise + setGone: (value: boolean) => Promise + setRenderPreload: (value: boolean) => Promise + setList: (value: Array) => Promise + } = { + setHash: (value) => ((hash.value = value), Vue.nextTick()), + setExtra: (value) => ((extra.value = value), Vue.nextTick()), + setGone: (value) => ((gone.value = value), Vue.nextTick()), + setRenderPreload: (value) => ( + (renderPreload.value = value), + Vue.nextTick() + ), + setList: (value) => ((list.value = value), Vue.nextTick()), + } + + // Stable updaters, and one component per changing part, so that changing + // one part does not re-render the other links. + const aSelfSearch = (prev: any) => { + counts.aUpdater++ + return prev + } + const aSelfSlot = ({ isActive }: { isActive: boolean }) => { + counts.aRenders++ + return isActive ? 'a self' : 'a self (inactive)' + } + const aNextSearch = (prev: any) => { + nextFrom.push(prev.x) + return { x: `${prev.x}-next` } + } + const aRenderSearch = (prev: any) => ({ x: `${prev.x}-render` }) + const sameSearch = (prev: any) => prev + const goneSearch = (prev: any) => { + counts.goneUpdater++ + return prev + } + const listSearches = new Map any>() + const listSearch = (item: string) => { + let search = listSearches.get(item) + if (!search) { + search = (prev: any) => { + counts.listUpdater++ + return { ...prev, item } + } + listSearches.set(item, search) + } + return search + } + + const ADot = Vue.defineComponent(() => () => ( + + a dot + + )) + const ARender = Vue.defineComponent( + () => () => + renderPreload.value ? ( + + a render + + ) : null, + ) + const AExtra = Vue.defineComponent( + () => () => + extra.value ? ( + + a extra + + ) : null, + ) + const AGone = Vue.defineComponent( + () => () => + gone.value ? null : ( + + a gone + + ), + ) + const AList = Vue.defineComponent(() => () => ( + <> + {list.value.map((item) => ( + + {item} + + ))} + + )) + + const root = createRootRoute({ + component: () => ( + <> + + root b + + + + ), + }) + const layout = createRoute({ + getParentRoute: () => root, + id: '_layout', + component: () => ( + <> + + layout b + + + + ), + }) + const a = createRoute({ + getParentRoute: () => layout, + path: '/a', + loaderDeps: ({ search }: { search: any }) => ({ x: search.x }), + loader: ({ deps }: { deps: { x: unknown } }) => { + aLoads.push(deps.x) + return gates.a?.promise + }, + component: () => ( + <> +

A page

+ + {aSelfSlot} + + + + a next + + + + + + + ), + }) + const b = createRoute({ + getParentRoute: () => layout, + path: '/b', + loader: async () => { + await gates.b?.promise + bAfterGate?.() + }, + component: () =>

B page

, + }) + const c = createRoute({ + getParentRoute: () => root, + path: '/c', + component: () =>

C page

, + }) + const items = createRoute({ + getParentRoute: () => root, + path: '/items/$id', + loader: () => gates.items?.promise, + component: () => ( + <> +

Items page

+ + item 1 + + + item 2 + + + ), + }) + + const router = createRouter({ + routeTree: root.addChildren([layout.addChildren([a, b]), c, items]), + history: createMemoryHistory({ initialEntries: [initial] }), + }) + + beforeRender?.(router) + render() + + const link = (id: string) => screen.getByTestId(id) + const isActive = (id: string) => + link(id).getAttribute('aria-current') === 'page' + const href = (id: string) => link(id).getAttribute('href') + + async function start(options: any) { + void router.navigate(options) + await tick() + } + + async function settle() { + await waitFor(() => expect(router.state.status).toBe('idle')) + } + + async function release(name: keyof Gates) { + const gate = gates[name]! + gates[name] = undefined + gate.resolve() + await gate.promise + await tick() + } + + return { + router, + gates, + counts, + aLoads, + nextFrom, + controls, + link, + isActive, + href, + start, + settle, + release, + } +} + +describe('links in a departing match', () => { + test('skip work at navigation start while staying links update urgently', async () => { + const t = setup() + await screen.findByText('A page') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + expect(t.isActive('layout-b')).toBe(false) + + const updater = t.counts.aUpdater + const renders = t.counts.aRenders + const list = t.counts.listUpdater + t.gates.b = deferred() + await t.start({ to: '/b' }) + + expect(t.router.state.status).toBe('pending') + expect(t.router.state.location.pathname).toBe('/b') + expect(screen.getByText('A page')).toBeInTheDocument() + // Staying root and layout links update while the loader is pending. + expect(t.isActive('root-b')).toBe(true) + expect(t.isActive('layout-b')).toBe(true) + // The departing route's links do no work. + expect(t.counts.aUpdater).toBe(updater) + expect(t.counts.aRenders).toBe(renders) + expect(t.counts.listUpdater).toBe(list) + expect(t.isActive('a-self')).toBe(true) + + await t.release('b') + await screen.findByText('B page') + expect(t.isActive('root-b')).toBe(true) + expect(t.router.state.status).toBe('idle') + }) + + test('staying route with changed params updates its links while pending', async () => { + const t = setup({ initial: '/items/1' }) + await screen.findByText('Items page') + expect(t.isActive('item-1')).toBe(true) + expect(t.isActive('item-2')).toBe(false) + + t.gates.items = deferred() + await t.start({ to: '/items/$id', params: { id: '2' } }) + expect(t.router.state.status).toBe('pending') + expect(t.isActive('item-1')).toBe(false) + expect(t.isActive('item-2')).toBe(true) + + await t.release('items') + await t.settle() + expect(t.isActive('item-2')).toBe(true) + }) + + test('a pending departure redirected back to the owner ends consistent', async () => { + const t = setup({ + bAfterGate: () => { + throw redirect({ to: '/a', search: { x: 'back' } } as any) + }, + }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + expect(t.isActive('a-self')).toBe(true) + expect(t.href('a-self')).toBe('/a') + + await t.release('b') + await t.settle() + await tick() + expect(t.router.state.location.href).toBe('/a?x=back') + expect(screen.getByText('A page')).toBeInTheDocument() + expect(t.href('a-self')).toBe('/a?x=back') + expect(t.isActive('a-self')).toBe(true) + expect(t.href('a-dot')).toBe('/a') + expect(t.isActive('root-b')).toBe(false) + }) + + test('a pending departure superseded by a location that keeps the owner ends consistent', async () => { + const t = setup() + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + const updater = t.counts.aUpdater + await t.start({ to: '/a', search: { x: 'two' } }) + expect(t.counts.aUpdater).toBeGreaterThan(updater) + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + t.gates.b.resolve() + await t.settle() + await tick() + expect(t.router.state.location.href).toBe('/a?x=two') + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + }) + + test('links mounting or changing in a departing match build from its held location', async () => { + const t = setup() + await screen.findByText('A page') + expect(t.href('a-dot')).toBe('/a') + t.gates.b = deferred() + await t.start({ to: '/b' }) + + await t.controls.setHash('h') + await t.controls.setExtra(true) + // Both build from the location the rest of the match still presents. + expect(t.href('a-dot')).toBe('/a#h') + expect(t.href('a-extra')).toBe('/a') + expect(t.isActive('a-self')).toBe(true) + + await t.start({ to: '/a', search: { x: 'one' } }) + expect(t.href('a-dot')).toBe('/a#h') + expect(t.href('a-extra')).toBe('/a?x=one') + expect(t.href('a-self')).toBe('/a?x=one') + t.gates.b.resolve() + await t.settle() + await tick() + expect(t.href('a-extra')).toBe('/a?x=one') + expect(t.isActive('a-extra')).toBe(true) + }) + + test('list churn in a departing match keeps building from its held location', async () => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + expect(t.href('a-list-one')).toBe('/a?x=one&item=one') + t.gates.b = deferred() + await t.start({ to: '/b' }) + + const list = t.counts.listUpdater + await t.controls.setList(['two', 'three']) + expect(screen.queryByTestId('a-list-one')).toBeNull() + // Only the new link derives, from the held location. + expect(t.counts.listUpdater).toBe(list + 1) + expect(t.href('a-list-two')).toBe('/a?x=one&item=two') + expect(t.href('a-list-three')).toBe('/a?x=one&item=three') + + await t.release('b') + await screen.findByText('B page') + expect(t.counts.listUpdater).toBe(list + 1) + }) + + test('a pending navigation within the owner, then a departure, then back', async () => { + const t = setup() + await screen.findByText('A page') + + t.gates.a = deferred() + const firstA = t.gates.a + await t.start({ to: '/a', search: { x: 'one' } }) + expect(t.router.state.status).toBe('pending') + // Staying: updates while the owner's own loader is pending. + expect(t.href('a-self')).toBe('/a?x=one') + + t.gates.b = deferred() + const updater = t.counts.aUpdater + const renders = t.counts.aRenders + await t.start({ to: '/b' }) + expect(t.counts.aUpdater).toBe(updater) + expect(t.counts.aRenders).toBe(renders) + expect(t.href('a-self')).toBe('/a?x=one') + expect(t.isActive('root-b')).toBe(true) + + await t.start({ to: '/a', search: { x: 'two' } }) + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('root-b')).toBe(false) + + firstA.resolve() + t.gates.b.resolve() + await t.settle() + await tick() + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + }) + + test('a departing link unmounted while pending does no further work', async () => { + const error = vi.spyOn(console, 'error') + const warn = vi.spyOn(console, 'warn') + const t = setup() + await screen.findByText('A page') + t.gates.b = deferred() + const gone = t.counts.goneUpdater + await t.start({ to: '/b' }) + await t.controls.setGone(true) + expect(screen.queryByTestId('a-gone')).toBeNull() + await t.release('b') + await screen.findByText('B page') + expect(t.counts.goneUpdater).toBe(gone) + expect(error).not.toHaveBeenCalled() + expect(warn).not.toHaveBeenCalled() + }) + + test.each([ + ['a-dot', '/a'], + ['a-next', '/a?x=one-next'], + ])( + 'clicking held link %s navigates to the href it displays', + async (id, displayed) => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + expect(t.router.state.status).toBe('pending') + expect(t.href(id)).toBe(displayed) + + await fireEvent.click(t.link(id)) + await tick() + expect(t.router.latestLocation.href).toBe(displayed) + t.gates.b.resolve() + await t.settle() + expect(t.router.state.location.href).toBe(displayed) + expect(screen.getByText('A page')).toBeInTheDocument() + }, + ) + + test.each(['mouseEnter', 'focus', 'touchStart'] as const)( + 'a %s preload of a held link loads the location it displays', + async (event) => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + expect(t.href('a-next')).toBe('/a?x=one-next') + t.aLoads.length = 0 + + await fireEvent[event](t.link('a-next')) + await tick() + expect(t.aLoads).toEqual(['one-next']) + await t.release('b') + await screen.findByText('B page') + }, + ) + + test('a render preload of a link mounting in a departing match loads the location it displays', async () => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + t.aLoads.length = 0 + + await t.controls.setRenderPreload(true) + await tick() + expect(t.href('a-render')).toBe('/a?x=one-render') + expect(t.aLoads).toEqual(['one-render']) + await t.release('b') + await screen.findByText('B page') + }) + + test('staying links click and preload from the live location', async () => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + t.gates.a = deferred() + await t.start({ to: '/a', search: { x: 'two' } }) + expect(t.router.state.status).toBe('pending') + expect(t.href('a-next')).toBe('/a?x=two-next') + t.aLoads.length = 0 + + await fireEvent.mouseEnter(t.link('a-next')) + await tick() + expect(t.aLoads).toEqual(['two-next']) + await fireEvent.click(t.link('a-next')) + await tick() + expect(t.router.latestLocation.href).toBe('/a?x=two-next') + await t.release('a') + await t.settle() + await tick() + expect(t.router.state.location.href).toBe('/a?x=two-next') + expect(t.href('a-next')).toBe('/a?x=two-next-next') + }) + + test('a revisited route starts with fresh links, also ones mounting during its next departure', async () => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + expect(t.href('a-next')).toBe('/a?x=one-next') + await t.release('b') + await screen.findByText('B page') + await t.settle() + + t.nextFrom.length = 0 + await t.router.navigate({ to: '/a', search: { x: 'two' } }) + await screen.findByText('A page') + await t.settle() + await tick() + // The remounted links never derive from the previous visit's location. + expect(t.nextFrom).not.toContain('one') + expect(t.href('a-next')).toBe('/a?x=two-next') + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + + // B is cached now: depart to a route that has not loaded yet. + t.gates.items = deferred() + const updater = t.counts.aUpdater + await t.start({ to: '/items/$id', params: { id: '1' } }) + expect(t.router.state.status).toBe('pending') + expect(t.counts.aUpdater).toBe(updater) + await t.controls.setExtra(true) + // The new link holds this visit's location, not the previous visit's. + expect(t.href('a-extra')).toBe('/a?x=two') + expect(t.href('a-next')).toBe('/a?x=two-next') + expect(t.isActive('root-b')).toBe(false) + + await fireEvent.click(t.link('a-extra')) + await tick() + expect(t.router.latestLocation.href).toBe('/a?x=two') + t.gates.items.resolve() + await t.settle() + await tick() + expect(t.router.state.location.href).toBe('/a?x=two') + expect(t.isActive('a-extra')).toBe(true) + expect(t.href('a-next')).toBe('/a?x=two-next') + }) + + test('a document redirect from the destination does not break later navigations', async () => { + // jsdom reports the attempted document navigation as not implemented. + vi.spyOn(console, 'error').mockImplementation(() => {}) + const t = setup({ + bAfterGate: () => { + throw redirect({ to: '/c', reloadDocument: true }) + }, + }) + await screen.findByText('A page') + t.gates.b = deferred() + await t.start({ to: '/b' }) + await t.release('b') + await tick() + + await t.router.navigate({ to: '/a', search: { x: 'two' } }) + await t.settle() + await tick() + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + }) + + test('a departure superseded by a history traversal back to the owner updates its links', async () => { + const t = setup({ initial: '/a?x=one' }) + await screen.findByText('A page') + await t.router.navigate({ to: '/a', search: { x: 'two' } }) + await t.settle() + await tick() + expect(t.href('a-self')).toBe('/a?x=two') + + t.gates.b = deferred() + const updater = t.counts.aUpdater + await t.start({ to: '/b' }) + expect(t.counts.aUpdater).toBe(updater) + t.router.history.go(-2) + await tick() + await t.settle() + await tick() + expect(t.router.state.location.href).toBe('/a?x=one') + expect(t.href('a-self')).toBe('/a?x=one') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + t.gates.b.resolve() + await tick() + expect(screen.getByText('A page')).toBeInTheDocument() + expect(t.href('a-self')).toBe('/a?x=one') + }) + + test('invalidating a pending departure keeps holding until it commits', async () => { + const t = setup() + await screen.findByText('A page') + t.gates.b = deferred() + const updater = t.counts.aUpdater + const renders = t.counts.aRenders + await t.start({ to: '/b' }) + void t.router.invalidate() + await tick() + expect(t.router.state.status).toBe('pending') + expect(t.router.state.location.pathname).toBe('/b') + expect(t.counts.aUpdater).toBe(updater) + expect(t.counts.aRenders).toBe(renders) + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(true) + await t.release('b') + await screen.findByText('B page') + expect(t.counts.aUpdater).toBe(updater) + }) + + test('a departure redirected or superseded to another departing location does no work', async () => { + const t = setup({ + bAfterGate: () => { + throw redirect({ to: '/c' }) + }, + }) + await screen.findByText('A page') + const updater = t.counts.aUpdater + const renders = t.counts.aRenders + t.gates.b = deferred() + await t.start({ to: '/b' }) + t.gates.items = deferred() + await t.start({ to: '/items/$id', params: { id: '1' } }) + // B redirects to C after being superseded; neither keeps A. + await t.release('b') + expect(t.counts.aUpdater).toBe(updater) + expect(t.counts.aRenders).toBe(renders) + await t.release('items') + await screen.findByText('Items page') + expect(t.router.state.location.pathname).toBe('/items/1') + + await t.router.navigate({ to: '/a' }) + await screen.findByText('A page') + await tick() + const again = t.counts.aUpdater + t.gates.b = deferred() + await t.start({ to: '/b' }) + await t.release('b') + await screen.findByText('C page') + expect(t.counts.aUpdater).toBe(again) + }) + + test('a view transition callback that throws does not break later navigations', async () => { + vi.stubGlobal('CSS', { supports: () => true }) + ;(document as any).startViewTransition = (update: () => unknown) => { + update() + return { + updateCallbackDone: Promise.resolve(), + finished: Promise.resolve(), + } + } + const failures: Array = [] + const t = setup({ + // The history listener's load rejects with the callback's error. Record + // it instead of leaving it unhandled. + beforeRender: (router) => { + const load = router.load + router.load = (opts: any) => + load(opts).catch((error: unknown) => failures.push(error)) + }, + }) + await screen.findByText('A page') + await t.start({ + to: '/b', + viewTransition: { + types: () => { + throw new Error('types failed') + }, + }, + }) + await tick() + expect(failures.length).toBeGreaterThan(0) + delete (document as any).startViewTransition + vi.unstubAllGlobals() + + // A navigation that keeps the page updates its links. + await t.router.navigate({ to: '/a', search: { x: 'two' } }) + await t.settle() + await tick() + expect(t.href('a-self')).toBe('/a?x=two') + expect(t.isActive('a-self')).toBe(true) + expect(t.isActive('root-b')).toBe(false) + }) + + test('links outside every match follow a pending navigation', async () => { + const t = setup() + await screen.findByText('A page') + cleanup() + const router = t.router + const InnerWrap = (_props: unknown, { slots }: Vue.SetupContext) => ( + <> + + wrap b + + {slots.default?.()} + + ) + router.update({ ...router.options, InnerWrap: InnerWrap as any }) + render() + await screen.findByText('A page') + expect(t.isActive('wrap-b')).toBe(false) + t.gates.b = deferred() + await t.start({ to: '/b' }) + expect(router.state.status).toBe('pending') + expect(t.isActive('wrap-b')).toBe(true) + await t.release('b') + await screen.findByText('B page') + expect(t.isActive('wrap-b')).toBe(true) + }) +}) + +describe('pending and failing destinations', () => { + function setupPending(options: { throwFromP?: boolean } = {}) { + const gate: { p?: Deferred } = {} + const counts = { aUpdater: 0 } + const aNextSearch = (prev: any) => { + counts.aUpdater++ + return { x: `${prev.x}-next` } + } + const pendingSearch = (prev: any) => ({ y: `${prev.y}-pending` }) + const root = createRootRoute({ + component: () => ( + <> + + root p + + + + ), + errorComponent: () => ( + + error a + + ), + }) + const a = createRoute({ + getParentRoute: () => root, + path: '/a', + component: () => ( + <> +

A page

+ + a next + + + ), + }) + const pRoute = createRoute({ + getParentRoute: () => root, + path: '/p', + validateSearch: (search: Record) => + search as { y?: string }, + loader: async () => { + await gate.p?.promise + if (options.throwFromP) { + throw new Error('p failed') + } + }, + pendingComponent: () => ( + + p pending + + ), + component: () =>

P page

, + }) + const router = createRouter({ + routeTree: root.addChildren([a, pRoute]), + history: createMemoryHistory({ initialEntries: ['/a?x=one'] }), + defaultPendingMs: 0, + defaultPendingMinMs: 0, + }) + render() + return { router, gate, counts } + } + + test('links in a pending component build from the destination and a return remounts fresh links', async () => { + const t = setupPending() + await screen.findByText('A page') + const updater = t.counts.aUpdater + t.gate.p = deferred() + void t.router.navigate({ to: '/p', search: { y: 'one' } }) + const pending = await screen.findByTestId('p-pending') + expect(t.counts.aUpdater).toBe(updater) + expect(pending).toHaveAttribute('href', '/p?y=one-pending') + expect(screen.getByTestId('root-p')).toHaveAttribute('aria-current', 'page') + + void t.router.navigate({ to: '/a', search: { x: 'two' } }) + await screen.findByText('A page') + await waitFor(() => expect(t.router.state.status).toBe('idle')) + await tick() + expect(screen.getByTestId('a-next')).toHaveAttribute( + 'href', + '/a?x=two-next', + ) + expect(screen.getByTestId('root-p')).not.toHaveAttribute('aria-current') + t.gate.p.resolve() + await tick() + expect(screen.getByText('A page')).toBeInTheDocument() + }) + + test('a departure that ends in an error leaves live links', async () => { + vi.spyOn(console, 'error').mockImplementation(() => {}) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const t = setupPending({ throwFromP: true }) + await screen.findByText('A page') + const updater = t.counts.aUpdater + t.gate.p = deferred() + void t.router.navigate({ to: '/p' }) + await tick() + expect(t.counts.aUpdater).toBe(updater) + t.gate.p.resolve() + const errorLink = await screen.findByTestId('error-a') + await waitFor(() => expect(t.router.state.status).toBe('idle')) + expect(t.router.state.location.pathname).toBe('/p') + expect(errorLink).toHaveAttribute('href', '/a') + expect(errorLink).not.toHaveAttribute('aria-current') + }) +}) + +describe('masked links in a departing match', () => { + test.each(['mask', 'routeMasks'] as const)( + 'clicking a held link with a location-dependent %s pushes the masked href it displays', + async (kind) => { + const root = createRootRoute() + const gate: { b?: Deferred } = {} + const photoSearch = (prev: any) => ({ id: prev.x }) + const mask = + kind === 'mask' + ? ({ to: '.', search: true, hash: true } as any) + : undefined + const a = createRoute({ + getParentRoute: () => root, + path: '/a', + component: () => ( + + masked + + ), + }) + const b = createRoute({ + getParentRoute: () => root, + path: '/b', + loader: () => gate.b?.promise, + component: () =>

B page

, + }) + const photo = createRoute({ + getParentRoute: () => root, + path: '/photo', + component: () =>

Photo page

, + }) + const routeTree = root.addChildren([a, b, photo]) + const router = createRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: ['/a?x=one#h'] }), + routeMasks: + kind === 'routeMasks' + ? [ + createRouteMask({ + routeTree, + from: '/photo', + to: '/a', + search: true, + hash: true, + } as any), + ] + : undefined, + }) + render() + const link = await screen.findByTestId('masked') + expect(link).toHaveAttribute('href', '/a?x=one#h') + + gate.b = deferred() + void router.navigate({ to: '/b' }) + await tick() + expect(router.state.status).toBe('pending') + expect(link).toHaveAttribute('href', '/a?x=one#h') + + await fireEvent.click(link) + await tick() + // The URL bar shows the masked href the link displayed. + expect(router.history.location.href).toBe('/a?x=one#h') + expect(router.latestLocation.pathname).toBe('/photo') + expect(router.latestLocation.search).toEqual({ id: 'one' }) + gate.b.resolve() + await screen.findByText('Photo page') + expect(router.history.location.href).toBe('/a?x=one#h') + }, + ) +}) + +describe('link location retention', () => { + setFlagsFromString('--expose-gc') + const gc: () => void = runInNewContext('gc') + async function collect() { + for (let round = 0; round < 3; round++) { + await tick() + gc() + } + } + const alive = (refs: Array>) => + refs.flatMap((ref, index) => (ref.deref() ? [index] : [])) + + // Builds and renders a router whose route `/a` and root render Links, and + // returns a function that visits a location with a large history state. + function renderApp() { + const sameSearch = (prev: any) => prev + const root = createRootRoute({ + component: () => ( + <> + + root b + + + + ), + }) + const a = createRoute({ + getParentRoute: () => root, + path: '/a', + component: () => ( + <> +

A page

+ + a self + + + ), + }) + const b = createRoute({ + getParentRoute: () => root, + path: '/b', + component: () =>

B page

, + }) + const router = createRouter({ + routeTree: root.addChildren([a, b]), + history: createMemoryHistory({ initialEntries: ['/a'] }), + }) + render() + return async (to: string, index: number) => { + await router.navigate({ + to, + search: { i: index }, + state: { payload: new Array(100_000).fill(index) } as any, + replace: true, + } as any) + await waitFor(() => expect(router.state.status).toBe('idle')) + await tick() + const location: any = router.state.location + return [new WeakRef(location), new WeakRef(location.state.payload)] + } + } + + test( + 'locations with large history state are collectable after their route is left', + { timeout: 20_000 }, + async () => { + const visit = renderApp() + await screen.findByText('A page') + // The router may keep its first navigation's state (also on main). + await visit('/a', 0) + const left: Array> = [] + for (let index = 1; index < 5; index++) { + left.push(...(await visit('/a', index))) + } + for (let index = 5; index < 9; index++) { + left.push(...(await visit('/b', index))) + } + await visit('/b', 9) + await screen.findByText('B page') + await collect() + // Only the current location (and its payload) stays reachable. + expect(alive(left)).toEqual([]) + }, + ) +}) + +describe('links after a same-href navigation that changes history state', () => { + function renderStateApp() { + // The `tag` state of every `/b` load, preloads included. + const bLoads: Array = [] + const root = createRootRoute({ component: () => }) + const a = createRoute({ + getParentRoute: () => root, + path: '/a', + component: () => ( + <> +

A page

+ + inherit + + ({ tag: `${prev.tag}-updated` }) as any} + data-testid="updater" + > + updater + + + ), + }) + const b = createRoute({ + getParentRoute: () => root, + path: '/b', + loader: ({ location }) => { + bLoads.push((location.state as any).tag) + }, + component: () =>

B page

, + }) + const router = createRouter({ + routeTree: root.addChildren([a, b]), + history: createMemoryHistory({ initialEntries: ['/a'] }), + }) + render() + return { router, bLoads } + } + + async function changeState(router: any) { + await screen.findByText('A page') + await router.navigate({ + to: '/a', + state: { tag: 'latest' } as any, + replace: true, + }) + expect(router.state.location.href).toBe('/a') + expect(router.state.location.state.tag).toBe('latest') + } + + test.each([ + ['inherit', 'latest'], + ['updater', 'latest-updated'], + ])( + 'clicking link %s derives its state from the latest location', + async (id, tag) => { + const { router } = renderStateApp() + await changeState(router) + + await fireEvent.click(screen.getByTestId(id)) + await screen.findByText('B page') + expect(router.state.location.pathname).toBe('/b') + expect((router.state.location.state as any).tag).toBe(tag) + }, + ) + + test('preloading derives its state from the latest location', async () => { + const { router, bLoads } = renderStateApp() + await changeState(router) + + await fireEvent.mouseEnter(screen.getByTestId('inherit')) + await waitFor(() => expect(bLoads).toEqual(['latest'])) + }) +}) diff --git a/packages/vue-router/tests/link-destination.test.tsx b/packages/vue-router/tests/link-destination.test.tsx new file mode 100644 index 0000000000..2615f07c58 --- /dev/null +++ b/packages/vue-router/tests/link-destination.test.tsx @@ -0,0 +1,236 @@ +import * as Vue from 'vue' +import { cleanup, fireEvent, render, screen } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { + Link, + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + defaultStringifySearch, +} from '../src' + +afterEach(() => { + cleanup() + vi.restoreAllMocks() +}) + +/** + * Renders `links` in the root route next to `/source/$id`, `/target/$id` and + * `/visible/$id`. `builds()` counts the destination builds that stringify a + * search carrying a `build` key, so a reused location does not count. + */ +function setup(links: () => any, initial = '/source/one') { + const counted = vi.fn(defaultStringifySearch) + const root = createRootRoute({ + component: () => ( + <> + {links()} + + + ), + }) + const routes = ['/source/$id', '/target/$id', '/visible/$id'].map((path) => + createRoute({ getParentRoute: () => root, path }), + ) + const router = createRouter({ + routeTree: root.addChildren(routes), + history: createMemoryHistory({ initialEntries: [initial] }), + stringifySearch: (search) => + 'build' in search ? counted(search) : defaultStringifySearch(search), + }) + render() + const go = (id: string, extra?: object) => + router.navigate({ to: '/source/$id', params: { id }, ...extra } as any) + return { router, go, builds: () => counted.mock.calls.length } +} + +test('reuses a fixed destination across navigations', async () => { + const params = { id: 'fixed' } + const search = { build: 1 } + const { go, builds } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/target/fixed?build=1#details') + const initial = builds() + + await go('two') + await go('three', { hash: 'x' }) + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/fixed?build=1#details') + expect(builds()).toBe(initial) + + await fireEvent.click(link) + await vi.waitFor(() => expect(link).toHaveAttribute('data-status', 'active')) +}) + +test('rebuilds on a destination prop change, not a presentation prop change', async () => { + const id = Vue.ref('one') + const cls = Vue.ref('a') + const { go, builds } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/target/one?build=1') + id.value = 'two' + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/two?build=1') + await go('two') + await Vue.nextTick() + const settled = builds() + await go('three') + await Vue.nextTick() + expect(builds()).toBe(settled) + expect(link).toHaveAttribute('href', '/target/two?build=1') +}) + +test('reactive params and search follow in-place mutations at the next navigation', async () => { + const params = Vue.reactive({ id: 'one' }) + const search = Vue.reactive({ build: 1 }) + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/target/one?build=1') + params.id = 'two' + search.build = 2 + await go('two') + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/two?build=2') + params.id = 'three' + await go('three') + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/three?build=2') +}) + +test('does not re-read a reactive object nested inside a plain object', async () => { + // Only the prop value itself is checked for a reactive proxy (one level). + const filters = Vue.reactive({ page: 1 }) + const params = { id: 'fixed' } + const search = { build: 1, filters } + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + const href = link.getAttribute('href') + filters.page = 2 + await go('two') + await Vue.nextTick() + expect(link).toHaveAttribute('href', href!) +}) + +test('inherited params and search rebuild on every navigation', async () => { + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/target/one') + await go('two', { search: { page: 2 } }) + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/two?page=2') +}) + +test('masked destinations follow their inputs', async () => { + const params = Vue.reactive({ id: 'one' }) + const fixed = { id: 'fixed' } + const mask = { to: '/visible/$id', params } + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/visible/one') + params.id = 'two' + await go('two') + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/visible/two') +}) + +test('switches a mounted Link between plain and reactive inputs', async () => { + const live = Vue.ref(false) + const params = Vue.reactive({ id: 'one' }) + const plain = { id: 'fixed' } + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + expect(link).toHaveAttribute('href', '/target/fixed') + live.value = true + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/one') + params.id = 'two' + await go('two') + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/two') + live.value = false + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/fixed') +}) + +test('never mutates frozen caller options', async () => { + const params = Object.freeze({ id: 'fixed' }) + const search = Object.freeze({ build: 1 }) + const { go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + await go('two') + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/target/fixed?build=1') + expect(Object.keys(params)).toEqual(['id']) +}) + +test.each([ + ['inherited state', true], + ['a state updater', (prev: any) => ({ label: `${prev.label}!` })], +])( + 'a click after a same-href, state-only navigation uses the new state (%s)', + async (_, state) => { + const fixed = { id: 'fixed' } + const { router, go } = setup(() => ( + + )) + const link = await screen.findByTestId('link') + await go('one', { state: { label: 'next' } }) + await fireEvent.click(link) + await vi.waitFor(() => + expect(router.state.location.pathname).toBe('/target/fixed'), + ) + expect(router.state.location.state).toMatchObject({ + label: state === true ? 'next' : 'next!', + }) + }, +) diff --git a/packages/vue-router/tests/link-href-safety.test.tsx b/packages/vue-router/tests/link-href-safety.test.tsx new file mode 100644 index 0000000000..a5518e83c0 --- /dev/null +++ b/packages/vue-router/tests/link-href-safety.test.tsx @@ -0,0 +1,111 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { cleanup, fireEvent, render } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { + Link, + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRouter, +} from '../src' + +afterEach(() => { + cleanup() + vi.restoreAllMocks() +}) + +// kind, final href, blocked, active +const cases: Array< + readonly [ + kind: 'history' | 'rewrite' | 'to', + href: string, + blocked: boolean, + active: boolean, + ] +> = [ + ['history', '//evil.example/path', true, false], + ['history', '/\\evil.example/path', true, false], + ['history', '\\/evil.example/path', true, false], + ['history', '\x01 \t//evil.example/path', true, false], + ['history', 'javascript:blocked()', true, false], + ['history', '/formatted', false, true], + ['rewrite', 'javascript:blocked()', true, false], + ['rewrite', 'https://other.example/', false, false], + ['rewrite', '/safe', false, true], + ['to', 'myapp:open', false, false], + ['to', 'mailto:person@example.com', true, false], +] + +for (const isServer of [true, false]) { + test.each(cases)( + `validates %s href %j on ${isServer ? 'server' : 'client'}`, + async (kind, href, blocked, active) => { + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const history = createMemoryHistory({ initialEntries: ['/safe'] }) + // Keep custom history output raw so Link must validate it itself. + history.createHref = vi.fn((path) => (kind === 'history' ? href : path)) + const router = createRouter({ + routeTree: createRootRoute(), + history, + isServer, + protocolAllowlist: ['http:', 'https:', 'myapp:'], + rewrite: + kind === 'rewrite' + ? { + output: ({ url }) => new URL(href, url), + } + : undefined, + }) + const navigate = vi.spyOn(router, 'navigate').mockResolvedValue() + const preload = vi + .spyOn(router, 'preloadRoute') + .mockResolvedValue(undefined) + const tree = Vue.h(RouterContextProvider, { router }, () => + Vue.h( + Link, + { + to: kind === 'to' ? href : '/safe', + preload: 'intent', + preloadDelay: 0, + activeProps: { class: 'active', href: 'javascript:active()' }, + inactiveProps: { class: 'inactive', href: 'javascript:inactive()' }, + }, + { + default: ({ isActive }: { isActive: boolean }) => String(isActive), + }, + ), + ) + let container: Element + if (isServer) { + container = document.createElement('div') + container.innerHTML = await renderToString(tree) + } else { + container = render(tree).container + } + const anchor = container.querySelector('a')! + if (kind === 'history') { + expect(history.createHref).toHaveBeenCalledWith('/safe') + } + expect(anchor.getAttribute('href')).toBe(blocked ? null : href) + expect(anchor.textContent).toBe(String(active)) + expect(anchor.getAttribute('aria-current')).toBe(active ? 'page' : null) + expect(anchor.getAttribute('aria-disabled')).toBe(blocked ? 'true' : null) + if (kind !== 'to') { + expect(anchor.className).toBe(active ? 'active' : 'inactive') + } + if (!isServer && blocked) { + expect( + anchor.dispatchEvent( + new MouseEvent('click', { bubbles: true, cancelable: true }), + ), + ).toBe(true) + await fireEvent.focus(anchor) + await fireEvent.mouseEnter(anchor) + await fireEvent.touchStart(anchor) + expect(navigate).not.toHaveBeenCalled() + expect(preload).not.toHaveBeenCalled() + } + }, + ) +} diff --git a/packages/vue-router/tests/link-location-transition.test.tsx b/packages/vue-router/tests/link-location-transition.test.tsx new file mode 100644 index 0000000000..69093faed9 --- /dev/null +++ b/packages/vue-router/tests/link-location-transition.test.tsx @@ -0,0 +1,87 @@ +import * as Vue from 'vue' +import { cleanup, render, waitFor } from '@testing-library/vue' +import { afterEach, expect, test } from 'vitest' +import { + Link, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +test('external links use the current location when becoming internal again', async () => { + const to = Vue.ref('https://other.example/') + const root = createRootRoute({ + component: Vue.defineComponent({ + setup: () => () => ( + + Target + + ), + }), + }) + const item = createRoute({ + getParentRoute: () => root, + path: '/items/$id', + validateSearch: (search: Record) => ({ + keep: String(search.keep), + }), + }) + const router = createRouter({ + routeTree: root.addChildren([item]), + history: createMemoryHistory({ + initialEntries: ['/items/one?keep=first#first'], + }), + }) + await router.load() + const view = render() + const anchor = await view.findByText('Target') + for (const [id, keep] of [ + ['two', 'second'], + ['three', 'third'], + ] as const) { + to.value = 'https://other.example/' + await Vue.nextTick() + await router.navigate({ + to: '/items/$id', + params: { id }, + search: { keep }, + hash: keep, + }) + expect(anchor).toHaveAttribute('href', 'https://other.example/') + to.value = '.' + await waitFor(() => { + expect(anchor).toHaveAttribute( + 'href', + `/items/${id}?keep=${keep}#${keep}`, + ) + expect(anchor).toHaveAttribute('aria-current', 'page') + }) + } + await router.navigate({ + to: '/items/$id', + params: { id: 'four' }, + search: { keep: 'fourth' }, + hash: 'fourth', + }) + await waitFor(() => + expect(anchor).toHaveAttribute('href', '/items/four?keep=fourth#fourth'), + ) + to.value = 'https://other.example/' + await Vue.nextTick() + await router.navigate({ to: '.', search: true, hash: 'latest' }) + to.value = '/items/three' + await waitFor(() => { + expect(anchor).toHaveAttribute('href', '/items/three?keep=fourth#latest') + expect(anchor).not.toHaveAttribute('aria-current') + }) +}) diff --git a/packages/vue-router/tests/link-path-matching.test.tsx b/packages/vue-router/tests/link-path-matching.test.tsx new file mode 100644 index 0000000000..4923efc64e --- /dev/null +++ b/packages/vue-router/tests/link-path-matching.test.tsx @@ -0,0 +1,97 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { cleanup, render } from '@testing-library/vue' +import { afterEach, expect, test } from 'vitest' +import { + Link, + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +const cases = [ + { current: '/', to: '/', exact: true, active: true }, + { current: '/posts', to: '/posts/', exact: true, active: true }, + { current: '/posts/', to: '/posts', exact: true, active: true }, + { current: '/posts/item', to: '/posts', exact: true, active: false }, + { current: '/posts/item', to: '/posts', exact: false, active: true }, + { current: '/posts/item', to: '/posts/', exact: false, active: true }, + { current: '/posts-other', to: '/posts', exact: false, active: false }, +] + +for (const basepath of ['', '/app']) { + test.each(cases)( + `pathname matching agrees on server and client with basepath "${basepath}": $current -> $to, exact=$exact`, + async ({ current, to, exact, active }) => { + for (const isServer of [true, false]) { + const router = createRouter({ + routeTree: createRootRoute(), + history: createMemoryHistory({ + initialEntries: [basepath + current], + }), + basepath, + trailingSlash: 'preserve', + isServer, + }) + const tree = Vue.h(RouterContextProvider, { router }, () => + Vue.h( + Link, + { + to, + activeOptions: { exact }, + inactiveProps: { class: 'inactive' }, + }, + { + default: ({ isActive }: { isActive: boolean }) => + String(isActive), + }, + ), + ) + let container: Element + if (isServer) { + container = document.createElement('div') + container.innerHTML = await renderToString(tree) + } else { + container = render(tree).container + } + const anchor = container.querySelector('a')! + expect(anchor.textContent).toBe(String(active)) + expect(anchor.getAttribute('aria-current')).toBe(active ? 'page' : null) + expect(anchor.className).toBe(active ? 'active' : 'inactive') + } + }, + ) +} + +test('pathname matching reacts when exact mode changes', async () => { + const exact = Vue.ref(true) + const router = createRouter({ + routeTree: createRootRoute(), + history: createMemoryHistory({ initialEntries: ['/posts/item'] }), + isServer: false, + }) + const { container } = render( + Vue.h(RouterContextProvider, { router }, () => + Vue.h( + Link, + { + to: '/posts', + activeOptions: { exact: exact.value }, + inactiveProps: { class: 'inactive' }, + }, + { default: ({ isActive }: { isActive: boolean }) => String(isActive) }, + ), + ), + ) + const anchor = container.querySelector('a')! + for (const mode of [true, false, true]) { + exact.value = mode + await Vue.nextTick() + expect(anchor.textContent).toBe(String(!mode)) + expect(anchor.getAttribute('aria-current')).toBe(mode ? null : 'page') + expect(anchor.className).toBe(mode ? 'inactive' : 'active') + } +}) diff --git a/packages/vue-router/tests/link-style-ssr.test.tsx b/packages/vue-router/tests/link-style-ssr.test.tsx new file mode 100644 index 0000000000..79af1f2164 --- /dev/null +++ b/packages/vue-router/tests/link-style-ssr.test.tsx @@ -0,0 +1,82 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { expect, test, vi } from 'vitest' +import { + Link, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +test('preserves selected state props and styling during SSR', async () => { + const active = vi.fn(() => ({ + class: ['selected', [{ 'active-object': true, hidden: false }]], + style: { color: 'blue' }, + title: 'selected', + })) + const unused = vi.fn(() => ({ class: 'unused' })) + const root = createRootRoute({ + component: () => + Vue.h(Vue.Fragment, [ + Vue.h( + Link, + { + to: '/', + class: 'base', + style: { color: 'red', marginTop: '2px' }, + activeProps: active, + inactiveProps: unused, + }, + () => 'Active', + ), + Vue.h( + Link, + { + to: '/other', + activeProps: unused, + inactiveProps: { class: { idle: true }, 'data-state': 'idle' }, + }, + () => 'Inactive', + ), + Vue.h(Link, { to: '/' }, () => 'Default'), + Vue.h(Link, { to: '/', activeProps: {} }, () => 'Empty'), + ]), + }) + const history = createMemoryHistory({ initialEntries: ['/'] }) + const router = createRouter({ + routeTree: root.addChildren([ + createRoute({ getParentRoute: () => root, path: '/' }), + createRoute({ getParentRoute: () => root, path: '/other' }), + ]), + history, + isServer: true, + }) + try { + await router.load() + const html = await renderToString( + Vue.createSSRApp(() => Vue.h(RouterProvider, { router })), + ) + const container = document.createElement('div') + container.innerHTML = html + const links = container.querySelectorAll('a') + expect(links).toHaveLength(4) + expect([...links[0]!.classList]).toEqual([ + 'base', + 'selected', + 'active-object', + ]) + expect(links[0]!.style.color).toBe('blue') + expect(links[0]!.style.marginTop).toBe('2px') + expect(links[0]!.getAttribute('title')).toBe('selected') + expect(links[1]!.className).toBe('idle') + expect(links[1]!.getAttribute('data-state')).toBe('idle') + expect(links[2]!.className).toBe('active') + expect(links[3]!.className).toBe('') + expect(active).toHaveBeenCalledWith() + expect(unused).not.toHaveBeenCalled() + } finally { + history.destroy() + } +}) diff --git a/packages/vue-router/tests/link-style.test.tsx b/packages/vue-router/tests/link-style.test.tsx new file mode 100644 index 0000000000..d2c4e7891a --- /dev/null +++ b/packages/vue-router/tests/link-style.test.tsx @@ -0,0 +1,242 @@ +import * as Vue from 'vue' +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, render, screen, waitFor } from '@testing-library/vue' +import { + Link, + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + useLinkProps, +} from '../src' + +const disposers: Array<() => void> = [] +afterEach(() => { + cleanup() + for (const dispose of disposers.splice(0)) { + dispose() + } +}) + +function renderLinks(Links: Vue.Component) { + const history = createMemoryHistory({ initialEntries: ['/target'] }) + disposers.push(history.destroy) + const root = createRootRoute({ + component: () => Vue.h(Vue.Fragment, [Vue.h(Links), Vue.h(Outlet)]), + }) + const router = createRouter({ + routeTree: root.addChildren([ + createRoute({ getParentRoute: () => root, path: '/' }), + createRoute({ getParentRoute: () => root, path: '/target' }), + ]), + history, + scrollRestoration: false, + defaultPreload: false, + }) + render(Vue.h(RouterProvider, { router })) + return router +} + +test('preserves object and nested-array class bindings across state updates', async () => { + const activeClass = Vue.reactive({ selected: true, removed: false }) + const inactiveClass = Vue.reactive({ idle: true }) + const router = renderLinks(() => + Vue.h( + Link, + { + to: '/target', + class: ['base', { decorated: true }], + activeProps: () => ({ + class: ['active-state', [undefined, activeClass, ['nested']]], + }), + inactiveProps: { class: inactiveClass }, + }, + () => 'Class bindings', + ), + ) + const link = await screen.findByRole('link', { name: 'Class bindings' }) + expect([...link.classList]).toEqual([ + 'base', + 'decorated', + 'active-state', + 'selected', + 'nested', + ]) + activeClass.selected = false + activeClass.removed = true + await waitFor(() => { + expect(link).not.toHaveClass('selected') + expect(link).toHaveClass('removed', 'nested') + }) + await router.navigate({ to: '/' }) + await waitFor(() => { + expect([...link.classList]).toEqual(['base', 'decorated', 'idle']) + }) + inactiveClass.idle = false + await waitFor(() => + expect([...link.classList]).toEqual(['base', 'decorated']), + ) +}) + +test.each([false, true])( + 'useLinkProps retains class values rather than strings (with base: %s)', + async (withBase) => { + const baseClass = ['base', { decorated: true }] + const stateClass = { selected: true } + let binding: unknown + const HookLink = Vue.defineComponent({ + setup() { + const props = useLinkProps({ + to: '/target', + class: withBase ? baseClass : undefined, + activeProps: { class: stateClass }, + }) + return () => { + const resolved = Vue.unref(props) + binding = resolved.class + return Vue.h('a', { ...resolved }, 'Hook classes') + } + }, + }) + renderLinks(HookLink) + await screen.findByRole('link', { name: 'Hook classes' }) + if (withBase) { + expect(binding).toEqual([baseClass, stateClass]) + } else { + expect(binding).toBe(stateClass) + } + }, +) + +test('omits the class binding when neither source provides a class', async () => { + renderLinks(() => + Vue.h(Link, { to: '/target', activeProps: {} }, () => 'No classes'), + ) + const link = await screen.findByRole('link', { name: 'No classes' }) + expect(link).not.toHaveAttribute('class') +}) + +test('tracks additions to an initially empty state-only style proxy', async () => { + const style = Vue.reactive({}) + renderLinks(() => + Vue.h( + Link, + { to: '/target', activeProps: () => ({ style }) }, + () => 'Reactive', + ), + ) + const link = await screen.findByRole('link', { name: 'Reactive' }) + expect(link.style.color).toBe('') + style.color = 'red' + await waitFor(() => expect(link.style.color).toBe('red')) + delete style.color + await waitFor(() => expect(link.style.color).toBe('')) +}) + +test('merges only the selected state and tracks reactive style properties', async () => { + const base = Vue.reactive({ color: 'red', marginTop: '2px' }) + const stateStyle = Vue.reactive({ backgroundColor: 'white' }) + const stateClass = Vue.ref('selected') + const active = vi.fn(() => ({ + class: stateClass.value, + style: stateStyle, + title: 'selected', + href: '/state-href', + })) + const inactive = vi.fn(() => ({ + class: 'idle', + style: { color: 'gray' }, + title: 'idle', + })) + const router = renderLinks(() => + Vue.h( + Link, + { + to: '/target', + class: ['base', { decorated: true }], + style: base, + activeProps: active, + inactiveProps: inactive, + }, + () => 'Styled', + ), + ) + const link = await screen.findByRole('link', { name: 'Styled' }) + expect(link).toHaveClass('base', 'decorated', 'selected') + expect(link.style).toMatchObject({ + color: 'red', + marginTop: '2px', + backgroundColor: 'white', + }) + expect(link).toHaveAttribute('href', '/target') + expect(inactive).not.toHaveBeenCalled() + + base.color = 'blue' + stateStyle.backgroundColor = 'black' + stateClass.value = 'updated' + await waitFor(() => { + expect(link).toHaveClass('base', 'decorated', 'updated') + expect(link.style).toMatchObject({ + color: 'blue', + backgroundColor: 'black', + }) + }) + + await router.navigate({ to: '/' }) + await waitFor(() => { + expect(link).toHaveClass('base', 'idle') + expect(link).toHaveAttribute('title', 'idle') + expect(link).toHaveAttribute('href', '/target') + expect(link.style).toMatchObject({ color: 'gray', marginTop: '2px' }) + expect(link.style.backgroundColor).toBe('') + }) + active.mockClear() + inactive.mockClear() + base.marginTop = '3px' + await waitFor(() => expect(link.style).toMatchObject({ marginTop: '3px' })) + expect(active).not.toHaveBeenCalled() + expect(inactive).toHaveBeenCalled() + + await router.navigate({ to: '/target' }) + await waitFor(() => { + expect(link).toHaveClass('base', 'updated') + expect(link.style).toMatchObject({ + color: 'blue', + backgroundColor: 'black', + }) + }) +}) + +test('switches between default and custom state props without stale attributes', async () => { + const custom = Vue.ref(false) + const router = renderLinks(() => + Vue.h( + Link, + { + to: '/target', + activeProps: custom.value + ? { title: 'custom', style: { color: 'red' } } + : undefined, + }, + () => 'Defaults', + ), + ) + const link = await screen.findByRole('link', { name: 'Defaults' }) + expect(link).toHaveClass('active') + custom.value = true + await waitFor(() => { + expect(link).not.toHaveClass('active') + expect(link).toHaveAttribute('title', 'custom') + expect(link.style).toMatchObject({ color: 'red' }) + }) + custom.value = false + await waitFor(() => { + expect(link).toHaveClass('active') + expect(link).not.toHaveAttribute('title') + expect(link.style.color).toBe('') + }) + await router.navigate({ to: '/' }) + await waitFor(() => expect(link).not.toHaveClass('active')) +}) diff --git a/packages/vue-router/tests/link.bench.tsx b/packages/vue-router/tests/link.bench.tsx index 8a30d80a2d..5a5b5f8752 100644 --- a/packages/vue-router/tests/link.bench.tsx +++ b/packages/vue-router/tests/link.bench.tsx @@ -1,7 +1,8 @@ /** @jsxImportSource vue */ import { render } from '@testing-library/vue' -import { bench, describe } from 'vitest' +import { describe, test } from 'vitest' +import { getRouteSegments } from '@tanstack/router-core' import * as Vue from 'vue' import { Link, @@ -37,10 +38,12 @@ const createRouterRenderer = (routesCount: number) => (children: Vue.VNode) => { const InterpolatePathLink = Vue.defineComponent({ props: ['to', 'params'], setup(props, { slots }) { - const href = interpolatePath({ - path: props.to, - params: props.params, - }).interpolatedPath + const router = useRouter() + const href = interpolatePath( + props.to, + getRouteSegments(router.routesByPath[props.to])!, + props.params, + ) return () => Vue.h('a', { href }, slots.default?.()) }, @@ -80,9 +83,8 @@ describe.each([ ])('$name', ({ numberOfRoutes, numberOfLinks, matchedParamId }) => { const renderRouter = createRouterRenderer(numberOfRoutes) - bench( - 'hardcoded href', - () => { + test('hardcoded href', async ({ bench }) => { + await bench('hardcoded href', () => { const links = Vue.h( 'div', null, @@ -93,13 +95,13 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) - bench( - 'interpolate path', - () => { + test('interpolate path', async ({ bench }) => { + await bench('interpolate path', () => { const links = Vue.h( 'div', null, @@ -118,13 +120,13 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) - bench( - 'build location', - () => { + test('build location', async ({ bench }) => { + await bench('build location', () => { const links = Vue.h( 'div', null, @@ -143,13 +145,13 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) - bench( - 'link to absolute path', - () => { + test('link to absolute path', async ({ bench }) => { + await bench('link to absolute path', () => { const links = Vue.h( 'div', null, @@ -170,13 +172,13 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) - bench( - 'link to relative path', - () => { + test('link to relative path', async ({ bench }) => { + await bench('link to relative path', () => { const links = Vue.h( 'div', null, @@ -199,13 +201,13 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) - bench( - 'link to current path', - () => { + test('link to current path', async ({ bench }) => { + await bench('link to current path', () => { const links = Vue.h( 'div', null, @@ -226,7 +228,8 @@ describe.each([ const router = renderRouter(links) render(Vue.h(RouterProvider, { router })) - }, - { warmupIterations: 1 }, - ) + }).run({ + warmupIterations: 1, + }) + }) }) diff --git a/packages/vue-router/tests/link.test.tsx b/packages/vue-router/tests/link.test.tsx index e047fe5993..bae8cf04f9 100644 --- a/packages/vue-router/tests/link.test.tsx +++ b/packages/vue-router/tests/link.test.tsx @@ -33,6 +33,7 @@ import { useRouteContext, useSearch, } from '../src' +import { useIntersectionObserver } from '../src/utils' import { getIntersectionObserverMock, getSearchParamsFromURI, @@ -42,12 +43,16 @@ import type { RouterHistory } from '../src' const ioObserveMock = vi.fn() const ioDisconnectMock = vi.fn() +let ioCallback: IntersectionObserverCallback let history: RouterHistory beforeEach(() => { const io = getIntersectionObserverMock({ observe: ioObserveMock, disconnect: ioDisconnectMock, + onCreate: (callback) => { + ioCallback = callback + }, }) vi.stubGlobal('IntersectionObserver', io) history = createBrowserHistory() @@ -55,6 +60,7 @@ beforeEach(() => { }) afterEach(() => { + vi.useRealTimers() history.destroy?.() window.history.replaceState(null, 'root', '/') vi.resetAllMocks() @@ -64,6 +70,170 @@ afterEach(() => { const WAIT_TIME = 300 describe('Link', () => { + test('keeps protocol-relative Link paths on the router origin', async () => { + const inputs = [ + '//evil.example', + '/\\evil.example', + '\\/evil.example', + ' \t/\\evil.example', + ] + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => ( + <> + {inputs.map((to, index) => ( + + ))} + + ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history, + }) + + render() + + for (let index = 0; index < inputs.length; index++) { + const link = await screen.findByTestId(`unsafe-link-${index}`) + const href = link.getAttribute('href') + expect(href).not.toBeNull() + expect(new URL(href!, window.location.href).origin).toBe( + window.location.origin, + ) + } + }) + + test('blocks a dangerous final href produced by an output rewrite', async () => { + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => , + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history, + rewrite: { + output: ({ url }) => + url.pathname === '/safe' ? new URL('javascript:alert(1)') : url, + }, + }) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + + render() + const link = await screen.findByTestId('rewritten-link') + + expect(link).not.toHaveAttribute('href') + expect(link).toHaveAttribute('role', 'link') + expect(link).toHaveAttribute('aria-disabled', 'true') + expect( + link.dispatchEvent( + new MouseEvent('click', { bubbles: true, cancelable: true }), + ), + ).toBe(true) + }) + + test('blocks a dangerous final href produced by custom history', async () => { + const customHistory = createBrowserHistory({ + createHref: () => 'javascript:alert(1)', + }) + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => ( + + ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: customHistory, + }) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + + render() + const link = await screen.findByTestId('custom-history-link') + + expect(link).not.toHaveAttribute('href') + expect( + link.dispatchEvent( + new MouseEvent('click', { bubbles: true, cancelable: true }), + ), + ).toBe(true) + customHistory.destroy() + }) + + test.each([ + { to: '/', disabled: false }, + { to: '/safe', disabled: false }, + { to: '/', disabled: true }, + { to: '/safe', disabled: true }, + ])( + 'keeps the validated href when applying state props: %j', + async (props) => { + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => ( + + ), + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history, + }) + + render() + const link = await screen.findByTestId('state-props-link') + + if (props.disabled) { + expect(link).not.toHaveAttribute('href') + } else { + expect(link).toHaveAttribute('href', props.to) + } + }, + ) + + test('does not intercept an external href produced by custom history', async () => { + const customHistory = createBrowserHistory({ + createHref: () => 'https://other.example/path', + }) + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => , + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: customHistory, + }) + render() + const link = await screen.findByTestId('custom-history-link') + + expect(link).toHaveAttribute('href', 'https://other.example/path') + expect( + link.dispatchEvent( + new MouseEvent('click', { bubbles: true, cancelable: true }), + ), + ).toBe(true) + customHistory.destroy() + }) + // rerender doesn't exist in solid // test('when using renderHook it returns a hook with same content to prove rerender works', async () => { @@ -406,6 +576,228 @@ describe('Link', () => { expect(vueCaseTouchstart).toHaveBeenCalledTimes(1) }) + test('reacts to internal and external destination changes', async () => { + const to = Vue.ref('/posts') + const target = Vue.ref() + const decorated = Vue.ref(false) + const disabled = Vue.ref(false) + + const RootComponent = Vue.defineComponent({ + setup() { + return () => + Vue.h( + Link as any, + { + to: to.value, + target: target.value, + disabled: disabled.value, + ...(decorated.value + ? { class: 'decorated', 'aria-label': 'Updated link' } + : {}), + }, + { default: () => 'Dynamic link' }, + ) + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts', + }) + const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([postsRoute, aboutRoute]), + history, + }) + + render() + + const link = await screen.findByRole('link', { name: 'Dynamic link' }) + expect(link).toHaveAttribute('href', '/posts') + expect(link).not.toHaveClass('decorated') + + to.value = 'https://example.com/one' + target.value = '_blank' + decorated.value = true + disabled.value = true + await Vue.nextTick() + + expect(link).not.toHaveAttribute('href') + expect(link).toHaveAttribute('target', '_blank') + expect(link).toHaveAttribute('aria-label', 'Updated link') + expect(link).toHaveClass('decorated') + expect(link).toHaveAttribute('role', 'link') + expect(link).toHaveAttribute('aria-disabled', 'true') + expect(link).not.toHaveAttribute('disabled') + + disabled.value = false + to.value = 'https://example.com/two' + await Vue.nextTick() + expect(link).toHaveAttribute('href', 'https://example.com/two') + expect(link).not.toHaveAttribute('aria-disabled') + expect(link).not.toHaveAttribute('disabled') + + to.value = 'javascript:alert(1)' + await Vue.nextTick() + expect(link).not.toHaveAttribute('href') + expect(link).toHaveAttribute('role', 'link') + expect(link).toHaveAttribute('aria-disabled', 'true') + + to.value = 'https://example.com/three' + await Vue.nextTick() + expect(link).toHaveAttribute('href', 'https://example.com/three') + expect(link).not.toHaveAttribute('aria-disabled') + + to.value = '/about' + target.value = undefined + decorated.value = false + disabled.value = false + await Vue.nextTick() + + expect(link).toHaveAttribute('href', '/about') + expect(link).not.toHaveAttribute('target') + expect(link).not.toHaveAttribute('aria-label') + expect(link).not.toHaveClass('decorated') + expect(link).not.toHaveAttribute('aria-disabled') + expect(link).not.toHaveAttribute('disabled') + + decorated.value = true + await Vue.nextTick() + expect(link).toHaveAttribute('aria-label', 'Updated link') + expect(link).toHaveClass('decorated') + + decorated.value = false + await Vue.nextTick() + expect(link).not.toHaveAttribute('aria-label') + expect(link).not.toHaveClass('decorated') + + await fireEvent.click(link) + await waitFor(() => expect(window.location.pathname).toBe('/about')) + }) + + test('tracks router location after an external link becomes internal', async () => { + const to = Vue.ref('https://example.com') + const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + + Initially external + + ) + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([postsRoute]), + history, + }) + + render() + + const link = await screen.findByRole('link', { name: 'Initially external' }) + expect(link).toHaveAttribute('href', 'https://example.com') + + to.value = '/posts' + await Vue.nextTick() + expect(link).toHaveAttribute('href', '/posts') + + await fireEvent.click(link) + await waitFor(() => { + expect(window.location.pathname).toBe('/posts') + expect(link).toHaveAttribute('data-status', 'active') + }) + }) + + test('uses current event handlers after link props change', async () => { + const firstClick = vi.fn((event: MouseEvent) => event.preventDefault()) + const secondClick = vi.fn((event: MouseEvent) => event.preventDefault()) + const firstMouseEnter = vi.fn() + const secondMouseEnter = vi.fn() + const clickHandler = Vue.shallowRef< + ((event: MouseEvent) => void) | undefined + >(firstClick) + const mouseEnterHandler = Vue.shallowRef< + ((event: MouseEvent) => void) | undefined + >(firstMouseEnter) + const disabled = Vue.ref(false) + + const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + + Dynamic handlers + + ) + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([postsRoute]), + history, + }) + + render() + + const link = await screen.findByRole('link', { name: 'Dynamic handlers' }) + await fireEvent.click(link) + await fireEvent.mouseEnter(link) + expect(firstClick).toHaveBeenCalledOnce() + expect(firstMouseEnter).toHaveBeenCalledOnce() + + clickHandler.value = secondClick + mouseEnterHandler.value = secondMouseEnter + await Vue.nextTick() + await fireEvent.click(link) + await fireEvent.mouseEnter(link) + + expect(firstClick).toHaveBeenCalledOnce() + expect(firstMouseEnter).toHaveBeenCalledOnce() + expect(secondClick).toHaveBeenCalledOnce() + expect(secondMouseEnter).toHaveBeenCalledOnce() + + clickHandler.value = undefined + mouseEnterHandler.value = undefined + await Vue.nextTick() + await fireEvent.click(link) + await fireEvent.mouseEnter(link) + + expect(secondClick).toHaveBeenCalledOnce() + expect(secondMouseEnter).toHaveBeenCalledOnce() + + disabled.value = true + await Vue.nextTick() + await fireEvent.click(link) + await fireEvent.mouseEnter(link) + + expect(secondClick).toHaveBeenCalledOnce() + expect(secondMouseEnter).toHaveBeenCalledOnce() + }) + describe('when the current route has a search fields with undefined values', () => { async function runTest(opts: { explicitUndefined: boolean | undefined }) { const rootRoute = createRootRoute() @@ -735,35 +1127,48 @@ describe('Link', () => { const postLoader = createControlledPromise() let postLoadCount = 0 - const rootRoute = createRootRoute({ - component: () => { + const RootComponent = Vue.defineComponent({ + setup() { const params = useParams({ strict: false }) - const nextPostId = params.value.postId === '1' ? '2' : '1' + return () => { + const nextPostId = params.value.postId === '1' ? '2' : '1' - return ( - <> - - Current post - - - Switch post - - - - ) + return ( + <> + + Current post + + + Switch post + + + + ) + } + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () =>

{`Post ${params.value.postId}`}

}, }) @@ -774,10 +1179,7 @@ describe('Link', () => { postLoadCount += 1 return postLoadCount === 1 ? Promise.resolve() : postLoader.promise }, - component: () => { - const params = useParams({ strict: false }) - return

{`Post ${params.value.postId}`}

- }, + component: PostComponent, }) const router = createRouter({ @@ -814,44 +1216,57 @@ describe('Link', () => { const postsLoader = createControlledPromise() let postsLoadCount = 0 - const rootRoute = createRootRoute({ - component: () => { + const RootComponent = Vue.defineComponent({ + setup() { const search = useSearch({ strict: false }) - const nextPage = Number(search.value.page ?? 1) === 1 ? 2 : 1 + return () => { + const nextPage = Number(search.value.page ?? 1) === 1 ? 2 : 1 - return ( - <> - - Static search - - - Current search - - - Switch search - - - - ) + return ( + <> + + Static search + + + Current search + + + Switch search + + + + ) + } + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + + const PostsComponent = Vue.defineComponent({ + setup() { + const search = useSearch({ strict: false }) + return () =>

{`Posts ${search.value.page}`}

}, }) @@ -866,10 +1281,7 @@ describe('Link', () => { postsLoadCount += 1 return postsLoadCount === 1 ? Promise.resolve() : postsLoader.promise }, - component: () => { - const search = useSearch({ strict: false }) - return

{`Posts ${search.value.page}`}

- }, + component: PostsComponent, }) const router = createRouter({ @@ -1135,10 +1547,13 @@ describe('Link', () => { expect(indexLink).not.toHaveAttribute('data-status', 'active') expect(indexLink).toHaveAttribute('href', '/') - expect(postsLink).toHaveAttribute('data-status', 'active') - expect(postsLink).toHaveAttribute('aria-current', 'page') - expect(postsLink).toHaveClass('active') - expect(postsLink).toHaveAttribute('href', '/posts') + // The clicked link left with the index page; check the posts page's own. + const activePostsLink = await screen.findByRole('link', { name: 'Posts' }) + expect(activePostsLink).not.toBe(postsLink) + expect(activePostsLink).toHaveAttribute('data-status', 'active') + expect(activePostsLink).toHaveAttribute('aria-current', 'page') + expect(activePostsLink).toHaveClass('active') + expect(activePostsLink).toHaveAttribute('href', '/posts') }) test('when navigating to /posts with a base url', async () => { @@ -1194,10 +1609,13 @@ describe('Link', () => { expect(indexLink).not.toHaveAttribute('data-status', 'active') expect(indexLink).toHaveAttribute('href', '/app/') - expect(postsLink).toHaveAttribute('data-status', 'active') - expect(postsLink).toHaveAttribute('aria-current', 'page') - expect(postsLink).toHaveClass('active') - expect(postsLink).toHaveAttribute('href', '/app/posts') + // The clicked link left with the index page; check the posts page's own. + const activePostsLink = await screen.findByRole('link', { name: 'Posts' }) + expect(activePostsLink).not.toBe(postsLink) + expect(activePostsLink).toHaveAttribute('data-status', 'active') + expect(activePostsLink).toHaveAttribute('aria-current', 'page') + expect(activePostsLink).toHaveClass('active') + expect(activePostsLink).toHaveAttribute('href', '/app/posts') }) test('when navigating to /posts with search', async () => { @@ -1217,15 +1635,17 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const search = useSearch({ strict: false }) - return ( - <> -

Posts

- Page: {search.value.page} - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const search = useSearch({ strict: false }) + return () => ( + <> +

Posts

+ Page: {search.value.page} + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1301,18 +1721,20 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const search = useSearch({ strict: false }) - return ( - <> -

Posts

- Page: {search.value.page} - - Filter: {search.value.filter} - - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const search = useSearch({ strict: false }) + return () => ( + <> +

Posts

+ Page: {search.value.page} + + Filter: {search.value.filter} + + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1365,15 +1787,16 @@ describe('Link', () => { expect(window.location.search).toBe('?page=2&filter=inactive') }) - const updatedPage = await screen.findByTestId('current-page') - const updatedFilter = await screen.findByTestId('current-filter') - // Verify search was updated expect(window.location.pathname).toBe('/posts') expect(window.location.search).toBe('?page=2&filter=inactive') - expect(updatedPage).toHaveTextContent('Page: 2') - expect(updatedFilter).toHaveTextContent('Filter: inactive') + await waitFor(() => { + expect(screen.getByTestId('current-page')).toHaveTextContent('Page: 2') + expect(screen.getByTestId('current-filter')).toHaveTextContent( + 'Filter: inactive', + ) + }) }) test('when navigation to . from /posts while updating search from / and using base path', async () => { @@ -1417,18 +1840,20 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const search = useSearch({ strict: false }) - return ( - <> -

Posts

- Page: {search.value.page} - - Filter: {search.value.filter} - - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const search = useSearch({ strict: false }) + return () => ( + <> +

Posts

+ Page: {search.value.page} + + Filter: {search.value.filter} + + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1491,10 +1916,12 @@ describe('Link', () => { expect(window.location.pathname).toBe('/Dashboard/posts') expect(window.location.search).toBe('?page=2&filter=inactive') - const updatedPage = await screen.findByTestId('current-page') - const updatedFilter = await screen.findByTestId('current-filter') - expect(updatedPage).toHaveTextContent('Page: 2') - expect(updatedFilter).toHaveTextContent('Filter: inactive') + await waitFor(() => { + expect(screen.getByTestId('current-page')).toHaveTextContent('Page: 2') + expect(screen.getByTestId('current-filter')).toHaveTextContent( + 'Filter: inactive', + ) + }) }) test('when navigating to /posts with invalid search', async () => { @@ -1515,15 +1942,17 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const search = useSearch({ strict: false }) - return ( - <> -

Posts

- Page: {search.value.page} - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const search = useSearch({ strict: false }) + return () => ( + <> +

Posts

+ Page: {search.value.page} + + ) + }, + }) const ErrorComponent = () => { return

Oops, something went wrong

@@ -1586,15 +2015,17 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const data = useLoaderData({ strict: false }) - return ( - <> -

Posts

- Page: {data.value.pageDoubled} - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const data = useLoaderData({ strict: false }) + return () => ( + <> +

Posts

+ Page: {data.value.pageDoubled} + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1649,15 +2080,17 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const loader = useLoaderData({ strict: false }) - return ( - <> -

Posts

- Page: {loader.value.pageDoubled} - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const loader = useLoaderData({ strict: false }) + return () => ( + <> +

Posts

+ Page: {loader.value.pageDoubled} + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1840,16 +2273,18 @@ describe('Link', () => { }, }) - const PostsComponent = () => { - const context = useRouteContext({ strict: false }) - return ( - <> -

Posts

- UserId: {context.value.userId} - Username: {context.value.username} - - ) - } + const PostsComponent = Vue.defineComponent({ + setup() { + const context = useRouteContext({ strict: false }) + return () => ( + <> +

Posts

+ UserId: {context.value.userId} + Username: {context.value.username} + + ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, @@ -2101,10 +2536,12 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return Params: {params.value.postId} - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => Params: {params.value.postId} + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2136,14 +2573,12 @@ describe('Link', () => { test('keeps a relative link active when changing inherited params (issue #5655)', async () => { const rootRoute = createRootRoute() - const postRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/post/$postId', - component: () => { + const PostComponent = Vue.defineComponent({ + setup() { const params = useParams({ strict: false }) - const postId = Vue.computed(() => params.value.postId) - return ( + const postId = Vue.computed(() => params.value.postId) + return () => ( <> { }, }) - const step1Route = createRoute({ - getParentRoute: () => postRoute, - path: 'step1', - component: () => { + const postRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/post/$postId', + component: PostComponent, + }) + + const Step1Component = Vue.defineComponent({ + setup() { const params = useParams({ strict: false }) + const postId = Vue.computed(() => params.value.postId) + const otherPostId = Vue.computed(() => postId.value === '1' ? '2' : '1', ) - - return ( + return () => ( <> {`Post ${postId.value} step1`} { }, }) - const step2Route = createRoute({ + const step1Route = createRoute({ getParentRoute: () => postRoute, - path: 'step2', - component: () => { + path: 'step1', + component: Step1Component, + }) + + const Step2Component = Vue.defineComponent({ + setup() { const params = useParams({ strict: false }) + const postId = Vue.computed(() => params.value.postId) + const otherPostId = Vue.computed(() => postId.value === '1' ? '2' : '1', ) - - return ( + return () => ( <> {`Post ${postId.value} step2`} { }, }) + const step2Route = createRoute({ + getParentRoute: () => postRoute, + path: 'step2', + component: Step2Component, + }) + const router = createRouter({ routeTree: rootRoute.addChildren([ postRoute.addChildren([step1Route, step2Route]), @@ -2299,15 +2750,17 @@ describe('Link', () => { component: PostsIndexComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - Index - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + Index + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2413,14 +2866,16 @@ describe('Link', () => { component: PostsIndexComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2524,15 +2979,17 @@ describe('Link', () => { component: PostsIndexComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - Index - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + Index + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2621,15 +3078,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2758,15 +3217,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2953,27 +3414,31 @@ describe('Link', () => { component: UsersComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + + Params: {params.value.postId} + + + ) + }, + }) - const UserComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - - Params: {params.value.userId} - - - ) - } + const UserComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + + Params: {params.value.userId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, path: '$postid', @@ -3095,15 +3560,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3232,15 +3699,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3359,15 +3828,17 @@ describe('Link', () => { validateSearch: () => ({ page: 2 }), }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3504,15 +3975,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3638,15 +4111,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3733,7 +4208,9 @@ describe('Link', () => { test('when navigating from /invoices to ./invoiceId and the current route is /posts/$postId/details', async () => { const rootRoute = createRootRoute({ - errorComponent: (err) =>
{err.error.message}
, + errorComponent: ({ error }) => ( +
{error instanceof Error ? error.message : String(error)}
+ ), }) const indexRoute = createRoute({ @@ -3780,15 +4257,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -3838,10 +4317,12 @@ describe('Link', () => { ), }) - const InvoiceComponent = () => { - const params = useParams({ strict: false }) - return invoiceId: {params.value.invoiceId} - } + const InvoiceComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => invoiceId: {params.value.invoiceId} + }, + }) const invoiceRoute = createRoute({ getParentRoute: () => invoicesRoute, @@ -3907,15 +4388,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -4001,15 +4484,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -4086,15 +4571,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const search = vi.fn((prev) => ({ page: prev.postPage })) @@ -4214,15 +4701,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const search = vi.fn((prev) => ({ page: prev.postPage })) @@ -4314,15 +4803,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const search = vi.fn((prev) => ({ page: prev.postPage })) @@ -4414,15 +4905,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const search = vi.fn((prev) => ({ page: prev.postPage })) @@ -4515,15 +5008,17 @@ describe('Link', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const search = vi.fn((prev) => ({ page: prev.postPage })) @@ -4765,10 +5260,12 @@ describe('Link', () => { let parseParams: any let stringifyParams: any - const PostComponent = () => { - const params = useParams({ strict: false }) - return
Post: {params.value.postId}
- } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () =>
Post: {params.value.postId}
+ }, + }) const postRoute = createRoute({ getParentRoute: () => rootRoute, @@ -4827,10 +5324,12 @@ describe('Link', () => { let parseParams: any let stringifyParams: any - const PostComponent = () => { - const params = useParams({ strict: false }) - return
Post: {params.value.postId}
- } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () =>
Post: {params.value.postId}
+ }, + }) const postRoute = createRoute({ getParentRoute: () => rootRoute, @@ -4908,10 +5407,12 @@ describe('Link', () => { } } - const PostComponent = () => { - const params = useParams({ strict: false }) - return
Post: {params.value.postId}
- } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () =>
Post: {params.value.postId}
+ }, + }) const postRoute = createRoute({ getParentRoute: () => rootRoute, @@ -5050,6 +5551,308 @@ describe('Link', () => { expect(ioDisconnectMock).not.toHaveBeenCalled() // it should not disconnect again }) + test.each([undefined, false, true])( + 'disabled observers honor the cleanup condition (%s)', + async (cleanupWhenDisabled) => { + const callback = vi.fn() + const TestComponent = Vue.defineComponent({ + setup() { + const element = Vue.ref(null) + useIntersectionObserver( + element, + callback, + () => true, + cleanupWhenDisabled === undefined + ? undefined + : () => cleanupWhenDisabled, + ) + return () =>
+ }, + }) + const view = render() + await Vue.nextTick() + callback.mockClear() + view.unmount() + if (cleanupWhenDisabled === false) { + expect(callback).not.toHaveBeenCalled() + } else { + expect(callback).toHaveBeenCalledWith() + } + }, + ) + + test.each(['intent', 'viewport'] as const)( + 'preserves %s timer cleanup across mode changes and unmount', + async (mode) => { + const preload = Vue.ref() + const RouteComponent = Vue.defineComponent({ + setup() { + return () => ( + + Preload Link + + ) + }, + }) + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: RouteComponent, + }) + const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, aboutRoute]), + history, + }) + const preloadRouteSpy = vi.spyOn(router, 'preloadRoute') + const view = render() + const link = await screen.findByRole('link', { name: 'Preload Link' }) + const notify = (callback: IntersectionObserverCallback) => { + callback( + [ + { + isIntersecting: true, + target: link, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + } + const trigger = async () => { + if (mode === 'intent') { + await fireEvent.mouseEnter(link) + } else { + notify(ioCallback) + } + } + vi.useFakeTimers() + + preload.value = mode + await Vue.nextTick() + const oldObserver = mode === 'viewport' ? ioCallback : undefined + await trigger() + await vi.advanceTimersByTimeAsync(49) + preload.value = false + await Vue.nextTick() + if (oldObserver) { + notify(oldObserver) + } + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + + preload.value = mode + await Vue.nextTick() + if (oldObserver) { + // The mode matches again, but the previous observer is still obsolete. + notify(oldObserver) + } + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + await trigger() + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).toHaveBeenCalledOnce() + + preloadRouteSpy.mockClear() + await trigger() + const lastObserver = mode === 'viewport' ? ioCallback : undefined + view.unmount() + if (lastObserver) { + notify(lastObserver) + } + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + }, + ) + + test('Link.preload="viewport" should respect preloadDelay', async () => { + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => ( + <> + + Viewport Link + + + Intent Link + + + ), + }) + const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, aboutRoute]), + history, + }) + const preloadRouteSpy = vi.spyOn(router, 'preloadRoute') + + render() + + const viewportLink = await screen.findByRole('link', { + name: 'Viewport Link', + }) + const intentLink = await screen.findByRole('link', { name: 'Intent Link' }) + vi.useFakeTimers() + + ioCallback([], {} as IntersectionObserver) + ioCallback( + [ + { + isIntersecting: false, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + + ioCallback( + [ + { + isIntersecting: true, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + ioCallback( + [ + { + isIntersecting: true, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + fireEvent.mouseLeave(viewportLink) + + expect(preloadRouteSpy).not.toHaveBeenCalled() + await vi.advanceTimersByTimeAsync(49) + expect(preloadRouteSpy).not.toHaveBeenCalled() + await vi.advanceTimersByTimeAsync(1) + expect(preloadRouteSpy).toHaveBeenCalledOnce() + + ioCallback( + [ + { + isIntersecting: true, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + { + isIntersecting: false, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).toHaveBeenCalledOnce() + + ioCallback( + [ + { + isIntersecting: true, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + await vi.advanceTimersByTimeAsync(49) + + ioCallback( + [ + { + isIntersecting: false, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + { + isIntersecting: true, + target: viewportLink, + } as unknown as IntersectionObserverEntry, + ], + {} as IntersectionObserver, + ) + await vi.advanceTimersByTimeAsync(1) + expect(preloadRouteSpy).toHaveBeenCalledTimes(2) + + fireEvent.mouseEnter(intentLink) + fireEvent.mouseLeave(intentLink) + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).toHaveBeenCalledTimes(2) + }) + + test('Link.disabled should disable viewport observation', async () => { + const rootRoute = createRootRoute() + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => ( + <> +

Index Heading

+ + Index Link + + + ), + }) + + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + defaultPreload: 'viewport', + }) + + render() + + const indexLink = await screen.findByRole('link', { name: 'Index Link' }) + expect(indexLink).toBeInTheDocument() + expect(indexLink).toHaveAttribute('aria-disabled', 'true') + expect(ioObserveMock).not.toHaveBeenCalled() + }) + + test('useIntersectionObserver should react to its disabled getter', async () => { + const TestComponent = Vue.defineComponent({ + name: 'TestComponent', + setup() { + const element = Vue.ref(null) + const disabled = Vue.ref(true) + + useIntersectionObserver( + element, + () => {}, + () => disabled.value, + ) + + return () => ( + <> + +
+ + ) + }, + }) + + render() + expect(ioObserveMock).not.toHaveBeenCalled() + + const toggle = screen.getByRole('button', { name: 'Toggle disabled' }) + await fireEvent.click(toggle) + await waitFor(() => expect(ioObserveMock).toHaveBeenCalledOnce()) + + await fireEvent.click(toggle) + await waitFor(() => expect(ioDisconnectMock).toHaveBeenCalledOnce()) + }) + test("Router.preload='render', should trigger the route loader on render", async () => { const mock = vi.fn() @@ -5090,6 +5893,116 @@ describe('Link', () => { expect(mock).toHaveBeenCalledTimes(1) }) + test('Link.preload="render" preloads each reactive destination', async () => { + const to = Vue.ref('/posts') + const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + + Dynamic render preload + + ) + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts', + }) + const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([postsRoute, aboutRoute]), + history, + }) + const preloadRouteSpy = vi.spyOn(router, 'preloadRoute') + + render() + + const link = await screen.findByRole('link', { + name: 'Dynamic render preload', + }) + await waitFor(() => expect(preloadRouteSpy).toHaveBeenCalledOnce()) + expect(link).toHaveAttribute('href', '/posts') + + to.value = '/about' + await waitFor(() => expect(preloadRouteSpy).toHaveBeenCalledTimes(2)) + expect(link).toHaveAttribute('href', '/about') + }) + + test('cancels stale delayed preloads after link inputs change', async () => { + const to = Vue.ref('/posts') + const disabled = Vue.ref(false) + const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + + Dynamic intent preload + + ) + }, + }) + + const rootRoute = createRootRoute({ + component: RootComponent, + }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts', + }) + const aboutRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/about', + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([postsRoute, aboutRoute]), + history, + }) + const preloadRouteSpy = vi.spyOn(router, 'preloadRoute') + + render() + const link = await screen.findByRole('link', { + name: 'Dynamic intent preload', + }) + vi.useFakeTimers() + + await fireEvent.mouseEnter(link) + disabled.value = true + await Vue.nextTick() + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + + disabled.value = false + await Vue.nextTick() + await fireEvent.mouseEnter(link) + to.value = '/about' + await Vue.nextTick() + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + + await fireEvent.mouseEnter(link) + to.value = 'https://example.com' + await Vue.nextTick() + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).not.toHaveBeenCalled() + + to.value = '/about' + await Vue.nextTick() + await fireEvent.mouseEnter(link) + await vi.advanceTimersByTimeAsync(50) + expect(preloadRouteSpy).toHaveBeenCalledOnce() + }) + test.each([undefined, false, 'render', 'viewport'] as const)( 'Link.preload="%s" should not preload on focus, hover, or touchstart', async (preloadMode) => { @@ -5147,6 +6060,7 @@ describe('Link', () => { ) test('Link.preload="intent" should preload on focus, hover, and touchstart', async () => { + const updateSearch = vi.fn((search) => search) const rootRoute = createRootRoute() const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -5154,7 +6068,7 @@ describe('Link', () => { component: () => ( <>

Index Heading

- + About Link @@ -5181,6 +6095,8 @@ describe('Link', () => { expect(aboutLink).toBeInTheDocument() const baselineCalls = preloadRouteSpy.mock.calls.length + const baselineSearchCalls = updateSearch.mock.calls.length + expect(baselineSearchCalls).toBeGreaterThan(0) fireEvent.focus(aboutLink) await waitFor(() => @@ -5196,6 +6112,10 @@ describe('Link', () => { await waitFor(() => expect(preloadRouteSpy).toHaveBeenCalledTimes(baselineCalls + 3), ) + expect(updateSearch).toHaveBeenCalledTimes(baselineSearchCalls + 3) + for (const call of preloadRouteSpy.mock.calls.slice(baselineCalls)) { + expect(call).toHaveLength(1) + } }) test('Router.preload="intent", pendingComponent renders during unresolved route loader', async () => { @@ -5250,79 +6170,6 @@ describe('Link', () => { expect(window.location.pathname).toBe('/posts') }) - test('Link slot receives isTransitioning during pending navigation', async () => { - let resolvePostsLoader: (() => void) | undefined - - const postsLoaderPromise = new Promise((resolve) => { - resolvePostsLoader = resolve - }) - - const rootRoute = createRootRoute({ - component: () => - Vue.h(Vue.Fragment, null, [ - Vue.h( - Link, - { to: '/posts', 'data-testid': 'posts-link' }, - { - default: ({ isTransitioning }: { isTransitioning: boolean }) => ( - <> - - {isTransitioning ? 'transitioning' : 'idle'} - - Posts - - ), - }, - ), - Vue.h(Outlet), - ]), - }) - - const indexRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', - component: () =>

Index page

, - }) - - const postsRoute = createRoute({ - ssr: false, - getParentRoute: () => rootRoute, - path: '/posts', - loader: () => postsLoaderPromise, - component: () =>

Posts page

, - }) - - const router = createRouter({ - routeTree: rootRoute.addChildren([indexRoute, postsRoute]), - history, - }) - - render() - - await screen.findByRole('heading', { name: 'Index page' }) - - const postsLink = await screen.findByTestId('posts-link') - const transitionState = await screen.findByTestId('slot-transition-state') - - expect(transitionState).toHaveTextContent('idle') - expect(postsLink).not.toHaveAttribute('data-transitioning') - - fireEvent.click(postsLink) - - await waitFor(() => expect(resolvePostsLoader).toBeDefined()) - await waitFor(() => - expect(transitionState).toHaveTextContent('transitioning'), - ) - expect(postsLink).toHaveAttribute('data-transitioning', 'transitioning') - - resolvePostsLoader?.() - - await screen.findByRole('heading', { name: 'Posts page' }) - - await waitFor(() => expect(transitionState).toHaveTextContent('idle')) - expect(postsLink).not.toHaveAttribute('data-transitioning') - }) - describe('when preloading a link, `preload` should be', () => { async function runTest({ expectedPreload, @@ -5387,14 +6234,16 @@ describe('Link', () => { loader: postsLoaderFn, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + ) + }, + }) const postBeforeLoadFn = vi.fn() const postLoaderFn = vi.fn() @@ -5800,7 +6649,9 @@ describe('search middleware', () => { test('search middlewares work', async () => { const rootRoute = createRootRoute({ - errorComponent: (error) =>
{error.error.stack}
, + errorComponent: ({ error }) => ( +
{error instanceof Error ? error.stack : String(error)}
+ ), validateSearch: (input) => { return { root: input.root as string | undefined, @@ -5820,12 +6671,10 @@ describe('search middleware', () => { ], }, }) - const indexRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', - component: () => { + const IndexComponent = Vue.defineComponent({ + setup() { const search = indexRoute.useSearch() - return ( + return () => ( <>

Index

{search.value.root ?? '$undefined'}
@@ -5844,6 +6693,12 @@ describe('search middleware', () => { }, }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: IndexComponent, + }) + const PostsComponent = () => { return ( <> @@ -5925,6 +6780,21 @@ describe('search middleware', () => { }, }) + const PostsComponent = Vue.defineComponent({ + setup() { + const search = postsRoute.useSearch() + return () => ( + <> +

Posts

+
{search.value.foo}
+ + new + + + ) + }, + }) + const postsRoute = createRoute({ getParentRoute: () => rootRoute, path: 'posts', @@ -5939,18 +6809,7 @@ describe('search middleware', () => { ], }, - component: () => { - const search = postsRoute.useSearch() - return ( - <> -

Posts

-
{search.value.foo}
- - new - - - ) - }, + component: PostsComponent, }) const postsNewRoute = createRoute({ @@ -6043,10 +6902,12 @@ describe('search middleware', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return Params: {params.value.postId} - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => Params: {params.value.postId} + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -6456,14 +7317,12 @@ describe('splat routes with empty splat', () => { async (trailingSlash) => { const tail = trailingSlash === 'always' ? '/' : '' - const rootRoute = createRootRoute() - const indexRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', + // The links stay mounted across the navigation so they can turn active. + const rootRoute = createRootRoute({ component: () => { return ( <> -

Index Route

+ { ) }, }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () => { + return

Index Route

+ }, + }) const splatRoute = createRoute({ getParentRoute: () => rootRoute, @@ -6778,16 +7644,18 @@ describe('relative links to current route', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -7211,15 +8079,17 @@ describe('when on /posts/$postId and navigating to ../ with default `from` /post // postsRouteApi.Link is not available in Vue, so we use Link with from prop instead // const postsRouteApi = getRouteApi('/_layout/posts') - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -7485,27 +8355,28 @@ describe('encoded and unicode paths', () => { }, }) + const PathRouteComponent = Vue.defineComponent({ + setup() { + const params = pathRoute.useParams() + return () => ( +
+

Path Route

+

+ params:{' '} + + {JSON.stringify(params.value)} + +

+
+ ) + }, + }) const pathRoute = createRoute({ getParentRoute: () => rootRoute, path, component: PathRouteComponent, }) - function PathRouteComponent() { - const params = pathRoute.useParams() - return ( -
-

Path Route

-

- params:{' '} - - {JSON.stringify(params.value)} - -

-
- ) - } - const router = createRouter({ routeTree: rootRoute.addChildren([indexRoute, pathRoute]), history, diff --git a/packages/vue-router/tests/loaders.test.tsx b/packages/vue-router/tests/loaders.test.tsx index ae267ac2ae..f8b94245a8 100644 --- a/packages/vue-router/tests/loaders.test.tsx +++ b/packages/vue-router/tests/loaders.test.tsx @@ -1,4 +1,11 @@ -import { cleanup, fireEvent, render, screen } from '@testing-library/vue' +import { defineComponent } from 'vue' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/vue' import { afterEach, describe, expect, test, vi } from 'vitest' @@ -199,13 +206,17 @@ test('reproducer for #2053', async () => { }, }) + const FooComponent = defineComponent({ + setup() { + const params = fooRoute.useParams() + return () =>
fooId: {params.value.fooId}
+ }, + }) + const fooRoute = createRoute({ getParentRoute: () => rootRoute, path: '/foo/$fooId', - component: () => { - const params = fooRoute.useParams() - return
fooId: {params.value.fooId}
- }, + component: FooComponent, }) window.history.replaceState(null, 'root', '/foo/3ΚΑΠΠΑ') @@ -276,6 +287,51 @@ test('throw error from loader upon initial load', async () => { expect(errorElement).toBeInTheDocument() }) +// https://github.com/TanStack/router/pull/7673 +test('#7673: aborted loader does not render the route component with undefined loaderData', async () => { + const abortError = new DOMException('Aborted', 'AbortError') + const routeComponentRendered = vi.fn() + const renderedError = vi.fn() + const rootRoute = createRootRoute({}) + const IndexComponent = defineComponent({ + setup() { + const data = indexRoute.useLoaderData() + return () => { + routeComponentRendered() + + return
{data.value.value}
+ } + }, + }) + + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: (): Promise<{ value: string }> => Promise.reject(abortError), + component: IndexComponent, + errorComponent: ({ error }) => { + renderedError(error) + return
indexErrorComponent
+ }, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + }) + + render() + + expect(await screen.findByTestId('index-error')).toBeInTheDocument() + expect(screen.queryByTestId('index-content')).not.toBeInTheDocument() + expect(routeComponentRendered).not.toHaveBeenCalled() + expect(renderedError).toHaveBeenCalledWith(abortError) + expect( + router.state.matches.find((match) => match.routeId === indexRoute.id), + ).toMatchObject({ + status: 'error', + error: abortError, + }) +}) + test('throw error from beforeLoad when navigating to route', async () => { const rootRoute = createRootRoute({}) @@ -324,17 +380,10 @@ test('reproducer #4245', async () => { const LOADER_WAIT_TIME = 500 const rootRoute = createRootRoute({}) - const indexRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', - loader: async () => { - await sleep(LOADER_WAIT_TIME) - return 'index' - }, - - component: () => { + const IndexComponent = defineComponent({ + setup() { const data = indexRoute.useLoaderData() - return ( + return () => (
foo @@ -345,6 +394,17 @@ test('reproducer #4245', async () => { }, }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + loader: async () => { + await sleep(LOADER_WAIT_TIME) + return 'index' + }, + + component: IndexComponent, + }) + const fooRoute = createRoute({ getParentRoute: () => rootRoute, path: '/foo', @@ -439,6 +499,30 @@ test('reproducer #4546', async () => { }) let counter = 0 + const Header = defineComponent({ + setup() { + const router = useRouter() + + const ctx = appRoute.useRouteContext() + return () => ( +
+ Header Counter:{' '} +

{ctx.value.counter}

+ +
+ ) + }, + }) const appRoute = createRoute({ getParentRoute: () => rootRoute, id: '_app', @@ -458,42 +542,12 @@ test('reproducer #4546', async () => { }, }) - function Header() { - const router = useRouter() - const ctx = appRoute.useRouteContext() - - return ( -
- Header Counter:

{ctx.value.counter}

- -
- ) - } - - const indexRoute = createRoute({ - getParentRoute: () => appRoute, - path: '/', - loader: ({ context }) => { - return { - counter: context.counter, - } - }, - - component: () => { + const IndexComponent = defineComponent({ + setup() { const data = indexRoute.useLoaderData() - const ctx = indexRoute.useRouteContext() - return ( + const ctx = indexRoute.useRouteContext() + return () => (
{ ) }, }) - const idRoute = createRoute({ + + const indexRoute = createRoute({ getParentRoute: () => appRoute, - path: '$id', + path: '/', loader: ({ context }) => { return { counter: context.counter, } }, - component: () => { + component: IndexComponent, + }) + const IdComponent = defineComponent({ + setup() { const data = idRoute.useLoaderData() - const ctx = idRoute.useRouteContext() - return ( + const ctx = idRoute.useRouteContext() + return () => (
{ }, }) + const idRoute = createRoute({ + getParentRoute: () => appRoute, + path: '$id', + loader: ({ context }) => { + return { + counter: context.counter, + } + }, + + component: IdComponent, + }) + const routeTree = rootRoute.addChildren([ appRoute.addChildren([indexRoute, idRoute]), ]) @@ -601,7 +671,7 @@ test('reproducer #4546', async () => { expect(routeContext).toHaveTextContent('3') const loaderData = await screen.findByTestId('index-loader-data') - expect(loaderData).toHaveTextContent('3') + await waitFor(() => expect(loaderData).toHaveTextContent('3')) } fireEvent.click(invalidateRouterButton) @@ -631,11 +701,11 @@ test('reproducer #4546', async () => { expect(routeContext).toHaveTextContent('5') const loaderData = await screen.findByTestId('id-loader-data') - expect(loaderData).toHaveTextContent('5') + await waitFor(() => expect(loaderData).toHaveTextContent('5')) } }) -test('clears pendingTimeout when match resolves', async () => { +test('does not show pending UI when routes resolve before their thresholds', async () => { const defaultPendingComponentOnMountMock = vi.fn() const nestedPendingComponentOnMountMock = vi.fn() const fooPendingComponentOnMountMock = vi.fn() @@ -703,7 +773,7 @@ test('clears pendingTimeout when match resolves', async () => { }) render() - await router.latestLoadPromise + await screen.findByText('Index page') const linkToFoo = await screen.findByTestId('link-to-foo') fireEvent.click(linkToFoo) const fooElement = await screen.findByText('Nested Foo page') @@ -717,7 +787,7 @@ test('clears pendingTimeout when match resolves', async () => { expect(fooPendingComponentOnMountMock).not.toHaveBeenCalled() }) -test('cancelMatches after pending timeout', async () => { +test('navigating away from pending UI aborts its loader', async () => { function getPendingComponent(onMount: () => void) { const PendingComponent = () => { onMount() @@ -769,7 +839,7 @@ test('cancelMatches after pending timeout', async () => { const routeTree = rootRoute.addChildren([fooRoute, barRoute]) const router = createRouter({ routeTree, history }) render() - await router.latestLoadPromise + await screen.findByText('Index page') const fooLink = await screen.findByTestId('link-to-foo') fireEvent.click(fooLink) await sleep(WAIT_TIME * 30) diff --git a/packages/vue-router/tests/not-found.test.tsx b/packages/vue-router/tests/not-found.test.tsx index 3cb4a78ec3..cefc7becda 100644 --- a/packages/vue-router/tests/not-found.test.tsx +++ b/packages/vue-router/tests/not-found.test.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { afterEach, beforeEach, expect, test } from 'vitest' import { cleanup, render, screen } from '@testing-library/vue' @@ -370,14 +371,10 @@ test('beforeLoad notFound with routeId targets parent boundary and preserves par ), }) - const parentRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/parent', - loader: () => ({ message: 'ready' }), - component: () => , - notFoundComponent: () => { + const ParentNotFoundComponent = defineComponent({ + setup() { const loaderData = parentRoute.useLoaderData() - return ( + return () => ( {loaderData.value.message} @@ -385,6 +382,14 @@ test('beforeLoad notFound with routeId targets parent boundary and preserves par }, }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + loader: () => ({ message: 'ready' }), + component: () => , + notFoundComponent: ParentNotFoundComponent, + }) + const childRoute = createRoute({ getParentRoute: () => parentRoute, path: '/child', diff --git a/packages/vue-router/tests/optional-path-params.test.tsx b/packages/vue-router/tests/optional-path-params.test.tsx index ca98aef616..52dcd9ddb4 100644 --- a/packages/vue-router/tests/optional-path-params.test.tsx +++ b/packages/vue-router/tests/optional-path-params.test.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { afterEach, describe, expect, it, vi } from 'vitest' import { cleanup, @@ -26,12 +27,10 @@ describe('Solid Router - Optional Path Parameters', () => { describe('Route matching with optional parameters', () => { it('should match route with no optional parameters', async () => { const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}/{-$slug}', - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -39,6 +38,12 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}/{-$slug}', + component: PostsComponent, + }) window.history.replaceState({}, '', '/posts') const router = createRouter({ @@ -54,12 +59,10 @@ describe('Solid Router - Optional Path Parameters', () => { it('should match route with one optional parameter', async () => { const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}/{-$slug}', - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -67,6 +70,12 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}/{-$slug}', + component: PostsComponent, + }) window.history.replaceState({}, '', '/posts/tech') const router = createRouter({ @@ -84,12 +93,10 @@ describe('Solid Router - Optional Path Parameters', () => { it('should match route with all optional parameters', async () => { const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}/{-$slug}', - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -97,6 +104,12 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}/{-$slug}', + component: PostsComponent, + }) window.history.replaceState({}, '', '/posts/tech/hello-world') const router = createRouter({ @@ -123,12 +136,10 @@ describe('Solid Router - Optional Path Parameters', () => { 'should handle mixed required and optional parameters: $path', async ({ path, expectedParams }) => { const rootRoute = createRootRoute() - const usersRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/users/$id/{-$tab}', - component: () => { + const UsersComponent = defineComponent({ + setup() { const params = usersRoute.useParams() - return ( + return () => (

User Profile

{JSON.stringify(params.value)}
@@ -136,6 +147,12 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const usersRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/users/$id/{-$tab}', + component: UsersComponent, + }) window.history.replaceState({}, '', path) const router = createRouter({ @@ -195,12 +212,10 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) - const indexRoute = createRoute({ - getParentRoute: () => localeRoute, - path: '/', - component: () => { + const IndexComponent = defineComponent({ + setup() { const context = indexRoute.useRouteContext() - return ( + return () => (

{context.value.content.title}

@@ -211,6 +226,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const indexRoute = createRoute({ + getParentRoute: () => localeRoute, + path: '/', + component: IndexComponent, + }) + window.history.replaceState({}, '', path) const router = createRouter({ @@ -477,12 +498,10 @@ describe('Solid Router - Optional Path Parameters', () => { ), }) - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}/{-$slug}', - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -491,6 +510,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}/{-$slug}', + component: PostsComponent, + }) + const router = createRouter({ routeTree: rootRoute.addChildren([indexRoute, postsRoute]), }) @@ -556,12 +581,10 @@ describe('Solid Router - Optional Path Parameters', () => { ), }) - const filesRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/files/prefix{-$name}.txt', - component: () => { + const FilesComponent = defineComponent({ + setup() { const params = filesRoute.useParams() - return ( + return () => (

Files

{JSON.stringify(params.value)}
@@ -570,6 +593,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const filesRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/files/prefix{-$name}.txt', + component: FilesComponent, + }) + const router = createRouter({ routeTree: rootRoute.addChildren([indexRoute, filesRoute]), }) @@ -587,55 +616,57 @@ describe('Solid Router - Optional Path Parameters', () => { describe('useNavigate with optional parameters', () => { it('should navigate with optional parameters programmatically', async () => { const rootRoute = createRootRoute() + const Component = defineComponent({ + setup() { + const navigate = useNavigate() + + const params = postsRoute.useParams() + return () => ( +
+
{JSON.stringify(params.value)}
+ + + +
+ ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, path: '/posts/{-$category}/{-$slug}', component: Component, }) - function Component() { - const navigate = useNavigate() - const params = postsRoute.useParams() - - return ( -
-
{JSON.stringify(params.value)}
- - - -
- ) - } // Start at a specific post window.history.replaceState({}, '', '/posts/tech/hello-world') @@ -667,37 +698,39 @@ describe('Solid Router - Optional Path Parameters', () => { it('should handle relative navigation with optional parameters', async () => { const rootRoute = createRootRoute() + const Component = defineComponent({ + setup() { + const navigate = useNavigate() + + const params = postsRoute.useParams() + return () => ( +
+

Posts

+
{JSON.stringify(params.value)}
+ + +
+ ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, path: '/posts/{-$category}', component: Component, }) - function Component() { - const navigate = useNavigate() - const params = postsRoute.useParams() - - return ( -
-

Posts

-
{JSON.stringify(params.value)}
- - -
- ) - } window.history.replaceState({}, '', '/posts') const router = createRouter({ @@ -779,12 +812,10 @@ describe('Solid Router - Optional Path Parameters', () => { 'should handle nested routes with optional parameters: $path', async ({ path, expected }) => { const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}', - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts Layout

@@ -796,12 +827,16 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) - const postRoute = createRoute({ - getParentRoute: () => postsRoute, - path: '/{-$slug}', - component: () => { + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}', + component: PostsComponent, + }) + + const PostComponent = defineComponent({ + setup() { const params = postRoute.useParams() - return ( + return () => (

Post Detail

@@ -812,6 +847,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const postRoute = createRoute({ + getParentRoute: () => postsRoute, + path: '/{-$slug}', + component: PostComponent, + }) + window.history.replaceState({}, '', path) const router = createRouter({ @@ -835,6 +876,20 @@ describe('Solid Router - Optional Path Parameters', () => { it('should work with search parameters', async () => { const rootRoute = createRootRoute() + const Component = defineComponent({ + setup() { + const params = postsRoute.useParams() + + const search = postsRoute.useSearch() + return () => ( +
+

Posts

+
{JSON.stringify(params.value)}
+
{JSON.stringify(search.value)}
+
+ ) + }, + }) const postsRoute = createRoute({ getParentRoute: () => rootRoute, path: '/posts/{-$category}', @@ -845,18 +900,6 @@ describe('Solid Router - Optional Path Parameters', () => { component: Component, }) - function Component() { - const params = postsRoute.useParams() - const search = postsRoute.useSearch() - return ( -
-

Posts

-
{JSON.stringify(params.value)}
-
{JSON.stringify(search.value)}
-
- ) - } - window.history.replaceState({}, '', '/posts/tech?page=2&sort=title') const router = createRouter({ routeTree: rootRoute.addChildren([postsRoute]), @@ -889,12 +932,10 @@ describe('Solid Router - Optional Path Parameters', () => { 'should handle multiple consecutive optional parameters: $path', async ({ path, expectedParams }) => { const rootRoute = createRootRoute() - const dateRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/{-$year}/{-$month}/{-$day}', - component: () => { + const DateComponent = defineComponent({ + setup() { const params = dateRoute.useParams() - return ( + return () => (

Date Route

{JSON.stringify(params.value)}
@@ -903,6 +944,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const dateRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/{-$year}/{-$month}/{-$day}', + component: DateComponent, + }) + window.history.replaceState({}, '', path) const router = createRouter({ @@ -950,12 +997,10 @@ describe('Solid Router - Optional Path Parameters', () => { 'should handle routes with required param after optional param: $path', async ({ path, expected }) => { const rootRoute = createRootRoute() - const roomsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/{-$locale}/$rooms', - component: () => { + const RoomsComponent = defineComponent({ + setup() { const params = roomsRoute.useParams() - return ( + return () => (

Rooms

@@ -970,6 +1015,12 @@ describe('Solid Router - Optional Path Parameters', () => { }, }) + const roomsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/{-$locale}/$rooms', + component: RoomsComponent, + }) + window.history.replaceState({}, '', path) const router = createRouter({ @@ -996,14 +1047,12 @@ describe('Solid Router - Optional Path Parameters', () => { }) const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}', - loader: mockLoader, - component: () => { + const PostsComponent = defineComponent({ + setup() { const data = postsRoute.useLoaderData() + const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -1012,6 +1061,13 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}', + loader: mockLoader, + component: PostsComponent, + }) window.history.replaceState({}, '', '/posts') const router = createRouter({ @@ -1048,13 +1104,10 @@ describe('Solid Router - Optional Path Parameters', () => { }) const rootRoute = createRootRoute() - const postsRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/posts/{-$category}', - beforeLoad: mockBeforeLoad, - component: () => { + const PostsComponent = defineComponent({ + setup() { const params = postsRoute.useParams() - return ( + return () => (

Posts

{JSON.stringify(params.value)}
@@ -1062,6 +1115,13 @@ describe('Solid Router - Optional Path Parameters', () => { ) }, }) + + const postsRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/posts/{-$category}', + beforeLoad: mockBeforeLoad, + component: PostsComponent, + }) window.history.replaceState({}, '', '/posts/tech') const router = createRouter({ diff --git a/packages/vue-router/tests/pending-fallback-promise-replacement.test.tsx b/packages/vue-router/tests/pending-fallback-promise-replacement.test.tsx new file mode 100644 index 0000000000..8cab6d41f0 --- /dev/null +++ b/packages/vue-router/tests/pending-fallback-promise-replacement.test.tsx @@ -0,0 +1,78 @@ +import { cleanup, render, screen } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { createControlledPromise } from '@tanstack/router-core' +import { + RouterProvider, + createMemoryHistory, + createRootRoute, + createRouter, +} from '../src' + +const testCleanups: Array<() => void | Promise> = [] + +afterEach(async () => { + vi.useRealTimers() + while (testCleanups.length) { + await testCleanups.pop()!() + } + cleanup() +}) + +test('a continuously visible fallback keeps its deadline across replacement loads', async () => { + const firstReload = createControlledPromise() + const secondReload = createControlledPromise() + const reloads = [firstReload, secondReload] + let loaderCall = 0 + + const rootRoute = createRootRoute({ + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
Pending
, + loader: () => { + const generation = ++loaderCall + const gate = reloads[generation - 2] + return gate ? gate.then(() => generation) : generation + }, + component: () =>
Content
, + }) + const router = createRouter({ + routeTree: rootRoute, + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + expect(await screen.findByText('Content')).toBeInTheDocument() + + vi.useFakeTimers() + const firstInvalidation = router.invalidate({ forcePending: true }) + const invalidations = [firstInvalidation] + testCleanups.push(async () => { + firstReload.resolve() + secondReload.resolve() + await Promise.allSettled(invalidations) + }) + await vi.advanceTimersByTimeAsync(0) + expect(screen.getByTestId('pending')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(25) + let secondSettled = false + const secondInvalidation = router + .invalidate({ forcePending: true }) + .then(() => { + secondSettled = true + }) + invalidations.push(secondInvalidation) + + firstReload.resolve() + secondReload.resolve() + await Promise.resolve() + + await vi.advanceTimersByTimeAsync(74) + expect(secondSettled).toBe(false) + expect(screen.getByTestId('pending')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(1) + await Promise.all(invalidations) + expect(screen.getByText('Content')).toBeInTheDocument() + expect(screen.queryByTestId('pending')).not.toBeInTheDocument() +}) diff --git a/packages/vue-router/tests/public-presentation-lane-contract.test.tsx b/packages/vue-router/tests/public-presentation-lane-contract.test.tsx new file mode 100644 index 0000000000..0dd4069b96 --- /dev/null +++ b/packages/vue-router/tests/public-presentation-lane-contract.test.tsx @@ -0,0 +1,487 @@ +import { cleanup, render, screen, waitFor } from '@testing-library/vue' +import { afterEach, describe, expect, test, vi } from 'vitest' +import { defineComponent, nextTick } from 'vue' +import { createControlledPromise } from '@tanstack/router-core' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, + notFound, +} from '../src' + +afterEach(() => { + cleanup() + vi.useRealTimers() + vi.restoreAllMocks() +}) + +describe('public presentation lane contracts', () => { + test('a plain load retry presents pending UI over a committed error', async () => { + const retryStarted = createControlledPromise() + const retry = createControlledPromise() + let attempt = 0 + + const rootRoute = createRootRoute({ component: () => }) + const PageComponent = defineComponent({ + setup() { + const loaderData = pageRoute.useLoaderData() + return () =>
{loaderData.value}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + pendingMs: 0, + pendingMinMs: 0, + pendingComponent: () =>
Retrying page
, + loader: () => { + if (!attempt++) { + throw new Error('Initial failure') + } + retryStarted.resolve() + return retry + }, + errorComponent: () =>
Page failed
, + component: PageComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([pageRoute]), + history: createMemoryHistory({ initialEntries: ['/page'] }), + }) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + + render() + expect(await screen.findByText('Page failed')).toBeInTheDocument() + + let retryLoad!: Promise + try { + retryLoad = router.load() + await retryStarted + await nextTick() + expect(screen.getByText('Retrying page')).toBeInTheDocument() + expect(screen.queryByText('Page failed')).not.toBeInTheDocument() + + retry.resolve('Page recovered') + await retryLoad + await nextTick() + expect(screen.getByText('Page recovered')).toBeInTheDocument() + } finally { + retry.resolve('Page recovered') + await retryLoad + } + }) + + test('same-boundary takeover republishes successor search without restarting pendingMinMs', async () => { + const firstGate = createControlledPromise() + const secondGate = createControlledPromise() + + const rootRoute = createRootRoute({ component: () => }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Home
, + }) + const PageComponent = defineComponent({ + setup() { + const search = pageRoute.useSearch() + return () =>
Page revision {search.value.revision}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + validateSearch: (search: Record) => ({ + revision: Number(search.revision), + }), + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
Loading page
, + beforeLoad: ({ search }) => + search.revision === 1 ? firstGate : secondGate, + component: PageComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, pageRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + expect(await screen.findByText('Home')).toBeInTheDocument() + await waitFor(() => expect(router.state.status).toBe('idle')) + vi.useFakeTimers() + vi.setSystemTime(0) + + let successorSettled = false + let settledAtOriginalDeadline = false + let renderedAtOriginalDeadline = false + try { + void router.navigate({ + to: '/page', + search: { revision: 1 }, + }) + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByText('Loading page')).toBeInTheDocument() + expect(router.state.matches.at(-1)?.search).toMatchObject({ revision: 1 }) + + await vi.advanceTimersByTimeAsync(25) + + const secondNavigation = router.navigate({ + to: '/page', + search: { revision: 2 }, + }) + await vi.advanceTimersByTimeAsync(0) + await nextTick() + + expect(screen.getByText('Loading page')).toBeInTheDocument() + expect(router.state.location.search).toMatchObject({ revision: 2 }) + expect(router.state.matches.at(-1)?.search).toMatchObject({ revision: 2 }) + + void secondNavigation.then(() => { + successorSettled = true + }) + secondGate.resolve() + await Promise.resolve() + + await vi.advanceTimersByTimeAsync(74) + await nextTick() + expect(successorSettled).toBe(false) + expect(screen.getByText('Loading page')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(5) + await Promise.resolve() + await nextTick() + + settledAtOriginalDeadline = successorSettled + renderedAtOriginalDeadline = + screen.queryByText('Page revision 2') !== null + } finally { + firstGate.resolve() + secondGate.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await nextTick() + } + + expect({ + settled: settledAtOriginalDeadline, + rendered: renderedAtOriginalDeadline, + }).toEqual({ settled: true, rendered: true }) + expect(screen.getByText('Page revision 2')).toBeInTheDocument() + expect(screen.queryByText('Loading page')).not.toBeInTheDocument() + }) + + test('an earlier pending-ineligible boundary retires a deeper pending minimum', async () => { + const childReloadStarted = createControlledPromise() + const childReload = createControlledPromise() + const parentReloadStarted = createControlledPromise() + const parentReload = createControlledPromise() + let childLoads = 0 + + const rootRoute = createRootRoute({ + validateSearch: (search: Record) => ({ + revision: Number(search.revision), + }), + component: () => , + }) + const parentRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/parent', + loaderDeps: ({ search }) => ({ revision: search.revision }), + beforeLoad: ({ search }) => { + if (search.revision === 2) { + parentReloadStarted.resolve() + return parentReload + } + return undefined + }, + component: () => , + }) + const ChildComponent = defineComponent({ + setup() { + const search = childRoute.useSearch() + return () =>
Child revision {search.value.revision}
+ }, + }) + + const childRoute = createRoute({ + getParentRoute: () => parentRoute, + path: '/child', + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
Loading child
, + loader: { + staleReloadMode: 'blocking', + handler: () => { + if (childLoads++) { + childReloadStarted.resolve() + return childReload + } + return undefined + }, + }, + component: ChildComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([parentRoute.addChildren([childRoute])]), + history: createMemoryHistory({ + initialEntries: ['/parent/child?revision=1'], + }), + }) + + render() + expect(await screen.findByText('Child revision 1')).toBeInTheDocument() + await waitFor(() => expect(router.state.status).toBe('idle')) + vi.useFakeTimers() + vi.setSystemTime(0) + + let firstNavigation: Promise | undefined + let secondNavigation: Promise | undefined + let settledBeforeOldMinimum = false + let renderedBeforeOldMinimum = false + try { + firstNavigation = router.invalidate({ + filter: (match) => match.routeId === childRoute.id, + forcePending: true, + }) + await childReloadStarted + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByText('Loading child')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(25) + secondNavigation = router.navigate({ + to: '/parent/child', + search: { revision: 2 }, + }) + await parentReloadStarted + expect(screen.getByText('Loading child')).toBeInTheDocument() + + childReload.resolve() + const successor = secondNavigation + void successor.then(() => { + settledBeforeOldMinimum = true + }) + parentReload.resolve() + await vi.advanceTimersByTimeAsync(5) + await nextTick() + renderedBeforeOldMinimum = screen.queryByText('Child revision 2') !== null + } finally { + childReload.resolve() + parentReload.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await Promise.allSettled( + [firstNavigation, secondNavigation].filter( + (navigation): navigation is Promise => !!navigation, + ), + ) + } + + expect({ + settled: settledBeforeOldMinimum, + rendered: renderedBeforeOldMinimum, + }).toEqual({ settled: true, rendered: true }) + }) + + test('same-boundary timing survives a private retained-context barrier', async () => { + const retainedStarted = createControlledPromise() + const retainedReady = createControlledPromise() + const firstPage = createControlledPromise() + const secondPageStarted = createControlledPromise() + const secondPage = createControlledPromise() + + const RootComponent = defineComponent({ + setup() { + const context = rootRoute.useRouteContext() + return () => ( +
+
Root revision {context.value.rootRevision}
+ +
+ ) + }, + }) + + const rootRoute = createRootRoute({ + validateSearch: (search: Record) => ({ + revision: Number(search.revision) || 0, + }), + beforeLoad: ({ search }) => { + if (search.revision === 2) { + retainedStarted.resolve() + return retainedReady.then(() => ({ rootRevision: 2 })) + } + return { rootRevision: search.revision } + }, + component: RootComponent, + }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Home
, + }) + const PageComponent = defineComponent({ + setup() { + const search = pageRoute.useSearch() + return () =>
Page revision {search.value.revision}
+ }, + }) + + const pageRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/page', + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: () =>
Loading page
, + beforeLoad: ({ search }) => { + if (search.revision === 1) { + return firstPage + } + secondPageStarted.resolve() + return secondPage + }, + component: PageComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute, pageRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + render() + expect(await screen.findByText('Home')).toBeInTheDocument() + vi.useFakeTimers() + vi.setSystemTime(0) + + let firstNavigation: Promise | undefined + let secondNavigation: Promise | undefined + try { + firstNavigation = router.navigate({ + to: '/page', + search: { revision: 1 }, + }) + await vi.advanceTimersByTimeAsync(0) + await nextTick() + expect(screen.getByText('Loading page')).toBeInTheDocument() + expect(screen.getByText('Root revision 1')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(25) + secondNavigation = router.navigate({ + to: '/page', + search: { revision: 2 }, + }) + await retainedStarted + await nextTick() + + expect(screen.getByText('Loading page')).toBeInTheDocument() + expect(screen.getByText('Root revision 1')).toBeInTheDocument() + + retainedReady.resolve() + await secondPageStarted + await nextTick() + expect(screen.getByText('Loading page')).toBeInTheDocument() + expect(screen.getByText('Root revision 2')).toBeInTheDocument() + + let settled = false + const successor = secondNavigation + void successor.then(() => { + settled = true + }) + secondPage.resolve() + await vi.advanceTimersByTimeAsync(74) + await nextTick() + expect(settled).toBe(false) + expect(screen.getByText('Loading page')).toBeInTheDocument() + + await vi.advanceTimersByTimeAsync(5) + await Promise.all([firstNavigation, successor]) + await nextTick() + expect(screen.getByText('Page revision 2')).toBeInTheDocument() + } finally { + retainedReady.resolve() + firstPage.resolve() + secondPage.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await Promise.allSettled( + [firstNavigation, secondNavigation].filter( + (navigation): navigation is Promise => !!navigation, + ), + ) + } + }) + + test('an exact-boundary terminal result supersedes an unrendered pending offer', async () => { + const pendingRenderStarted = createControlledPromise() + const pendingRender = createControlledPromise() + const terminalLoadStarted = createControlledPromise() + const terminalLoad = createControlledPromise() + const Pending = defineComponent({ + async setup() { + pendingRenderStarted.resolve() + await pendingRender + return () =>
Root pending
+ }, + }) + + const rootRoute = createRootRoute({ + validateSearch: (search: Record) => ({ + terminal: search.terminal === true, + }), + pendingMs: 0, + pendingMinMs: 100, + pendingComponent: Pending, + beforeLoad: async ({ search }) => { + if (search.terminal) { + terminalLoadStarted.resolve() + await terminalLoad + throw notFound() + } + }, + notFoundComponent: () =>
Root not found
, + component: () => , + }) + const indexRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/', + component: () =>
Home
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/?terminal=false'] }), + }) + + render() + expect(await screen.findByText('Home')).toBeInTheDocument() + await waitFor(() => expect(router.state.status).toBe('idle')) + vi.useFakeTimers() + vi.setSystemTime(0) + + let navigation: Promise | undefined + try { + navigation = router.navigate({ + to: '/', + search: { terminal: true }, + }) + await terminalLoadStarted + await vi.advanceTimersByTimeAsync(0) + await pendingRenderStarted + await nextTick() + expect(screen.getByText('Home')).toBeInTheDocument() + + terminalLoad.resolve() + await navigation + await nextTick() + + expect(screen.getByText('Root not found')).toBeInTheDocument() + expect(Date.now()).toBe(0) + } finally { + terminalLoad.resolve() + pendingRender.resolve() + await vi.advanceTimersByTimeAsync(1_000) + await Promise.allSettled(navigation ? [navigation] : []) + } + }) +}) diff --git a/packages/vue-router/tests/redirect.test.tsx b/packages/vue-router/tests/redirect.test.tsx index b7ba2e1af3..e26fe9a372 100644 --- a/packages/vue-router/tests/redirect.test.tsx +++ b/packages/vue-router/tests/redirect.test.tsx @@ -1,11 +1,12 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/vue' -import { afterEach, describe, expect, test, vi } from 'vitest' +import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' import { Link, Outlet, RouterProvider, + createBrowserHistory, createMemoryHistory, createRootRoute, createRoute, @@ -15,8 +16,17 @@ import { } from '../src' import { sleep } from './utils' +import type { RouterHistory } from '../src' + +let history: RouterHistory + +beforeEach(() => { + history = createBrowserHistory() + expect(window.location.pathname).toBe('/') +}) afterEach(() => { + history.destroy() vi.clearAllMocks() vi.resetAllMocks() window.history.replaceState(null, 'root', '/') @@ -74,7 +84,7 @@ describe('redirect', () => { aboutRoute, indexRoute, ]) - const router = createRouter({ routeTree }) + const router = createRouter({ routeTree, history }) render() @@ -196,7 +206,7 @@ describe('redirect', () => { aboutRoute, indexRoute, ]) - const router = createRouter({ routeTree }) + const router = createRouter({ routeTree, history }) render() @@ -274,7 +284,7 @@ describe('redirect', () => { indexRoute, finalRoute, ]) - const router = createRouter({ routeTree }) + const router = createRouter({ routeTree, history }) render() @@ -292,108 +302,4 @@ describe('redirect', () => { expect(window.location.pathname).toBe('/final') }) }) - - describe('SSR', () => { - test('when `redirect` is thrown in `beforeLoad`', async () => { - const rootRoute = createRootRoute() - - const indexRoute = createRoute({ - path: '/', - getParentRoute: () => rootRoute, - beforeLoad: () => { - throw redirect({ - to: '/about', - }) - }, - }) - - const aboutRoute = createRoute({ - path: '/about', - getParentRoute: () => rootRoute, - component: () => { - return <>About - }, - }) - - const router = createRouter({ - routeTree: rootRoute.addChildren([indexRoute, aboutRoute]), - // Mock server mode - isServer: true, - history: createMemoryHistory({ - initialEntries: ['/'], - }), - }) - - await router.load() - - expect(router.state.redirect).toBeDefined() - expect(router.state.redirect).toBeInstanceOf(Response) - const redirectResponse = router.state.redirect! - - expect(redirectResponse.options).toEqual({ - _fromLocation: expect.objectContaining({ - hash: '', - href: '/', - pathname: '/', - search: {}, - searchStr: '', - }), - to: '/about', - href: '/about', - statusCode: 307, - }) - }) - - test('when `redirect` is thrown in `loader`', async () => { - const rootRoute = createRootRoute() - - const indexRoute = createRoute({ - path: '/', - getParentRoute: () => rootRoute, - loader: () => { - throw redirect({ - to: '/about', - }) - }, - }) - - const aboutRoute = createRoute({ - path: '/about', - getParentRoute: () => rootRoute, - component: () => { - return <>About - }, - }) - - const router = createRouter({ - history: createMemoryHistory({ - initialEntries: ['/'], - }), - routeTree: rootRoute.addChildren([indexRoute, aboutRoute]), - // Mock server mode - isServer: true, - }) - - await router.load() - - const currentRedirect = router.state.redirect - - expect(currentRedirect).toBeDefined() - expect(currentRedirect).toBeInstanceOf(Response) - const redirectResponse = currentRedirect! - - expect(redirectResponse.options).toEqual({ - _fromLocation: expect.objectContaining({ - hash: '', - href: '/', - pathname: '/', - search: {}, - searchStr: '', - }), - to: '/about', - href: '/about', - statusCode: 307, - }) - }) - }) }) diff --git a/packages/vue-router/tests/remountDeps.test.tsx b/packages/vue-router/tests/remountDeps.test.tsx new file mode 100644 index 0000000000..ff9bf6808e --- /dev/null +++ b/packages/vue-router/tests/remountDeps.test.tsx @@ -0,0 +1,100 @@ +import * as Vue from 'vue' +import { cleanup, render, screen } from '@testing-library/vue' +import { afterEach, expect, test, vi } from 'vitest' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(() => { + cleanup() +}) + +function setup(remountOnParams: boolean | 'falsy' = false) { + const mounted = vi.fn() + const unmounted = vi.fn() + const rootRoute = createRootRoute({ component: () => }) + const ItemComponent = Vue.defineComponent({ + name: 'ItemComponent', + setup() { + const params = itemRoute.useParams() + + Vue.onMounted(mounted) + Vue.onUnmounted(unmounted) + + return () =>
Item {params.value.itemId}
+ }, + }) + const itemRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/items/$itemId', + component: ItemComponent, + remountDeps: + remountOnParams === 'falsy' + ? ({ params }) => (params.itemId === 'one' ? false : 0) + : remountOnParams + ? ({ params }) => params + : undefined, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([itemRoute]), + history: createMemoryHistory({ initialEntries: ['/items/one'] }), + }) + + render() + + return { mounted, router, unmounted } +} + +async function navigateToSecondItem( + router: ReturnType['router'], +) { + await router.navigate({ + to: '/items/$itemId', + params: { itemId: 'two' }, + }) +} + +test('keeps an active route component mounted when params change by default', async () => { + const { mounted, router, unmounted } = setup() + + expect(await screen.findByText('Item one')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(1) + expect(unmounted).not.toHaveBeenCalled() + + await navigateToSecondItem(router) + + expect(await screen.findByText('Item two')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(1) + expect(unmounted).not.toHaveBeenCalled() +}) + +test('remounts an active route component when params are remount deps', async () => { + const { mounted, router, unmounted } = setup(true) + + expect(await screen.findByText('Item one')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(1) + + await navigateToSecondItem(router) + + expect(await screen.findByText('Item two')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(2) + expect(unmounted).toHaveBeenCalledTimes(1) +}) + +test('remounts when remount deps change between falsy values', async () => { + const { mounted, router, unmounted } = setup('falsy') + + expect(await screen.findByText('Item one')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(1) + + await navigateToSecondItem(router) + + expect(await screen.findByText('Item two')).toBeInTheDocument() + expect(mounted).toHaveBeenCalledTimes(2) + expect(unmounted).toHaveBeenCalledTimes(1) +}) diff --git a/packages/vue-router/tests/renderRouterToStream.test.tsx b/packages/vue-router/tests/renderRouterToStream.test.tsx index 527bfa0e03..656e8a54b5 100644 --- a/packages/vue-router/tests/renderRouterToStream.test.tsx +++ b/packages/vue-router/tests/renderRouterToStream.test.tsx @@ -4,12 +4,30 @@ import { normalizeSsrResponse, } from '@tanstack/router-core/ssr/server' import { createMemoryHistory, createRootRoute, createRouter } from '../src' +import type { RouterManagedTag } from '@tanstack/router-core' +import type * as RouterSsrServer from '@tanstack/router-core/ssr/server' import type * as VueServerRenderer from 'vue/server-renderer' const rendererMocks = vi.hoisted(() => ({ - pipeToWebWritable: vi.fn(), + renderToWebStream: vi.fn(), renderToString: vi.fn(), })) +const routerTransformMocks = vi.hoisted(() => ({ + readableOptions: vi.fn(), +})) + +vi.mock('@tanstack/router-core/ssr/server', async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + transformReadableStreamWithRouter: ( + ...args: Parameters + ) => { + routerTransformMocks.readableOptions(args[2]) + return actual.transformReadableStreamWithRouter(...args) + }, + } +}) vi.mock('vue/server-renderer', async () => { const actual = await vi.importActual( @@ -17,11 +35,15 @@ vi.mock('vue/server-renderer', async () => { ) return { ...actual, - pipeToWebWritable: rendererMocks.pipeToWebWritable, + renderToWebStream: rendererMocks.renderToWebStream, renderToString: rendererMocks.renderToString, } }) +const actualVueServerRenderer = await vi.importActual( + 'vue/server-renderer', +) + // Imported after mock so the wrapper picks up the mocked binding. const { renderRouterToStream } = await import('../src/ssr/renderRouterToStream') @@ -32,8 +54,9 @@ function unwrapResponse( } afterEach(() => { - rendererMocks.pipeToWebWritable.mockReset() + rendererMocks.renderToWebStream.mockReset() rendererMocks.renderToString.mockReset() + routerTransformMocks.readableOptions.mockReset() vi.restoreAllMocks() }) @@ -61,14 +84,40 @@ function drainBody(response: Response) { })().catch(() => true) } +function createManualVueStream() { + let controller!: ReadableStreamDefaultController + const cancel = vi.fn() + const stream = new ReadableStream({ + start(nextController) { + controller = nextController + }, + cancel, + }) + return { stream, controller, cancel } +} + +function renderScript(tag: RouterManagedTag) { + const attrs = tag.attrs ?? {} + const id = attrs.id ? ` id="${attrs.id}"` : '' + const nonce = attrs.nonce ? ` nonce="${attrs.nonce}"` : '' + const streamPart = + 'data-tsr-stream-part' in attrs ? ' data-tsr-stream-part=""' : '' + return `${tag.children ?? ''}` +} + describe('renderRouterToStream - sync setup failures', () => { - test('bot string response injects final scripts and cleans up', async () => { - rendererMocks.renderToString.mockResolvedValueOnce( - '
bot
', - ) + test('bot string response preserves hydration scripts and cleans up', async () => { const router = await buildRouter() await router.serverSsr!.dehydrate() const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const initialScripts = router.serverSsr!.takeInitialHydrationScriptTags()! + expect(initialScripts.boundary.attrs).not.toHaveProperty('id') + const renderedScripts = [...initialScripts.before, initialScripts.boundary] + .map(renderScript) + .join('') + rendererMocks.renderToString.mockResolvedValueOnce( + `
bot
${renderedScripts}`, + ) const response = unwrapResponse( await renderRouterToStream({ @@ -83,82 +132,279 @@ describe('renderRouterToStream - sync setup failures', () => { const html = await response.text() expect(html).toContain('$_TSR.e()') + expect(html).toContain(initialScripts.boundary.children) expect(html.indexOf('$_TSR.e()')).toBeLessThan(html.indexOf('')) expect(cleanup).toHaveBeenCalledOnce() expect(router.serverSsr).toBeUndefined() }) - test('pipeToWebWritable sync throw terminates response stream', async () => { - rendererMocks.pipeToWebWritable.mockImplementationOnce(() => { - throw new Error('forced-sync-setup-throw') + test('request abort stops a bot wait and removes its temporary listener', async () => { + rendererMocks.renderToString.mockImplementationOnce( + () => new Promise(() => {}), + ) + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const abortController = new AbortController() + const request = new Request('http://localhost/', { + headers: { 'User-Agent': 'Googlebot' }, + signal: abortController.signal, }) + const addEventListener = vi.spyOn(request.signal, 'addEventListener') + const reason = new Error('bot-request-gone') + + const responsePromise = renderRouterToStream({ + request, + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }) + await Promise.resolve() + abortController.abort(reason) + + await expect(responsePromise).rejects.toBe(reason) + // The shared abort waiter registers once; `{ once: true }` retires it. + expect( + addEventListener.mock.calls.filter(([type]) => type === 'abort'), + ).toHaveLength(1) + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + test('an already-aborted bot request does not start string rendering', async () => { + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const abortController = new AbortController() + const reason = new Error('bot-already-gone') + abortController.abort(reason) + + await expect( + renderRouterToStream({ + request: new Request('http://localhost/', { + headers: { 'User-Agent': 'Googlebot' }, + signal: abortController.signal, + }), + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }), + ).rejects.toBe(reason) + + expect(rendererMocks.renderToString).not.toHaveBeenCalled() + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + test('prepends one doctype without wrapping the renderer stream', async () => { + const router = await buildRouter() + await router.serverSsr!.dehydrate() + const initialScripts = router.serverSsr!.takeInitialHydrationScriptTags()! + const renderedScripts = [...initialScripts.before, initialScripts.boundary] + .map(renderScript) + .join('') + const appHtml = `
app
${renderedScripts}` + rendererMocks.renderToWebStream.mockReturnValueOnce( + new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode(appHtml)) + controller.close() + }, + }), + ) + + const response = unwrapResponse( + await renderRouterToStream({ + request: new Request('http://localhost/'), + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }), + ) + const html = await response.text() + + expect(html).toBe(`${appHtml}`) + expect(html.match(//g)).toHaveLength(1) + expect(router.serverSsr).toBeUndefined() + }) + + test('already-aborted requests do not start the Vue producer', async () => { + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const abortController = new AbortController() + const reason = new Error('already-gone') + abortController.abort(reason) + + await expect( + renderRouterToStream({ + request: new Request('http://localhost/', { + signal: abortController.signal, + }), + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }), + ).rejects.toBe(reason) + + expect(rendererMocks.renderToWebStream).not.toHaveBeenCalled() + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + test('an abort during producer setup rejects before a response', async () => { + const abortController = new AbortController() + const reason = new Error('reentrant-abort') + rendererMocks.renderToWebStream.mockImplementationOnce( + actualVueServerRenderer.renderToWebStream, + ) const router = await buildRouter() + await expect( + renderRouterToStream({ + request: new Request('http://localhost/', { + signal: abortController.signal, + }), + router, + responseHeaders: new Headers(), + App: { + setup() { + abortController.abort(reason) + return () => null + }, + }, + }), + ).rejects.toBe(reason) + + expect(router.serverSsr).toBeUndefined() + }) + + test('real synchronous renderer failure rejects before creating a response', async () => { + const setupError = new Error('real-vue-setup-failure') + rendererMocks.renderToWebStream.mockImplementationOnce( + actualVueServerRenderer.renderToWebStream, + ) + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const originalServerSsr = router.serverSsr! + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + await expect( + renderRouterToStream({ + request: new Request('http://localhost/'), + router, + responseHeaders: new Headers(), + App: { + setup() { + throw setupError + }, + }, + }), + ).rejects.toBe(setupError) + + expect(routerTransformMocks.readableOptions).not.toHaveBeenCalled() + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + } finally { + errorSpy.mockRestore() + warnSpy.mockRestore() + originalServerSsr.cleanup() + } + }) + + test('request abort drops later Vue writes and terminates the response', async () => { + const vue = createManualVueStream() + rendererMocks.renderToWebStream.mockReturnValueOnce(vue.stream) + + const router = await buildRouter() + const abortController = new AbortController() + const request = new Request('http://localhost/', { + signal: abortController.signal, + }) + const addEventListener = vi.spyOn(request.signal, 'addEventListener') + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + const response = unwrapResponse( + await renderRouterToStream({ + request, + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }), + ) + + expect( + addEventListener.mock.calls.filter(([type]) => type === 'abort'), + ).toHaveLength(1) + const reason = new Error('client-gone') + abortController.abort(reason) + expect(response.body).not.toBeNull() + + expect(await drainBody(response)).toBe(true) + expect(vue.cancel).toHaveBeenCalledWith(reason) + expect(() => + vue.controller.enqueue(new TextEncoder().encode('
')), + ).toThrow() + } finally { + errorSpy.mockRestore() + router.serverSsr?.cleanup() + } + }) + + test('downstream cancellation stops Vue writes and cleans up once', async () => { + const vue = createManualVueStream() + rendererMocks.renderToWebStream.mockReturnValueOnce(vue.stream) + + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + const response = unwrapResponse( + await renderRouterToStream({ + request: new Request('http://localhost/'), + router, + responseHeaders: new Headers(), + App: { template: '
' } as any, + }), + ) + + await response.body!.cancel('consumer-gone') + expect(vue.cancel).toHaveBeenCalledWith('consumer-gone') + expect(() => + vue.controller.enqueue(new TextEncoder().encode('
')), + ).toThrow() + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() + }) + + test('a renderer buffer failure errors the response body', async () => { + const renderError = new Error('vue-buffer-failed') + rendererMocks.renderToWebStream.mockImplementationOnce( + actualVueServerRenderer.renderToWebStream, + ) + const router = await buildRouter() + const cleanup = vi.spyOn(router.serverSsr!, 'cleanup') + router.serverSsr!.disableHydration() + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) try { const response = unwrapResponse( await renderRouterToStream({ request: new Request('http://localhost/'), router, responseHeaders: new Headers(), - App: { template: '
' } as any, + App: { + ssrRender(_context: unknown, push: (value: unknown) => void) { + push('partial') + push(Promise.reject(renderError)) + }, + } as any, }), ) - const terminated = await Promise.race([ - drainBody(response), - new Promise((resolve) => setTimeout(() => resolve(false), 2000)), - ]) - - expect(terminated).toBe(true) - } finally { - errorSpy.mockRestore() - router.serverSsr?.cleanup() - } - }) - - test('request abort drops later Vue writes and terminates response stream', async () => { - let vueWriter: WritableStreamDefaultWriter | undefined - rendererMocks.pipeToWebWritable.mockImplementationOnce( - ( - _app: unknown, - _context: unknown, - writable: WritableStream, - ) => { - vueWriter = writable.getWriter() - }, - ) - - const router = await buildRouter() - const abortController = new AbortController() - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) - try { - const response = unwrapResponse( - await renderRouterToStream({ - request: new Request('http://localhost/', { - signal: abortController.signal, - }), - router, - responseHeaders: new Headers(), - App: { template: '
' } as any, - }), - ) - - expect(vueWriter).toBeDefined() - abortController.abort(new Error('client-gone')) - - await expect( - vueWriter!.write(new TextEncoder().encode('
')), - ).resolves.toBeUndefined() - - const terminated = await Promise.race([ - drainBody(response), - new Promise((resolve) => setTimeout(() => resolve(false), 2000)), - ]) - - expect(terminated).toBe(true) + await expect(response.text()).rejects.toBe(renderError) + expect(cleanup).toHaveBeenCalledOnce() + expect(router.serverSsr).toBeUndefined() } finally { errorSpy.mockRestore() + warnSpy.mockRestore() router.serverSsr?.cleanup() } }) diff --git a/packages/vue-router/tests/route.test.tsx b/packages/vue-router/tests/route.test.tsx index 70930e7ad4..6547de6634 100644 --- a/packages/vue-router/tests/route.test.tsx +++ b/packages/vue-router/tests/route.test.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { cleanup, render, screen } from '@testing-library/vue' import { afterEach, beforeEach, describe, expect, it, test, vi } from 'vitest' @@ -207,17 +208,25 @@ describe('onEnter event', () => { describe('useLoaderDeps', () => { test('returns a Ref', async () => { const rootRoute = createRootRoute() + const IndexComponent = defineComponent({ + setup() { + const deps = indexRoute.useLoaderDeps() + return () => { + // deps should be a Vue ref, so we access .value to get the value + expect(typeof deps).toBe('object') + + expect(deps.value).toEqual({ testDep: 'value' }) + + return
Index
+ } + }, + }) + const indexRoute = createRoute({ getParentRoute: () => rootRoute, path: '/', loaderDeps: ({ search }) => ({ testDep: 'value' }), - component: () => { - const deps = indexRoute.useLoaderDeps() - // deps should be a Vue ref, so we access .value to get the value - expect(typeof deps).toBe('object') - expect(deps.value).toEqual({ testDep: 'value' }) - return
Index
- }, + component: IndexComponent, }) const routeTree = rootRoute.addChildren([indexRoute]) const router = createRouter({ routeTree, history }) @@ -228,18 +237,27 @@ describe('useLoaderDeps', () => { test('returns a Ref via Route API', async () => { const rootRoute = createRootRoute() + const IndexComponent = defineComponent({ + setup() { + const api = getRouteApi('/') + + const deps = api.useLoaderDeps() + return () => { + // deps should be a Vue ref, so we access .value to get the value + expect(typeof deps).toBe('object') + + expect(deps.value).toEqual({ testDep: 'api-value' }) + + return
Index with API
+ } + }, + }) + const indexRoute = createRoute({ getParentRoute: () => rootRoute, path: '/', loaderDeps: ({ search }) => ({ testDep: 'api-value' }), - component: () => { - const api = getRouteApi('/') - const deps = api.useLoaderDeps() - // deps should be a Vue ref, so we access .value to get the value - expect(typeof deps).toBe('object') - expect(deps.value).toEqual({ testDep: 'api-value' }) - return
Index with API
- }, + component: IndexComponent, }) const routeTree = rootRoute.addChildren([indexRoute]) const router = createRouter({ routeTree, history }) diff --git a/packages/vue-router/tests/routeApi.test-d.tsx b/packages/vue-router/tests/routeApi.test-d.tsx index b2b4163837..073e9fd395 100644 --- a/packages/vue-router/tests/routeApi.test-d.tsx +++ b/packages/vue-router/tests/routeApi.test-d.tsx @@ -62,6 +62,12 @@ describe('getRouteApi', () => { invoiceId: string }> >() + + expectTypeOf( + invoiceRouteApi.useParams({ + shouldThrow: false, + }), + ).toEqualTypeOf>() }) test('useContext', () => { expectTypeOf( @@ -78,6 +84,12 @@ describe('getRouteApi', () => { page: number }> >() + + expectTypeOf( + invoiceRouteApi.useSearch({ + shouldThrow: false, + }), + ).toEqualTypeOf>() }) test('useLoaderData', () => { expectTypeOf(invoiceRouteApi.useLoaderData()).toEqualTypeOf< @@ -97,6 +109,16 @@ describe('getRouteApi', () => { expectTypeOf(invoiceRouteApi.useMatch()).toEqualTypeOf< Vue.Ref> >() + + expectTypeOf( + invoiceRouteApi.useMatch({ + shouldThrow: false, + }), + ).toEqualTypeOf< + Vue.Ref< + MakeRouteMatch | undefined + > + >() }) }) diff --git a/packages/vue-router/tests/routeContext.test.tsx b/packages/vue-router/tests/routeContext.test.tsx index 53db6aa42f..8e37527844 100644 --- a/packages/vue-router/tests/routeContext.test.tsx +++ b/packages/vue-router/tests/routeContext.test.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { cleanup, fireEvent, render, screen } from '@testing-library/vue' import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' import { z } from 'zod' @@ -71,20 +72,12 @@ describe('context function', () => { ) }, }) - const detailRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/detail/$id', - params: { - parse: (p) => z.object({ id: z.coerce.number() }).parse(p), - stringify: (p) => ({ id: `${p.id}` }), - }, - context: (args) => { - mockContextFn(args.params) - }, - component: () => { + const DetailComponent = defineComponent({ + setup() { const id = detailRoute.useParams({ select: (params) => params.id }) + const navigate = detailRoute.useNavigate() - return ( + return () => (

Detail page: {id.value}

- - - ) - } + useBlocker({ shouldBlockFn: () => false }) + return () => ( + <> +

Index

+ + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -76,19 +76,20 @@ describe('useBlocker', () => { test('does not block navigation when disabled', async () => { const rootRoute = createRootRoute() - const IndexComponent = () => { - const navigate = useNavigate() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - useBlocker({ shouldBlockFn: () => true, disabled: true }) - - return ( - <> -

Index

- - - - ) - } + useBlocker({ shouldBlockFn: () => true, disabled: true }) + return () => ( + <> +

Index

+ + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -128,19 +129,20 @@ describe('useBlocker', () => { test('blocks navigation when enabled', async () => { const rootRoute = createRootRoute() - const IndexComponent = () => { - const navigate = useNavigate() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - useBlocker({ shouldBlockFn: () => true }) - - return ( - <> -

Index

- - - - ) - } + useBlocker({ shouldBlockFn: () => true }) + return () => ( + <> +

Index

+ + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -182,21 +184,22 @@ describe('useBlocker', () => { const shouldBlockFn = vi.fn().mockReturnValue(true) - const IndexComponent = () => { - const navigate = useNavigate() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - useBlocker({ shouldBlockFn }) - - return ( - <> -

Index

- - - - ) - } + useBlocker({ shouldBlockFn }) + return () => ( + <> +

Index

+ + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -256,29 +259,30 @@ describe('useBlocker', () => { const shouldBlockFn = vi.fn().mockReturnValue(true) - const IndexComponent = () => { - const navigate = useNavigate() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - useBlocker({ shouldBlockFn }) - - return ( - <> -

Index

- - - - ) - } + useBlocker({ shouldBlockFn }) + return () => ( + <> +

Index

+ + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -340,29 +344,30 @@ describe('useBlocker', () => { test('conditionally blocking navigation works', async () => { const rootRoute = createRootRoute() - const IndexComponent = () => { - const navigate = useNavigate() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - useBlocker({ - shouldBlockFn: ({ next }) => { - if (next.fullPath === '/posts') { - return true - } - return false - }, - }) - - return ( - <> -

Index

- - - - - ) - } + useBlocker({ + shouldBlockFn: ({ next }) => { + if (next.fullPath === '/posts') { + return true + } + return false + }, + }) + return () => ( + <> +

Index

+ + + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -495,13 +500,12 @@ describe('useBlocker', () => { }) test('should allow navigation from 404 page when blocker is active', async () => { - const rootRoute = createRootRoute({ - notFoundComponent: function NotFoundComponent() { + const NotFoundComponent = Vue.defineComponent({ + setup() { const navigate = useNavigate() useBlocker({ shouldBlockFn: () => true }) - - return ( + return () => ( <>

Not Found

@@ -513,6 +517,10 @@ describe('useBlocker', () => { }, }) + const rootRoute = createRootRoute({ + notFoundComponent: NotFoundComponent, + }) + const indexRoute = createRoute({ getParentRoute: () => rootRoute, path: '/', @@ -562,13 +570,12 @@ describe('useBlocker', () => { }) test('should handle blocker navigation from 404 to another 404', async () => { - const rootRoute = createRootRoute({ - notFoundComponent: function NotFoundComponent() { + const NotFoundComponent = Vue.defineComponent({ + setup() { const navigate = useNavigate() useBlocker({ shouldBlockFn: () => true }) - - return ( + return () => ( <>

Not Found

- Home - About - - - ) - } + const canGoBack = useCanGoBack() + return () => { + expect(canGoBack.value).toBe( + location.value.pathname === '/' ? false : true, + ) + + return ( + <> + + Home + About + + + ) + } + }, + }) const rootRoute = createRootRoute({ component: RootComponent, diff --git a/packages/vue-router/tests/useMatch.test.tsx b/packages/vue-router/tests/useMatch.test.tsx index 2c3575f052..54306dea88 100644 --- a/packages/vue-router/tests/useMatch.test.tsx +++ b/packages/vue-router/tests/useMatch.test.tsx @@ -1,5 +1,12 @@ import { afterEach, describe, expect, test, vi } from 'vitest' -import { cleanup, render, screen, waitFor } from '@testing-library/vue' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/vue' +import * as Vue from 'vue' import { Link, Outlet, @@ -10,7 +17,7 @@ import { createRouter, useMatch, } from '../src' -import type { RouteComponent, RouterHistory } from '../src' +import type { AnyRoute, RouterHistory } from '../src' afterEach(() => { window.history.replaceState(null, 'root', '/') @@ -22,7 +29,7 @@ describe('useMatch', () => { RootComponent, history, }: { - RootComponent: RouteComponent + RootComponent: NonNullable history?: RouterHistory }) { const rootRoute = createRootRoute({ @@ -57,12 +64,18 @@ describe('useMatch', () => { test.each([true, false, undefined])( 'returns the match if shouldThrow = %s', async (shouldThrow) => { - function RootComponent() { - const match = useMatch({ from: '/posts', shouldThrow }) - expect(match.value).toBeDefined() - expect(match.value!.routeId).toBe('/posts') - return - } + const RootComponent = Vue.defineComponent({ + setup() { + const match = useMatch({ from: '/posts', shouldThrow }) + return () => { + expect(match.value).toBeDefined() + + expect(match.value!.routeId).toBe('/posts') + + return + } + }, + }) setup({ RootComponent, @@ -74,14 +87,213 @@ describe('useMatch', () => { ) }) + test('tracks presentation generations across replacement and re-entry', async () => { + const RootComponent = Vue.defineComponent({ + setup() { + const targetedRevision = useMatch({ + from: '/item', + shouldThrow: false, + select: (match) => match.loaderData, + }) + + return () => ( + <> +
+ {targetedRevision.value === undefined + ? 'Targeted absent' + : `Targeted revision ${targetedRevision.value}`} +
+ + Revision 2 + + + Revision 3 + + Other + + + ) + }, + }) + + const ItemComponent = Vue.defineComponent({ + setup() { + const nearestRevision = useMatch({ + strict: false, + shouldThrow: false, + select: (match) => match.loaderData as number, + }) + return () =>
Nearest revision {nearestRevision.value}
+ }, + }) + + const rootRoute = createRootRoute({ component: RootComponent }) + const itemRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/item', + validateSearch: (search: Record) => ({ + revision: Number(search.revision), + }), + loaderDeps: ({ search }) => ({ revision: search.revision }), + loader: ({ deps }) => deps.revision, + component: ItemComponent, + }) + const otherRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/other', + component: () =>
Other route
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([itemRoute, otherRoute]), + history: createMemoryHistory({ initialEntries: ['/item?revision=1'] }), + }) + + render() + expect(await screen.findByText('Nearest revision 1')).toBeInTheDocument() + expect(screen.getByTestId('targeted-match')).toHaveTextContent( + 'Targeted revision 1', + ) + + await fireEvent.click(screen.getByText('Revision 2')) + expect(await screen.findByText('Nearest revision 2')).toBeInTheDocument() + expect(screen.getByTestId('targeted-match')).toHaveTextContent( + 'Targeted revision 2', + ) + + await fireEvent.click(screen.getByText('Other')) + expect(await screen.findByText('Other route')).toBeInTheDocument() + expect(screen.getByTestId('targeted-match')).toHaveTextContent( + 'Targeted absent', + ) + + await fireEvent.click(screen.getByText('Revision 3')) + expect(await screen.findByText('Nearest revision 3')).toBeInTheDocument() + expect(screen.getByTestId('targeted-match')).toHaveTextContent( + 'Targeted revision 3', + ) + }) + + test('renders a route generation that re-enters before an intermediate route renders', async () => { + const RootComponent = Vue.defineComponent({ + setup() { + return () => ( + <> + Other + + + ) + }, + }) + const ItemComponent = Vue.defineComponent({ + setup() { + const revision = useMatch({ + strict: false, + select: (match) => match.loaderData as number, + }) + return () =>
Item revision {revision.value}
+ }, + }) + + const rootRoute = createRootRoute({ component: RootComponent }) + const itemRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/item', + validateSearch: (search: Record) => ({ + revision: Number(search.revision), + }), + loaderDeps: ({ search }) => ({ revision: search.revision }), + loader: ({ deps }) => deps.revision, + component: ItemComponent, + }) + const OtherComponent = Vue.defineComponent({ + setup: () => () =>
Other route
, + }) + + const otherRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/other', + component: OtherComponent, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([itemRoute, otherRoute]), + history: createMemoryHistory({ initialEntries: ['/item?revision=1'] }), + }) + + render() + expect(await screen.findByText('Item revision 1')).toBeInTheDocument() + + let returnNavigation: Promise | undefined + const unsubscribe = router.subscribe('onLoad', (event) => { + if (event.toLocation.pathname === '/other') { + returnNavigation = router.navigate({ + to: '/item', + search: { revision: 2 }, + }) + } + }) + try { + await fireEvent.click(screen.getByText('Other')) + await waitFor(() => expect(returnNavigation).toBeDefined()) + await returnNavigation + + expect(await screen.findByText('Item revision 2')).toBeInTheDocument() + expect(screen.queryByText('Other route')).not.toBeInTheDocument() + } finally { + unsubscribe() + } + }) + + test('an outgoing component never observes its own match disappear', async () => { + const observedRouteIds: Array = [] + const rootRoute = createRootRoute({ component: () => }) + const FirstComponent = Vue.defineComponent({ + setup() { + const match = useMatch({ + from: '/first', + shouldThrow: false, + }) + Vue.watchEffect(() => observedRouteIds.push(match.value?.routeId), { + flush: 'sync', + }) + return () =>
First route
+ }, + }) + + const firstRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/first', + component: FirstComponent, + }) + const nextRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/next', + component: () =>
Next route
, + }) + const router = createRouter({ + routeTree: rootRoute.addChildren([firstRoute, nextRoute]), + history: createMemoryHistory({ initialEntries: ['/first'] }), + }) + + render() + expect(await screen.findByText('First route')).toBeInTheDocument() + + await router.navigate({ to: '/next' }) + + expect(await screen.findByText('Next route')).toBeInTheDocument() + expect(observedRouteIds).not.toContain(undefined) + }) + describe('when match is not found', () => { test.each([undefined, true])( 'throws if shouldThrow = %s', async (shouldThrow) => { - function RootComponent() { - useMatch({ from: '/posts', shouldThrow }) - return - } + const RootComponent = Vue.defineComponent({ + setup() { + useMatch({ from: '/posts', shouldThrow }) + return () => + }, + }) + setup({ RootComponent }) const postsError = await screen.findByText( 'Invariant failed: Could not find an active match from "/posts"', @@ -92,11 +304,17 @@ describe('useMatch', () => { describe('returns undefined if shouldThrow = false', () => { test('without select function', async () => { - function RootComponent() { - const match = useMatch({ from: 'posts', shouldThrow: false }) - expect(match.value).toBeUndefined() - return - } + const RootComponent = Vue.defineComponent({ + setup() { + const match = useMatch({ from: 'posts', shouldThrow: false }) + return () => { + expect(match.value).toBeUndefined() + + return + } + }, + }) + setup({ RootComponent }) expect( await waitFor(() => screen.findByText('IndexTitle')), @@ -104,11 +322,21 @@ describe('useMatch', () => { }) test('with select function', async () => { const select = vi.fn() - function RootComponent() { - const match = useMatch({ from: 'posts', shouldThrow: false, select }) - expect(match.value).toBeUndefined() - return - } + const RootComponent = Vue.defineComponent({ + setup() { + const match = useMatch({ + from: 'posts', + shouldThrow: false, + select, + }) + return () => { + expect(match.value).toBeUndefined() + + return + } + }, + }) + setup({ RootComponent }) const indexTitle = await screen.findByText('IndexTitle') expect(indexTitle).toBeInTheDocument() diff --git a/packages/vue-router/tests/useNavigate.test.tsx b/packages/vue-router/tests/useNavigate.test.tsx index e71151863f..7ffdb64c32 100644 --- a/packages/vue-router/tests/useNavigate.test.tsx +++ b/packages/vue-router/tests/useNavigate.test.tsx @@ -1,5 +1,4 @@ import * as Vue from 'vue' -import '@testing-library/jest-dom/vitest' import { afterEach, beforeEach, describe, expect, test } from 'vitest' import { cleanup, @@ -153,16 +152,19 @@ test('when navigating from /posts to ./$postId', async () => { component: PostsIndexComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - const navigate = useNavigate() - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + + const navigate = useNavigate() + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -263,16 +265,19 @@ test('when navigating from /posts to ../posts/$postId', async () => { component: PostsIndexComponent, }) - const PostComponent = () => { - const navigate = useNavigate() - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() + + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -361,15 +366,17 @@ test('when navigating from /posts/$postId to /posts/$postId/info and the current component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -506,15 +513,17 @@ test('when navigating from /posts/$postId to ./info and the current route is /po component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -649,15 +658,17 @@ test('when navigating from /posts/$postId to ../$postId and the current route is component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -790,15 +801,17 @@ test('when navigating from /posts/$postId with an index to ../$postId and the cu component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -941,15 +954,17 @@ test('when navigating from /invoices to ./invoiceId and the current route is /po component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -1015,14 +1030,16 @@ test('when navigating from /invoices to ./invoiceId and the current route is /po ), }) - const InvoiceComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - invoiceId: {params.value.invoiceId} - - ) - } + const InvoiceComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + invoiceId: {params.value.invoiceId} + + ) + }, + }) const invoiceRoute = createRoute({ getParentRoute: () => invoicesRoute, @@ -1099,15 +1116,17 @@ test('when navigating to /posts/$postId/info which is masked as /posts/$postId', component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -1202,15 +1221,17 @@ test('when navigating to /posts/$postId/info which is imperatively masked as /po component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -1257,33 +1278,35 @@ test('when navigating to /posts/$postId/info which is imperatively masked as /po test('when setting search params with 2 parallel navigate calls', async () => { const rootRoute = createRootRoute() - const IndexComponent = () => { - const navigate = useNavigate() - const search = indexRoute.useSearch() + const IndexComponent = Vue.defineComponent({ + setup() { + const navigate = useNavigate() - return ( - <> -

Index

-
{search.value.param1}
-
{search.value.param2}
- - - ) - } + navigate({ + to: '/', + search: (prev: any) => ({ ...prev, param2: 'bar' }), + }) + }} + > + search + + + ) + }, + }) const indexRoute = createRoute({ getParentRoute: () => rootRoute, @@ -1398,15 +1421,17 @@ describe('when on /posts/$postId and navigating to ../ with default `from` /post component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -1916,16 +1941,18 @@ describe('relative navigate to current route', () => { component: PostsComponent, }) - const PostComponent = () => { - const params = useParams({ strict: false }) - return ( - <> - - Params: {params.value.postId} - - - ) - } + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( + <> + + Params: {params.value.postId} + + + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2047,45 +2074,53 @@ describe('relative navigate to current route', () => { return [currentOpen, setModal] as const } - function DetailComponent(props: { id: string }) { - const params = useParams({ strict: false }) - const [currentTest, setTest] = useModal('test') + const DetailComponent = Vue.defineComponent({ + props: { + id: { type: String, required: true }, + }, + setup(props) { + const params = useParams({ strict: false }) + const [currentTest, setTest] = useModal('test') - return ( - <> -
- Post Path "/{params.value.postId}/detail-{props.id}"! + return () => ( + <> +
+ Post Path "/{params.value.postId}/detail-{props.id}"! +
+ {currentTest.value ? ( + + ) : ( + + )} + + ) + }, + }) + + const PostComponent = Vue.defineComponent({ + setup() { + const params = useParams({ strict: false }) + return () => ( +
+
+ Post "{params.value.postId}"! +
+ +
- {currentTest.value ? ( - - ) : ( - - )} - - ) - } - - const PostComponent = () => { - const params = useParams({ strict: false }) - - return ( -
-
Post "{params.value.postId}"!
- - -
- ) - } + ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postsRoute, @@ -2719,27 +2754,28 @@ describe('encoded and unicode paths', () => { ) } + const PathRouteComponent = Vue.defineComponent({ + setup() { + const params = pathRoute.useParams() + return () => ( +
+

Path Route

+

+ params:{' '} + + {JSON.stringify(params.value)} + +

+
+ ) + }, + }) const pathRoute = createRoute({ getParentRoute: () => rootRoute, path, component: PathRouteComponent, }) - function PathRouteComponent() { - const params = pathRoute.useParams() - return ( -
-

Path Route

-

- params:{' '} - - {JSON.stringify(params.value)} - -

-
- ) - } - const router = createRouter({ routeTree: rootRoute.addChildren([indexRoute, pathRoute]), history, diff --git a/packages/vue-router/tests/useParams.test.tsx b/packages/vue-router/tests/useParams.test.tsx index 0d65361056..75fe4c4014 100644 --- a/packages/vue-router/tests/useParams.test.tsx +++ b/packages/vue-router/tests/useParams.test.tsx @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { expect, test, vi } from 'vitest' import { fireEvent, render, screen, waitFor } from '@testing-library/vue' import { @@ -33,6 +34,30 @@ test('useParams must return parsed result if applicable.', async () => { component: PostsComponent, }) + const PostCategoryComponent = defineComponent({ + setup() { + const data = postCategoryRoute.useLoaderData() + return () => ( +
+

Post Categories

+ {data.value.posts.map((post: (typeof posts)[number]) => { + const id = post.id === 1 ? 'one' : 'two' + return ( + + {post.title} + + ) + })} + +
+ ) + }, + }) const postCategoryRoute = createRoute({ getParentRoute: () => postsRoute, path: 'category_{$category}', @@ -68,6 +93,42 @@ test('useParams must return parsed result if applicable.', async () => { }), }) + const PostComponent = defineComponent({ + setup() { + const params = useParams({ from: postRoute.fullPath }) + + const data = postRoute.useLoaderData() + return () => ( +
+

Post Route

+
+ Category_Param:{' '} + + {params.value.category} + +
+
+ PostId_Param:{' '} + {params.value.postId} +
+
+ PostId:{' '} + {data.value.post.id} +
+
+ Title:{' '} + {data.value.post.title} +
+
+ Category:{' '} + + {data.value.post.category} + +
+
+ ) + }, + }) const postRoute = createRoute({ getParentRoute: () => postCategoryRoute, path: '$postId', @@ -109,65 +170,6 @@ test('useParams must return parsed result if applicable.', async () => { ) } - function PostCategoryComponent() { - const data = postCategoryRoute.useLoaderData() - - return ( -
-

Post Categories

- {data.value.posts.map((post: (typeof posts)[number]) => { - const id = post.id === 1 ? 'one' : 'two' - return ( - - {post.title} - - ) - })} - -
- ) - } - - function PostComponent() { - const params = useParams({ from: postRoute.fullPath }) - - const data = postRoute.useLoaderData() - - return ( -
-

Post Route

-
- Category_Param:{' '} - - {params.value.category} - -
-
- PostId_Param:{' '} - {params.value.postId} -
-
- PostId: {data.value.post.id} -
-
- Title:{' '} - {data.value.post.title} -
-
- Category:{' '} - - {data.value.post.category} - -
-
- ) - } - window.history.replaceState({}, '', '/posts') const router = createRouter({ diff --git a/packages/vue-router/tests/utils.ts b/packages/vue-router/tests/utils.ts index be5d60819b..da96eb2d95 100644 --- a/packages/vue-router/tests/utils.ts +++ b/packages/vue-router/tests/utils.ts @@ -20,9 +20,11 @@ export function createTimer() { export const getIntersectionObserverMock = ({ observe, disconnect, + onCreate, }: { observe: Mock disconnect: Mock + onCreate?: (callback: IntersectionObserverCallback) => void }) => { return class IO implements IntersectionObserver { root: Document | Element | null @@ -33,6 +35,7 @@ export const getIntersectionObserverMock = ({ _cb: IntersectionObserverCallback, options?: IntersectionObserverInit, ) { + onCreate?.(_cb) this.root = options?.root ?? null this.rootMargin = options?.rootMargin ?? '0px' this.scrollMargin = options?.scrollMargin ?? '0px' diff --git a/packages/vue-router/vite.config.ts b/packages/vue-router/vite.config.ts index 88949476fa..13928e0a1a 100644 --- a/packages/vue-router/vite.config.ts +++ b/packages/vue-router/vite.config.ts @@ -24,7 +24,7 @@ const config = defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, - setupFiles: ['./tests/setupTests.tsx'], + setupFiles: ['./tests/jest-dom.setup.ts', './tests/setupTests.tsx'], }, }) diff --git a/packages/vue-start-client/CHANGELOG.md b/packages/vue-start-client/CHANGELOG.md index 88d3855bbf..334da56ce7 100644 --- a/packages/vue-start-client/CHANGELOG.md +++ b/packages/vue-start-client/CHANGELOG.md @@ -1,5 +1,235 @@ # @tanstack/vue-start-client +## 1.167.45 + +### Patch Changes + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + - @tanstack/start-client-core@1.170.39 + - @tanstack/vue-router@1.170.42 + +## 1.167.44 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + - @tanstack/start-client-core@1.170.38 + - @tanstack/vue-router@1.170.41 + +## 1.167.43 + +### Patch Changes + +- Updated dependencies [[`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/router-core@1.171.37 + - @tanstack/start-client-core@1.170.37 + - @tanstack/vue-router@1.170.40 + +## 1.167.42 + +### Patch Changes + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`550f478`](https://github.com/TanStack/router/commit/550f47881070c0558a87e1acce7f38fbc85b9549), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + - @tanstack/start-client-core@1.170.36 + - @tanstack/vue-router@1.170.39 + +## 1.167.41 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/router-core@1.171.35 + - @tanstack/vue-router@1.170.38 + - @tanstack/start-client-core@1.170.35 + +## 1.167.40 + +### Patch Changes + +- Updated dependencies [[`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949), [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/vue-router@1.170.37 + - @tanstack/router-core@1.171.34 + - @tanstack/start-client-core@1.170.34 + +## 1.167.39 + +### Patch Changes + +- Updated dependencies [[`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676), [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2), [`76a7c0b`](https://github.com/TanStack/router/commit/76a7c0bfadb42d5f7fe7b9e1748acc7333178c91)]: + - @tanstack/vue-router@1.170.36 + - @tanstack/router-core@1.171.33 + - @tanstack/start-client-core@1.170.33 + +## 1.167.38 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + - @tanstack/start-client-core@1.170.32 + - @tanstack/vue-router@1.170.35 + +## 1.167.37 + +### Patch Changes + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + - @tanstack/vue-router@1.170.34 + - @tanstack/start-client-core@1.170.31 + +## 1.167.36 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`cb8749e`](https://github.com/TanStack/router/commit/cb8749e9fcd32d2290bf6c957b2701c3c0a14da5), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/vue-router@1.170.33 + - @tanstack/start-client-core@1.170.30 + +## 1.167.35 + +### Patch Changes + +- Updated dependencies [[`8c43c71`](https://github.com/TanStack/router/commit/8c43c712523fc63dc3a814f3a19617e270ce8ed1)]: + - @tanstack/vue-router@1.170.32 + +## 1.167.34 + +### Patch Changes + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/vue-router@1.170.31 + - @tanstack/start-client-core@1.170.29 + +## 1.167.33 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/vue-router@1.170.30 + - @tanstack/start-client-core@1.170.28 + +## 1.167.32 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + - @tanstack/vue-router@1.170.29 + - @tanstack/start-client-core@1.170.27 + +## 1.167.31 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + - @tanstack/start-client-core@1.170.26 + - @tanstack/vue-router@1.170.28 + +## 1.167.30 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + - @tanstack/vue-router@1.170.27 + - @tanstack/start-client-core@1.170.25 + +## 1.167.29 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + - @tanstack/vue-router@1.170.26 + - @tanstack/start-client-core@1.170.24 + +## 1.167.28 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90), [`3848503`](https://github.com/TanStack/router/commit/38485038c52ff898777cabeeeb2eaaa29c93f789)]: + - @tanstack/router-core@1.171.23 + - @tanstack/vue-router@1.170.25 + - @tanstack/start-client-core@1.170.23 + +## 1.167.27 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13), [`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3), [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1), [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e)]: + - @tanstack/router-core@1.171.22 + - @tanstack/vue-router@1.170.24 + - @tanstack/start-client-core@1.170.22 + +## 1.167.26 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + - @tanstack/start-client-core@1.170.21 + - @tanstack/vue-router@1.170.23 + +## 1.167.25 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`c59788c`](https://github.com/TanStack/router/commit/c59788ca20f2d2e7f264a859ebe01b7646ba3154), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + - @tanstack/start-client-core@1.170.20 + - @tanstack/vue-router@1.170.22 + +## 1.167.24 + +### Patch Changes + +- Updated dependencies [[`2fbc99f`](https://github.com/TanStack/router/commit/2fbc99f2c262b057cb957e6ebba1ee073c655186), [`6bede65`](https://github.com/TanStack/router/commit/6bede65d7074dcd83455151b66b4574268bc782c)]: + - @tanstack/start-client-core@1.170.19 + +## 1.167.23 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + - @tanstack/start-client-core@1.170.18 + - @tanstack/vue-router@1.170.21 + +## 1.167.22 + +### Patch Changes + +- Updated dependencies [[`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf), [`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/vue-router@1.170.20 + - @tanstack/router-core@1.171.18 + - @tanstack/start-client-core@1.170.17 + +## 1.167.21 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + - @tanstack/start-client-core@1.170.16 + - @tanstack/vue-router@1.170.19 + +## 1.167.20 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/vue-router@1.170.18 + - @tanstack/start-client-core@1.170.15 + ## 1.167.19 ### Patch Changes diff --git a/packages/vue-start-client/package.json b/packages/vue-start-client/package.json index 53427881ac..74b8016924 100644 --- a/packages/vue-start-client/package.json +++ b/packages/vue-start-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-start-client", - "version": "1.167.19", + "version": "1.167.45", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -30,12 +30,12 @@ "test:unit:dev": "vitest --watch", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -64,9 +64,15 @@ "@tanstack/start-client-core": "workspace:*" }, "devDependencies": { - "@vitejs/plugin-vue-jsx": "^4.1.2", + "@vitejs/plugin-vue-jsx": "catalog:", "vite": "*", - "vue": "^3.5.25" + "vue": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "vue": "^3.3.0" diff --git a/packages/vue-start-client/src/hydrateStart.test.ts b/packages/vue-start-client/src/hydrateStart.test.ts new file mode 100644 index 0000000000..c338122c6c --- /dev/null +++ b/packages/vue-start-client/src/hydrateStart.test.ts @@ -0,0 +1,23 @@ +import { afterEach, expect, test, vi } from 'vitest' +import { hydrateStart } from './hydrateStart' + +const coreHydrateStart = vi.hoisted(() => vi.fn()) + +vi.mock('@tanstack/start-client-core/client', () => ({ + hydrateStart: coreHydrateStart, +})) + +afterEach(() => { + delete window.$_TSR + coreHydrateStart.mockReset() +}) + +test('signals streaming cleanup without hiding a hydration failure', async () => { + const error = new Error('hydration failed') + coreHydrateStart.mockRejectedValue(error) + const hydrated = vi.fn() + window.$_TSR = { h: hydrated } as any + + await expect(hydrateStart()).rejects.toBe(error) + expect(hydrated).toHaveBeenCalledTimes(1) +}) diff --git a/packages/vue-start-client/src/hydrateStart.ts b/packages/vue-start-client/src/hydrateStart.ts index b9e4860b57..7a90e6d27c 100644 --- a/packages/vue-start-client/src/hydrateStart.ts +++ b/packages/vue-start-client/src/hydrateStart.ts @@ -89,9 +89,15 @@ export function configureHydrationSuppressions( * suppression for routes with ssr: false or ssr: 'data-only' before returning */ export async function hydrateStart(): Promise { - const router = await coreHydrateStart() - // Install console suppression before app.mount() is called - // This catches the "Hydration completed but contains mismatches" error - suppressSsrHydrationMismatches(router) - return router + try { + const router = await coreHydrateStart() + // Install console suppression before app.mount() is called + // This catches the "Hydration completed but contains mismatches" error + suppressSsrHydrationMismatches(router) + return router + } catch (error) { + // A failed router hydration never mounts StartClient, so release the stream here. + window.$_TSR?.h() + throw error + } } diff --git a/packages/vue-start-server/CHANGELOG.md b/packages/vue-start-server/CHANGELOG.md index 90583544fd..0963c82fe8 100644 --- a/packages/vue-start-server/CHANGELOG.md +++ b/packages/vue-start-server/CHANGELOG.md @@ -1,5 +1,278 @@ # @tanstack/vue-start-server +## 1.167.50 + +### Patch Changes + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c)]: + - @tanstack/router-core@1.171.39 + - @tanstack/start-server-core@1.169.45 + - @tanstack/vue-router@1.170.42 + +## 1.167.49 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/router-core@1.171.38 + - @tanstack/start-server-core@1.169.44 + - @tanstack/vue-router@1.170.41 + +## 1.167.48 + +### Patch Changes + +- Updated dependencies [[`71d9694`](https://github.com/TanStack/router/commit/71d9694da6346fbece2cda4ecde92b0b12a7ee08)]: + - @tanstack/start-server-core@1.169.43 + +## 1.167.47 + +### Patch Changes + +- Updated dependencies [[`740b0ce`](https://github.com/TanStack/router/commit/740b0ce17737d1f7398740136acdbeabe80df7d8), [`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/start-server-core@1.169.42 + - @tanstack/router-core@1.171.37 + - @tanstack/vue-router@1.170.40 + +## 1.167.46 + +### Patch Changes + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Remove the built-in `useSession` API. Applications choose a session library, such as iron-session, and save or destroy sessions explicitly before returning or redirecting. Connect a cookie adapter through `getCookie` and `setCookie`, or append serialized cookies with `appendResponseHeader('set-cookie', cookie)`. Existing session cookies require a deliberate migration or signing in again with a new cookie name. + + `createServerEntry` keeps the complete callback, including custom error handling, inside the request context and converts errors that escape it. The built-in entry still converts errors automatically. Raw `createStartHandler` handlers now rethrow the original error. For custom reporting, catch inside `createServerEntry`, then rethrow for default conversion or return `handleStartError(error)` to preserve response-helper status, headers, and cookies. Return an explicit `Response` when choosing a custom error payload. + + Response helpers now apply consistently across server routes, SSR, server functions, redirects, errors, and middleware response replacements. Helper setters override returned values; cookie helpers preserve independent cookies and replace matching cookie identities. Use `appendResponseHeader('set-cookie', cookie)` when adding a serialized cookie without replacing other cookies. Changed responses receive copied headers and reuse the body stream, so applications should inspect the response returned by Start rather than relying on mutation of the original response. + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5)]: + - @tanstack/router-core@1.171.36 + - @tanstack/start-server-core@1.169.41 + - @tanstack/vue-router@1.170.39 + +## 1.167.45 + +### Patch Changes + +- Updated dependencies [[`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`dfe3dea`](https://github.com/TanStack/router/commit/dfe3dea88a28400db1677111e2b15ae7914782c2), [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`663282b`](https://github.com/TanStack/router/commit/663282b0ebbc494aee3595ed95867ee29d01938e)]: + - @tanstack/router-core@1.171.35 + - @tanstack/vue-router@1.170.38 + - @tanstack/start-server-core@1.169.40 + +## 1.167.44 + +### Patch Changes + +- Updated dependencies [[`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949), [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/vue-router@1.170.37 + - @tanstack/router-core@1.171.34 + - @tanstack/start-server-core@1.169.39 + +## 1.167.43 + +### Patch Changes + +- Updated dependencies [[`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676), [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`e81845f`](https://github.com/TanStack/router/commit/e81845ff1e4fc66d4e4a87f086be65906f7adb94), [`0c1b5e3`](https://github.com/TanStack/router/commit/0c1b5e38de71b7e81bbf1fd81c73ee0cd68ffe47), [`3cdd1af`](https://github.com/TanStack/router/commit/3cdd1af04b3e2d6f777797ee7bddf285318dd9d2)]: + - @tanstack/vue-router@1.170.36 + - @tanstack/router-core@1.171.33 + - @tanstack/start-server-core@1.169.38 + +## 1.167.42 + +### Patch Changes + +- Updated dependencies [[`cecae54`](https://github.com/TanStack/router/commit/cecae5440b8edaea77c5448fe3d74bbd20fe10a4), [`0103578`](https://github.com/TanStack/router/commit/01035782e53af9b929c784b94ddd64b95efb89c7), [`ce10dcd`](https://github.com/TanStack/router/commit/ce10dcd4d9d3d23738744e453205aad5c6dbd716), [`84936cc`](https://github.com/TanStack/router/commit/84936cc04530bba11059c57b293a794922bbc5aa), [`bbd2336`](https://github.com/TanStack/router/commit/bbd2336b8446de3f7dd85070895e7cf43980183e)]: + - @tanstack/router-core@1.171.32 + - @tanstack/start-server-core@1.169.37 + - @tanstack/vue-router@1.170.35 + +## 1.167.41 + +### Patch Changes + +- [#8204](https://github.com/TanStack/router/pull/8204) [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26) - Stream large deferred SSR hydration payloads through a backpressure-aware router transport, fail known setup errors before response creation, and close cancelled or expired transforms safely. + + Start now cancels discarded middleware and HEAD response bodies, including plain streams and derived branches. + + Server-function raw streams share one ordered response. Arbitrary or sequential consumption can require potentially unbounded buffering of unread data on the client. Cancelling one raw stream discards it locally, while aborting the whole call cancels the response and server work. Consume streams concurrently, cancel unused streams promptly, or use separate calls when independent backpressure is required. A raw stream that exceeds its unread-byte limit now fails alone; sibling streams and the JSON result keep flowing. + + The JSON wire shape of a `RawStream` server-function argument changed. Clients and servers must run matching versions for requests that pass a `RawStream`. + + The frame-protocol constants (`FRAME_TYPE_*`, `MAX_FRAME_PAYLOAD_SIZE`, `MAX_FRAMED_STREAMS`) moved from the `@tanstack/start-client-core` root to the `@tanstack/start-client-core/client-rpc` subpath. + + Router requests whose `Accept` header allows neither `text/html` nor `*/*` now receive `406 Not Acceptable` instead of `500`. + + Framework adapters share the body `` composition (`getSsrBodyScriptParts`, `composeSsrBodyScripts`) and the eager HTML response wrapper (`renderSsrHtmlResponse`) from `@tanstack/router-core`. + + Solid SSR now emits one document type and renders late lazy errors through route boundaries. A Solid `` without a `fallback` no longer holds the streamed shell; it renders inside the nearest `` boundary like React and Vue, and now renders falsy resolved values. + + Static server functions decode cached `RawStream` values with the client deserializer plugins. + + SSR Query integrations now keep request cleanup and stream ownership aligned with the router lifecycle. + +- Updated dependencies [[`bc80866`](https://github.com/TanStack/router/commit/bc80866f6d6eb3e6f152ee3682eb783c96403e83), [`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a0b2ad9`](https://github.com/TanStack/router/commit/a0b2ad99aee64af08d16b0e4ff26b3ba42a99f0a), [`1ca361b`](https://github.com/TanStack/router/commit/1ca361ba52a627d2f76ab33323bd83d1d0aa65a3)]: + - @tanstack/router-core@1.171.31 + - @tanstack/vue-router@1.170.34 + - @tanstack/start-server-core@1.169.36 + +## 1.167.40 + +### Patch Changes + +- Updated dependencies [[`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`b747fb8`](https://github.com/TanStack/router/commit/b747fb8891b3347b1ffdfe0fa81e7d15049cb776), [`6cfb1e8`](https://github.com/TanStack/router/commit/6cfb1e8b564be282584765352250bf61747895ed), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`cb8749e`](https://github.com/TanStack/router/commit/cb8749e9fcd32d2290bf6c957b2701c3c0a14da5), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`873c830`](https://github.com/TanStack/router/commit/873c830ccb2610a864ee697250e10fcc99772ffa), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`f151ab0`](https://github.com/TanStack/router/commit/f151ab018eede64ae849b77e68f3cdf31cb95cc5), [`bc57fa3`](https://github.com/TanStack/router/commit/bc57fa3f12450cf34c731450947c7c8f1ea05e58), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`d76a332`](https://github.com/TanStack/router/commit/d76a33284bc0668f7af4c972a6d32bd0f42b22a6), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`7e349c3`](https://github.com/TanStack/router/commit/7e349c3071ef7a346698d320fc0989998ad55734), [`9448caa`](https://github.com/TanStack/router/commit/9448caa03a89076b9770631c356c0cc502802c09), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`700a714`](https://github.com/TanStack/router/commit/700a714c5fb64199b4edfaa3273d230c9894e274), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef)]: + - @tanstack/router-core@1.171.30 + - @tanstack/vue-router@1.170.33 + - @tanstack/start-server-core@1.169.35 + +## 1.167.39 + +### Patch Changes + +- Updated dependencies [[`8c43c71`](https://github.com/TanStack/router/commit/8c43c712523fc63dc3a814f3a19617e270ce8ed1), [`d914b08`](https://github.com/TanStack/router/commit/d914b085bb4bf29ec18a531201e377c10681b661)]: + - @tanstack/vue-router@1.170.32 + - @tanstack/start-server-core@1.169.34 + +## 1.167.38 + +### Patch Changes + +- Updated dependencies [[`f9836f1`](https://github.com/TanStack/router/commit/f9836f16f0e25b0a8495f5e01e3f303b1cbc8725), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`9871c06`](https://github.com/TanStack/router/commit/9871c0625806001d6bf373524821a00303438a91), [`0654c0a`](https://github.com/TanStack/router/commit/0654c0a1a427db24d9af13c1d6ad1217a588c0c9)]: + - @tanstack/router-core@1.171.29 + - @tanstack/vue-router@1.170.31 + - @tanstack/start-server-core@1.169.33 + +## 1.167.37 + +### Patch Changes + +- Updated dependencies [[`edf0e16`](https://github.com/TanStack/router/commit/edf0e16ebfe82ec6e8f68f403a1fda8de9e28889), [`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`08eff50`](https://github.com/TanStack/router/commit/08eff50c447a154a3373909009e9e4375cea17ce), [`216c0c4`](https://github.com/TanStack/router/commit/216c0c48036fd1a33163b70dcabfed2b893808b0), [`2f91503`](https://github.com/TanStack/router/commit/2f9150309bc472f4a75cbe98adcdb50c76b12c7a), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`50eafca`](https://github.com/TanStack/router/commit/50eafcaebbbedb6fde3b2816de7a0ace8cde4832), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5), [`ee28348`](https://github.com/TanStack/router/commit/ee283480dfa51150a2e0b096a6eff94a89ff8b3f), [`c18e690`](https://github.com/TanStack/router/commit/c18e69081475a7c98f9d40bd0fe6da78ccb84598)]: + - @tanstack/router-core@1.171.28 + - @tanstack/vue-router@1.170.30 + - @tanstack/start-server-core@1.169.32 + +## 1.167.36 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b)]: + - @tanstack/router-core@1.171.27 + - @tanstack/vue-router@1.170.29 + - @tanstack/start-server-core@1.169.31 + +## 1.167.35 + +### Patch Changes + +- Updated dependencies [[`3e016ac`](https://github.com/TanStack/router/commit/3e016ac84ffec8119f0c25cfdd1fb17e5292bd34)]: + - @tanstack/router-core@1.171.26 + - @tanstack/start-server-core@1.169.30 + - @tanstack/vue-router@1.170.28 + +## 1.167.34 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175), [`63d2cc9`](https://github.com/TanStack/router/commit/63d2cc9155ff5374112f7d067d0b278bafeb8486)]: + - @tanstack/router-core@1.171.25 + - @tanstack/vue-router@1.170.27 + - @tanstack/start-server-core@1.169.29 + +## 1.167.33 + +### Patch Changes + +- Updated dependencies [[`4c89b15`](https://github.com/TanStack/router/commit/4c89b15dd2b46491ee5e57985559bae8e31d62c2), [`cf6ab17`](https://github.com/TanStack/router/commit/cf6ab178b39e7628bf784759f384e0f4230e6d9e), [`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720), [`bdaf73a`](https://github.com/TanStack/router/commit/bdaf73a4063ee2b02e3c9cc105ad10ce82a5a0ff)]: + - @tanstack/router-core@1.171.24 + - @tanstack/vue-router@1.170.26 + - @tanstack/start-server-core@1.169.28 + +## 1.167.32 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90), [`3848503`](https://github.com/TanStack/router/commit/38485038c52ff898777cabeeeb2eaaa29c93f789)]: + - @tanstack/router-core@1.171.23 + - @tanstack/vue-router@1.170.25 + - @tanstack/start-server-core@1.169.27 + +## 1.167.31 + +### Patch Changes + +- Updated dependencies [[`7e93431`](https://github.com/TanStack/router/commit/7e93431ae9ff58c91c3c5ca10ffcb8414c1d0b13), [`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3), [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1), [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e)]: + - @tanstack/router-core@1.171.22 + - @tanstack/vue-router@1.170.24 + - @tanstack/start-server-core@1.169.26 + +## 1.167.30 + +### Patch Changes + +- Updated dependencies [[`51138a8`](https://github.com/TanStack/router/commit/51138a824cea053738f125c4c95073bd6286ff05)]: + - @tanstack/router-core@1.171.21 + - @tanstack/start-server-core@1.169.25 + - @tanstack/vue-router@1.170.23 + +## 1.167.29 + +### Patch Changes + +- Updated dependencies [[`44a8c3e`](https://github.com/TanStack/router/commit/44a8c3e1d2af305064b2363d97fc7847c6f1a246), [`5253e70`](https://github.com/TanStack/router/commit/5253e70db2083d68a788fb7c9a043bb0c5518f2a)]: + - @tanstack/router-core@1.171.20 + - @tanstack/start-server-core@1.169.24 + - @tanstack/vue-router@1.170.22 + +## 1.167.28 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-server-core@1.169.23 + +## 1.167.27 + +### Patch Changes + +- Updated dependencies [[`ea3a665`](https://github.com/TanStack/router/commit/ea3a665d81cbb5074c2d77ec953255ab534e7db9)]: + - @tanstack/router-core@1.171.19 + - @tanstack/start-server-core@1.169.22 + - @tanstack/vue-router@1.170.21 + +## 1.167.26 + +### Patch Changes + +- Updated dependencies [[`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf), [`84db4a8`](https://github.com/TanStack/router/commit/84db4a842311df3f7e58073f6f12aaf371aeb5c7), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/vue-router@1.170.20 + - @tanstack/router-core@1.171.18 + - @tanstack/start-server-core@1.169.21 + +## 1.167.25 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/router-core@1.171.17 + - @tanstack/start-server-core@1.169.20 + - @tanstack/vue-router@1.170.19 + +## 1.167.24 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/router-core@1.171.16 + - @tanstack/vue-router@1.170.18 + - @tanstack/start-server-core@1.169.19 + +## 1.167.23 + +### Patch Changes + +- [#7944](https://github.com/TanStack/router/pull/7944) [`65f7b7f`](https://github.com/TanStack/router/commit/65f7b7f791272f2ea581a1fe0fcd43183bc01162) - Use focused server entrypoints for shared constants and handler helpers so build tooling and framework renderers do not traverse the full Start server barrel. + +- Updated dependencies [[`65f7b7f`](https://github.com/TanStack/router/commit/65f7b7f791272f2ea581a1fe0fcd43183bc01162)]: + - @tanstack/start-server-core@1.169.18 + ## 1.167.22 ### Patch Changes diff --git a/packages/vue-start-server/package.json b/packages/vue-start-server/package.json index 9d83a25178..4fc4c1c9fd 100644 --- a/packages/vue-start-server/package.json +++ b/packages/vue-start-server/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-start-server", - "version": "1.167.22", + "version": "1.167.50", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -29,12 +29,12 @@ "test:unit": "exit 0; vitest", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -63,10 +63,17 @@ "@tanstack/start-server-core": "workspace:*" }, "devDependencies": { - "@vitejs/plugin-vue-jsx": "^4.1.2", - "typescript": "^6.0.2", + "@vitejs/plugin-vue-jsx": "catalog:", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "*", - "vue": "^3.5.25" + "vue": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "vue": "^3.3.0" diff --git a/packages/vue-start-server/src/defaultRenderHandler.tsx b/packages/vue-start-server/src/defaultRenderHandler.tsx index 69fa83d8ac..1e31e6e97e 100644 --- a/packages/vue-start-server/src/defaultRenderHandler.tsx +++ b/packages/vue-start-server/src/defaultRenderHandler.tsx @@ -1,5 +1,7 @@ -import { defineHandlerCallback } from '@tanstack/start-server-core' -import { renderRouterToString } from '@tanstack/vue-router/ssr/server' +import { + defineHandlerCallback, + renderRouterToString, +} from '@tanstack/vue-router/ssr/server' import { StartServer } from './StartServer' export const defaultRenderHandler = defineHandlerCallback( diff --git a/packages/vue-start-server/src/defaultStreamHandler.tsx b/packages/vue-start-server/src/defaultStreamHandler.tsx index 94106eee85..c02aeb8c6c 100644 --- a/packages/vue-start-server/src/defaultStreamHandler.tsx +++ b/packages/vue-start-server/src/defaultStreamHandler.tsx @@ -1,10 +1,12 @@ -import { defineHandlerCallback } from '@tanstack/start-server-core' -import { renderRouterToStream } from '@tanstack/vue-router/ssr/server' +import { + defineHandlerCallback, + renderRouterToStream, +} from '@tanstack/vue-router/ssr/server' import { StartServer } from './StartServer' export const defaultStreamHandler = defineHandlerCallback( - async ({ request, router, responseHeaders }) => - await renderRouterToStream({ + ({ request, router, responseHeaders }) => + renderRouterToStream({ request, router, responseHeaders, diff --git a/packages/vue-start/CHANGELOG.md b/packages/vue-start/CHANGELOG.md index dd4a7e7233..2e781d8694 100644 --- a/packages/vue-start/CHANGELOG.md +++ b/packages/vue-start/CHANGELOG.md @@ -1,5 +1,390 @@ # @tanstack/vue-start +## 1.169.6 + +### Patch Changes + +- Updated dependencies [[`3f22686`](https://github.com/TanStack/router/commit/3f226869e0af211ff7f1de5d7343e43462dbb101), [`559c7de`](https://github.com/TanStack/router/commit/559c7ded6e2a6eeda3f91c80d8c03f4cfeb9a206)]: + - @tanstack/start-plugin-core@1.171.57 + +## 1.169.5 + +### Patch Changes + +- [#8863](https://github.com/TanStack/router/pull/8863) [`01fab5a`](https://github.com/TanStack/router/commit/01fab5a6c8aed70d61d82c64bc344cbac66c240c) - The Rsbuild plugin keeps the app's `server.compress` setting instead of always setting it to `false`. Compression stays off by default: a compressed streamed page reaches the browser only once the stream ends. The optional `@rsbuild/core` peer is now `^2.0.5`, the first version whose compression keeps SSR response headers intact. + +- [#8869](https://github.com/TanStack/router/pull/8869) [`d05c6c6`](https://github.com/TanStack/router/commit/d05c6c66e7efc659286f37a56b3b1d4d267139e7) - Vite dev: Vue Start pre-bundles `@tanstack/vue-router > @tanstack/vue-store`, as React Start does for `@tanstack/react-store`. The first page load on a cold dependency cache no longer re-optimizes `vue` and reloads the page. + +- Updated dependencies [[`01fab5a`](https://github.com/TanStack/router/commit/01fab5a6c8aed70d61d82c64bc344cbac66c240c), [`c5320d7`](https://github.com/TanStack/router/commit/c5320d7ca23eca82d720ac5629d2bad5cf7d9b02), [`545a8d3`](https://github.com/TanStack/router/commit/545a8d3790989ca502153c3292c6b1e8063257f4), [`da8c28c`](https://github.com/TanStack/router/commit/da8c28c498230a5730ce75b2693baeeb3ef68ac1)]: + - @tanstack/start-plugin-core@1.171.56 + +## 1.169.4 + +### Patch Changes + +- [#8670](https://github.com/TanStack/router/pull/8670) [`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c) - Reference agent skills in other packages by their `intent load` identifier (`@tanstack/#`) instead of relative file links that break once packages are installed. + +- Updated dependencies [[`32a3360`](https://github.com/TanStack/router/commit/32a3360cba0e0f884b3215813a48c63467f5a53c), [`ed55775`](https://github.com/TanStack/router/commit/ed5577593a749b8c7193cc7b5d945fd084bfac2f), [`63a886d`](https://github.com/TanStack/router/commit/63a886da9040c4b039ea3bf5b3a841771375cddb), [`d9b07e8`](https://github.com/TanStack/router/commit/d9b07e8d3b724cdbfac0aa2fba4c1f7a3a241100)]: + - @tanstack/start-client-core@1.170.39 + - @tanstack/start-server-core@1.169.45 + - @tanstack/vue-router@1.170.42 + - @tanstack/start-plugin-core@1.171.55 + - @tanstack/vue-start-client@1.167.45 + - @tanstack/vue-start-server@1.167.50 + +## 1.169.3 + +### Patch Changes + +- Updated dependencies [[`18154b1`](https://github.com/TanStack/router/commit/18154b1c45454a70aa77e9d6d27c8a6e0733d031)]: + - @tanstack/start-server-core@1.169.44 + - @tanstack/start-client-core@1.170.38 + - @tanstack/start-plugin-core@1.171.54 + - @tanstack/vue-router@1.170.41 + - @tanstack/vue-start-client@1.167.44 + - @tanstack/vue-start-server@1.167.49 + +## 1.169.2 + +### Patch Changes + +- Updated dependencies [[`71d9694`](https://github.com/TanStack/router/commit/71d9694da6346fbece2cda4ecde92b0b12a7ee08), [`fdc10fa`](https://github.com/TanStack/router/commit/fdc10fa13fbac758615f9a3d37075088d1cc1e1f)]: + - @tanstack/start-server-core@1.169.43 + - @tanstack/start-plugin-core@1.171.53 + - @tanstack/vue-start-server@1.167.48 + +## 1.169.1 + +### Patch Changes + +- Updated dependencies [[`740b0ce`](https://github.com/TanStack/router/commit/740b0ce17737d1f7398740136acdbeabe80df7d8), [`d6ba115`](https://github.com/TanStack/router/commit/d6ba115d5751c75e20943f0062577cf17b446d82)]: + - @tanstack/start-server-core@1.169.42 + - @tanstack/start-plugin-core@1.171.52 + - @tanstack/vue-start-server@1.167.47 + - @tanstack/start-client-core@1.170.37 + - @tanstack/vue-router@1.170.40 + - @tanstack/vue-start-client@1.167.43 + +## 1.169.0 + +### Minor Changes + +- [#8696](https://github.com/TanStack/router/pull/8696) [`f243c61`](https://github.com/TanStack/router/commit/f243c61e95dae64fe04da4499c0c4ec44f26abae) - TanStack Start is stable. To upgrade from a release candidate, follow [Migrate from the Release Candidate](https://tanstack.com/start/latest/docs/framework/react/migrate-from-release-candidate). + +### Patch Changes + +- [#8694](https://github.com/TanStack/router/pull/8694) [`550f478`](https://github.com/TanStack/router/commit/550f47881070c0558a87e1acce7f38fbc85b9549) - Remove the deprecated `.inputValidator()` from `createServerFn` and `createMiddleware`. Use `.validator()`, which takes the same validator. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Keep streaming a page when request middleware returns a response that reads the page body, such as a copy made through a wrapped global `Response`, a copy in Bun, or a body piped through a transform. Start now disposes a replaced page stream only when nothing reads it. `transferResponseBodyOwnership` is removed: return the derived response directly. + +- [#7588](https://github.com/TanStack/router/pull/7588) [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5) - Remove the built-in `useSession` API. Applications choose a session library, such as iron-session, and save or destroy sessions explicitly before returning or redirecting. Connect a cookie adapter through `getCookie` and `setCookie`, or append serialized cookies with `appendResponseHeader('set-cookie', cookie)`. Existing session cookies require a deliberate migration or signing in again with a new cookie name. + + `createServerEntry` keeps the complete callback, including custom error handling, inside the request context and converts errors that escape it. The built-in entry still converts errors automatically. Raw `createStartHandler` handlers now rethrow the original error. For custom reporting, catch inside `createServerEntry`, then rethrow for default conversion or return `handleStartError(error)` to preserve response-helper status, headers, and cookies. Return an explicit `Response` when choosing a custom error payload. + + Response helpers now apply consistently across server routes, SSR, server functions, redirects, errors, and middleware response replacements. Helper setters override returned values; cookie helpers preserve independent cookies and replace matching cookie identities. Use `appendResponseHeader('set-cookie', cookie)` when adding a serialized cookie without replacing other cookies. Changed responses receive copied headers and reuse the body stream, so applications should inspect the response returned by Start rather than relying on mutation of the original response. + +- [#8696](https://github.com/TanStack/router/pull/8696) [`f243c61`](https://github.com/TanStack/router/commit/f243c61e95dae64fe04da4499c0c4ec44f26abae) - Require Vite 8 for Vite builds. Vite 7 is no longer supported. + +- Updated dependencies [[`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`550f478`](https://github.com/TanStack/router/commit/550f47881070c0558a87e1acce7f38fbc85b9549), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`f3d7ee3`](https://github.com/TanStack/router/commit/f3d7ee3374c660e0fe82a03ac580a90ed2e2fa98), [`4104b8e`](https://github.com/TanStack/router/commit/4104b8ef11498706b5059c5a915f2ae47ffbc5ba), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`94d6d8e`](https://github.com/TanStack/router/commit/94d6d8e49694e225cb07e2a6777633d08aeeb3c5), [`f243c61`](https://github.com/TanStack/router/commit/f243c61e95dae64fe04da4499c0c4ec44f26abae), [`19524cc`](https://github.com/TanStack/router/commit/19524ccdd75870ce1db2f324518eeb3f23cc0f97)]: + - @tanstack/start-server-core@1.169.41 + - @tanstack/start-client-core@1.170.36 + - @tanstack/start-plugin-core@1.171.51 + - @tanstack/vue-start-server@1.167.46 + - @tanstack/vue-router@1.170.39 + - @tanstack/vue-start-client@1.167.42 + +## 1.168.57 + +### Patch Changes + +- Updated dependencies [[`4191640`](https://github.com/TanStack/router/commit/41916400b93fdb62189722266ed1d77ba9c26be9), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb), [`d35aab4`](https://github.com/TanStack/router/commit/d35aab425b07b46e222a507c0f0239644669757b), [`efc2042`](https://github.com/TanStack/router/commit/efc2042c2d02a9780c3e7efe81f123d066a869eb)]: + - @tanstack/start-plugin-core@1.171.50 + - @tanstack/vue-router@1.170.38 + - @tanstack/start-server-core@1.169.40 + - @tanstack/start-client-core@1.170.35 + - @tanstack/vue-start-client@1.167.41 + - @tanstack/vue-start-server@1.167.45 + +## 1.168.56 + +### Patch Changes + +- Updated dependencies [[`41ebd28`](https://github.com/TanStack/router/commit/41ebd288677beacb8eb56953f5f8c26e9d33313e), [`614bc27`](https://github.com/TanStack/router/commit/614bc27034c8ec98747bf305ed41d4a619640949), [`05223c2`](https://github.com/TanStack/router/commit/05223c2ada4d48af4b3881f10e3b6261898b2d40), [`d521abd`](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)]: + - @tanstack/start-plugin-core@1.171.49 + - @tanstack/vue-router@1.170.37 + - @tanstack/start-server-core@1.169.39 + - @tanstack/vue-start-client@1.167.40 + - @tanstack/vue-start-server@1.167.44 + - @tanstack/start-client-core@1.170.34 + +## 1.168.55 + +### Patch Changes + +- Updated dependencies [[`f5ffd38`](https://github.com/TanStack/router/commit/f5ffd3884ba26778a2a8ce53b379a5bded231676), [`488d046`](https://github.com/TanStack/router/commit/488d046a907d330429e2c807ef95326dad87480f), [`e81845f`](https://github.com/TanStack/router/commit/e81845ff1e4fc66d4e4a87f086be65906f7adb94), [`76a7c0b`](https://github.com/TanStack/router/commit/76a7c0bfadb42d5f7fe7b9e1748acc7333178c91)]: + - @tanstack/vue-router@1.170.36 + - @tanstack/start-client-core@1.170.33 + - @tanstack/start-server-core@1.169.38 + - @tanstack/start-plugin-core@1.171.48 + - @tanstack/vue-start-client@1.167.39 + - @tanstack/vue-start-server@1.167.43 + +## 1.168.54 + +### Patch Changes + +- Updated dependencies [[`222300b`](https://github.com/TanStack/router/commit/222300b82fe6f2a5e7e7f460ae21a2e35c6230d7)]: + - @tanstack/start-plugin-core@1.171.47 + +## 1.168.53 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.32 + - @tanstack/start-plugin-core@1.171.46 + - @tanstack/start-server-core@1.169.37 + - @tanstack/vue-router@1.170.35 + - @tanstack/vue-start-client@1.167.38 + - @tanstack/vue-start-server@1.167.42 + +## 1.168.52 + +### Patch Changes + +- Updated dependencies [[`e561fa1`](https://github.com/TanStack/router/commit/e561fa1d7118e3d29267cc3b6ce1130d6581f387), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26), [`a1c8d1a`](https://github.com/TanStack/router/commit/a1c8d1aa759c227eae9601a030321ac4c53c24bd), [`cbbfbe3`](https://github.com/TanStack/router/commit/cbbfbe37ab1dbe328c343cb437c5660769cc9f26)]: + - @tanstack/vue-router@1.170.34 + - @tanstack/start-plugin-core@1.171.45 + - @tanstack/start-client-core@1.170.31 + - @tanstack/start-server-core@1.169.36 + - @tanstack/vue-start-server@1.167.41 + - @tanstack/vue-start-client@1.167.37 + +## 1.168.51 + +### Patch Changes + +- Updated dependencies [[`ab99818`](https://github.com/TanStack/router/commit/ab99818225835a1553a9f3513cd2093ff1b257be)]: + - @tanstack/start-plugin-core@1.171.44 + +## 1.168.50 + +### Patch Changes + +- Updated dependencies [[`cb8749e`](https://github.com/TanStack/router/commit/cb8749e9fcd32d2290bf6c957b2701c3c0a14da5), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8), [`634da91`](https://github.com/TanStack/router/commit/634da9176e16fa8aa49af459bbb054fcae7d85ef), [`e9396c9`](https://github.com/TanStack/router/commit/e9396c928945d1dd6fd3f3bd8052143794f688b5), [`9872d2a`](https://github.com/TanStack/router/commit/9872d2ac39fc05f4ef6566c0b421f71ceb115244), [`9b2adaf`](https://github.com/TanStack/router/commit/9b2adaf8c3fca905f156c42f6a4fe17a787afcc8)]: + - @tanstack/vue-router@1.170.33 + - @tanstack/start-server-core@1.169.35 + - @tanstack/start-client-core@1.170.30 + - @tanstack/start-plugin-core@1.171.43 + - @tanstack/vue-start-client@1.167.36 + - @tanstack/vue-start-server@1.167.40 + +## 1.168.49 + +### Patch Changes + +- Updated dependencies [[`8c43c71`](https://github.com/TanStack/router/commit/8c43c712523fc63dc3a814f3a19617e270ce8ed1), [`d914b08`](https://github.com/TanStack/router/commit/d914b085bb4bf29ec18a531201e377c10681b661)]: + - @tanstack/vue-router@1.170.32 + - @tanstack/start-server-core@1.169.34 + - @tanstack/vue-start-client@1.167.35 + - @tanstack/vue-start-server@1.167.39 + - @tanstack/start-plugin-core@1.171.42 + +## 1.168.48 + +### Patch Changes + +- Updated dependencies [[`49bcd4d`](https://github.com/TanStack/router/commit/49bcd4db743dba4a783d5533a42a0f97a5721292), [`9c1871c`](https://github.com/TanStack/router/commit/9c1871ccc88bc1157186b8b460941a304ec740b8), [`919c397`](https://github.com/TanStack/router/commit/919c3971493374cccc963e75b9b2a4e98ebf878a)]: + - @tanstack/start-plugin-core@1.171.41 + - @tanstack/vue-router@1.170.31 + - @tanstack/start-server-core@1.169.33 + - @tanstack/start-client-core@1.170.29 + - @tanstack/vue-start-client@1.167.34 + - @tanstack/vue-start-server@1.167.38 + +## 1.168.47 + +### Patch Changes + +- Updated dependencies [[`2f20c00`](https://github.com/TanStack/router/commit/2f20c00224c5ba63467551914e0c37012588c4c2), [`28a5e45`](https://github.com/TanStack/router/commit/28a5e4504e4ea5cb1480667a4bea2588a53e110f), [`f0b5eda`](https://github.com/TanStack/router/commit/f0b5eda544606686a8a8d675a686ca1366428b96), [`37877da`](https://github.com/TanStack/router/commit/37877da166fe4ce055c7b85e138b6681ebd7e8b4), [`0497cae`](https://github.com/TanStack/router/commit/0497caeef3ff7e1c1c6080eca38bca24e7ec320b), [`0caf6b9`](https://github.com/TanStack/router/commit/0caf6b9a2b7e14b0b146c74cc27cb05c19d700a5)]: + - @tanstack/vue-router@1.170.30 + - @tanstack/start-plugin-core@1.171.40 + - @tanstack/start-client-core@1.170.28 + - @tanstack/start-server-core@1.169.32 + - @tanstack/vue-start-client@1.167.33 + - @tanstack/vue-start-server@1.167.37 + +## 1.168.46 + +### Patch Changes + +- Updated dependencies [[`fa65287`](https://github.com/TanStack/router/commit/fa652872812c9433ba8b9d9a285e51b535e7367c), [`cb281d7`](https://github.com/TanStack/router/commit/cb281d70c1f5fe780f9d07bc500ea3a284a4e04b), [`a0041bb`](https://github.com/TanStack/router/commit/a0041bb36e700b3263b894e4d1573d924383b56b)]: + - @tanstack/vue-router@1.170.29 + - @tanstack/start-plugin-core@1.171.39 + - @tanstack/start-client-core@1.170.27 + - @tanstack/start-server-core@1.169.31 + - @tanstack/vue-start-client@1.167.32 + - @tanstack/vue-start-server@1.167.36 + +## 1.168.45 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.26 + - @tanstack/start-plugin-core@1.171.38 + - @tanstack/start-server-core@1.169.30 + - @tanstack/vue-router@1.170.28 + - @tanstack/vue-start-client@1.167.31 + - @tanstack/vue-start-server@1.167.35 + +## 1.168.44 + +### Patch Changes + +- Updated dependencies [[`5d3785d`](https://github.com/TanStack/router/commit/5d3785dcc366b66b1c261b5d01e66af778ff1175)]: + - @tanstack/vue-router@1.170.27 + - @tanstack/start-client-core@1.170.25 + - @tanstack/start-plugin-core@1.171.37 + - @tanstack/start-server-core@1.169.29 + - @tanstack/vue-start-client@1.167.30 + - @tanstack/vue-start-server@1.167.34 + +## 1.168.43 + +### Patch Changes + +- Updated dependencies [[`0fdf9ff`](https://github.com/TanStack/router/commit/0fdf9ff16fc532de9fc131d18df167ebd8038720)]: + - @tanstack/vue-router@1.170.26 + - @tanstack/start-client-core@1.170.24 + - @tanstack/start-plugin-core@1.171.36 + - @tanstack/start-server-core@1.169.28 + - @tanstack/vue-start-client@1.167.29 + - @tanstack/vue-start-server@1.167.33 + +## 1.168.42 + +### Patch Changes + +- Updated dependencies [[`31882c7`](https://github.com/TanStack/router/commit/31882c7fa87debef236228831655cb112c20ce90), [`3848503`](https://github.com/TanStack/router/commit/38485038c52ff898777cabeeeb2eaaa29c93f789)]: + - @tanstack/vue-router@1.170.25 + - @tanstack/start-client-core@1.170.23 + - @tanstack/start-plugin-core@1.171.35 + - @tanstack/start-server-core@1.169.27 + - @tanstack/vue-start-client@1.167.28 + - @tanstack/vue-start-server@1.167.32 + +## 1.168.41 + +### Patch Changes + +- Updated dependencies [[`f500760`](https://github.com/TanStack/router/commit/f5007607d62e932b8df19de866cdc6bddcff8db3), [`1aafca9`](https://github.com/TanStack/router/commit/1aafca9b45d24f8f0dba78e716fc9582346c6ca1), [`aa10b65`](https://github.com/TanStack/router/commit/aa10b6589eeda215f5a60ea0af95a3101d8c414e)]: + - @tanstack/vue-router@1.170.24 + - @tanstack/start-client-core@1.170.22 + - @tanstack/start-plugin-core@1.171.34 + - @tanstack/start-server-core@1.169.26 + - @tanstack/vue-start-client@1.167.27 + - @tanstack/vue-start-server@1.167.31 + +## 1.168.40 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.21 + - @tanstack/start-plugin-core@1.171.33 + - @tanstack/start-server-core@1.169.25 + - @tanstack/vue-router@1.170.23 + - @tanstack/vue-start-client@1.167.26 + - @tanstack/vue-start-server@1.167.30 + +## 1.168.39 + +### Patch Changes + +- Updated dependencies [[`c59788c`](https://github.com/TanStack/router/commit/c59788ca20f2d2e7f264a859ebe01b7646ba3154)]: + - @tanstack/start-client-core@1.170.20 + - @tanstack/start-plugin-core@1.171.32 + - @tanstack/start-server-core@1.169.24 + - @tanstack/vue-router@1.170.22 + - @tanstack/vue-start-client@1.167.25 + - @tanstack/vue-start-server@1.167.29 + +## 1.168.38 + +### Patch Changes + +- Updated dependencies [[`2fbc99f`](https://github.com/TanStack/router/commit/2fbc99f2c262b057cb957e6ebba1ee073c655186), [`6bede65`](https://github.com/TanStack/router/commit/6bede65d7074dcd83455151b66b4574268bc782c)]: + - @tanstack/start-client-core@1.170.19 + - @tanstack/start-server-core@1.169.23 + - @tanstack/vue-start-client@1.167.24 + - @tanstack/start-plugin-core@1.171.31 + - @tanstack/vue-start-server@1.167.28 + +## 1.168.37 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/start-client-core@1.170.18 + - @tanstack/start-plugin-core@1.171.30 + - @tanstack/start-server-core@1.169.22 + - @tanstack/vue-router@1.170.21 + - @tanstack/vue-start-client@1.167.23 + - @tanstack/vue-start-server@1.167.27 + +## 1.168.36 + +### Patch Changes + +- Updated dependencies [[`2435885`](https://github.com/TanStack/router/commit/2435885fa8b5e31c8c4b74d93920919f27316ebf), [`9cac62a`](https://github.com/TanStack/router/commit/9cac62a5c7f99ef070991ea6f1fa7e42c746d46b), [`86bf510`](https://github.com/TanStack/router/commit/86bf510c2923afb76804223bd04afc2a809b33e7), [`6aefb33`](https://github.com/TanStack/router/commit/6aefb3392595a07a93f89301d7b5e3558ff9190c)]: + - @tanstack/vue-router@1.170.20 + - @tanstack/start-client-core@1.170.17 + - @tanstack/start-server-core@1.169.21 + - @tanstack/vue-start-client@1.167.22 + - @tanstack/vue-start-server@1.167.26 + - @tanstack/start-plugin-core@1.171.29 + +## 1.168.35 + +### Patch Changes + +- Updated dependencies [[`b2908c6`](https://github.com/TanStack/router/commit/b2908c642ac09aa08e6d965d2a820d7186e42fd5)]: + - @tanstack/start-client-core@1.170.16 + - @tanstack/start-plugin-core@1.171.28 + - @tanstack/start-server-core@1.169.20 + - @tanstack/vue-router@1.170.19 + - @tanstack/vue-start-client@1.167.21 + - @tanstack/vue-start-server@1.167.25 + +## 1.168.34 + +### Patch Changes + +- Updated dependencies [[`45c4ad8`](https://github.com/TanStack/router/commit/45c4ad8d629e291fab70c37900525449e415ffcd)]: + - @tanstack/vue-router@1.170.18 + - @tanstack/start-client-core@1.170.15 + - @tanstack/start-plugin-core@1.171.27 + - @tanstack/start-server-core@1.169.19 + - @tanstack/vue-start-client@1.167.20 + - @tanstack/vue-start-server@1.167.24 + +## 1.168.33 + +### Patch Changes + +- Updated dependencies [[`65f7b7f`](https://github.com/TanStack/router/commit/65f7b7f791272f2ea581a1fe0fcd43183bc01162)]: + - @tanstack/start-server-core@1.169.18 + - @tanstack/start-plugin-core@1.171.26 + - @tanstack/vue-start-server@1.167.23 + +## 1.168.32 + +### Patch Changes + +- Updated dependencies [[`7592555`](https://github.com/TanStack/router/commit/7592555b86c968efbc8c817ac0cf6fdae60aabe0)]: + - @tanstack/start-plugin-core@1.171.25 + ## 1.168.31 ### Patch Changes diff --git a/packages/vue-start/package.json b/packages/vue-start/package.json index 9c9c59b245..bf6b79e636 100644 --- a/packages/vue-start/package.json +++ b/packages/vue-start/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-start", - "version": "1.168.31", + "version": "1.169.6", "description": "Modern and scalable routing for Vue applications", "author": "Tanner Linsley", "license": "MIT", @@ -118,19 +118,25 @@ "@tanstack/vue-router": "workspace:*", "@tanstack/vue-start-client": "workspace:*", "@tanstack/vue-start-server": "workspace:*", - "pathe": "^2.0.3" + "pathe": "catalog:" }, "devDependencies": { - "@rsbuild/core": "^2.0.11", + "@rsbuild/core": "catalog:", "@tanstack/router-utils": "workspace:*", "@types/node": ">=20", - "@vitejs/plugin-vue-jsx": "^4.1.2", + "@vitejs/plugin-vue-jsx": "catalog:", "vite": "*", - "vue": "^3.5.25" + "vue": "catalog:", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { - "@rsbuild/core": "^2.0.0", - "vite": ">=7.0.0", + "@rsbuild/core": "^2.0.5", + "vite": ">=8.0.0", "vue": "^3.3.0" }, "peerDependenciesMeta": { diff --git a/packages/vue-start/skills/vue-start/SKILL.md b/packages/vue-start/skills/vue-start/SKILL.md index 13fac52d1b..3a32dc169a 100644 --- a/packages/vue-start/skills/vue-start/SKILL.md +++ b/packages/vue-start/skills/vue-start/SKILL.md @@ -5,10 +5,11 @@ description: >- Vite plugin, StartClient, StartServer, Vue-specific setup, re-exports from @tanstack/start-client-core. Full project setup with Vue. -type: framework -library: tanstack-start -library_version: '1.166.2' -framework: vue +metadata: + type: framework + library: tanstack-start + library_version: '1.166.2' + framework: vue requires: - start-core sources: @@ -17,7 +18,7 @@ sources: # Vue Start (`@tanstack/vue-start`) -This skill builds on start-core. Read [start-core](../../../start-client-core/skills/start-core/SKILL.md) first for foundational concepts. +This skill builds on start-core. Read `@tanstack/start-client-core#start-core` first for foundational concepts. This skill covers the Vue-specific bindings, setup, and patterns for TanStack Start. @@ -35,7 +36,7 @@ This skill covers the Vue-specific bindings, setup, and patterns for TanStack St All core APIs (`createServerFn`, `createMiddleware`, `createStart`, `createIsomorphicFn`, `createServerOnlyFn`, `createClientOnlyFn`) are available from `@tanstack/vue-start`. -Server utilities (`getRequest`, `getRequestHeader`, `setResponseHeader`, `setCookie`, `getCookie`, `useSession`) are imported from `@tanstack/vue-start/server`. +Server utilities (`getRequest`, `getRequestHeader`, `setResponseHeader`, `setCookie`, `getCookie`) are imported from `@tanstack/vue-start/server`. ## Full Project Setup @@ -150,20 +151,23 @@ function RootComponent() { ```tsx import { createFileRoute } from '@tanstack/vue-router' import { createServerFn } from '@tanstack/vue-start' +import { defineComponent } from 'vue' const getGreeting = createServerFn({ method: 'GET' }).handler(async () => { return 'Hello from TanStack Start!' }) +const HomePage = defineComponent({ + setup() { + const greeting = Route.useLoaderData() + return () =>

{greeting.value}

+ }, +}) + export const Route = createFileRoute('/')({ loader: () => getGreeting(), component: HomePage, }) - -function HomePage() { - const greeting = Route.useLoaderData() - return

{greeting.value}

-} ``` ## useServerFn Composable @@ -299,6 +303,6 @@ function RootComponent() { ## Cross-References -- [start-core](../../../start-client-core/skills/start-core/SKILL.md) — core Start concepts -- [router-core](../../../router-core/skills/router-core/SKILL.md) — routing fundamentals -- [vue-router](../../../vue-router/skills/vue-router/SKILL.md) — Vue Router composables and components +- `@tanstack/start-client-core#start-core` — core Start concepts +- `@tanstack/router-core#router-core` — routing fundamentals +- `@tanstack/vue-router#vue-router` — Vue Router composables and components diff --git a/packages/vue-start/src/default-entry/server.ts b/packages/vue-start/src/default-entry/server.ts index 5729a469d3..c716a7ac14 100644 --- a/packages/vue-start/src/default-entry/server.ts +++ b/packages/vue-start/src/default-entry/server.ts @@ -1,6 +1,7 @@ import { createStartHandler, defaultStreamHandler, + createServerEntry as createCoreServerEntry, } from '@tanstack/vue-start/server' import type { Register } from '@tanstack/vue-router' import type { RequestHandler } from '@tanstack/vue-start/server' @@ -10,12 +11,8 @@ const fetch = createStartHandler(defaultStreamHandler) // Providing `RequestHandler` from `@tanstack/vue-start/server` is required so that the output types don't import it from `@tanstack/start-server-core` export type ServerEntry = { fetch: RequestHandler } -export function createServerEntry(entry: ServerEntry): ServerEntry { - return { - async fetch(...args) { - return await entry.fetch(...args) - }, - } -} +// Bind the shared request context and fallback error handling to Vue's Register. +export const createServerEntry: (entry: ServerEntry) => ServerEntry = + createCoreServerEntry export default createServerEntry({ fetch }) diff --git a/packages/vue-start/src/plugin/vite.ts b/packages/vue-start/src/plugin/vite.ts index 4af970a088..d257ce7256 100644 --- a/packages/vue-start/src/plugin/vite.ts +++ b/packages/vue-start/src/plugin/vite.ts @@ -39,6 +39,14 @@ export function tanstackStart( '@tanstack/vue-router', '@tanstack/start-static-server-functions', ], + include: [ + // `@tanstack/vue-router` is excluded, so the scanner never + // sees its `@tanstack/vue-store` import; discovered while + // crawling, it imports `vue` and re-chunks the already + // optimized `vue`, which forces a full page reload on + // every cold start (and loses an in-flight page load). + '@tanstack/vue-router > @tanstack/vue-store', + ], } : undefined, } diff --git a/packages/zod-adapter/package.json b/packages/zod-adapter/package.json index d2c3a19efa..0f2c330d0c 100644 --- a/packages/zod-adapter/package.json +++ b/packages/zod-adapter/package.json @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js", "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js", "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", - "test:types:ts60": "tsc", + "test:types:ts60": "tsc6", + "test:types:ts70": "tsc", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --typecheck", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", @@ -64,13 +64,21 @@ "node": ">=20.19" }, "devDependencies": { - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.2.0", + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", "@tanstack/react-router": "workspace:*", "zod": "^3.24.2", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "vite": "*" + "react": "catalog:", + "react-dom": "catalog:", + "vite": "*", + "@tanstack/vite-config": "catalog:", + "vitest": "catalog:", + "jsdom": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@arethetypeswrong/cli": "catalog:", + "publint": "catalog:", + "rimraf": "catalog:" }, "peerDependencies": { "zod": "^3.23.8", diff --git a/packages/zod-adapter/tests/index.test.tsx b/packages/zod-adapter/tests/index.test.tsx index d59ec207fc..36abe0f239 100644 --- a/packages/zod-adapter/tests/index.test.tsx +++ b/packages/zod-adapter/tests/index.test.tsx @@ -9,7 +9,6 @@ import { RouterProvider, } from '@tanstack/react-router' import { cleanup, fireEvent, render, screen } from '@testing-library/react' -import '@testing-library/jest-dom/vitest' afterEach(() => { vi.resetAllMocks() diff --git a/packages/zod-adapter/tests/jest-dom.setup.ts b/packages/zod-adapter/tests/jest-dom.setup.ts new file mode 100644 index 0000000000..8f7cbf15be --- /dev/null +++ b/packages/zod-adapter/tests/jest-dom.setup.ts @@ -0,0 +1,18 @@ +import * as jestDomMatchers from '@testing-library/jest-dom/matchers' +import { expect } from 'vitest' +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers' + +// Workaround for Vitest 5: remove once testing-library/jest-dom#742 is merged +// and released, and go back to `import '@testing-library/jest-dom/vitest'`. +// That entry imports `vitest` from its own install location, which can resolve +// a different Vitest copy than the one running these tests, and its types +// augment Vitest 4's `Assertion` instead of Vitest 5's `Matchers`. +// Keep `jest-dom` in this file name: vite-plugin-solid only skips injecting +// `@testing-library/jest-dom/vitest` when a setup file path contains it. +expect.extend(jestDomMatchers) + +declare module 'vitest' { + // Type parameter names must match Vitest's declaration for the interfaces to merge. + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Matchers extends TestingLibraryMatchers {} +} diff --git a/packages/zod-adapter/vite.config.ts b/packages/zod-adapter/vite.config.ts index 8c8c0c519f..8d553e0a59 100644 --- a/packages/zod-adapter/vite.config.ts +++ b/packages/zod-adapter/vite.config.ts @@ -9,6 +9,7 @@ const config = defineConfig({ watch: false, environment: 'jsdom', typecheck: { enabled: true }, + setupFiles: ['./tests/jest-dom.setup.ts'], }, }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffa17b9543..4328f4fab6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,34 +1,264 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + pnpm: + specifier: 12.18.0 + version: 12.18.0 + +packages: + + '@pnpm/exe.android-arm64@12.18.0': + resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==} + cpu: [arm64] + os: [android] + + '@pnpm/exe.android-x64@12.18.0': + resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==} + cpu: [x64] + os: [android] + + '@pnpm/exe.darwin-arm64@12.18.0': + resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==} + cpu: [arm64] + os: [darwin] + + '@pnpm/exe.darwin-x64@12.18.0': + resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==} + cpu: [x64] + os: [darwin] + + '@pnpm/exe.freebsd-x64@12.18.0': + resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==} + cpu: [x64] + os: [freebsd] + + '@pnpm/exe.linux-arm64-musl@12.18.0': + resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-arm64@12.18.0': + resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-ppc64@12.18.0': + resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-riscv64@12.18.0': + resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-s390x@12.18.0': + resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-x64-musl@12.18.0': + resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-x64@12.18.0': + resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.win32-arm64@12.18.0': + resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==} + cpu: [arm64] + os: [win32] + + '@pnpm/exe.win32-x64@12.18.0': + resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==} + cpu: [x64] + os: [win32] + + pnpm@12.18.0: + resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==} + engines: {node: '>=18'} + hasBin: true + +snapshots: + + '@pnpm/exe.android-arm64@12.18.0': + optional: true + + '@pnpm/exe.android-x64@12.18.0': + optional: true + + '@pnpm/exe.darwin-arm64@12.18.0': + optional: true + + '@pnpm/exe.darwin-x64@12.18.0': + optional: true + + '@pnpm/exe.freebsd-x64@12.18.0': + optional: true + + '@pnpm/exe.linux-arm64-musl@12.18.0': + optional: true + + '@pnpm/exe.linux-arm64@12.18.0': + optional: true + + '@pnpm/exe.linux-ppc64@12.18.0': + optional: true + + '@pnpm/exe.linux-riscv64@12.18.0': + optional: true + + '@pnpm/exe.linux-s390x@12.18.0': + optional: true + + '@pnpm/exe.linux-x64-musl@12.18.0': + optional: true + + '@pnpm/exe.linux-x64@12.18.0': + optional: true + + '@pnpm/exe.win32-arm64@12.18.0': + optional: true + + '@pnpm/exe.win32-x64@12.18.0': + optional: true + + pnpm@12.18.0: + optionalDependencies: + '@pnpm/exe.android-arm64': 12.18.0 + '@pnpm/exe.android-x64': 12.18.0 + '@pnpm/exe.darwin-arm64': 12.18.0 + '@pnpm/exe.darwin-x64': 12.18.0 + '@pnpm/exe.freebsd-x64': 12.18.0 + '@pnpm/exe.linux-arm64': 12.18.0 + '@pnpm/exe.linux-arm64-musl': 12.18.0 + '@pnpm/exe.linux-ppc64': 12.18.0 + '@pnpm/exe.linux-riscv64': 12.18.0 + '@pnpm/exe.linux-s390x': 12.18.0 + '@pnpm/exe.linux-x64': 12.18.0 + '@pnpm/exe.linux-x64-musl': 12.18.0 + '@pnpm/exe.win32-arm64': 12.18.0 + '@pnpm/exe.win32-x64': 12.18.0 + +--- lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false +catalogs: + default: + '@arethetypeswrong/cli': + specifier: ^0.18.4 + version: 0.18.4 + '@babel/core': + specifier: ^7.29.7 + version: 7.29.7 + '@babel/types': + specifier: ^7.29.8 + version: 7.29.8 + '@eslint-react/eslint-plugin': + specifier: ^1.26.2 + version: 1.26.2 + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@tanstack/vite-config': + specifier: 0.5.2 + version: 0.5.2 + '@testing-library/jest-dom': + specifier: ^7.0.1 + version: 7.0.1 + '@testing-library/react': + specifier: ^16.2.0 + version: 16.3.0 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1 + '@vitejs/plugin-vue-jsx': + specifier: ^4.1.2 + version: 4.2.0 + '@vitest/ui': + specifier: ^5.0.4 + version: 5.0.4 + chokidar: + specifier: ^5.0.0 + version: 5.0.0 + combinate: + specifier: ^1.1.11 + version: 1.1.11 + eslint-plugin-react-hooks: + specifier: ^5.1.0 + version: 5.1.0 + isbot: + specifier: ^5.1.22 + version: 5.1.28 + jsdom: + specifier: ^25.0.1 + version: 25.0.1 + pathe: + specifier: ^2.0.3 + version: 2.0.3 + publint: + specifier: ^0.3.16 + version: 0.3.17 + redaxios: + specifier: ^0.5.1 + version: 0.5.1 + rimraf: + specifier: ^6.1.2 + version: 6.1.2 + tinyglobby: + specifier: ^0.2.17 + version: 0.2.17 + vite-plugin-solid: + specifier: 2.11.10 + version: 2.11.10 + vitest: + specifier: ^5.0.4 + version: 5.0.4 + vue: + specifier: ^3.5.25 + version: 3.5.25 + zod: + specifier: ^4.5.4 + version: 4.5.4 + overrides: - tanstack-start-example-nativescript>vite: 7.3.6 - '@nativescript/vite@2.0.3>vite': 7.3.6 - nativescript@9.0.6>axios: 1.18.1 - nativescript@9.0.6>simple-git: 3.36.0 - wait-on@9.0.10>axios: 1.18.1 '@types/babel__traverse': ^7.28.0 vite-plugin-dts: 4.2.3 solid-js: 1.9.12 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 eslint: ^9.22.0 - vite: ^8.0.14 + vite: ^8.3.4 '@types/node': 25.0.9 - '@playwright/test': ^1.61.0 - '@tanstack/query-core': ^5.99.0 - '@tanstack/react-query': ^5.99.0 - '@tanstack/solid-query': ^5.99.0 - '@tanstack/vue-query': ^5.99.0 + '@playwright/test': ^1.63.0 + '@tanstack/query-core': ^5.102.0 + '@tanstack/react-query': ^5.102.0 + '@tanstack/solid-query': ^5.102.0 + '@tanstack/vue-query': ^5.102.0 '@tanstack/history': workspace:* '@tanstack/router-core': workspace:* '@tanstack/react-router': workspace:* - '@tanstack/react-nativescript-router': workspace:* '@tanstack/router-cli': workspace:* '@tanstack/router-devtools': workspace:* '@tanstack/router-devtools-core': workspace:^ @@ -64,114 +294,56 @@ overrides: '@tanstack/eslint-plugin-router': workspace:* '@tanstack/router-utils': workspace:* '@tanstack/start-static-server-functions': workspace:* - '@tanstack/nitro-v2-vite-plugin': workspace:* importers: .: devDependencies: - '@arethetypeswrong/cli': - specifier: ^0.18.4 - version: 0.18.4 '@changesets/changelog-github': specifier: ^0.7.0 version: 0.7.0 '@changesets/cli': specifier: ^2.30.0 version: 2.30.0(@types/node@25.0.9) - '@eslint-react/eslint-plugin': - specifier: ^1.26.2 - version: 1.26.2(eslint@9.22.0(jiti@2.7.0))(ts-api-utils@2.4.0(typescript@6.0.2))(typescript@6.0.2) '@nx/devkit': - specifier: 22.7.5 - version: 22.7.5(nx@22.7.5(@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))(debug@4.4.3)) + specifier: 24.0.0 + version: 24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 - '@swc-node/core': - specifier: ^1.14.1 - version: 1.14.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26) + specifier: ^1.63.0 + version: 1.63.0 '@swc-node/register': specifier: ^1.11.1 - version: 1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2) + version: 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@tanstack/eslint-config': specifier: 0.4.0 - version: 0.4.0(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@tanstack/query-core': - specifier: ^5.99.0 - version: 5.99.0 - '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) - '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) - '@tanstack/vite-config': - specifier: 0.5.2 - version: 0.5.2(@types/node@25.0.9)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + version: 0.4.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@types/node': specifier: 25.0.9 version: 25.0.9 - '@types/react': - specifier: ^19.2.8 - version: 19.2.9 - '@types/react-dom': - specifier: ^19.2.3 - version: 19.2.3(@types/react@19.2.9) - '@vitest/browser': - specifier: ^4.1.4 - version: 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4) - '@vitest/ui': - specifier: ^4.1.4 - version: 4.1.4(vitest@4.1.4) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0) - eslint-plugin-react-hooks: - specifier: ^5.1.0 - version: 5.1.0(eslint@9.22.0(jiti@2.7.0)) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-unused-imports: specifier: ^4.1.4 - version: 4.1.4(@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0)) - jsdom: - specifier: ^25.0.1 - version: 25.0.1 + version: 4.1.4(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) markdown-link-extractor: specifier: ^4.0.3 version: 4.0.3 nx: - specifier: 22.7.5 - version: 22.7.5(@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))(debug@4.4.3) + specifier: 24.0.0 + version: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)) prettier: specifier: ^3.8.0 version: 3.8.1 - publint: - specifier: ^0.3.16 - version: 0.3.17 - react: - specifier: ^19.2.3 - version: 19.2.3 - react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) - redaxios: - specifier: ^0.5.1 - version: 0.5.1 - rimraf: - specifier: ^6.1.2 - version: 6.1.2 tinyglobby: specifier: ^0.2.15 version: 0.2.15 typescript: - specifier: ^6.0.2 - version: 6.0.2 - typescript55: - specifier: npm:typescript@5.5 - version: typescript@5.5.4 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' typescript56: specifier: npm:typescript@5.6 version: typescript@5.6.3 @@ -185,17 +357,20 @@ importers: specifier: npm:typescript@5.9 version: typescript@5.9.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@25.0.1)(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) benchmarks/bundle-size: dependencies: + '@tanstack/react-query': + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../packages/react-router + '@tanstack/react-router-ssr-query': + specifier: workspace:* + version: link:../../packages/react-router-ssr-query '@tanstack/react-start': specifier: workspace:* version: link:../../packages/react-start @@ -212,24 +387,24 @@ importers: specifier: workspace:* version: link:../../packages/vue-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) solid-js: specifier: 1.9.12 version: 1.9.12 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../packages/router-plugin @@ -239,27 +414,33 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/client-nav: dependencies: + '@tanstack/history': + specifier: workspace:* + version: link:../../packages/history '@tanstack/react-router': specifier: workspace:* version: link:../../packages/react-router @@ -273,21 +454,21 @@ importers: specifier: workspace:* version: link:../../packages/vue-router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) solid-js: specifier: 1.9.12 version: 1.9.12 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@codspeed/vitest-plugin': - specifier: ^5.5.0 - version: 5.5.0(debug@4.4.3)(tinybench@2.9.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4) + specifier: ^6.0.1 + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@platformatic/flame': specifier: ^1.6.0 version: 1.6.0 @@ -296,31 +477,43 @@ importers: version: link:../../packages/router-plugin '@testing-library/react': specifier: ^16.2.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/jsdom': specifier: 28.0.0 version: 28.0.0 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: ^29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/memory/client: dependencies: @@ -337,21 +530,21 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) solid-js: specifier: 1.9.12 version: 1.9.12 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@codspeed/vitest-plugin': - specifier: ^5.5.0 - version: 5.5.0(debug@4.4.3)(tinybench@2.9.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4) + specifier: ^6.0.1 + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@datadog/pprof': specifier: ^5.13.2 version: 5.13.2 @@ -360,34 +553,43 @@ importers: version: 1.6.0 '@testing-library/react': specifier: ^16.2.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/jsdom': specifier: 28.0.0 version: 28.0.0 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 29.1.1 version: 29.1.1(@noble/hashes@2.0.1) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/memory/server: dependencies: @@ -410,45 +612,54 @@ importers: specifier: workspace:* version: link:../../../packages/vue-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) solid-js: specifier: 1.9.12 version: 1.9.12 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@codspeed/vitest-plugin': - specifier: ^5.5.0 - version: 5.5.0(debug@4.4.3)(tinybench@2.9.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4) + specifier: ^6.0.1 + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@datadog/pprof': specifier: ^5.13.2 version: 5.13.2 '@platformatic/flame': specifier: ^1.6.0 version: 1.6.0 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/ssr: dependencies: @@ -471,54 +682,72 @@ importers: specifier: workspace:* version: link:../../packages/vue-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) solid-js: specifier: 1.9.12 version: 1.9.12 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@codspeed/vitest-plugin': - specifier: ^5.5.0 - version: 5.5.0(debug@4.4.3)(tinybench@2.9.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4) + specifier: ^6.0.1 + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) seroval: - specifier: ^1.5.4 - version: 1.5.4 + specifier: ^1.6.7 + version: 1.6.7 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/e2e-utils: devDependencies: - get-port-please: - specifier: ^3.2.0 - version: 3.2.0 + '@msw/playwright': + specifier: 0.6.7 + version: 0.6.7(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2)) + msw: + specifier: 2.15.0 + version: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/eslint-plugin-start: devDependencies: @@ -539,19 +768,19 @@ importers: version: 19.2.9 '@typescript-eslint/parser': specifier: ^8.23.0 - version: 8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) + version: 8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 typescript: specifier: ^5.7.2 version: 5.9.2 vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/react-router/basepath-file-based: dependencies: @@ -565,15 +794,15 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -585,16 +814,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -602,21 +831,24 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 + zod: + specifier: 'catalog:' + version: 4.5.4 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -628,10 +860,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-esbuild-file-based: dependencies: @@ -645,21 +877,21 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -677,7 +909,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -688,13 +920,13 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -704,8 +936,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -717,19 +949,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-file-based-code-splitting: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -740,11 +972,14 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + redaxios: + specifier: 'catalog:' + version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -753,8 +988,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -766,22 +1001,22 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -789,21 +1024,21 @@ importers: specifier: workspace:* version: link:../../../packages/router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -815,22 +1050,22 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -841,13 +1076,13 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -857,8 +1092,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -870,16 +1105,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -888,23 +1123,23 @@ importers: version: link:../../../packages/react-router-devtools '@tanstack/react-virtual': specifier: ^3.13.0 - version: 3.13.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 3.13.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -916,19 +1151,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: ~5.9.0 version: 5.9.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -942,13 +1177,13 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -958,8 +1193,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -971,16 +1206,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-virtual-named-export-config-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -994,13 +1229,13 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -1010,8 +1245,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1023,10 +1258,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/escaped-special-strings: dependencies: @@ -1037,15 +1272,15 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1057,16 +1292,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/generator-cli-only: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1077,21 +1312,21 @@ importers: specifier: workspace:* version: link:../../../packages/router-cli react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1103,25 +1338,25 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -1130,8 +1365,8 @@ importers: specifier: ^2.4.0 version: 2.4.0(babel-plugin-macros@3.1.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1147,21 +1382,126 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-router/issue-4759: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-router/issue-7120: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/router-plugin': + specifier: workspace:* + version: link:../../../packages/router-plugin + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-router/issue-7457: + dependencies: + '@tanstack/react-query': + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/router-plugin': + specifier: workspace:* + version: link:../../../packages/router-plugin + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/js-only-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1169,21 +1509,21 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1198,10 +1538,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/match-params: dependencies: @@ -1209,15 +1549,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1228,8 +1568,48 @@ importers: specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-router/react-compiler: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@babel/core': + specifier: ^7.29.0 + version: 7.29.0(supports-color@10.2.2) + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@rolldown/plugin-babel': + specifier: ^0.2.0 + version: 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + babel-plugin-react-compiler: + specifier: ^1.0.0 + version: 1.0.0 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/rspack-basic-file-based: dependencies: @@ -1240,24 +1620,24 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -1273,6 +1653,9 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.3 @@ -1280,8 +1663,8 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' e2e/react-router/rspack-basic-virtual-named-export-config-file-based: dependencies: @@ -1292,24 +1675,24 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -1328,6 +1711,9 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.3 @@ -1335,14 +1721,14 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' e2e/react-router/scroll-restoration-sandbox-vite: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1353,13 +1739,13 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -1369,8 +1755,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1382,25 +1768,25 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/sentry-integration: dependencies: '@sentry/react': specifier: ^10.32.0 - version: 10.32.0(react@19.2.3) + version: 10.32.0(react@19.2.9) '@sentry/tracing': specifier: ^7.120.4 version: 7.120.4 '@sentry/vite-plugin': specifier: ^4.6.1 - version: 4.6.1 + version: 4.6.1(supports-color@10.2.2) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1408,21 +1794,21 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1434,16 +1820,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1454,13 +1840,13 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -1470,8 +1856,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1481,15 +1867,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic: dependencies: @@ -1504,41 +1893,44 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) http-proxy-middleware: specifier: ^3.0.5 - version: 3.0.5 + version: 3.0.5(supports-color@10.2.2) + iron-session: + specifier: ^9.0.1 + version: 9.0.1 js-cookie: specifier: ^3.0.5 version: 3.0.5 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1554,24 +1946,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) zod: specifier: ^4.4.3 version: 4.4.3 @@ -1586,7 +1981,7 @@ importers: version: 7.0.0 '@prisma/client': specifier: ^7.0.0 - version: 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + version: 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1596,25 +1991,28 @@ importers: '@tanstack/react-start': specifier: workspace:* version: link:../../../packages/react-start + iron-session: + specifier: ^9.0.1 + version: 9.0.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1627,24 +2025,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) dotenv: specifier: ^17.2.3 version: 17.2.3 prisma: specifier: ^7.0.0 - version: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic-cloudflare: dependencies: @@ -1658,21 +2059,21 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1685,18 +2086,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -1704,11 +2108,11 @@ importers: e2e/react-start/basic-react-query: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1722,13 +2126,13 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -1738,11 +2142,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1755,21 +2159,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic-tsr-config: dependencies: @@ -1780,11 +2187,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tanstack/router-e2e-utils': specifier: workspace:^ @@ -1798,21 +2205,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + rimraf: + specifier: 'catalog:' + version: 6.1.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/clerk-basic: dependencies: '@clerk/tanstack-react-start': specifier: ^0.19.0 - version: 0.19.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 0.19.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1823,24 +2236,24 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1853,18 +2266,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/csp: dependencies: @@ -1875,15 +2291,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1896,15 +2312,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/css-inline: dependencies: @@ -1916,26 +2335,26 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1948,15 +2367,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/css-modules: dependencies: @@ -1967,18 +2389,27 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + '@rsbuild/plugin-sass': + specifier: ^2.0.1 + version: 2.0.1(@rsbuild/core@2.3.1) '@tanstack/router-e2e-utils': specifier: workspace:* version: link:../../e2e-utils @@ -1991,24 +2422,33 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + cf: + specifier: 1.0.0-beta.28 + version: 1.0.0-beta.28(@types/node@25.0.9) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta + rsbuild-plugin-cloudflare: + specifier: ^0.0.4 + version: 0.0.4(@rsbuild/core@2.3.1)(@types/node@25.0.9)(workerd@1.20261104.1) sass: specifier: ^1.97.2 version: 1.97.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -2026,23 +2466,23 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2058,15 +2498,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) cross-env: specifier: ^10.0.0 version: 10.0.0 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2074,11 +2517,11 @@ importers: specifier: ^4.20.3 version: 4.20.3 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/custom-server-rsbuild: dependencies: @@ -2090,23 +2533,23 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -2125,12 +2568,15 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 cross-env: specifier: ^10.0.0 version: 10.0.0 srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2138,8 +2584,8 @@ importers: specifier: ^4.20.3 version: 4.20.3 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' e2e/react-start/deferred-hydration: dependencies: @@ -2150,18 +2596,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2174,18 +2620,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/dev-ssr-styles: dependencies: @@ -2196,15 +2645,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-core': specifier: workspace:* version: link:../../../packages/router-core @@ -2220,21 +2669,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) zod: specifier: ^4.4.3 version: 4.4.3 @@ -2248,15 +2700,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2272,24 +2724,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) node-forge: specifier: ^1.3.1 version: 1.3.1 srvx: - specifier: 0.11.15 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 tsx: specifier: 4.20.3 version: 4.20.3 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/flamegraph-bench: dependencies: @@ -2300,21 +2755,24 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 devDependencies: '@platformatic/flame': specifier: latest version: 1.7.0 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) autocannon: specifier: ^8.0.0 version: 8.0.0 @@ -2322,14 +2780,14 @@ importers: specifier: 9.2.1 version: 9.2.1 nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/hmr: dependencies: @@ -2340,27 +2798,27 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2373,18 +2831,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/i18n-paraglide: dependencies: @@ -2398,21 +2859,21 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@inlang/paraglide-js': specifier: ^2.4.0 version: 2.4.0(babel-plugin-macros@3.1.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2425,18 +2886,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/import-protection: dependencies: @@ -2447,24 +2911,24 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) react-tweet: specifier: ^3.3.0 - version: 3.3.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 3.3.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2477,18 +2941,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/import-protection-custom-config: dependencies: @@ -2499,15 +2966,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2520,27 +2987,64 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/issue-8049: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/query-integration: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -2554,11 +3058,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwind-merge: specifier: ^3.6.0 version: 3.6.0 @@ -2567,11 +3071,63 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + tailwindcss: + specifier: ^4.2.2 + version: 4.2.2 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/response-reconciliation: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2586,16 +3142,105 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - tailwindcss: - specifier: ^4.2.2 - version: 4.2.2 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 typescript: specifier: ^6.0.2 version: 6.0.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/root-document-hydration: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:* + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/rsbuild: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: ^5.7.2 + version: 5.9.3 e2e/react-start/rsc: dependencies: @@ -2609,21 +3254,21 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/eslint-plugin-start': specifier: workspace:^ version: link:../../../packages/eslint-plugin-start @@ -2641,25 +3286,25 @@ importers: version: 19.2.3(@types/react@19.2.9) '@typescript-eslint/parser': specifier: ^8.23.0 - version: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) + version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': - specifier: ^0.5.20 - version: 0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^0.5.39 + version: 0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) srvx: - specifier: ^0.10.0 - version: 0.10.0 + specifier: ^1.0.0 + version: 1.0.5 typescript: specifier: ^5.7.2 version: 5.9.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-deferred-hydration: dependencies: @@ -2670,15 +3315,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2691,30 +3336,33 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': - specifier: ^0.5.20 - version: 0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^0.5.39 + version: 0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-query: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -2728,15 +3376,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2751,19 +3399,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': - specifier: ^0.5.20 - version: 0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^0.5.39 + version: 0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.10.0 - version: 0.10.0 + specifier: ^1.0.0 + version: 1.0.5 typescript: specifier: ^5.7.2 version: 5.9.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-rsbuild: dependencies: @@ -2774,21 +3422,21 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.8 - version: 2.0.8 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.8)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2802,8 +3450,8 @@ importers: specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) srvx: - specifier: ^0.10.0 - version: 0.10.1 + specifier: ^1.0.0 + version: 1.0.5 typescript: specifier: ^5.7.2 version: 5.9.3 @@ -2820,13 +3468,13 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -2836,11 +3484,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2853,24 +3501,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/selective-ssr: dependencies: @@ -2884,18 +3535,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2908,21 +3559,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/serialization-adapters: dependencies: @@ -2936,18 +3590,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2960,27 +3614,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-functions: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -2997,13 +3654,13 @@ importers: specifier: ^3.0.5 version: 3.0.5 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -3013,20 +3670,20 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3042,24 +3699,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-functions-global-middleware: dependencies: @@ -3070,18 +3730,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3094,27 +3754,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-routes: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -3131,13 +3794,13 @@ importers: specifier: ^3.0.5 version: 3.0.5 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -3147,11 +3810,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3167,24 +3830,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-routes-global-middleware: dependencies: @@ -3195,18 +3861,85 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + tailwindcss: + specifier: ^4.2.2 + version: 4.2.2 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/session-handling: + dependencies: + '@hono/session': + specifier: 0.2.1 + version: 0.2.1(hono@4.13.9) + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + hono: + specifier: 4.13.9 + version: 4.13.9 + hono-sessions: + specifier: 0.8.1 + version: 0.8.1(hono@4.13.9) + iron-session: + specifier: 9.0.1 + version: 9.0.1 + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3221,19 +3954,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 - tailwindcss: - specifier: ^4.2.2 - version: 4.2.2 + specifier: ^1.0.0 + version: 1.0.5 typescript: specifier: ^6.0.2 version: 6.0.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/spa-mode: dependencies: @@ -3247,15 +3977,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3268,15 +3998,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/split-base-and-basepath: dependencies: @@ -3288,17 +4021,17 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3311,18 +4044,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/start-manifest: dependencies: @@ -3333,15 +4069,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3354,18 +4090,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/static-server-functions: dependencies: @@ -3379,18 +4118,18 @@ importers: specifier: workspace:* version: link:../../../packages/start-static-server-functions nitro: - specifier: ^3.0.1-alpha.2 - version: 3.0.1-alpha.2(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(ioredis@5.9.2)(lru-cache@11.5.1)(mysql2@3.15.3)(rolldown@1.0.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:* version: link:../../e2e-utils @@ -3403,21 +4142,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/streaming-ssr: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -3428,15 +4170,15 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3449,15 +4191,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/transform-asset-urls: dependencies: @@ -3469,17 +4217,17 @@ importers: version: link:../../../packages/react-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3492,18 +4240,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/virtual-routes: dependencies: @@ -3520,13 +4271,13 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -3536,11 +4287,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3553,24 +4304,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/website: dependencies: @@ -3584,13 +4338,13 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 @@ -3600,11 +4354,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3617,21 +4371,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/solid-router/basepath-file-based: dependencies: @@ -3649,23 +4406,23 @@ importers: version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -3673,7 +4430,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3683,17 +4440,17 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-esbuild-file-based: dependencies: @@ -3707,7 +4464,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3717,8 +4474,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3727,13 +4484,13 @@ importers: version: 0.27.4 esbuild-plugin-solid: specifier: ^0.6.0 - version: 0.6.0(esbuild@0.27.4)(solid-js@1.9.12) + version: 0.6.0(esbuild@0.27.4)(solid-js@1.9.12)(supports-color@10.2.2) e2e/solid-router/basic-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -3744,7 +4501,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3757,8 +4514,8 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3766,17 +4523,17 @@ importers: specifier: ^1.1.11 version: 1.1.11 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-file-based-code-splitting: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -3786,6 +4543,9 @@ importers: '@tanstack/solid-router-devtools': specifier: workspace:^ version: link:../../../packages/solid-router-devtools + redaxios: + specifier: 'catalog:' + version: 0.5.1 solid-js: specifier: 1.9.12 version: 1.9.12 @@ -3797,23 +4557,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -3824,7 +4584,7 @@ importers: specifier: ^3.13.0 version: 3.13.12(solid-js@1.9.12) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3834,8 +4594,8 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3843,23 +4603,23 @@ importers: specifier: ~5.9.0 version: 5.9.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -3867,7 +4627,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3877,32 +4637,32 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -3910,7 +4670,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3923,23 +4683,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -3953,7 +4713,7 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -3966,23 +4726,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-virtual-named-export-config-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -3996,7 +4756,7 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4009,23 +4769,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/generator-cli-only: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-cli': specifier: workspace:* version: link:../../../packages/router-cli @@ -4036,7 +4796,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4046,23 +4806,23 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/js-only-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4070,7 +4830,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4080,8 +4840,8 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4089,11 +4849,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/rspack-basic-file-based: dependencies: @@ -4104,24 +4864,24 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.0)(@rsbuild/core@2.0.14)(solid-js@1.9.12) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -4131,6 +4891,9 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.3 @@ -4138,8 +4901,8 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' e2e/solid-router/rspack-basic-virtual-named-export-config-file-based: dependencies: @@ -4150,24 +4913,24 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7)(@rsbuild/core@2.0.14)(solid-js@1.9.12) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -4180,6 +4943,9 @@ importers: '@tanstack/virtual-file-routes': specifier: workspace:* version: link:../../../packages/virtual-file-routes + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.3 @@ -4187,14 +4953,14 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' e2e/solid-router/scroll-restoration-sandbox-vite: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4205,7 +4971,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4218,17 +4984,17 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/sentry-integration: dependencies: @@ -4240,10 +5006,10 @@ importers: version: 7.120.4 '@sentry/vite-plugin': specifier: ^4.6.1 - version: 4.6.1 + version: 4.6.1(supports-color@10.2.2) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4251,7 +5017,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4261,23 +5027,23 @@ importers: version: 4.2.2 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4288,7 +5054,7 @@ importers: specifier: workspace:^ version: link:../../../packages/solid-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4301,20 +5067,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic: dependencies: @@ -4329,15 +5098,15 @@ importers: version: link:../../../packages/solid-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) http-proxy-middleware: specifier: ^3.0.5 - version: 3.0.5 + version: 3.0.5(supports-color@10.2.2) js-cookie: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4350,23 +5119,23 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7)(@rsbuild/core@2.0.14)(solid-js@1.9.12) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4376,24 +5145,27 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-auth: dependencies: @@ -4405,7 +5177,7 @@ importers: version: 7.0.0 '@prisma/client': specifier: ^7.0.0 - version: 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + version: 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4415,8 +5187,11 @@ importers: '@tanstack/solid-start': specifier: workspace:* version: link:../../../packages/solid-start + iron-session: + specifier: ^9.0.1 + version: 9.0.1 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4426,38 +5201,41 @@ importers: version: 3.6.0 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 dotenv: specifier: ^17.2.3 version: 17.2.3 prisma: specifier: ^7.0.0 - version: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-cloudflare: dependencies: @@ -4476,31 +5254,34 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -4508,11 +5289,11 @@ importers: e2e/solid-start/basic-solid-query: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4526,7 +5307,7 @@ importers: specifier: workspace:* version: link:../../../packages/solid-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4539,32 +5320,35 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-tsr-config: dependencies: @@ -4587,18 +5371,24 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + rimraf: + specifier: 'catalog:' + version: 6.1.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/csp: dependencies: @@ -4613,26 +5403,29 @@ importers: version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/css-modules: dependencies: @@ -4647,29 +5440,32 @@ importers: version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:* version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 sass: specifier: ^1.97.2 version: 1.97.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/custom-basepath: dependencies: @@ -4684,20 +5480,20 @@ importers: version: link:../../../packages/solid-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4707,12 +5503,15 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 cross-env: specifier: ^10.0.0 version: 10.0.0 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -4720,14 +5519,14 @@ importers: specifier: ^4.20.3 version: 4.20.3 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/deferred-hydration: dependencies: @@ -4742,41 +5541,84 @@ importers: version: 1.9.12 devDependencies: '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7)(@rsbuild/core@2.0.14)(solid-js@1.9.12) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/solid-start/dev-ssr-styles: + dependencies: + '@tanstack/solid-router': + specifier: workspace:* + version: link:../../../packages/solid-router + '@tanstack/solid-start': + specifier: workspace:* + version: link:../../../packages/solid-start + solid-js: + specifier: 1.9.12 + version: 1.9.12 + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../packages/router-core + '@tanstack/router-e2e-utils': + specifier: workspace:* + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-solid: + specifier: ^2.11.11 + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/query-integration: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4800,29 +5642,32 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/scroll-restoration: dependencies: @@ -4836,7 +5681,7 @@ importers: specifier: workspace:* version: link:../../../packages/solid-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4849,35 +5694,38 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/selective-ssr: dependencies: @@ -4896,25 +5744,28 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/serialization-adapters: dependencies: @@ -4936,34 +5787,37 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/server-functions: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4980,7 +5834,7 @@ importers: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -4993,11 +5847,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5007,30 +5861,33 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/server-routes: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -5047,7 +5904,7 @@ importers: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -5060,11 +5917,11 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5074,30 +5931,33 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/solid-query-layout-suspense: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -5109,23 +5969,26 @@ importers: version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/spa-mode: dependencies: @@ -5147,22 +6010,25 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/start-manifest: dependencies: @@ -5177,26 +6043,72 @@ importers: version: 1.9.12 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/solid-start/streaming-ssr: + dependencies: + '@tanstack/solid-query': + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) + '@tanstack/solid-router': + specifier: workspace:^ + version: link:../../../packages/solid-router + '@tanstack/solid-router-ssr-query': + specifier: workspace:* + version: link:../../../packages/solid-router-ssr-query + '@tanstack/solid-start': + specifier: workspace:* + version: link:../../../packages/solid-start + solid-js: + specifier: 1.9.12 + version: 1.9.12 + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-solid: + specifier: ^2.11.11 + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/virtual-routes: dependencies: @@ -5213,7 +6125,7 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -5226,35 +6138,38 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/website: dependencies: @@ -5268,7 +6183,7 @@ importers: specifier: workspace:* version: link:../../../packages/solid-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 solid-js: specifier: 1.9.12 @@ -5281,47 +6196,50 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/vue-router/basepath-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5329,7 +6247,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5339,32 +6257,32 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5372,7 +6290,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5382,23 +6300,23 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-esbuild-file-based: dependencies: @@ -5415,11 +6333,11 @@ importers: specifier: ^8.5.1 version: 8.5.6 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 @@ -5428,41 +6346,44 @@ importers: specifier: ^9.36.0 version: 9.36.0 '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@typescript-eslint/eslint-plugin': specifier: ^8.44.1 - version: 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 8.44.1(@typescript-eslint/parser@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/parser': specifier: ^8.44.1 - version: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 esbuild: specifier: ^0.27.4 version: 0.27.4 esbuild-plugin-vue3: specifier: ^0.5.1 - version: 0.5.1(cheerio@1.0.0)(sass@1.97.2)(vue@3.5.25(typescript@6.0.2)) + version: 0.5.1(cheerio@1.0.0)(sass@1.97.2)(vue@3.5.25(@typescript/typescript6@6.0.2)) eslint-plugin-vue: specifier: ^9.33.0 - version: 9.33.0(eslint@9.22.0(jiti@2.7.0)) + version: 9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vue-eslint-parser: specifier: ^9.4.3 - version: 9.4.3(eslint@9.22.0(jiti@2.7.0)) + version: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) e2e/vue-router/basic-file-based-jsx: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -5473,7 +6394,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5489,44 +6410,44 @@ importers: specifier: ^9.36.0 version: 9.36.0 '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@typescript-eslint/eslint-plugin': specifier: ^8.44.1 - version: 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + version: 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@typescript-eslint/parser': specifier: ^8.44.1 - version: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) eslint-plugin-vue: specifier: ^9.33.0 - version: 9.33.0(eslint@9.22.0(jiti@2.7.0)) + version: 9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-eslint-parser: specifier: ^9.4.3 - version: 9.4.3(eslint@9.22.0(jiti@2.7.0)) + version: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-file-based-sfc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -5537,7 +6458,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5550,32 +6471,32 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5586,7 +6507,7 @@ importers: specifier: ^3.13.0 version: 3.13.13(vue@3.5.25(typescript@5.9.3)) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5596,32 +6517,32 @@ importers: version: 3.5.25(typescript@5.9.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) typescript: specifier: ~5.9.0 version: 5.9.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.9.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.9.3) e2e/vue-router/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -5629,11 +6550,11 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5641,7 +6562,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5651,32 +6572,32 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-virtual-named-export-config-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -5684,11 +6605,11 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5696,7 +6617,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5706,38 +6627,38 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-vue-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5745,7 +6666,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5755,41 +6676,41 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/basic-vue-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5797,7 +6718,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5810,32 +6731,32 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/generator-cli-only: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-cli': specifier: workspace:* version: link:../../../packages/router-cli @@ -5846,7 +6767,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5856,41 +6777,41 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/js-only-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@6.0.2)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -5898,7 +6819,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -5908,20 +6829,20 @@ importers: version: 3.5.25(typescript@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-router/rspack-basic-file-based: dependencies: @@ -5932,27 +6853,27 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-vue': specifier: ^1.2.7 - version: 1.2.7(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23))(vue@3.5.25(typescript@6.0.2)) + version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': specifier: ^2.0.0 - version: 2.0.0(@babel/core@7.29.0)(@rsbuild/core@2.0.14) + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -5965,6 +6886,9 @@ importers: '@tanstack/virtual-file-routes': specifier: workspace:* version: link:../../../packages/virtual-file-routes + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.6 @@ -5972,11 +6896,11 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) e2e/vue-router/rspack-basic-virtual-named-export-config-file-based: dependencies: @@ -5987,27 +6911,27 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-vue': specifier: ^1.2.7 - version: 1.2.7(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23))(vue@3.5.25(typescript@6.0.2)) + version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': specifier: ^2.0.0 - version: 2.0.0(@babel/core@7.29.7)(@rsbuild/core@2.0.14) + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -6020,6 +6944,9 @@ importers: '@tanstack/virtual-file-routes': specifier: workspace:* version: link:../../../packages/virtual-file-routes + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 postcss: specifier: ^8.5.1 version: 8.5.6 @@ -6027,17 +6954,17 @@ importers: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) e2e/vue-router/scroll-restoration-sandbox-vite: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6048,7 +6975,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -6061,26 +6988,26 @@ importers: version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/sentry-integration: dependencies: @@ -6089,13 +7016,13 @@ importers: version: 7.120.4 '@sentry/vite-plugin': specifier: ^4.6.1 - version: 4.6.1 + version: 4.6.1(supports-color@10.2.2) '@sentry/vue': specifier: ^10.32.0 version: 10.32.0(@tanstack/vue-router@packages+vue-router)(vue@3.5.25(typescript@5.8.3)) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6103,7 +7030,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -6113,38 +7040,38 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-router/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@5.8.3)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6152,7 +7079,7 @@ importers: specifier: workspace:* version: link:../../../packages/vue-router-devtools redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwindcss: specifier: ^4.2.2 @@ -6162,26 +7089,26 @@ importers: version: 3.5.25(typescript@5.8.3) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) e2e/vue-start/basic: dependencies: @@ -6196,47 +7123,47 @@ importers: version: link:../../../packages/vue-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) http-proxy-middleware: specifier: ^3.0.5 - version: 3.0.5 + version: 3.0.5(supports-color@10.2.2) js-cookie: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': - specifier: ^1.0.5 - version: 1.0.6(@rsbuild/core@2.0.14) + specifier: ^1.1.2 + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-vue': - specifier: ^1.2.2 - version: 1.2.2(@rsbuild/core@2.0.14)(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(vue@3.5.25(typescript@6.0.2)) + specifier: ^1.2.7 + version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': - specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.0)(@rsbuild/core@2.0.14) + specifier: ^2.0.0 + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6246,27 +7173,30 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-auth: dependencies: @@ -6278,7 +7208,7 @@ importers: version: 7.0.0 '@prisma/client': specifier: ^7.0.0 - version: 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + version: 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6288,52 +7218,58 @@ importers: '@tanstack/vue-start': specifier: workspace:* version: link:../../../packages/vue-start + iron-session: + specifier: ^9.0.1 + version: 9.0.1 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) dotenv: specifier: ^17.2.3 version: 17.2.3 prisma: specifier: ^7.0.0 - version: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-cloudflare: dependencies: @@ -6348,38 +7284,41 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -6397,7 +7336,7 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@tanstack/router-e2e-utils': specifier: workspace:^ @@ -6405,30 +7344,36 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + rimraf: + specifier: 'catalog:' + version: 6.1.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-vue-query: dependencies: '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6442,48 +7387,51 @@ importers: specifier: workspace:* version: link:../../../packages/vue-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/css-modules: dependencies: @@ -6495,32 +7443,35 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:* version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) sass: specifier: ^1.97.2 version: 1.97.2 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/custom-basepath: dependencies: @@ -6535,20 +7486,20 @@ importers: version: link:../../../packages/vue-start express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6558,18 +7509,21 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) cross-env: specifier: ^10.0.0 version: 10.0.0 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -6577,20 +7531,63 @@ importers: specifier: ^4.20.3 version: 4.20.3 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/vue-start/dev-ssr-styles: + dependencies: + '@tanstack/vue-router': + specifier: workspace:* + version: link:../../../packages/vue-router + '@tanstack/vue-start': + specifier: workspace:* + version: link:../../../packages/vue-start + vue: + specifier: ^3.5.16 + version: 3.5.25(@typescript/typescript6@6.0.2) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../packages/router-core + '@tanstack/router-e2e-utils': + specifier: workspace:* + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-vue': + specifier: ^6.0.5 + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + '@vitejs/plugin-vue-jsx': + specifier: ^5.1.5 + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/query-integration: dependencies: '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-query-devtools': specifier: ^5.90.0 - version: 5.91.0(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2)) + version: 5.91.0(@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6608,38 +7605,41 @@ importers: version: 3.6.0 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/scroll-restoration: dependencies: @@ -6653,51 +7653,54 @@ importers: specifier: workspace:* version: link:../../../packages/vue-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/selective-ssr: dependencies: @@ -6709,38 +7712,41 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.8 - version: 3.1.8(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) e2e/vue-start/serialization-adapters: dependencies: @@ -6755,44 +7761,47 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.8 - version: 3.1.8(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) e2e/vue-start/server-functions: dependencies: '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6809,24 +7818,24 @@ importers: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6836,33 +7845,36 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/server-routes: dependencies: '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6879,24 +7891,24 @@ importers: specifier: ^3.0.5 version: 3.0.5 redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6906,27 +7918,30 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/spa-mode: dependencies: @@ -6941,32 +7956,35 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/start-manifest: dependencies: @@ -6978,29 +7996,75 @@ importers: version: link:../../../packages/vue-start vue: specifier: ^3.5.16 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: - specifier: ^0.11.9 - version: 0.11.15 + specifier: ^1.0.0 + version: 1.0.5 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/vue-start/streaming-ssr: + dependencies: + '@tanstack/vue-query': + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) + '@tanstack/vue-router': + specifier: workspace:* + version: link:../../../packages/vue-router + '@tanstack/vue-router-ssr-query': + specifier: workspace:* + version: link:../../../packages/vue-router-ssr-query + '@tanstack/vue-start': + specifier: workspace:* + version: link:../../../packages/vue-start + vue: + specifier: ^3.5.16 + version: 3.5.25(@typescript/typescript6@6.0.2) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-vue-jsx': + specifier: ^5.1.5 + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/virtual-routes: dependencies: @@ -7017,51 +8081,54 @@ importers: specifier: workspace:* version: link:../../../packages/vue-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/website: dependencies: @@ -7075,54 +8142,57 @@ importers: specifier: workspace:* version: link:../../../packages/vue-start redaxios: - specifier: ^0.5.1 + specifier: 'catalog:' version: 0.5.1 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 vue: specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) zod: specifier: ^4.4.3 version: 4.4.3 devDependencies: '@playwright/test': - specifier: ^1.61.0 - version: 1.61.1 + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/authenticated-routes: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7133,11 +8203,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7154,21 +8224,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/authenticated-routes-firebase: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7182,11 +8255,11 @@ importers: specifier: ^11.4.0 version: 11.4.0 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7206,21 +8279,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7228,11 +8304,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7246,24 +8322,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-default-search-params: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7271,11 +8350,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7292,24 +8371,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-devtools-panel: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@tanstack/react-query': + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.67.2 - version: 5.67.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.67.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7317,11 +8402,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7335,21 +8420,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7360,11 +8448,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7381,21 +8469,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-non-nested-devtools: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7403,11 +8494,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7421,27 +8512,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7449,11 +8543,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7467,27 +8561,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7498,11 +8595,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7519,15 +8616,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-ssr-file-based: dependencies: @@ -7539,10 +8639,10 @@ importers: version: link:../../../packages/router-plugin compression: specifier: ^1.8.0 - version: 1.8.0 + version: 1.8.0(supports-color@10.2.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) get-port: specifier: ^7.1.0 version: 7.1.0 @@ -7550,11 +8650,11 @@ importers: specifier: ^3.3.2 version: 3.3.2 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tanstack/react-router-devtools': specifier: workspace:^ @@ -7568,15 +8668,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-ssr-streaming-file-based: dependencies: @@ -7588,10 +8691,10 @@ importers: version: link:../../../packages/router-plugin compression: specifier: ^1.8.0 - version: 1.8.0 + version: 1.8.0(supports-color@10.2.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) get-port: specifier: ^7.1.0 version: 7.1.0 @@ -7599,11 +8702,11 @@ importers: specifier: ^3.3.2 version: 3.3.2 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tanstack/react-router-devtools': specifier: workspace:^ @@ -7617,21 +8720,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7645,11 +8751,11 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7666,21 +8772,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-virtual-inside-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7694,11 +8803,11 @@ importers: specifier: workspace:* version: link:../../../packages/virtual-file-routes react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7715,21 +8824,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/deferred-data: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7737,11 +8849,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7758,21 +8870,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7780,11 +8895,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -7801,21 +8916,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7826,11 +8944,11 @@ importers: specifier: ^10.1.1 version: 10.1.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7847,21 +8965,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7875,11 +8996,11 @@ importers: specifier: ^10.1.1 version: 10.1.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7896,27 +9017,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7927,11 +9051,11 @@ importers: specifier: ^10.1.1 version: 10.1.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -7948,27 +9072,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -7982,11 +9109,11 @@ importers: specifier: ^10.1.1 version: 10.1.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8003,24 +9130,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/large-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8031,11 +9161,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8052,27 +9182,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/location-masking: dependencies: '@radix-ui/react-dialog': specifier: ^1.1.6 - version: 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8080,11 +9213,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8098,24 +9231,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/navigation-blocking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8123,11 +9259,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8141,21 +9277,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8163,11 +9302,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -8178,15 +9317,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart-esbuild-file-based: dependencies: @@ -8200,11 +9342,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8226,7 +9368,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8237,11 +9379,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8258,15 +9400,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart-rspack-file-based: dependencies: @@ -8283,21 +9428,21 @@ importers: specifier: ^8.5.1 version: 8.5.3 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -8307,9 +9452,12 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' examples/react/quickstart-webpack-file-based: dependencies: @@ -8320,11 +9468,11 @@ importers: specifier: workspace:^ version: link:../../../packages/react-router-devtools react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@swc/core': specifier: ^1.15.33 @@ -8338,6 +9486,9 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 html-webpack-plugin: specifier: ^5.6.3 version: 5.6.3(webpack@5.97.1) @@ -8348,8 +9499,8 @@ importers: specifier: ^0.2.6 version: 0.2.6(@swc/core@1.15.33(@swc/helpers@0.5.23))(webpack@5.97.1) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' webpack: specifier: ^5.97.1 version: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) @@ -8358,16 +9509,16 @@ importers: version: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) webpack-dev-server: specifier: ^5.2.4 - version: 5.2.4(webpack-cli@5.1.4)(webpack@5.97.1) + version: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) examples/react/router-monorepo-react-query: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8378,11 +9529,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8396,18 +9547,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/app: dependencies: @@ -8418,18 +9572,18 @@ importers: specifier: workspace:* version: link:../router '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -8439,21 +9593,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/post-feature: dependencies: @@ -8464,14 +9621,14 @@ importers: specifier: workspace:* version: link:../router '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@types/react': specifier: ^19.2.8 @@ -8479,24 +9636,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/post-query: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8504,15 +9664,18 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/router-monorepo-react-query/packages/router: dependencies: @@ -8523,8 +9686,8 @@ importers: specifier: workspace:* version: link:../../../../../packages/history '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../../../packages/react-router @@ -8532,11 +9695,11 @@ importers: specifier: workspace:* version: link:../../../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8550,18 +9713,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple: dependencies: @@ -8575,11 +9741,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8593,18 +9759,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy: dependencies: @@ -8618,11 +9787,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8636,18 +9805,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/app: dependencies: @@ -8658,15 +9830,15 @@ importers: specifier: workspace:* version: link:../router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -8676,21 +9848,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/post-feature: dependencies: @@ -8698,14 +9873,14 @@ importers: specifier: workspace:* version: link:../router '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@types/react': specifier: ^19.2.8 @@ -8713,18 +9888,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/router: dependencies: @@ -8738,11 +9916,11 @@ importers: specifier: workspace:* version: link:../../../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8756,18 +9934,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/app: dependencies: @@ -8778,15 +9959,15 @@ importers: specifier: workspace:* version: link:../router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -8796,21 +9977,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/post-feature: dependencies: @@ -8818,11 +10002,11 @@ importers: specifier: workspace:* version: link:../router react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@types/react': specifier: ^19.2.8 @@ -8830,18 +10014,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/router: dependencies: @@ -8855,11 +10042,11 @@ importers: specifier: workspace:* version: link:../../../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -8873,24 +10060,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8899,13 +10089,13 @@ importers: version: link:../../../packages/react-router-devtools '@tanstack/react-virtual': specifier: ^3.13.0 - version: 3.13.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 3.13.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -8916,27 +10106,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/search-validator-adapters: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/arktype-adapter': specifier: workspace:* version: link:../../../packages/arktype-adapter '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8956,42 +10149,51 @@ importers: specifier: ^2.1.7 version: 2.1.7 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 valibot: specifier: 1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@6.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) zod: specifier: ^3.24.2 version: 3.25.76 devDependencies: '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: ^7.0.1 + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/react': specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/react': specifier: ^19.2.8 version: 19.2.9 '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + jsdom: + specifier: ^27.0.0 + version: 27.0.0(supports-color@10.2.2) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: ^5.0.4 + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/start-bare: dependencies: @@ -9005,11 +10207,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) zod: specifier: ^4.4.3 version: 4.4.3 @@ -9023,15 +10225,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic: dependencies: @@ -9045,11 +10250,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwind-merge: specifier: ^3.6.0 version: 3.6.0 @@ -9059,7 +10264,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9069,21 +10274,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-auth: dependencies: @@ -9095,7 +10303,7 @@ importers: version: 7.0.0 '@prisma/client': specifier: ^7.0.0 - version: 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + version: 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9105,12 +10313,15 @@ importers: '@tanstack/react-start': specifier: workspace:* version: link:../../../packages/react-start + iron-session: + specifier: ^9.0.1 + version: 9.0.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -9120,7 +10331,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9130,24 +10341,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) dotenv: specifier: ^17.2.3 version: 17.2.3 prisma: specifier: ^7.0.0 - version: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-authjs: dependencies: @@ -9164,11 +10378,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) start-authjs: specifier: ^1.0.0 version: 1.0.0(@auth/core@0.41.1) @@ -9178,7 +10392,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9188,18 +10402,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-cloudflare: dependencies: @@ -9213,18 +10430,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9234,18 +10451,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -9253,11 +10473,11 @@ importers: examples/react/start-basic-react-query: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9271,11 +10491,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -9283,9 +10503,12 @@ importers: specifier: ^3.6.0 version: 3.6.0 devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9295,18 +10518,76 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + examples/react/start-basic-rsbuild: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-router-devtools': + specifier: workspace:^ + version: link:../../../packages/react-router-devtools + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + tailwind-merge: + specifier: ^3.6.0 + version: 3.6.0 + zod: + specifier: ^4.4.3 + version: 4.4.3 + devDependencies: + '@rsbuild/core': + specifier: ^2.3.1 + version: 2.3.1 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + '@rsbuild/plugin-tailwindcss': + specifier: ^2.0.3 + version: 2.0.3(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3) + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + srvx: + specifier: ^1.0.0 + version: 1.0.5 + tailwindcss: + specifier: ^4.2.2 + version: 4.2.2 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' examples/react/start-basic-static: dependencies: @@ -9324,13 +10605,13 @@ importers: version: link:../../../packages/start-static-server-functions '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -9340,7 +10621,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9350,24 +10631,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-bun: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-devtools': specifier: ^0.7.0 - version: 0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12) + version: 0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9384,24 +10668,24 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 devDependencies: '@tanstack/eslint-config': specifier: ^0.3.2 - version: 0.3.2(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 '@testing-library/react': specifier: ^16.3.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/bun': specifier: ^1.2.22 version: 1.2.22(@types/react@19.2.9) @@ -9414,24 +10698,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: ^27.0.0 - version: 27.0.0(postcss@8.5.15) + version: 27.0.0(supports-color@10.2.2) prettier: specifier: ^3.6.2 version: 3.6.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@27.0.0(postcss@8.5.15))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^5.0.4 + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) web-vitals: specifier: ^5.1.0 version: 5.1.0 @@ -9440,7 +10727,7 @@ importers: dependencies: '@clerk/tanstack-react-start': specifier: ^0.27.14 - version: 0.27.14(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 0.27.14(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9452,26 +10739,26 @@ importers: version: link:../../../packages/react-start '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tailwind-merge: specifier: ^3.6.0 version: 3.6.0 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9481,27 +10768,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-convex-trellaux: dependencies: '@convex-dev/react-query': specifier: 0.0.0-alpha.8 - version: 0.0.0-alpha.8(@tanstack/react-query@5.99.0(react@19.2.3))(convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)) + version: 0.0.0-alpha.8(@tanstack/react-query@5.102.0(react@19.2.9))(convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9519,22 +10809,22 @@ importers: version: 8.2.2 convex: specifier: ^1.19.0 - version: 1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9) ky: specifier: ^1.7.4 version: 1.7.4 msw: specifier: ^2.7.0 - version: 2.7.0(@types/node@25.0.9)(typescript@6.0.2) + version: 2.7.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) react-hot-toast: specifier: ^2.5.1 - version: 2.5.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 2.5.1(react-dom@19.2.9(react@19.2.9))(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -9547,7 +10837,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9557,18 +10847,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-counter: dependencies: @@ -9582,11 +10875,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@types/node': specifier: 25.0.9 @@ -9597,21 +10890,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-i18n-paraglide: dependencies: '@tanstack/react-devtools': specifier: ^0.7.0 - version: 0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12) + version: 0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9622,18 +10918,18 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@inlang/paraglide-js': specifier: ^2.4.0 version: 2.4.0(babel-plugin-macros@3.1.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9643,24 +10939,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-large: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9671,11 +10970,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -9684,11 +10983,11 @@ importers: version: 3.6.0 valibot: specifier: ^1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@6.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9698,18 +10997,21 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-material-ui: dependencies: @@ -9718,16 +11020,16 @@ importers: version: 11.14.0 '@emotion/react': specifier: 11.14.0 - version: 11.14.0(@types/react@19.2.9)(react@19.2.3) + version: 11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) '@emotion/styled': specifier: 11.14.0 - version: 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3) + version: 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) '@fontsource-variable/roboto': specifier: 5.2.5 version: 5.2.5 '@mui/material': specifier: 6.4.7 - version: 6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9738,11 +11040,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) zod: specifier: ^4.4.3 version: 4.4.3 @@ -9756,64 +11058,43 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - examples/react/start-nativescript: + examples/react/start-next-migration: dependencies: - '@nativescript-community/react': - specifier: ^19.0.0 - version: 19.0.0(@nativescript/core@9.0.20)(dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2))(react@19.2.3)(undom-ng@1.1.2) - '@nativescript/core': - specifier: ^9.0.20 - version: 9.0.20 - '@tanstack/react-nativescript-router': - specifier: workspace:* - version: link:../../../packages/react-nativescript-router '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router '@tanstack/react-start': specifier: workspace:* version: link:../../../packages/react-start - dominative: - specifier: ^0.1.3 - version: 0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2) + iron-session: + specifier: ^9.0.1 + version: 9.0.1 + next: + specifier: 16.3.4 + version: 16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.97.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) - react-nativescript: - specifier: npm:@nativescript-community/react@^19.0.0 - version: '@nativescript-community/react@19.0.0(@nativescript/core@9.0.20)(dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2))(react@19.2.3)(undom-ng@1.1.2)' - undom-ng: - specifier: ^1.1.2 - version: 1.1.2 + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: - '@nativescript/android': - specifier: ^9.0.5 - version: 9.0.5 - '@nativescript/ios': - specifier: ^9.0.3 - version: 9.0.3 - '@nativescript/types': - specifier: ^9.0.0 - version: 9.0.0 - '@nativescript/vite': - specifier: 2.0.3 - version: 2.0.3(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@testing-library/jest-dom@6.6.3)(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(postcss@8.5.12)(react@19.2.3)(rollup@4.56.0)(solid-js@1.9.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2))(yaml@2.9.0) - '@tanstack/router-cli': - specifier: workspace:* - version: link:../../../packages/router-cli + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9824,29 +11105,17 @@ importers: specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^5.2.0 - version: 5.2.0(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - concurrently: - specifier: ^9.2.1 - version: 9.2.1 - cross-env: - specifier: ^10.1.0 - version: 10.1.0 - nativescript: - specifier: ^9.0.6 - version: 9.0.6(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(debug@4.4.3) + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: 7.3.6 - version: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - wait-on: - specifier: ^9.0.3 - version: 9.0.10 + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-rscs: dependencies: @@ -9863,11 +11132,11 @@ importers: specifier: ^4.0.10 version: 4.2.1 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwind-merge: specifier: ^3.6.0 version: 3.6.0 @@ -9876,11 +11145,11 @@ importers: version: 4.4.3 zustand: specifier: ^5.0.10 - version: 5.0.12(@types/react@19.2.9)(immer@10.1.1)(react@19.2.3)(use-sync-external-store@1.6.0(react@19.2.3)) + version: 5.0.12(@types/react@19.2.9)(immer@10.1.1)(react@19.2.9)(use-sync-external-store@1.6.0(react@19.2.9)) devDependencies: '@tailwindcss/vite': specifier: ^4.1.18 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -9892,13 +11161,13 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': - specifier: ^0.5.20 - version: 0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^0.5.39 + version: 0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta tailwindcss: specifier: ^4.1.18 version: 4.2.2 @@ -9906,8 +11175,8 @@ importers: specifier: ^5.7.2 version: 5.9.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-streaming-data-from-server-functions: dependencies: @@ -9921,11 +11190,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) zod: specifier: ^4.4.3 version: 4.4.3 @@ -9939,15 +11208,18 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-supabase-basic: dependencies: @@ -9967,36 +11239,39 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/react': specifier: ^19.2.8 version: 19.2.9 '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-tailwind-v4: dependencies: @@ -10010,11 +11285,11 @@ importers: specifier: workspace:* version: link:../../../packages/react-start react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) tailwind-merge: specifier: ^3.6.0 version: 3.6.0 @@ -10024,7 +11299,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10034,27 +11309,30 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-trellaux: dependencies: '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10072,16 +11350,16 @@ importers: version: 1.7.4 msw: specifier: ^2.7.0 - version: 2.7.0(@types/node@25.0.9)(typescript@6.0.2) + version: 2.7.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) react-hot-toast: specifier: ^2.5.1 - version: 2.5.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 2.5.1(react-dom@19.2.9(react@19.2.9))(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -10094,7 +11372,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10104,24 +11382,27 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-workos: dependencies: '@radix-ui/themes': specifier: ^3.3.0 - version: 3.3.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 3.3.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10133,13 +11414,13 @@ importers: version: link:../../../packages/react-start '@workos/authkit-tanstack-react-start': specifier: ^0.5.0 - version: 0.5.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 0.5.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) devDependencies: '@types/react': specifier: ^19.2.8 @@ -10147,21 +11428,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10172,11 +11456,11 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -10193,21 +11477,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-framer-motion: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10216,13 +11503,13 @@ importers: version: link:../../../packages/react-router-devtools framer-motion: specifier: ^11.18.2 - version: 11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -10239,21 +11526,24 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-trpc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10265,19 +11555,19 @@ importers: version: link:../../../packages/router-plugin '@trpc/client': specifier: ^11.4.3 - version: 11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2) + version: 11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2) '@trpc/server': specifier: ^11.4.3 - version: 11.4.3(typescript@6.0.2) + version: 11.4.3(@typescript/typescript6@6.0.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -10299,25 +11589,25 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tsx: specifier: ^4.20.3 version: 4.20.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-trpc-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-query-devtools': specifier: ^5.90.0 - version: 5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3) + version: 5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10329,22 +11619,22 @@ importers: version: link:../../../packages/router-plugin '@trpc/client': specifier: ^11.4.3 - version: 11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2) + version: 11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2) '@trpc/server': specifier: ^11.4.3 - version: 11.4.3(typescript@6.0.2) + version: 11.4.3(@typescript/typescript6@6.0.2) '@trpc/tanstack-react-query': specifier: ^11.4.3 - version: 11.4.3(@tanstack/react-query@5.99.0(react@19.2.3))(@trpc/client@11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2))(@trpc/server@11.4.3(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 11.4.3(@tanstack/react-query@5.102.0(react@19.2.9))(@trpc/client@11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2))(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -10366,24 +11656,24 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tsx: specifier: ^4.20.3 version: 4.20.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/solid/authenticated-routes: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10401,26 +11691,29 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/authenticated-routes-firebase: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10444,23 +11737,26 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10481,26 +11777,29 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-default-search-params: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10518,23 +11817,26 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-devtools-panel: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10549,23 +11851,26 @@ importers: specifier: ^4.2.2 version: 4.2.2 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10586,23 +11891,26 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-non-nested-devtools: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10623,29 +11931,32 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10663,29 +11974,32 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10706,15 +12020,18 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-ssr-file-based: dependencies: @@ -10722,14 +12039,14 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router compression: specifier: ^1.8.0 - version: 1.8.0 + version: 1.8.0(supports-color@10.2.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) get-port: specifier: ^7.1.0 version: 7.1.0 @@ -10746,33 +12063,36 @@ importers: '@types/express': specifier: ^5.0.6 version: 5.0.6 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-ssr-streaming-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ version: link:../../../packages/solid-router-devtools compression: specifier: ^1.8.0 - version: 1.8.0 + version: 1.8.0(supports-color@10.2.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) get-port: specifier: ^7.1.0 version: 7.1.0 @@ -10798,26 +12118,29 @@ importers: '@types/express': specifier: ^5.0.6 version: 5.0.6 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10838,26 +12161,29 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-virtual-inside-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10878,23 +12204,26 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/deferred-data: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10912,26 +12241,29 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router solid-js: specifier: 1.9.12 @@ -10946,23 +12278,26 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -10983,23 +12318,26 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11023,29 +12361,32 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11066,32 +12407,35 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11112,29 +12456,32 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/large-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11152,26 +12499,29 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/location-masking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11186,26 +12536,29 @@ importers: specifier: ^4.2.2 version: 4.2.2 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/navigation-blocking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11220,23 +12573,26 @@ importers: specifier: ^4.2.2 version: 4.2.2 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11248,15 +12604,18 @@ importers: specifier: ^4.2.2 version: 4.2.2 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart-esbuild-file-based: dependencies: @@ -11264,7 +12623,7 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11287,15 +12646,15 @@ importers: version: 0.27.4 esbuild-plugin-solid: specifier: ^0.6.0 - version: 0.6.0(esbuild@0.27.4)(solid-js@1.9.12) + version: 0.6.0(esbuild@0.27.4)(solid-js@1.9.12)(supports-color@10.2.2) examples/solid/quickstart-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11316,15 +12675,18 @@ importers: '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart-rspack-file-based: dependencies: @@ -11332,7 +12694,7 @@ importers: specifier: ^4.2.2 version: 4.2.2 '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11348,25 +12710,28 @@ importers: version: 4.2.2 devDependencies: '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: ^2.3.1 + version: 2.3.1 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.0.14) + version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7)(@rsbuild/core@2.0.14)(solid-js@1.9.12) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' examples/solid/quickstart-webpack-file-based: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11380,19 +12745,22 @@ importers: devDependencies: '@babel/core': specifier: ^7.28.5 - version: 7.28.5 + version: 7.28.5(supports-color@10.2.2) '@babel/preset-typescript': specifier: ^7.27.1 - version: 7.27.1(@babel/core@7.28.5) + version: 7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 babel-loader: specifier: ^10.0.0 - version: 10.0.0(@babel/core@7.28.5)(webpack@5.97.1) + version: 10.0.0(@babel/core@7.28.5(supports-color@10.2.2))(webpack@5.97.1) babel-preset-solid: specifier: ^1.9.10 - version: 1.9.10(@babel/core@7.28.5)(solid-js@1.9.12) + version: 1.9.10(@babel/core@7.28.5(supports-color@10.2.2))(solid-js@1.9.12) css-loader: specifier: ^7.1.2 version: 7.1.2(webpack@5.97.1) @@ -11404,13 +12772,13 @@ importers: version: 8.5.6 postcss-loader: specifier: ^8.2.0 - version: 8.2.0(postcss@8.5.6)(typescript@6.0.2)(webpack@5.97.1) + version: 8.2.0(@typescript/typescript6@6.0.2)(postcss@8.5.6)(webpack@5.97.1) style-loader: specifier: ^4.0.0 version: 4.0.0(webpack@5.97.1) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' webpack: specifier: ^5.97.1 version: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) @@ -11419,7 +12787,7 @@ importers: version: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) webpack-dev-server: specifier: ^5.2.4 - version: 5.2.4(webpack-cli@5.1.4)(webpack@5.97.1) + version: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) examples/solid/router-monorepo-simple: dependencies: @@ -11427,7 +12795,7 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11442,18 +12810,21 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/router-monorepo-simple-lazy: dependencies: @@ -11461,7 +12832,7 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11476,18 +12847,21 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/router-monorepo-solid-query: dependencies: @@ -11495,13 +12869,13 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11516,26 +12890,29 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11550,21 +12927,24 @@ importers: specifier: ^4.2.2 version: 4.2.2 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/search-validator-adapters: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/arktype-adapter': specifier: workspace:* version: link:../../../packages/arktype-adapter @@ -11572,10 +12952,10 @@ importers: specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11597,7 +12977,7 @@ importers: version: 4.2.2 valibot: specifier: 1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@6.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) zod: specifier: ^3.24.2 version: 3.25.76 @@ -11606,22 +12986,31 @@ importers: specifier: ^0.8.10 version: 0.8.10(solid-js@1.9.12) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: ^7.0.1 + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + jsdom: + specifier: ^27.0.0 + version: 27.0.0(supports-color@10.2.2) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: ^5.0.4 + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11641,25 +13030,28 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-auth: dependencies: @@ -11671,9 +13063,9 @@ importers: version: 7.0.0 '@prisma/client': specifier: ^7.0.0 - version: 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + version: 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11681,6 +13073,9 @@ importers: '@tanstack/solid-start': specifier: workspace:* version: link:../../../packages/solid-start + iron-session: + specifier: ^9.0.1 + version: 9.0.1 redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -11693,28 +13088,31 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 dotenv: specifier: ^17.2.3 version: 17.2.3 prisma: specifier: ^7.0.0 - version: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-authjs: dependencies: @@ -11722,7 +13120,7 @@ importers: specifier: ^0.41.1 version: 0.41.1 '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11742,27 +13140,30 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-cloudflare: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11776,25 +13177,28 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -11802,7 +13206,7 @@ importers: examples/solid/start-basic-netlify: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11815,31 +13219,34 @@ importers: version: 1.9.12 devDependencies: '@netlify/vite-plugin-tanstack-start': - specifier: ^1.1.4 - version: 1.1.4(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^1.3.19 + version: 1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-nitro: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11853,36 +13260,39 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 nitro: - specifier: ^3.0.260311-beta - version: 3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2) + specifier: ^3.0.260903-beta + version: 3.0.260903-beta tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-solid-query: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-query-devtools': specifier: ^5.90.0 - version: 5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12) + version: 5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11905,27 +13315,30 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-static: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -11948,28 +13361,31 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-bun: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -11977,7 +13393,7 @@ importers: specifier: ^0.7.0 version: 0.7.14(csstype@3.2.3)(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12000,7 +13416,7 @@ importers: version: 0.8.10(solid-js@1.9.12) '@tanstack/eslint-config': specifier: ^0.3.2 - version: 0.3.2(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -12010,24 +13426,27 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 jsdom: specifier: ^27.0.0 - version: 27.0.0(postcss@8.5.15) + version: 27.0.0(supports-color@10.2.2) prettier: specifier: ^3.6.2 version: 3.6.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@27.0.0(postcss@8.5.15))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^5.0.4 + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) web-vitals: specifier: ^5.1.0 version: 5.1.0 @@ -12036,12 +13455,12 @@ importers: dependencies: '@convex-dev/better-auth': specifier: ^0.9.7 - version: 0.9.7(@standard-schema/spec@1.1.0)(better-auth@1.6.19(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.7.10)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + version: 0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9))(hono@4.13.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12051,16 +13470,16 @@ importers: version: link:../../../packages/solid-start better-auth: specifier: ^1.6.19 - version: 1.6.19(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2)) + version: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) clsx: specifier: ^2.1.1 version: 2.1.1 convex: specifier: ^1.28.2 - version: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) + version: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9) convex-solidjs: specifier: ^0.0.3 - version: 0.0.3(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)(solid-js@1.9.12) + version: 0.0.3(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9)(solid-js@1.9.12) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -12080,23 +13499,26 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-counter: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12120,18 +13542,21 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 combinate: specifier: ^1.1.11 version: 1.1.11 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-i18n-paraglide: dependencies: @@ -12139,7 +13564,7 @@ importers: specifier: ^0.7.0 version: 0.7.14(csstype@3.2.3)(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12156,30 +13581,33 @@ importers: version: 2.4.0(babel-plugin-macros@3.1.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-large: dependencies: '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12198,31 +13626,34 @@ importers: version: 3.6.0 valibot: specifier: ^1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@6.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-streaming-data-from-server-functions: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12240,15 +13671,18 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-supabase-basic: dependencies: @@ -12259,7 +13693,7 @@ importers: specifier: ^2.48.1 version: 2.48.1 '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12276,27 +13710,30 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-tailwind-v4: dependencies: '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12316,33 +13753,36 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 tailwindcss: specifier: ^4.2.2 version: 4.2.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12360,23 +13800,26 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/with-framer-motion: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ @@ -12397,39 +13840,42 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/with-trpc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/solid-router': - specifier: ^1.170.18 + specifier: ^1.170.43 version: link:../../../packages/solid-router '@tanstack/solid-router-devtools': specifier: workspace:^ version: link:../../../packages/solid-router-devtools '@trpc/client': specifier: ^11.4.3 - version: 11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2) + version: 11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2) '@trpc/server': specifier: ^11.4.3 - version: 11.4.3(typescript@6.0.2) + version: 11.4.3(@typescript/typescript6@6.0.2) express: specifier: ^5.2.1 - version: 5.2.1 + version: 5.2.1(supports-color@10.2.2) redaxios: specifier: ^0.5.1 version: 0.5.1 @@ -12450,11 +13896,11 @@ importers: specifier: ^4.20.3 version: 4.20.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/vue/basic: dependencies: @@ -12472,32 +13918,35 @@ importers: version: 4.1.18 vue: specifier: ^3.5.13 - version: 3.5.25(typescript@6.0.2) + version: 3.5.25(@typescript/typescript6@6.0.2) devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@6.0.2) + specifier: ^3.3.8 + version: 3.3.8(@typescript/typescript6@6.0.2) examples/vue/basic-file-based-jsx: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12525,37 +13974,37 @@ importers: version: 9.36.0 '@typescript-eslint/eslint-plugin': specifier: ^8.44.1 - version: 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + version: 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@typescript-eslint/parser': specifier: ^8.44.1 - version: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) eslint-plugin-vue: specifier: ^9.33.0 - version: 9.33.0(eslint@9.22.0(jiti@2.7.0)) + version: 9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-eslint-parser: specifier: ^9.4.3 - version: 9.4.3(eslint@9.22.0(jiti@2.7.0)) + version: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) examples/vue/basic-file-based-sfc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12580,151 +14029,159 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: - specifier: ^3.1.5 - version: 3.1.5(typescript@5.8.3) + specifier: ^3.3.8 + version: 3.3.8(typescript@5.8.3) packages/arktype-adapter: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/react-router': specifier: workspace:* version: link:../react-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) arktype: specifier: ^2.1.7 version: 2.1.7 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/eslint-plugin-router: dependencies: '@typescript-eslint/utils': specifier: ^8.23.0 - version: 8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript-eslint/rule-tester': specifier: ^8.23.0 - version: 8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) combinate: - specifier: ^1.1.11 + specifier: 'catalog:' version: 1.1.11 eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/eslint-plugin-start: dependencies: '@typescript-eslint/utils': specifier: ^8.44.1 - version: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) + version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) globals: specifier: ^16.2.0 version: 16.4.0 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript-eslint/rule-tester': specifier: ^8.44.1 - version: 8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) + version: 8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 typescript: specifier: ^5.8.2 version: 5.9.2 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/history: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - - packages/nitro-v2-vite-plugin: - dependencies: - nitropack: - specifier: ^2.13.1 - version: 2.13.1(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(mysql2@3.15.3)(rolldown@1.0.2)(xml2js@0.6.2) - pathe: - specifier: ^2.0.3 - version: 2.0.3 - vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - - packages/react-nativescript-router: - dependencies: - '@tanstack/history': - specifier: workspace:* - version: link:../history - '@tanstack/react-router': - specifier: workspace:* - version: link:../react-router - '@tanstack/react-store': - specifier: ^0.9.3 - version: 0.9.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@tanstack/router-core': - specifier: workspace:* - version: link:../router-core - '@tanstack/store': - specifier: ^0.9.3 - version: 0.9.3 - devDependencies: - '@nativescript-community/react': - specifier: ^19.0.0 - version: 19.0.0(@nativescript/core@9.0.20)(dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2))(react@19.2.3)(undom-ng@1.1.2) - '@nativescript/core': - specifier: ^9.0.20 - version: 9.0.20 - '@nativescript/types': - specifier: ^9.0.0 - version: 9.0.0 - '@types/node': - specifier: 25.0.9 - version: 25.0.9 - '@types/react': - specifier: ^19.2.8 - version: 19.2.9 - '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.7.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - dominative: - specifier: ^0.1.3 - version: 0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2) - react: - specifier: ^19.2.3 - version: 19.2.3 - react-nativescript: - specifier: npm:@nativescript-community/react@^19.0.0 - version: '@nativescript-community/react@19.0.0(@nativescript/core@9.0.20)(dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2))(react@19.2.3)(undom-ng@1.1.2)' - undom-ng: - specifier: ^1.1.2 - version: 1.1.2 - vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-router: dependencies: @@ -12732,45 +14189,75 @@ importers: specifier: workspace:* version: link:../history '@tanstack/react-store': - specifier: ^0.9.3 - version: 0.9.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: ^0.11.2 + version: 0.11.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/router-core': specifier: workspace:* version: link:../router-core - '@tanstack/store': - specifier: ^0.9.3 - version: 0.9.3 isbot: - specifier: ^5.1.22 + specifier: 'catalog:' version: 5.1.28 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) + '@tanstack/react-query': + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: - specifier: ^1.1.11 + specifier: 'catalog:' version: 1.1.11 + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 packages/react-router-devtools: dependencies: @@ -12784,49 +14271,109 @@ importers: specifier: workspace:^ version: link:../router-devtools-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-router-ssr-query: dependencies: '@tanstack/query-core': - specifier: ^5.99.0 - version: 5.99.0 + specifier: ^5.102.0 + version: 5.102.0 '@tanstack/router-ssr-query-core': specifier: workspace:* version: link:../router-ssr-query-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@tanstack/react-query': - specifier: ^5.99.0 - version: 5.99.0(react@19.2.3) + specifier: ^5.102.0 + version: 5.102.0(react@19.2.9) '@tanstack/react-router': specifier: workspace:* version: link:../react-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.6.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start: dependencies: @@ -12842,9 +14389,6 @@ importers: '@tanstack/react-start-server': specifier: workspace:* version: link:../react-start-server - '@tanstack/router-plugin': - specifier: workspace:* - version: link:../router-plugin '@tanstack/router-utils': specifier: workspace:* version: link:../router-utils @@ -12858,27 +14402,54 @@ importers: specifier: workspace:* version: link:../start-server-core pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 - react: - specifier: ^19.2.3 - version: 19.2.3 - react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 - '@tanstack/react-nativescript-router': - specifier: workspace:* - version: link:../react-nativescript-router + specifier: 'catalog:' + version: 2.3.1 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-client: dependencies: @@ -12891,25 +14462,55 @@ importers: '@tanstack/start-client-core': specifier: workspace:* version: link:../start-client-core - react: - specifier: ^19.2.3 - version: 19.2.3 - react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-rsc: dependencies: @@ -12931,37 +14532,64 @@ importers: '@tanstack/start-plugin-core': specifier: workspace:* version: link:../start-plugin-core - '@tanstack/start-server-core': - specifier: workspace:* - version: link:../start-server-core '@tanstack/start-storage-context': specifier: workspace:* version: link:../start-storage-context pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 - react: - specifier: ^19.2.3 - version: 19.2.3 - react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@rspack/core': - specifier: 2.0.0 - version: 2.0.0(@swc/helpers@0.5.23) + specifier: 2.2.7 + version: 2.2.7(@swc/helpers@0.5.23) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/react': - specifier: ^16.2.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.7.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': - specifier: ^0.5.20 - version: 0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^0.5.39 + version: 0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) react-server-dom-rspack: - specifier: ^0.0.2 - version: 0.0.2(@rspack/core@2.0.0(@swc/helpers@0.5.23))(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: ^0.1.1 + version: 0.1.1(@rspack/core@2.2.7(@swc/helpers@0.5.23))(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-server: dependencies: @@ -12975,49 +14603,88 @@ importers: specifier: workspace:* version: link:../start-server-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-cli: dependencies: '@tanstack/router-generator': specifier: workspace:* version: link:../router-generator + cac: + specifier: ^7.1.0 + version: 7.1.0 chokidar: - specifier: ^5.0.0 + specifier: 'catalog:' version: 5.0.0 - yaml: - specifier: ^2.9.0 - version: 2.9.0 - yargs: - specifier: ^17.7.2 - version: 17.7.2 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 - '@types/yargs': - specifier: ^17.0.33 - version: 17.0.33 + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: - specifier: ^4.1.4 - version: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-core: dependencies: @@ -13028,24 +14695,42 @@ importers: specifier: ^3.0.0 version: 3.1.1 seroval: - specifier: ^1.5.4 - version: 1.5.4 + specifier: ^1.6.7 + version: 1.6.7 seroval-plugins: - specifier: ^1.5.4 - version: 1.5.4(seroval@1.5.4) + specifier: ^1.6.7 + version: 1.6.7(seroval@1.6.7) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/store': - specifier: ^0.9.3 - version: 0.9.3 + specifier: ^0.11.2 + version: 0.11.2 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 esbuild: specifier: ^0.27.4 version: 0.27.4 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-devtools: dependencies: @@ -13059,18 +14744,45 @@ importers: specifier: ^3.0.10 version: 3.2.3 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-devtools-core: dependencies: @@ -13087,21 +14799,42 @@ importers: specifier: ^2.1.16 version: 2.1.16(csstype@3.2.3) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@testing-library/jest-dom': + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 solid-js: specifier: 1.9.12 version: 1.9.12 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-generator: dependencies: '@babel/types': - specifier: ^7.28.5 - version: 7.29.0 + specifier: 'catalog:' + version: 7.29.8 '@tanstack/router-core': specifier: workspace:* version: link:../router-core @@ -13118,36 +14851,54 @@ importers: specifier: ^0.30.21 version: 0.30.21 prettier: - specifier: ^3.5.0 - version: 3.5.0 + specifier: ^3.9.6 + version: 3.9.6 zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/react-router': specifier: workspace:* version: link:../react-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + publint: + specifier: 'catalog:' + version: 0.3.17 + react: + specifier: ~19.2.9 + version: 19.2.9 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-plugin: dependencies: '@babel/core': - specifier: ^7.28.5 - version: 7.28.5 + specifier: 'catalog:' + version: 7.29.7(supports-color@10.2.2) '@babel/template': - specifier: ^7.27.2 - version: 7.27.2 + specifier: ^7.29.7 + version: 7.29.7 '@babel/types': - specifier: ^7.28.5 - version: 7.28.5 - '@rsbuild/core': - specifier: '>=1.0.2 || ^2.0.0' - version: 2.0.1 + specifier: 'catalog:' + version: 7.29.8 '@tanstack/react-router': specifier: workspace:* version: link:../react-router @@ -13161,24 +14912,30 @@ importers: specifier: workspace:* version: link:../router-utils chokidar: - specifier: ^5.0.0 + specifier: 'catalog:' version: 5.0.0 unplugin: - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^3.5.0 + version: 3.7.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(esbuild@0.28.1)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.10 || ^3.0.0-0 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - webpack: - specifier: '>=5.92.0' - version: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@rsbuild/core': + specifier: 'catalog:' + version: 2.3.1 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__core': specifier: ^7.20.5 version: 7.20.5 @@ -13188,55 +14945,118 @@ importers: '@types/node': specifier: 25.0.9 version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + prettier: + specifier: ^3.9.6 + version: 3.9.6 + publint: + specifier: 'catalog:' + version: 0.3.17 + react: + specifier: ~19.2.9 + version: 19.2.9 + react-dom: + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + webpack: + specifier: ^5.104.1 + version: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) packages/router-ssr-query-core: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/query-core': - specifier: ^5.99.0 - version: 5.99.0 + specifier: ^5.102.0 + version: 5.102.0 '@tanstack/router-core': specifier: workspace:* version: link:../router-core + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-utils: dependencies: '@babel/generator': - specifier: ^7.28.5 - version: 7.28.5 + specifier: ^7.29.8 + version: 7.29.8 '@babel/parser': - specifier: ^7.28.5 - version: 7.28.5 + specifier: ^7.29.8 + version: 7.29.8 '@babel/types': - specifier: ^7.28.5 - version: 7.28.5 + specifier: 'catalog:' + version: 7.29.8 ansis: - specifier: ^4.1.0 - version: 4.1.0 + specifier: ^4.3.1 + version: 4.3.1 babel-dead-code-elimination: specifier: ^1.0.12 - version: 1.0.12 + version: 1.0.12(supports-color@10.2.2) diff: - specifier: ^8.0.2 - version: 8.0.2 + specifier: ^9.0.0 + version: 9.0.0 pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 tinyglobby: - specifier: ^0.2.15 - version: 0.2.15 + specifier: 'catalog:' + version: 0.2.17 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__generator': specifier: ^7.27.0 version: 7.27.0 '@types/node': specifier: 25.0.9 version: 25.0.9 + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-vite-plugin: dependencies: @@ -13244,9 +15064,24 @@ importers: specifier: workspace:* version: link:../router-plugin devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-router: dependencies: @@ -13263,33 +15098,51 @@ importers: specifier: workspace:* version: link:../router-core isbot: - specifier: ^5.1.22 + specifier: 'catalog:' version: 5.1.28 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@solidjs/testing-library': specifier: ^0.8.10 version: 0.8.10(solid-js@1.9.12) + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@types/node': specifier: 25.0.9 version: 25.0.9 combinate: - specifier: ^1.1.11 + specifier: 'catalog:' version: 1.1.11 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 solid-js: specifier: 1.9.12 version: 1.9.12 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 packages/solid-router-devtools: dependencies: @@ -13303,46 +15156,79 @@ importers: specifier: workspace:^ version: link:../solid-router devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 solid-js: specifier: 1.9.12 version: 1.9.12 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-router-ssr-query: dependencies: '@tanstack/query-core': - specifier: ^5.99.0 - version: 5.99.0 + specifier: ^5.102.0 + version: 5.102.0 '@tanstack/router-ssr-query-core': specifier: workspace:* version: link:../router-ssr-query-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/solid-query': - specifier: ^5.99.0 - version: 5.99.0(solid-js@1.9.12) + specifier: ^5.102.0 + version: 5.102.0(solid-js@1.9.12) '@tanstack/solid-router': specifier: workspace:* version: link:../solid-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-solid: specifier: ^0.14.5 - version: 0.14.5(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + version: 0.14.5(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 solid-js: specifier: 1.9.12 version: 1.9.12 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start: dependencies: @@ -13365,24 +15251,48 @@ importers: specifier: workspace:* version: link:../start-server-core pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 solid-js: specifier: 1.9.12 version: 1.9.12 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@eslint-react/eslint-plugin': + specifier: 'catalog:' + version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: 'catalog:' + version: 2.3.1 '@tanstack/router-utils': specifier: workspace:* version: link:../router-utils + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + eslint-plugin-react-hooks: + specifier: 'catalog:' + version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start-client: dependencies: @@ -13399,15 +15309,33 @@ importers: specifier: 1.9.12 version: 1.9.12 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start-server: dependencies: @@ -13421,18 +15349,39 @@ importers: specifier: workspace:* version: link:../start-server-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 solid-js: specifier: 1.9.12 version: 1.9.12 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: - specifier: ^2.11.10 - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: 'catalog:' + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-client-core: dependencies: @@ -13446,33 +15395,69 @@ importers: specifier: workspace:* version: link:../start-storage-context seroval: - specifier: ^1.5.4 - version: 1.5.4 + specifier: ^1.6.7 + version: 1.6.7 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-fn-stubs: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-plugin-core: dependencies: '@babel/code-frame': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.29.7 + version: 7.29.7 '@babel/core': - specifier: ^7.28.5 - version: 7.28.5 + specifier: 'catalog:' + version: 7.29.7(supports-color@10.2.2) '@babel/types': - specifier: ^7.28.5 - version: 7.28.5 + specifier: 'catalog:' + version: 7.29.8 + '@jridgewell/remapping': + specifier: ^2.3.5 + version: 2.3.5 '@tanstack/router-core': specifier: workspace:* version: link:../router-core @@ -13489,45 +15474,51 @@ importers: specifier: workspace:* version: link:../start-server-core exsolve: - specifier: ^1.0.7 - version: 1.0.7 + specifier: ^1.1.3 + version: 1.2.0 lightningcss: - specifier: ^1.32.0 - version: 1.32.0 + specifier: ^1.33.0 + version: 1.33.0 pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 picomatch: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^4.0.7 + version: 4.0.7 seroval: - specifier: ^1.5.4 - version: 1.5.4 + specifier: ^1.6.7 + version: 1.6.7 source-map: specifier: ^0.7.6 version: 0.7.6 srvx: - specifier: ^0.11.9 - version: 0.11.12 + specifier: ^1.0.0 + version: 1.0.5 tinyglobby: - specifier: ^0.2.15 - version: 0.2.15 + specifier: 'catalog:' + version: 0.2.17 ufo: - specifier: ^1.5.4 - version: 1.6.1 + specifier: ^1.6.4 + version: 1.6.4 vitefu: - specifier: ^1.1.1 - version: 1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + specifier: ^1.1.3 + version: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) xmlbuilder2: specifier: ^4.0.3 version: 4.0.3 zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: 'catalog:' + version: 2.3.1 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__code-frame': specifier: ^7.0.6 version: 7.0.6 @@ -13540,9 +15531,21 @@ importers: '@types/picomatch': specifier: ^4.0.2 version: 4.0.2 + prettier: + specifier: ^3.9.6 + version: 3.9.6 + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-server-core: dependencies: @@ -13558,28 +15561,46 @@ importers: '@tanstack/start-storage-context': specifier: workspace:* version: link:../start-storage-context - fetchdts: - specifier: ^0.1.6 - version: 0.1.7 - h3-v2: - specifier: npm:h3@2.0.1-rc.20 - version: h3@2.0.1-rc.20(crossws@0.4.5(srvx@0.11.15)) - seroval: - specifier: ^1.5.4 - version: 1.5.4 - devDependencies: - '@standard-schema/spec': - specifier: ^1.0.0 - version: 1.0.0 - '@types/node': - specifier: 25.0.9 - version: 25.0.9 cookie-es: specifier: ^3.0.0 version: 3.1.1 + fetchdts: + specifier: ^0.2.0 + version: 0.2.0 + seroval: + specifier: ^1.6.7 + version: 1.6.7 + devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@standard-schema/spec': + specifier: ^1.0.0 + version: 1.0.0 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + iron-session: + specifier: 9.0.1 + version: 9.0.1 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-static-server-functions: dependencies: @@ -13593,15 +15614,33 @@ importers: specifier: workspace:* version: link:../start-client-core seroval: - specifier: ^1.5.4 - version: 1.5.4 + specifier: ^1.6.7 + version: 1.6.7 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-storage-context: dependencies: @@ -13609,42 +15648,102 @@ importers: specifier: workspace:* version: link:../router-core devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/valibot-adapter: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/react-router': specifier: workspace:* version: link:../react-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 valibot: specifier: 1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@6.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/virtual-file-routes: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/vue-router: dependencies: @@ -13655,39 +15754,60 @@ importers: specifier: workspace:* version: link:../router-core '@tanstack/vue-store': - specifier: ^0.9.3 - version: 0.9.3(vue@3.5.25(typescript@6.0.2)) + specifier: ^0.11.2 + version: 0.11.2(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vue/runtime-dom': specifier: ^3.5.25 version: 3.5.25 isbot: - specifier: ^5.1.22 + specifier: 'catalog:' version: 5.1.28 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/vue': specifier: ^8.1.0 - version: 8.1.0(@vue/compiler-sfc@3.5.25)(vue@3.5.25(typescript@6.0.2)) + version: 8.1.0(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@types/node': specifier: 25.0.9 version: 25.0.9 '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + '@vitest/ui': + specifier: 'catalog:' + version: 5.0.4(vitest@5.0.4) combinate: - specifier: ^1.1.11 + specifier: 'catalog:' version: 1.1.11 + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) zod: - specifier: ^4.4.3 - version: 4.4.3 + specifier: 'catalog:' + version: 4.5.4 packages/vue-router-devtools: dependencies: @@ -13701,43 +15821,73 @@ importers: specifier: workspace:* version: link:../vue-router vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.13 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) packages/vue-router-ssr-query: dependencies: '@tanstack/query-core': - specifier: ^5.99.0 - version: 5.99.0 + specifier: ^5.102.0 + version: 5.102.0 '@tanstack/router-ssr-query-core': specifier: workspace:* version: link:../router-ssr-query-core '@tanstack/vue-query': - specifier: ^5.99.0 - version: 5.99.0(vue@3.5.25(typescript@6.0.2)) + specifier: ^5.102.0 + version: 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../vue-router '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) packages/vue-start: dependencies: @@ -13760,27 +15910,45 @@ importers: specifier: workspace:* version: link:../vue-start-server pathe: - specifier: ^2.0.3 + specifier: 'catalog:' version: 2.0.3 devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@rsbuild/core': - specifier: ^2.0.11 - version: 2.0.14 + specifier: 'catalog:' + version: 2.3.1 '@tanstack/router-utils': specifier: workspace:* version: link:../router-utils + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) packages/vue-start-client: dependencies: @@ -13794,15 +15962,33 @@ importers: specifier: workspace:* version: link:../vue-router devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) packages/vue-start-server: dependencies: @@ -13816,39 +16002,84 @@ importers: specifier: workspace:* version: link:../vue-router devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': - specifier: ^4.1.2 - version: 4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + specifier: 'catalog:' + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 + rimraf: + specifier: 'catalog:' + version: 6.1.2 typescript: - specifier: ^6.0.2 - version: 6.0.2 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: - specifier: ^3.5.25 - version: 3.5.25(typescript@6.0.2) + specifier: 'catalog:' + version: 3.5.25(@typescript/typescript6@6.0.2) packages/zod-adapter: devDependencies: + '@arethetypeswrong/cli': + specifier: 'catalog:' + version: 0.18.4 '@tanstack/react-router': specifier: workspace:* version: link:../react-router + '@tanstack/vite-config': + specifier: 'catalog:' + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 + specifier: 'catalog:' + version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 'catalog:' + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + jsdom: + specifier: 'catalog:' + version: 25.0.1(supports-color@10.2.2) + publint: + specifier: 'catalog:' + version: 0.3.17 react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ~19.2.9 + version: 19.2.9 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ~19.2.9 + version: 19.2.9(react@19.2.9) + rimraf: + specifier: 'catalog:' + version: 6.1.2 vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: specifier: ^3.24.2 version: 3.25.57 @@ -13862,159 +16093,9 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@analogjs/vite-plugin-angular@2.6.3': - resolution: {integrity: sha512-llAevDhrGRSYL3IlUBC6nhM4kIM9W81TXC0w0ygKz5VnnR0+uiOysyJhcOZ9M4yVgG9C6/TsjBnSA4Gjql1+iQ==} - peerDependencies: - '@angular-devkit/build-angular': ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0 - '@angular/build': ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0 - vite: ^8.0.14 - peerDependenciesMeta: - '@angular-devkit/build-angular': - optional: true - '@angular/build': - optional: true - vite: - optional: true - '@andrewbranch/untar.js@1.0.3': resolution: {integrity: sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==} - '@angular-devkit/architect@0.2102.19': - resolution: {integrity: sha512-cj4tzUMiloLTg5rNf17E8MsvIxCWYoBiBsaj7ns6dgXqT9XCeG+J0TA2t1M+N9uuqfeLd22U/rYoCkADmcircQ==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - hasBin: true - - '@angular-devkit/build-angular@21.2.19': - resolution: {integrity: sha512-AlPZT9E7+1gp4TJ4CK8Kefsyo2dx8riREjDTyAYe4++BeWRIjxsaypgHgTZER3CtkugLXr0wknvsCw4i+A3qSg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - '@angular/compiler-cli': ^21.0.0 - '@angular/core': ^21.0.0 - '@angular/localize': ^21.0.0 - '@angular/platform-browser': ^21.0.0 - '@angular/platform-server': ^21.0.0 - '@angular/service-worker': ^21.0.0 - '@angular/ssr': ^21.2.19 - '@web/test-runner': ^0.20.0 - browser-sync: ^3.0.2 - jest: ^30.2.0 - jest-environment-jsdom: ^30.2.0 - karma: ^6.3.0 - ng-packagr: ^21.0.0 - protractor: ^7.0.0 - tailwindcss: ^2.0.0 || ^3.0.0 || ^4.0.0 - typescript: '>=5.9 <6.0' - peerDependenciesMeta: - '@angular/core': - optional: true - '@angular/localize': - optional: true - '@angular/platform-browser': - optional: true - '@angular/platform-server': - optional: true - '@angular/service-worker': - optional: true - '@angular/ssr': - optional: true - '@web/test-runner': - optional: true - browser-sync: - optional: true - jest: - optional: true - jest-environment-jsdom: - optional: true - karma: - optional: true - ng-packagr: - optional: true - protractor: - optional: true - tailwindcss: - optional: true - - '@angular-devkit/build-webpack@0.2102.19': - resolution: {integrity: sha512-T8omQt2QSbNOCTPvOJkt7zg9EtaFt1x6ZiJaqZrq/GK729dD/RGYF0hZqi2AeAE7OMyutFhrDREr2WrNqv1nWg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - webpack: ^5.30.0 - webpack-dev-server: ^5.0.2 - - '@angular-devkit/core@21.2.19': - resolution: {integrity: sha512-dtpJMQBz5nhkcIogPmXP/aT2Ak8m/wLRPOSTI/g4vSJSuGiI53PgtWq4/wfQga6E6wdM2XWsblAE89d8w5heQQ==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - chokidar: ^5.0.0 - peerDependenciesMeta: - chokidar: - optional: true - - '@angular/build@21.2.19': - resolution: {integrity: sha512-emy9mqrTXAwhZzcvx8MaHyz+cUR06PVGxnqy91+bpDxPP9S5x67sPoOkY9y/ETFFhRpB5ULlUxyq0eN/pi6QOg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - '@angular/compiler': ^21.0.0 - '@angular/compiler-cli': ^21.0.0 - '@angular/core': ^21.0.0 - '@angular/localize': ^21.0.0 - '@angular/platform-browser': ^21.0.0 - '@angular/platform-server': ^21.0.0 - '@angular/service-worker': ^21.0.0 - '@angular/ssr': ^21.2.19 - karma: ^6.4.0 - less: ^4.2.0 - ng-packagr: ^21.0.0 - postcss: ^8.4.0 - tailwindcss: ^2.0.0 || ^3.0.0 || ^4.0.0 - tslib: ^2.3.0 - typescript: '>=5.9 <6.0' - vitest: ^4.0.8 - peerDependenciesMeta: - '@angular/core': - optional: true - '@angular/localize': - optional: true - '@angular/platform-browser': - optional: true - '@angular/platform-server': - optional: true - '@angular/service-worker': - optional: true - '@angular/ssr': - optional: true - karma: - optional: true - less: - optional: true - ng-packagr: - optional: true - postcss: - optional: true - tailwindcss: - optional: true - vitest: - optional: true - - '@angular/compiler-cli@21.2.18': - resolution: {integrity: sha512-L5zbIp7YfTTB4I4xT33FgEBanzhppNejzZX0HJOEqKDyDL2jXq+flt83lE0XVuRJ6/zrG+UKj0B+y/CK6Ro7Wg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} - hasBin: true - peerDependencies: - '@angular/compiler': 21.2.18 - typescript: '>=5.9 <6.1' - peerDependenciesMeta: - typescript: - optional: true - - '@angular/compiler@21.2.18': - resolution: {integrity: sha512-ccnDuKLuzIa0ayijR+alarsHNWIksuGV/lxGTZ0t6/0+B6J/RXupz6M2IO6ZHHEcg8r7pcrLCUBTyp3FoiRJrg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} - '@arethetypeswrong/cli@0.18.4': resolution: {integrity: sha512-kNWo6LTzGAuLYPpJ7Sgo63whSUeeSuKMlYx6IBgzs4ONEG807gW4hSSENvpeCHzO2H2wIzG5EFl0OKBbqGBAyA==} engines: {node: '>=20'} @@ -14071,14 +16152,6 @@ packages: nodemailer: optional: true - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} - engines: {node: '>=6.9.0'} - - '@babel/code-frame@7.29.0': - resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.29.7': resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} engines: {node: '>=6.9.0'} @@ -14107,26 +16180,14 @@ packages: resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} engines: {node: '>=6.9.0'} - '@babel/generator@7.28.5': - resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.29.1': - resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.29.7': - resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==} + '@babel/generator@7.29.8': + resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==} engines: {node: '>=6.9.0'} '@babel/helper-annotate-as-pure@7.27.3': resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.29.7': - resolution: {integrity: sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==} - engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.27.2': resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} @@ -14145,35 +16206,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.28.5': - resolution: {integrity: sha512-q3WC4JfdODypvxArsJQROfupPBq9+lMwjKq7C33GhbFYJsufD0yd/ziwD+hJucLeWsnFPWZjsU2DNFqBPE7jwQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.28.6': resolution: {integrity: sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.29.7': - resolution: {integrity: sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-create-regexp-features-plugin@7.29.7': - resolution: {integrity: sha512-907Uymvqgg1dwUA+7IGwFAOSYzQOuzPXKNJ1yxzwPffzkYFg2q2eHi1fIOs6sXkG9NbIUMunnUlkYsfRFNvomg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-define-polyfill-provider@0.6.8': - resolution: {integrity: sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} @@ -14190,10 +16228,6 @@ packages: resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.29.7': - resolution: {integrity: sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg==} - engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.18.6': resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} @@ -14232,10 +16266,6 @@ packages: resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} engines: {node: '>=6.9.0'} - '@babel/helper-optimise-call-expression@7.29.7': - resolution: {integrity: sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==} - engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.27.1': resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} @@ -14244,16 +16274,6 @@ packages: resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.29.7': - resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-remap-async-to-generator@7.29.7': - resolution: {integrity: sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.27.1': resolution: {integrity: sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==} engines: {node: '>=6.9.0'} @@ -14266,36 +16286,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.29.7': - resolution: {integrity: sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.29.7': - resolution: {integrity: sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-split-export-declaration@7.24.7': - resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.27.1': - resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.29.7': resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.28.5': - resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.29.7': resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} @@ -14308,10 +16306,6 @@ packages: resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.29.7': - resolution: {integrity: sha512-iES0Skag9ERIF68aXadpO6dbXa03mNWK3sEqJaMnLNs/eC3l0lkImdfoy6Y09/SfkpawdAB4RjQ7PVA7TcVGdw==} - engines: {node: '>=6.9.0'} - '@babel/helpers@7.28.4': resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} engines: {node: '>=6.9.0'} @@ -14329,88 +16323,23 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.29.2': - resolution: {integrity: sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==} + '@babel/parser@7.29.8': + resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.29.7': - resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.29.7': - resolution: {integrity: sha512-j8SrR0zLZrRsC09DlszEx8FpMiwukKffYXMK0d5LmOglO7vGG6sz/BR/20yHqWH+Lnn31JTt2PE3hIWNgM2J6w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.29.7': - resolution: {integrity: sha512-r8j8escF+U2FUHo0KOhPUdMzUO+jp9fInva6+ACVAF3Y97Ev+5iNZwiqTghmzNeWwDkOPlYuTcfb1vDaoZKmAQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.29.7': - resolution: {integrity: sha512-GE1TFSiuFeGsCxmYXZl8HwoPrVlwe4rHPFE8weieGKZqnDORK+Ar3vgWMgW+AOxQ6/2TgLSKx9p6W7O4rC6qgQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.29.7': - resolution: {integrity: sha512-QQt9qKHZ2sg/kivaLr7lnQr8HVrQDdBNSfCsTjiDxRuX/K5ORyKq+Bu8Xr0cDE3Dfkv0cw28Ve0EKyKMvulkOw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.13.0 - - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.29.7': - resolution: {integrity: sha512-pn6QacGLgvCcwc+syUhKE/qSjV2D1IHDB84RNxWYSt1mW3K/SCtjinZ2p0cETJxAWBjPy3K/1lHwG5BjjPxNlw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-proposal-decorators@7.28.0': - resolution: {integrity: sha512-zOiZqvANjWDUaUS9xMxbMcK/Zccztbe/6ikvUXaG9nsPH3w6qh5UaPGAnirI/WhIbZ8m3OHU0ReyPrknG+ZKeg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-decorators@7.29.0': resolution: {integrity: sha512-CVBVv3VY/XRMxRYq5dwr2DS7/MvqPm23cOCjbwNnVrfOqcWlnefua1uUs0sjdKOGjvPUG633o07uWzJq4oI6dA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2': - resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-decorators@7.27.1': - resolution: {integrity: sha512-YMq8Z87Lhl8EGkmb0MwYkt36QnxC+fzCgrl66ereamPlYToRpIk5nUjKUY3QKLWq8mwUB1BgbeXcTJhZOCDg5A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.28.6': resolution: {integrity: sha512-71EYI0ONURHJBL4rSFXnITXqXrrY8q4P0q006DPfN+Rk+ASM+++IBXem/ruokgBZR8YNEWZ8R6B+rCb8VcUTqA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-assertions@7.29.7': - resolution: {integrity: sha512-/An1OCBN93thpBAGyfsK2pcf0jvju1SAtKkL2Ny++B5Sy6sqgzXDQH1cZxWbF96Wuk+bn41MDA9bLd4VVAw6rw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-attributes@7.29.7': - resolution: {integrity: sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.27.1': resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} engines: {node: '>=6.9.0'} @@ -14429,389 +16358,30 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-unicode-sets-regex@7.18.6': - resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-transform-arrow-functions@7.29.7': - resolution: {integrity: sha512-N7zArUXWzAMzm+/N0uPBeVB3Fam5lMxtUwMmDK5f/IBBS7a7p1qeUoxd/6CckXoxUdgsntq1Dh8xNW06maZbDQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-async-generator-functions@7.29.0': - resolution: {integrity: sha512-va0VdWro4zlBr2JsXC+ofCPB2iG12wPtVGTWFx2WLDOM3nYQZZIGP82qku2eW/JR83sD+k2k+CsNtyEbUqhU6w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-async-to-generator@7.28.6': - resolution: {integrity: sha512-ilTRcmbuXjsMmcZ3HASTe4caH5Tpo93PkTxF9oG2VZsSWsahydmcEHhix9Ik122RcTnZnUzPbmux4wh1swfv7g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-block-scoped-functions@7.29.7': - resolution: {integrity: sha512-cUSmjh72N+rN4PrkFlN1dJwNCwjVp5d38/CQrEsFggkD10UiFlBFgdH3tv5dNsLuHY+3S8db2xCHjhZcv5WgvA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-block-scoping@7.29.7': - resolution: {integrity: sha512-ONyr4+AZhKh8yKWInVxU9AXA9EbsyeLcL6V0dJy6M2/62vuvpGm29zzuymbTpdc451GEpDIdAyPLP3r+P61yKQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-class-properties@7.27.1': - resolution: {integrity: sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.28.6': resolution: {integrity: sha512-dY2wS3I2G7D697VHndN91TJr8/AAfXQNt5ynCTI/MpxMsSzHp+52uNivYT5wCPax3whc47DR8Ba7cmlQMg24bw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-static-block@7.29.7': - resolution: {integrity: sha512-kibJgmEdX2iMwsHY2tSZNDgj8PwIlCQz7FK9KuGKO8zsuoUwSEhoNnNVp/emKWrbY4HeO6kkXfdMqRKKKXBm2A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.12.0 - - '@babel/plugin-transform-classes@7.29.7': - resolution: {integrity: sha512-qV0OGGBVacduzQHE649JyCneOFI/maT+YKsO+K4Yi3xv2wTPNjM/W2o2gdzMwEAZz7fXNTHAe0NcSg30bIN69g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-computed-properties@7.29.7': - resolution: {integrity: sha512-RK7/IyU5phpuCdBAuig5VkzG/EnbDaui5SQGdU9BFrHdV+mV4cUjLMQ9lJDjLNtWHsqtiefpGZUXQP2BiTYMsA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-destructuring@7.29.7': - resolution: {integrity: sha512-iPX8aD6H9zV5s7ZsqTdNocPN/MGQ5sSMnElKrktxjJRMnB2jN/1p2+R7GkfD6CAYoVFqy5A4XnSIUeGgJzIWpg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-dotall-regex@7.29.7': - resolution: {integrity: sha512-3qc18hsD2RdZiyJNDNc7HQpv6xbncwh8FYtxNFFzclSyh/trPD9KkVR9BDECUjDLvb7yJVF15GfYUuC+LMkkiQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-duplicate-keys@7.29.7': - resolution: {integrity: sha512-6IvRRriEMqnBwD6chtxdLpMYCHWEzN+oL5cyQtjykya19UgzbmKhxmhZgKC/LHxS2nYr9Q/qYPZ5Lr6jOL9+yQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.29.7': - resolution: {integrity: sha512-2wiIyo2BjtgU7HufSeDnL9L2O7zr8jmhFKuSr65VpRkUiRKRNpb0mdlk56+XPPKoIrfHqzbMuglDvZun0RISsA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-transform-dynamic-import@7.29.7': - resolution: {integrity: sha512-giOlEm/EFjfjr+te9NsdjkUo2v4f8rS/SXPumRVHAtbNcyNlvtREkU1dZzaIDclNpnaVhlCqRdFKhJBjBikzLg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-explicit-resource-management@7.29.7': - resolution: {integrity: sha512-Rstj7coNz8sE+7Ju7ihpHLI564lsK5pUpNNlvptCIC/16E/S5hbl6n3kESPKdNRmqEWlpn5xpS5Q2dvXBsySLw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-exponentiation-operator@7.29.7': - resolution: {integrity: sha512-zFpMOTLZBdW5LfObqcSbL6kefg4R4eLdmvS0wbN9M6D5Mym/sKm9toOoWyVOa+xDjvCnuWcHls2YonXwHvH3CQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-export-namespace-from@7.29.7': - resolution: {integrity: sha512-24B2nOy2TeJSMheqwPD4DDQOV/elLSIlKxjZt4i05H5AgdPdWR3n18HnNrcJ+j76WJd9gbwb9jPjNYUy6RautA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-for-of@7.29.7': - resolution: {integrity: sha512-zeSIHh0+E1Um1WJRXCFlHQYu2ieJNdivLLjlBEp+dIBu3S51n+SZZmIXjxnItw6pz56Cn+KvK68BIBVsxq2JiQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-function-name@7.29.7': - resolution: {integrity: sha512-otRWaHXE6fbAGkePvaj/kvs3HsqXfPhlnzwSOlnFgbqCPMd975dW+4wZ00WFBt+/YlBGcJwNrARQTOJOb4ZrIg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-json-strings@7.29.7': - resolution: {integrity: sha512-RRnE2+eon1rJAq8MnoF1b5kTpY1vU88twHcvcKMrsqP/jxIRqDVs9iJB5fqPuqyeFAW0wJo4MlUIPpQCq/aRsg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-literals@7.29.7': - resolution: {integrity: sha512-DZ/oLP21ZuWx1vKqnoNv6/tvEK48AQOBRai40CX9dTjGluvT/YZCyY3rryDtyUqCEoyNroy5KKPwX2iQCiRvyw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-logical-assignment-operators@7.29.7': - resolution: {integrity: sha512-A0H91hh6W8MFRkp5TqJmMr39jzGD1A1E1Ysiv2O06Sfbhkapm+XyIzxWCEh5kqwOZ1/8QZ0dY3SeQ7XBqfJd5Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-member-expression-literals@7.29.7': - resolution: {integrity: sha512-hl1kwFZCCiDyfH25Xmco9jTrkPgnS9pmOzSG7W5I4SaGbLeqKv417hcU2RKmaxoPEgsoJh7ZPOrnPGq99bHoUg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-modules-amd@7.29.7': - resolution: {integrity: sha512-fxtQoH3m5ywUSIfaH0FGCzWu4McsYon5bD3K4XnskC7f+OyQMj7rsOMi4NvvmJ83WwBAg4UCe+ov4VZlqEvyew==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.27.1': resolution: {integrity: sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.29.7': - resolution: {integrity: sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-modules-systemjs@7.29.7': - resolution: {integrity: sha512-TM2ZcQLoG2/y4HODiStCo10DibYhWhGWAwVv+EQKmG/7GFl0N+AAmUiXOMKM+aiJ9XBJ9AHVZBvTzMnJ2sM3cQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-modules-umd@7.29.7': - resolution: {integrity: sha512-B4UkaTK3QpgCwJnrxKfMPKdo92CN7OKXAlpAAnM3UPu0Q0lCCk57ylA9AJbRy2v8dDKOPAAWcoR6CMyeoHwRCA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-named-capturing-groups-regex@7.29.7': - resolution: {integrity: sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-transform-new-target@7.29.7': - resolution: {integrity: sha512-fEo41GmsOUhOBlw8ioo6zvjX5Xc2Lqkzlyfqbpsk3eB6TReV18uhxZ0esfEokVbY2+PVJAQHNKxER6lGrzNd3A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-nullish-coalescing-operator@7.29.7': - resolution: {integrity: sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-numeric-separator@7.29.7': - resolution: {integrity: sha512-zR7fv/z14OjgHl4AgRtkDBvBMhIzCxqV/qN/2BCRC7LjFwvuzjYe7gDWxC4Wl/SNsLM6SE1IWvRPYMgSJaUvNw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-object-rest-spread@7.29.7': - resolution: {integrity: sha512-Ld98jn4c0smUywL57m7SgsHq3OpThOa6LqZJif3G6jYOovPleoFhVrBJ1WegRApSFB2wu4+RelAj9AC9G08Z4A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-object-super@7.29.7': - resolution: {integrity: sha512-Ea/diGcw0twB5IlZPO5sgET6fJsLJqPABqTuFWIR+iMPGPZJkATEIWx0wa+aEQ5UY1CBQyP/gkAiLEqn1vBiQA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-optional-catch-binding@7.29.7': - resolution: {integrity: sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-optional-chaining@7.29.7': - resolution: {integrity: sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-parameters@7.29.7': - resolution: {integrity: sha512-ZDOBqV/qLYJI0YElr8DcENEyARsFQeESqWXH6gZlghYXuPPjvweuDhP4VyEi4BlUBlLRFZVjxoZDMjxhLW766g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-private-methods@7.29.7': - resolution: {integrity: sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-private-property-in-object@7.29.7': - resolution: {integrity: sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-property-literals@7.29.7': - resolution: {integrity: sha512-bOMRLQuI0A5ZqHq3OWJ89/rXpJ/NJrbVhXiP4zwPGMs6kpcVsuTUNjwoE30K0Qm3mf48a/TnRYYD6vPNqcg6jA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-self@7.25.9': - resolution: {integrity: sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-self@7.27.1': - resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-source@7.25.9': - resolution: {integrity: sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-source@7.27.1': - resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-regenerator@7.29.7': - resolution: {integrity: sha512-rNNFV0DBAJp988xW2DOntfDoYn1eR8GGF5AT5vYc+rjyfaQkM242c9tZUHHPe7KYaiJizXPWhQTzzdbXySyhBw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-regexp-modifiers@7.29.7': - resolution: {integrity: sha512-mB5Fs0VWrJ42ZCmc8114v60qetdaUVNkj9PmSZRmanCZM3S9hm0CFRLjRmYIsuXav14l2jvZ+4T8iiCGnhj3nQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/plugin-transform-reserved-words@7.29.7': - resolution: {integrity: sha512-5+YhdpVgmfSmwZyLMftfaiffLRMHjzIRHFHHLdibcSyJm2pasMrKHrO3Ptrt2DRshjvpgjEJJ1zVW14WPq/6QA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-runtime@7.29.0': - resolution: {integrity: sha512-jlaRT5dJtMaMCV6fAuLbsQMSwz/QkvaHOHOSXRitGGwSpR1blCY4KUKoyP2tYO8vJcqYe8cEj96cqSztv3uF9w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-shorthand-properties@7.29.7': - resolution: {integrity: sha512-I+WYbGBAiCn7nA6xBrlgPH+MB7HWb4u8pv5S0Pv7OtwNvIFvCCb24YlttKEeUFVurfBCEaOTnuhlqsb7f0Z5Dg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-spread@7.29.7': - resolution: {integrity: sha512-/u5K1QWada7tbYNqTjMh96718g9NTwh9tfPJMsSmVsQwGT447FskV+KcfeXkXq2GWki4EM/MuTdmBec+hOuVTQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-sticky-regex@7.29.7': - resolution: {integrity: sha512-BCHzNYJGe9l7EpwwDBN/ztlL2NYFFq8hp9ddjtUEM9f2O7S7kKV/lL6Fwo7IF7NSkYhPK2vO+86nIGltA90MsA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-template-literals@7.29.7': - resolution: {integrity: sha512-NCSEJ4sLFU2gqAub45HYh4fus2yQ36rr6ei6vpU7NdoJqCpxvEG8E6eJpscGyXP3VHD2Ny+fSXr04k1hoUrFqA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-typeof-symbol@7.29.7': - resolution: {integrity: sha512-223mNGoTkBiTEWFoK+Q6Go3tueMRclO8vxxxxquNCYuNI4jWOofFKJRRDu6SDrB8Sgo1UEGW9T4GAQ8ZyRso1A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.27.1': resolution: {integrity: sha512-Q5sT5+O4QUebHdbwKedFBEwRLb02zJ7r4A5Gg2hUoLuU3FjdMcyqcywqUrLCaDsFCxzokf7u9kuy7qz51YUuAg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.28.5': - resolution: {integrity: sha512-x2Qa+v/CuEoX7Dr31iAfr0IhInrVOWZU/2vJMJ00FOR/2nM0BcBEclpaf9sWCDc+v5e9dMrhSH8/atq/kX7+bA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.28.6': resolution: {integrity: sha512-0YWL2RFxOqEm9Efk5PvreamxPME8OyY0wM5wh5lHjF+VtVhdneCWGzZeSqzOfiobVqQaNCd2z0tQvnI9DaPWPw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-escapes@7.29.7': - resolution: {integrity: sha512-jCfXxSjf94lf4E0hKE0AByxF6F3/pVFqRdUUNkDJhsY0m1ZKjnN6ZYyMeHNpzflxb/0q5b7t3p+BE+SLF1WOtA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-unicode-property-regex@7.29.7': - resolution: {integrity: sha512-OgZ+zoAJgZLUCunsTRQ5LAjOywDv5zzZ2/hQ5aMw1pGXyY2rtE8/chXYUmu3AlVHKpm10KEdG9aMwbI/K76ZGw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-unicode-regex@7.29.7': - resolution: {integrity: sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-unicode-sets-regex@7.29.7': - resolution: {integrity: sha512-BLOhLht9DOJwIxlmp91wHvkXv1lguuHS3/FwUO8HL1H0u8s4hR1gASVFyilu9iGtcTRYqjTZmlsFFeQletntEg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/preset-env@7.29.2': - resolution: {integrity: sha512-DYD23veRYGvBFhcTY1iUvJnDNpuqNd/BzBwCvzOTKUnJjKg5kpUBh3/u9585Agdkgj+QuygG7jLfOPWMa2KVNw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/preset-modules@0.1.6-no-external-plugins': - resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} - peerDependencies: - '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - '@babel/preset-typescript@7.27.1': resolution: {integrity: sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==} engines: {node: '>=6.9.0'} @@ -14828,18 +16398,6 @@ packages: resolution: {integrity: sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.29.2': - resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==} - engines: {node: '>=6.9.0'} - - '@babel/template@7.27.2': - resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} - engines: {node: '>=6.9.0'} - - '@babel/template@7.28.6': - resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} - engines: {node: '>=6.9.0'} - '@babel/template@7.29.7': resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} engines: {node: '>=6.9.0'} @@ -14852,24 +16410,12 @@ packages: resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.29.7': - resolution: {integrity: sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==} + '@babel/traverse@7.29.8': + resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==} engines: {node: '>=6.9.0'} - '@babel/types@7.28.4': - resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.28.5': - resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.29.0': - resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.29.7': - resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} engines: {node: '>=6.9.0'} '@better-auth/core@1.6.19': @@ -14951,9 +16497,6 @@ packages: '@better-fetch/fetch@1.3.1': resolution: {integrity: sha512-ABkD1WhyfPZprKRQI3bhATjeiFuNWC9PXhfGWqL+sg/gKrM977oFrYkdb4msM3hgUGonr7KlOsOFT5TU2rht9g==} - '@blazediff/core@1.9.1': - resolution: {integrity: sha512-ehg3jIkYKulZh+8om/O25vkvSsXXwC+skXmyA87FFx6A/45eqOkZsBltMw/TVteb0mloiGT8oGRTcjRAz66zaA==} - '@braidai/lang@1.1.2': resolution: {integrity: sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA==} @@ -14961,6 +16504,9 @@ packages: resolution: {integrity: sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==} hasBin: true + '@bufbuild/protobuf@2.16.0': + resolution: {integrity: sha512-FWa0sPlqYGJgpTs6OxBRcL/AW4JT0OIO+W1ajerluoTVh8CV0B7XM1qsNCRgnkSCkRCgOICKHRQlY17jrsm0+Q==} + '@bundled-es-modules/cookie@2.0.1': resolution: {integrity: sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==} @@ -15043,6 +16589,14 @@ packages: '@chevrotain/utils@10.5.0': resolution: {integrity: sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==} + '@clack/core@1.4.3': + resolution: {integrity: sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==} + engines: {node: '>= 20.12.0'} + + '@clack/prompts@1.7.0': + resolution: {integrity: sha512-y7/yvZ2TPAnR9+jnc00klvNNLkJiXFFrQA/hlLCcxA9a2A4zQIOimyFQ9XfwYKiGD1fb5GY8vbKIIgO8d5Tb2A==} + engines: {node: '>= 20.12.0'} + '@clerk/backend@2.18.3': resolution: {integrity: sha512-fWMq/Tb2hgfUXLKJN8jr6pbpA5XLUwC4BjWz7lB5Y+YhXhBrO7GtfpZIS91L/aDhNb17X6IaE6XvS6tDJBCUUw==} engines: {node: '>=18.17.0'} @@ -15056,23 +16610,23 @@ packages: engines: {node: '>=18.17.0'} deprecated: 'This package is no longer supported. Please use @clerk/react instead. See the upgrade guide for more info: https://clerk.com/docs/guides/development/upgrading/upgrade-guides/core-3' peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@clerk/clerk-react@5.59.3': resolution: {integrity: sha512-r1gmAYxhXs+QkXjDwj5Eqvm0Io8PtJ4FKkA45khiAzIQXcaQLFq/wFy7d1K8OSIYAIdFbuO0bnIOU/FdgWOc+A==} engines: {node: '>=18.17.0'} deprecated: 'This package is no longer supported. Please use @clerk/react instead. See the upgrade guide for more info: https://clerk.com/docs/guides/development/upgrading/upgrade-guides/core-3' peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@clerk/shared@3.28.2': resolution: {integrity: sha512-BfBCPaoPoLCiU0b0MhQUfCjs+bWRRLkdHw0vBffSjtsFLxp1b5IL5D8nKgDPIKIIv7DmCCmO15tr+GqG3CGpYQ==} engines: {node: '>=18.17.0'} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: react: optional: true @@ -15083,8 +16637,8 @@ packages: resolution: {integrity: sha512-sJUur/7jnHHlAsdoDosxpOmfV05VR7K5rvqlFskj3GaAMFEJrvdOztw0hmhBGVSWiCpjTZfdGITegton8mo7mQ==} engines: {node: '>=18.17.0'} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: react: optional: true @@ -15097,8 +16651,8 @@ packages: peerDependencies: '@tanstack/react-router': workspace:* '@tanstack/react-start': workspace:* - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@clerk/tanstack-react-start@0.27.14': resolution: {integrity: sha512-So+pchhM3NUIY0sFqxh3yv2hG9bifPUqkCIDUKVzq0+korMhHTsMXBwcsbt2LpQ9UBXob1dW5v1WxtdWkqELFw==} @@ -15106,8 +16660,8 @@ packages: peerDependencies: '@tanstack/react-router': workspace:* '@tanstack/react-start': workspace:* - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@clerk/types@4.101.10': resolution: {integrity: sha512-qlmgnAm/IeK02RKEKVN8/Glx07xw/Lcv67jBfikM8HXhHc5v7bfYLD8UiWTr6H2RGtvB09cIt9JezRRlsuVBew==} @@ -15119,10 +16673,19 @@ packages: engines: {node: '>=18.17.0'} deprecated: 'This package is no longer supported. Please import types from @clerk/shared/types instead. See the upgrade guide for more info: https://clerk.com/docs/guides/development/upgrading/upgrade-guides/core-3' + '@cloudflare/build-output-utils@0.9.10': + resolution: {integrity: sha512-9F6RSV0FJnF0zQLIoMVgxc0ub57FrZBGKZ8oUQHyVAbbjodlcIHk0BF5fd3B89N/Y4cE+FSqzWfpq3RzFy3tjA==} + + '@cloudflare/config@0.30.2': + resolution: {integrity: sha512-YTasjo8Kvfn3SlVs5gHZ6fy73BNQafY2Y8aosasicO8CTRVj2h8K7h+IJnjHK+tzM00Qi96VcOCfefCNLuMauw==} + '@cloudflare/kv-asset-handler@0.4.2': resolution: {integrity: sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==} engines: {node: '>=18.0.0'} + '@cloudflare/runtime-types@0.1.23': + resolution: {integrity: sha512-uQVuBfVlJqGFryfyiMG+62KKS6NNC/EKYqbHGnNE2ExhcPNUihfYp3hWtTKshikZe7STTmIaLpDqT+h7J8Fdrw==} + '@cloudflare/unenv-preset@2.15.0': resolution: {integrity: sha512-EGYmJaGZKWl+X8tXxcnx4v2bOZSjQeNI5dWFeXivgX9+YCT69AkzHHwlNbVpqtEUTbew8eQurpyOpeN8fg00nw==} peerDependencies: @@ -15132,10 +16695,19 @@ packages: workerd: optional: true + '@cloudflare/unenv-preset@2.16.2': + resolution: {integrity: sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==} + peerDependencies: + unenv: 2.0.0-rc.24 + workerd: '>1.20260305.0 <2.0.0-0' + peerDependenciesMeta: + workerd: + optional: true + '@cloudflare/vite-plugin@1.29.1': resolution: {integrity: sha512-HTbVG43olzk3KTZD8b0nlmJTI3G6sQdFTmuD9HMJy7bkQbxKppkt16jayFo/NWAAs1GJXpFjLkC8udRdyn3aEg==} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 wrangler: ^4.75.0 '@cloudflare/workerd-darwin-64@1.20260317.1': @@ -15144,39 +16716,69 @@ packages: cpu: [x64] os: [darwin] + '@cloudflare/workerd-darwin-64@1.20261104.1': + resolution: {integrity: sha512-5Bl+P1HT1/Ezk7Yrhyd+QkJ4VC/3naO0L3so/AkpgdaAHG3bmUmcCJBAtwH7O4JdVt8SMfm6EV89seiPpdjHJQ==} + engines: {node: '>=16'} + cpu: [x64] + os: [darwin] + '@cloudflare/workerd-darwin-arm64@1.20260317.1': resolution: {integrity: sha512-M/MnNyvO5HMgoIdr3QHjdCj2T1ki9gt0vIUnxYxBu9ISXS/jgtMl6chUVPJ7zHYBn9MyYr8ByeN6frjYxj0MGg==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] + '@cloudflare/workerd-darwin-arm64@1.20261104.1': + resolution: {integrity: sha512-2fM+0klAjspAQ3Jl0iw0gVyGpNnkvPiZ50WHigPLhWQRiS+zhabFXVR07zz1RaPGkJHrMjEpWoEfjjm8nU5IOg==} + engines: {node: '>=16'} + cpu: [arm64] + os: [darwin] + '@cloudflare/workerd-linux-64@1.20260317.1': resolution: {integrity: sha512-1ltuEjkRcS3fsVF7CxsKlWiRmzq2ZqMfqDN0qUOgbUwkpXsLVJsXmoblaLf5OP00ELlcgF0QsN0p2xPEua4Uug==} engines: {node: '>=16'} cpu: [x64] os: [linux] + '@cloudflare/workerd-linux-64@1.20261104.1': + resolution: {integrity: sha512-VgpZIOooZHjSxjEZIJ1hkyt/jTfL3KeavkWCc0x7xxVu9zgkplaJF78Iv6CzoCTamQXyZeBaRQHS2bbAc70Vgg==} + engines: {node: '>=16'} + cpu: [x64] + os: [linux] + '@cloudflare/workerd-linux-arm64@1.20260317.1': resolution: {integrity: sha512-3QrNnPF1xlaNwkHpasvRvAMidOvQs2NhXQmALJrEfpIJ/IDL2la8g499yXp3eqhG3hVMCB07XVY149GTs42Xtw==} engines: {node: '>=16'} cpu: [arm64] os: [linux] + '@cloudflare/workerd-linux-arm64@1.20261104.1': + resolution: {integrity: sha512-uEBJJHh2SbeQauRGrad7tIFIrpUQ5LUqZX40l7IKwYd0yeemvsno8f57w34Bx/pPpaSsNYVcV5oNFVbv+v/BOw==} + engines: {node: '>=16'} + cpu: [arm64] + os: [linux] + '@cloudflare/workerd-windows-64@1.20260317.1': resolution: {integrity: sha512-MfZTz+7LfuIpMGTa3RLXHX8Z/pnycZLItn94WRdHr8LPVet+C5/1Nzei399w/jr3+kzT4pDKk26JF/tlI5elpQ==} engines: {node: '>=16'} cpu: [x64] os: [win32] - '@codspeed/core@5.5.0': - resolution: {integrity: sha512-5FbjNlxSVOfemB85orEecikZiTz0C8aZYUfCkt5HY6QLLd1mqkrHAfekEJw0gkHcgCjNgD6DVp2TXm0V/xtt4w==} + '@cloudflare/workerd-windows-64@1.20261104.1': + resolution: {integrity: sha512-b/fnEU1leVm8UrI2EHQ4MSrK2vmnWdR1jefRyEUDZe3ucpKY0PWi4bVxWh5niZdlL0MIc4C5tXNXTlAMZpKDdA==} + engines: {node: '>=16'} + cpu: [x64] + os: [win32] - '@codspeed/vitest-plugin@5.5.0': - resolution: {integrity: sha512-u7NTLXujxo0bQVCYDXk2mDJ+lA8h5vPY96FvUpPYLUbzVRsM6HO62gXXn4ABJOGYwx1bIwXtgSpUlK/V63iIcg==} + '@codspeed/core@6.0.1': + resolution: {integrity: sha512-p6yrZIoz/Bf5vW/QfGhiPOCKccGPES3jQ8NA+03qGcUYR3/U0tZ9h6ZkxVg2zLN10YaHrABEY4GtmTEEE5xF5Q==} + + '@codspeed/vitest-plugin@6.0.1': + resolution: {integrity: sha512-QEIkp3UtXwbT3eB7NZ49+Jz5xpzHopSFMscASF4lpbjTgbOt/Xax6vIPShDSPKB5JErexyJBze7AwCOPgkoNqQ==} peerDependencies: tinybench: '>=2.9.0' - vite: ^8.0.14 - vitest: ^3.2 || ^4 + vite: ^8.3.4 + vitest: ^3.2 || ^4 || ^5 '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} @@ -15191,13 +16793,13 @@ packages: peerDependencies: better-auth: 1.3.27 convex: '>=1.28.2 <1.35.0' - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@convex-dev/react-query@0.0.0-alpha.8': resolution: {integrity: sha512-Rv/q7/CplU75f7ckBd2vh+HoeeQ0tOrjwMl14Hk7D/03e55oUIU0TV5JYYzC79ZQyyAtoj7CmCo5ZxcmtKNv1Q==} peerDependencies: - '@tanstack/react-query': ^5.99.0 + '@tanstack/react-query': ^5.102.0 convex: ^1.17.0 '@cspotcode/source-map-support@0.8.1': @@ -15252,12 +16854,6 @@ packages: peerDependencies: '@csstools/css-tokenizer': ^4.0.0 - '@csstools/css-syntax-patches-for-csstree@1.0.14': - resolution: {integrity: sha512-zSlIxa20WvMojjpCSy8WrNpcZ61RqfTfX3XTaOeVlGJrt/8HF3YbzgFZa01yTbT4GWQLwfTcC3EB8i3XnB647Q==} - engines: {node: '>=18'} - peerDependencies: - postcss: ^8.4 - '@csstools/css-syntax-patches-for-csstree@1.1.5': resolution: {integrity: sha512-oNjBvzLq2GPZtJphCjLqXow/cHySHSgtxvKZb7OqSZ/xHgw6NWNhfad+6AB9cLeVm6eA9d/qMll3JdEHjy6M+A==} peerDependencies: @@ -15293,10 +16889,6 @@ packages: resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} engines: {node: '>=10.0.0'} - '@discoveryjs/json-ext@0.6.3': - resolution: {integrity: sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==} - engines: {node: '>=14.17.0'} - '@electric-sql/pglite-socket@0.0.6': resolution: {integrity: sha512-6RjmgzphIHIBA4NrMGJsjNWK4pu+bCWJlEWlwcxFTVY3WT86dFpKwbZaGWZV6C5Rd7sCk1Z0CI76QEfukLAUXw==} hasBin: true @@ -15308,17 +16900,20 @@ packages: peerDependencies: '@electric-sql/pglite': 0.3.2 + '@electric-sql/pglite@0.3.16': + resolution: {integrity: sha512-mZkZfOd9OqTMHsK+1cje8OSzfAQcpD7JmILXTl5ahdempjUDdmg4euf1biDex5/LfQIDJ3gvCu6qDgdnDxfJmA==} + '@electric-sql/pglite@0.3.2': resolution: {integrity: sha512-zfWWa+V2ViDCY/cmUfRqeWY1yLto+EpxjXnZzenB1TyxsTiXaTWeZFIZw6mac52BsuQm0RjCnisjBtdBaXOI6w==} - '@emnapi/core@1.10.0': - resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} + '@emnapi/core@1.11.3': + resolution: {integrity: sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg==} '@emnapi/core@1.4.5': resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==} - '@emnapi/runtime@1.10.0': - resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} + '@emnapi/runtime@1.11.3': + resolution: {integrity: sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==} '@emnapi/runtime@1.4.5': resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} @@ -15326,8 +16921,8 @@ packages: '@emnapi/wasi-threads@1.0.4': resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==} - '@emnapi/wasi-threads@1.2.1': - resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + '@emnapi/wasi-threads@1.2.3': + resolution: {integrity: sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==} '@emotion/babel-plugin@11.13.5': resolution: {integrity: sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==} @@ -15348,7 +16943,7 @@ packages: resolution: {integrity: sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==} peerDependencies: '@types/react': '*' - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -15364,7 +16959,7 @@ packages: peerDependencies: '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -15375,7 +16970,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks@1.2.0': resolution: {integrity: sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==} peerDependencies: - react: ^19.2.3 + react: ~19.2.9 '@emotion/utils@1.4.2': resolution: {integrity: sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==} @@ -16661,8 +18256,8 @@ packages: '@floating-ui/react-dom@2.1.2': resolution: {integrity: sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@floating-ui/utils@0.2.9': resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==} @@ -16670,13 +18265,6 @@ packages: '@fontsource-variable/roboto@5.2.5': resolution: {integrity: sha512-csqBSOWXv0h5IbPhEqYJua6/nxl7dSNZbBOMeXSO9aqzgPw3GpfgC9kL5M6ULFLRaoDoBD4U9QctoDLKMaTyMg==} - '@foxt/js-srp@0.0.3-patch2': - resolution: {integrity: sha512-mCjMIf+/mwmuzSGr8CWWQDjDUqMBnw9TBnzfcBUTR2ySPoXcg6Pfb4/WPklY1TwY3Pe3f3r8q6hzWvvogInuug==} - - '@gar/promise-retry@1.0.3': - resolution: {integrity: sha512-GmzA9ckNokPypTg10pgpeHNQe7ph+iIKKmhKu3Ob9ANkswreCx7R3cKmY781K8QK3AqVL3xVh9A42JvIAbkkSA==} - engines: {node: ^20.17.0 || >=22.9.0} - '@grpc/grpc-js@1.9.15': resolution: {integrity: sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==} engines: {node: ^8.13.0 || >=10.10.0} @@ -16686,35 +18274,17 @@ packages: engines: {node: '>=6'} hasBin: true - '@hapi/address@5.1.1': - resolution: {integrity: sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==} - engines: {node: '>=14.0.0'} - - '@hapi/formula@3.0.2': - resolution: {integrity: sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==} - - '@hapi/hoek@11.0.7': - resolution: {integrity: sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==} - - '@hapi/pinpoint@2.0.1': - resolution: {integrity: sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==} - - '@hapi/tlds@1.1.7': - resolution: {integrity: sha512-MgNjRwy9Ti92yVAixLmDc8dd1bJIKwO9qlWCfFQRwRmUEDPQHYn4G6hwPFvFGUTzAa0FsS+inMjLin7GnyBRhA==} - engines: {node: '>=14.0.0'} - - '@hapi/topo@6.0.2': - resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} - - '@harperfast/extended-iterable@1.0.3': - resolution: {integrity: sha512-sSAYhQca3rDWtQUHSAPeO7axFIUJOI6hn1gjRC5APVE1a90tuyT8f5WIgRsFhhWA7htNkju2veB9eWL6YHi/Lw==} - '@hono/node-server@1.14.2': resolution: {integrity: sha512-GHjpOeHYbr9d1vkID2sNUYkl5IxumyhDrUJB7wBp7jvqYwPFt+oNKsAPBRcdSbV7kIrXhouLE199ks1QcK4r7A==} engines: {node: '>=18.14.1'} peerDependencies: hono: ^4 + '@hono/session@0.2.1': + resolution: {integrity: sha512-9bEkT8DnQDM0KNOrSokXMvx4wp1uLmopu0BCLrHjw5DMWPAEDcONuqyn/1dqosQktcNYA3HwUHGK8WT86JtnYA==} + peerDependencies: + hono: '>=4.0.0' + '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -16739,29 +18309,26 @@ packages: resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==} engines: {node: '>=18.18'} - '@iarna/toml@2.2.5': - resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} - - '@img/colour@1.0.0': - resolution: {integrity: sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==} + '@img/colour@1.1.0': + resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} engines: {node: '>=18'} - '@img/sharp-darwin-arm64@0.34.4': - resolution: {integrity: sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [darwin] - '@img/sharp-darwin-arm64@0.34.5': resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [darwin] - '@img/sharp-darwin-x64@0.34.4': - resolution: {integrity: sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] + '@img/sharp-darwin-arm64@0.35.4': + resolution: {integrity: sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA==} + engines: {node: '>=20.9.0'} + cpu: [arm64] + os: [darwin] + + '@img/sharp-darwin-arm64@0.35.5': + resolution: {integrity: sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==} + engines: {node: '>=20.9.0'} + cpu: [arm64] os: [darwin] '@img/sharp-darwin-x64@0.34.5': @@ -16770,19 +18337,41 @@ packages: cpu: [x64] os: [darwin] - '@img/sharp-libvips-darwin-arm64@1.2.3': - resolution: {integrity: sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==} - cpu: [arm64] + '@img/sharp-darwin-x64@0.35.4': + resolution: {integrity: sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw==} + engines: {node: '>=20.9.0'} + cpu: [x64] os: [darwin] + '@img/sharp-darwin-x64@0.35.5': + resolution: {integrity: sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [darwin] + + '@img/sharp-freebsd-wasm32@0.35.4': + resolution: {integrity: sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA==} + engines: {node: '>=20.9.0'} + os: [freebsd] + + '@img/sharp-freebsd-wasm32@0.35.5': + resolution: {integrity: sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==} + engines: {node: '>=20.9.0'} + os: [freebsd] + '@img/sharp-libvips-darwin-arm64@1.2.4': resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==} cpu: [arm64] os: [darwin] - '@img/sharp-libvips-darwin-x64@1.2.3': - resolution: {integrity: sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==} - cpu: [x64] + '@img/sharp-libvips-darwin-arm64@1.3.3': + resolution: {integrity: sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg==} + cpu: [arm64] + os: [darwin] + + '@img/sharp-libvips-darwin-arm64@1.3.4': + resolution: {integrity: sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==} + cpu: [arm64] os: [darwin] '@img/sharp-libvips-darwin-x64@1.2.4': @@ -16790,11 +18379,15 @@ packages: cpu: [x64] os: [darwin] - '@img/sharp-libvips-linux-arm64@1.2.3': - resolution: {integrity: sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==} - cpu: [arm64] - os: [linux] - libc: [glibc] + '@img/sharp-libvips-darwin-x64@1.3.3': + resolution: {integrity: sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw==} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-darwin-x64@1.3.4': + resolution: {integrity: sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==} + cpu: [x64] + os: [darwin] '@img/sharp-libvips-linux-arm64@1.2.4': resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} @@ -16802,9 +18395,15 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-libvips-linux-arm@1.2.3': - resolution: {integrity: sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==} - cpu: [arm] + '@img/sharp-libvips-linux-arm64@1.3.3': + resolution: {integrity: sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-arm64@1.3.4': + resolution: {integrity: sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==} + cpu: [arm64] os: [linux] libc: [glibc] @@ -16814,9 +18413,15 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-libvips-linux-ppc64@1.2.3': - resolution: {integrity: sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==} - cpu: [ppc64] + '@img/sharp-libvips-linux-arm@1.3.3': + resolution: {integrity: sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-arm@1.3.4': + resolution: {integrity: sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==} + cpu: [arm] os: [linux] libc: [glibc] @@ -16826,15 +18431,33 @@ packages: os: [linux] libc: [glibc] + '@img/sharp-libvips-linux-ppc64@1.3.3': + resolution: {integrity: sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-ppc64@1.3.4': + resolution: {integrity: sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] libc: [glibc] - '@img/sharp-libvips-linux-s390x@1.2.3': - resolution: {integrity: sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==} - cpu: [s390x] + '@img/sharp-libvips-linux-riscv64@1.3.3': + resolution: {integrity: sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-riscv64@1.3.4': + resolution: {integrity: sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==} + cpu: [riscv64] os: [linux] libc: [glibc] @@ -16844,9 +18467,15 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-libvips-linux-x64@1.2.3': - resolution: {integrity: sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==} - cpu: [x64] + '@img/sharp-libvips-linux-s390x@1.3.3': + resolution: {integrity: sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-s390x@1.3.4': + resolution: {integrity: sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==} + cpu: [s390x] os: [linux] libc: [glibc] @@ -16856,11 +18485,17 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-libvips-linuxmusl-arm64@1.2.3': - resolution: {integrity: sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==} - cpu: [arm64] + '@img/sharp-libvips-linux-x64@1.3.3': + resolution: {integrity: sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA==} + cpu: [x64] os: [linux] - libc: [musl] + libc: [glibc] + + '@img/sharp-libvips-linux-x64@1.3.4': + resolution: {integrity: sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==} + cpu: [x64] + os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} @@ -16868,9 +18503,15 @@ packages: os: [linux] libc: [musl] - '@img/sharp-libvips-linuxmusl-x64@1.2.3': - resolution: {integrity: sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==} - cpu: [x64] + '@img/sharp-libvips-linuxmusl-arm64@1.3.3': + resolution: {integrity: sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@img/sharp-libvips-linuxmusl-arm64@1.3.4': + resolution: {integrity: sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==} + cpu: [arm64] os: [linux] libc: [musl] @@ -16880,12 +18521,17 @@ packages: os: [linux] libc: [musl] - '@img/sharp-linux-arm64@0.34.4': - resolution: {integrity: sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] + '@img/sharp-libvips-linuxmusl-x64@1.3.3': + resolution: {integrity: sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw==} + cpu: [x64] os: [linux] - libc: [glibc] + libc: [musl] + + '@img/sharp-libvips-linuxmusl-x64@1.3.4': + resolution: {integrity: sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==} + cpu: [x64] + os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} @@ -16894,10 +18540,17 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-arm@0.34.4': - resolution: {integrity: sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm] + '@img/sharp-linux-arm64@0.35.4': + resolution: {integrity: sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ==} + engines: {node: '>=20.9.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-arm64@0.35.5': + resolution: {integrity: sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==} + engines: {node: '>=20.9.0'} + cpu: [arm64] os: [linux] libc: [glibc] @@ -16908,10 +18561,17 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-ppc64@0.34.4': - resolution: {integrity: sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [ppc64] + '@img/sharp-linux-arm@0.35.4': + resolution: {integrity: sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A==} + engines: {node: '>=20.9.0'} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-arm@0.35.5': + resolution: {integrity: sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==} + engines: {node: '>=20.9.0'} + cpu: [arm] os: [linux] libc: [glibc] @@ -16922,6 +18582,20 @@ packages: os: [linux] libc: [glibc] + '@img/sharp-linux-ppc64@0.35.4': + resolution: {integrity: sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ==} + engines: {node: '>=20.9.0'} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-ppc64@0.35.5': + resolution: {integrity: sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==} + engines: {node: '>=20.9.0'} + cpu: [ppc64] + os: [linux] + libc: [glibc] + '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} @@ -16929,10 +18603,17 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-s390x@0.34.4': - resolution: {integrity: sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [s390x] + '@img/sharp-linux-riscv64@0.35.4': + resolution: {integrity: sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA==} + engines: {node: '>=20.9.0'} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-riscv64@0.35.5': + resolution: {integrity: sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==} + engines: {node: '>=20.9.0'} + cpu: [riscv64] os: [linux] libc: [glibc] @@ -16943,10 +18624,17 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-x64@0.34.4': - resolution: {integrity: sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] + '@img/sharp-linux-s390x@0.35.4': + resolution: {integrity: sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ==} + engines: {node: '>=20.9.0'} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-s390x@0.35.5': + resolution: {integrity: sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==} + engines: {node: '>=20.9.0'} + cpu: [s390x] os: [linux] libc: [glibc] @@ -16957,12 +18645,19 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linuxmusl-arm64@0.34.4': - resolution: {integrity: sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] + '@img/sharp-linux-x64@0.35.4': + resolution: {integrity: sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA==} + engines: {node: '>=20.9.0'} + cpu: [x64] os: [linux] - libc: [musl] + libc: [glibc] + + '@img/sharp-linux-x64@0.35.5': + resolution: {integrity: sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} @@ -16971,10 +18666,17 @@ packages: os: [linux] libc: [musl] - '@img/sharp-linuxmusl-x64@0.34.4': - resolution: {integrity: sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] + '@img/sharp-linuxmusl-arm64@0.35.4': + resolution: {integrity: sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA==} + engines: {node: '>=20.9.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@img/sharp-linuxmusl-arm64@0.35.5': + resolution: {integrity: sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==} + engines: {node: '>=20.9.0'} + cpu: [arm64] os: [linux] libc: [musl] @@ -16985,21 +18687,42 @@ packages: os: [linux] libc: [musl] - '@img/sharp-wasm32@0.34.4': - resolution: {integrity: sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [wasm32] + '@img/sharp-linuxmusl-x64@0.35.4': + resolution: {integrity: sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@img/sharp-linuxmusl-x64@0.35.5': + resolution: {integrity: sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [linux] + libc: [musl] '@img/sharp-wasm32@0.34.5': resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [wasm32] - '@img/sharp-win32-arm64@0.34.4': - resolution: {integrity: sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [win32] + '@img/sharp-wasm32@0.35.4': + resolution: {integrity: sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA==} + engines: {node: '>=20.9.0'} + + '@img/sharp-wasm32@0.35.5': + resolution: {integrity: sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==} + engines: {node: '>=20.9.0'} + + '@img/sharp-webcontainers-wasm32@0.35.4': + resolution: {integrity: sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA==} + engines: {node: '>=20.9.0'} + cpu: [wasm32] + + '@img/sharp-webcontainers-wasm32@0.35.5': + resolution: {integrity: sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==} + engines: {node: '>=20.9.0'} + cpu: [wasm32] '@img/sharp-win32-arm64@0.34.5': resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==} @@ -17007,10 +18730,16 @@ packages: cpu: [arm64] os: [win32] - '@img/sharp-win32-ia32@0.34.4': - resolution: {integrity: sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [ia32] + '@img/sharp-win32-arm64@0.35.4': + resolution: {integrity: sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw==} + engines: {node: '>=20.9.0'} + cpu: [arm64] + os: [win32] + + '@img/sharp-win32-arm64@0.35.5': + resolution: {integrity: sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==} + engines: {node: '>=20.9.0'} + cpu: [arm64] os: [win32] '@img/sharp-win32-ia32@0.34.5': @@ -17019,10 +18748,16 @@ packages: cpu: [ia32] os: [win32] - '@img/sharp-win32-x64@0.34.4': - resolution: {integrity: sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] + '@img/sharp-win32-ia32@0.35.4': + resolution: {integrity: sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw==} + engines: {node: ^20.9.0} + cpu: [ia32] + os: [win32] + + '@img/sharp-win32-ia32@0.35.5': + resolution: {integrity: sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==} + engines: {node: ^20.9.0} + cpu: [ia32] os: [win32] '@img/sharp-win32-x64@0.34.5': @@ -17031,6 +18766,18 @@ packages: cpu: [x64] os: [win32] + '@img/sharp-win32-x64@0.35.4': + resolution: {integrity: sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [win32] + + '@img/sharp-win32-x64@0.35.5': + resolution: {integrity: sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==} + engines: {node: '>=20.9.0'} + cpu: [x64] + os: [win32] + '@import-maps/resolve@2.0.0': resolution: {integrity: sha512-RwzRTpmrrS6Q1ZhQExwuxJGK1Wqhv4stt+OF2JzS+uawewpwNyU7EJL1WpBex7aDiiGLs4FsXGkfUBdYuX7xiQ==} @@ -17045,22 +18792,32 @@ packages: resolution: {integrity: sha512-cvz/C1rF5WBxzHbEoiBoI6Sz6q6M+TdxfWkEGBYTD77opY8i8WN01prUWXEM87GPF4SZcyIySez9U0Ccm12oFQ==} engines: {node: '>=18.0.0'} - '@inquirer/ansi@1.0.2': - resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} - engines: {node: '>=18'} + '@inquirer/ansi@2.0.8': + resolution: {integrity: sha512-WpQM+Ti6Z40EFwwt+uL2p4UabT+W179zHp6HhLVOzfbwnVn05IPO/eXIZXGNqcT1jbQ15SujNLzQ39k4QPPxBQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - '@inquirer/confirm@5.1.21': - resolution: {integrity: sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==} + '@inquirer/confirm@5.1.4': + resolution: {integrity: sha512-EsiT7K4beM5fN5Mz6j866EFA9+v9d5o9VUra3hrg8zY4GHmCS8b616FErbdo5eyKoVotBQkHzMIeeKYsKDStDw==} engines: {node: '>=18'} peerDependencies: '@types/node': 25.0.9 + + '@inquirer/confirm@6.3.2': + resolution: {integrity: sha512-Xvr/0HggjddPtGppuqVmxhTw+Hr8PvsZ/k0HmOEaAqQEt80OITNkFWnsdNmyT0/eM4Ab+iJLx2R8rctlEyfSVg==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': 25.0.9 peerDependenciesMeta: '@types/node': optional: true - '@inquirer/core@10.3.2': - resolution: {integrity: sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==} + '@inquirer/core@10.1.5': + resolution: {integrity: sha512-/vyCWhET0ktav/mUeBqJRYTwmjFPIKPRYb3COAw7qORULgipGSUO2vL32lQKki3UxDKJ8BvuEbokaoyCA6YlWw==} engines: {node: '>=18'} + + '@inquirer/core@12.0.3': + resolution: {integrity: sha512-wsSy0sznmXwkty+2PzZwx00Cazc/E0r0B7mAzdGROz2Ct+DFZXaK7WDjGZvgjRldxH5ZhFVfF2lgkYrqgOw2KA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} peerDependencies: '@types/node': 25.0.9 peerDependenciesMeta: @@ -17076,12 +18833,16 @@ packages: '@types/node': optional: true - '@inquirer/figures@1.0.15': - resolution: {integrity: sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==} + '@inquirer/figures@1.0.10': + resolution: {integrity: sha512-Ey6176gZmeqZuY/W/nZiUyvmb1/qInjcpiZjXWi6nON+nxJpD1bxtSoBxNliGISae32n6OwbY+TSXPZ1CfS4bw==} engines: {node: '>=18'} - '@inquirer/type@3.0.10': - resolution: {integrity: sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==} + '@inquirer/figures@2.0.9': + resolution: {integrity: sha512-EAWgUTGQ/Umgga51dE3B2PUHbufuXarDfg86uVgoSgNHNNQnyFKcOrQLWVqYMghuSyHh8+2HUH0Js9cTC1WAdg==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + + '@inquirer/type@3.0.4': + resolution: {integrity: sha512-2MNFrDY8jkFYc9Il9DgLsHhMzuHnOYM1+CUYVWbzu9oT0hC7V7EcYvdCKeoll/Fcci04A+ERZ9wcc7cQ8lTkIA==} engines: {node: '>=18'} peerDependencies: '@types/node': 25.0.9 @@ -17089,36 +18850,17 @@ packages: '@types/node': optional: true - '@ionic/utils-array@2.1.6': - resolution: {integrity: sha512-0JZ1Zkp3wURnv8oq6Qt7fMPo5MpjbLoUoa9Bu2Q4PJuSDWM8H8gwF3dQO7VTeUj3/0o1IB1wGkFWZZYgUXZMUg==} - engines: {node: '>=16.0.0'} + '@inquirer/type@4.1.1': + resolution: {integrity: sha512-yJoHYrMnxIsJZCY+0Vb66Dy3he3kL3e2wOBKhoSwWWAzZAY82emlxwgprCtp6yRixvNRNq9ztfRWQYPNr3Go7A==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': 25.0.9 + peerDependenciesMeta: + '@types/node': + optional: true - '@ionic/utils-fs@3.1.7': - resolution: {integrity: sha512-2EknRvMVfhnyhL1VhFkSLa5gOcycK91VnjfrTB0kbqkTFCOXyXgVLI5whzq7SLrgD9t1aqos3lMMQyVzaQ5gVA==} - engines: {node: '>=16.0.0'} - - '@ionic/utils-object@2.1.6': - resolution: {integrity: sha512-vCl7sl6JjBHFw99CuAqHljYJpcE88YaH2ZW4ELiC/Zwxl5tiwn4kbdP/gxi2OT3MQb1vOtgAmSNRtusvgxI8ww==} - engines: {node: '>=16.0.0'} - - '@ionic/utils-process@2.1.11': - resolution: {integrity: sha512-Uavxn+x8j3rDlZEk1X7YnaN6wCgbCwYQOeIjv/m94i1dzslqWhqIHEqxEyeE8HsT5Negboagg7GtQiABy+BLbA==} - engines: {node: '>=16.0.0'} - - '@ionic/utils-stream@3.1.6': - resolution: {integrity: sha512-4+Kitey1lTA1yGtnigeYNhV/0tggI3lWBMjC7tBs1K9GXa/q7q4CtOISppdh8QgtOhrhAXS2Igp8rbko/Cj+lA==} - engines: {node: '>=16.0.0'} - - '@ionic/utils-subprocess@2.1.14': - resolution: {integrity: sha512-nGYvyGVjU0kjPUcSRFr4ROTraT3w/7r502f5QJEsMRKTqa4eEzCshtwRk+/mpASm0kgBN5rrjYA5A/OZg8ahqg==} - engines: {node: '>=16.0.0'} - - '@ionic/utils-terminal@2.3.4': - resolution: {integrity: sha512-cEiMFl3jklE0sW60r8JHH3ijFTwh/jkdEKWbylSyExQwZ8pPuwoXz7gpkWoJRLuoRHHSvg+wzNYyPJazIHfoJA==} - engines: {node: '>=16.0.0'} - - '@ioredis/commands@1.5.0': - resolution: {integrity: sha512-eUgLqrMf8nJkZxT24JvVRrQya1vZkQh8BBeYNwGDqa5I0VUi8ACx7uFvAaLxintokpTenkK6DASvo/bvNbBGow==} + '@ioredis/commands@1.10.0': + resolution: {integrity: sha512-UmeW7z4LfctwoQ5wkhVzgq8tXkreED2xZGpX+Bg+zA+WJFZCT6c062AfCK/Dfk81xZnnwdhJCUMkitihRaoC2Q==} '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -17128,129 +18870,10 @@ packages: resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} engines: {node: '>=18.0.0'} - '@isaacs/string-locale-compare@1.1.0': - resolution: {integrity: sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==} - - '@istanbuljs/schema@0.1.6': - resolution: {integrity: sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==} - engines: {node: '>=8'} - '@jest/diff-sequences@30.0.1': resolution: {integrity: sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} - '@jimp/core@1.6.0': - resolution: {integrity: sha512-EQQlKU3s9QfdJqiSrZWNTxBs3rKXgO2W+GxNXDtwchF3a4IqxDheFX1ti+Env9hdJXDiYLp2jTRjlxhPthsk8w==} - engines: {node: '>=18'} - - '@jimp/diff@1.6.0': - resolution: {integrity: sha512-+yUAQ5gvRC5D1WHYxjBHZI7JBRusGGSLf8AmPRPCenTzh4PA+wZ1xv2+cYqQwTfQHU5tXYOhA0xDytfHUf1Zyw==} - engines: {node: '>=18'} - - '@jimp/file-ops@1.6.0': - resolution: {integrity: sha512-Dx/bVDmgnRe1AlniRpCKrGRm5YvGmUwbDzt+MAkgmLGf+jvBT75hmMEZ003n9HQI/aPnm/YKnXjg/hOpzNCpHQ==} - engines: {node: '>=18'} - - '@jimp/js-bmp@1.6.0': - resolution: {integrity: sha512-FU6Q5PC/e3yzLyBDXupR3SnL3htU7S3KEs4e6rjDP6gNEOXRFsWs6YD3hXuXd50jd8ummy+q2WSwuGkr8wi+Gw==} - engines: {node: '>=18'} - - '@jimp/js-gif@1.6.0': - resolution: {integrity: sha512-N9CZPHOrJTsAUoWkWZstLPpwT5AwJ0wge+47+ix3++SdSL/H2QzyMqxbcDYNFe4MoI5MIhATfb0/dl/wmX221g==} - engines: {node: '>=18'} - - '@jimp/js-jpeg@1.6.0': - resolution: {integrity: sha512-6vgFDqeusblf5Pok6B2DUiMXplH8RhIKAryj1yn+007SIAQ0khM1Uptxmpku/0MfbClx2r7pnJv9gWpAEJdMVA==} - engines: {node: '>=18'} - - '@jimp/js-png@1.6.0': - resolution: {integrity: sha512-AbQHScy3hDDgMRNfG0tPjL88AV6qKAILGReIa3ATpW5QFjBKpisvUaOqhzJ7Reic1oawx3Riyv152gaPfqsBVg==} - engines: {node: '>=18'} - - '@jimp/js-tiff@1.6.0': - resolution: {integrity: sha512-zhReR8/7KO+adijj3h0ZQUOiun3mXUv79zYEAKvE0O+rP7EhgtKvWJOZfRzdZSNv0Pu1rKtgM72qgtwe2tFvyw==} - engines: {node: '>=18'} - - '@jimp/plugin-blit@1.6.0': - resolution: {integrity: sha512-M+uRWl1csi7qilnSK8uxK4RJMSuVeBiO1AY0+7APnfUbQNZm6hCe0CCFv1Iyw1D/Dhb8ph8fQgm5mwM0eSxgVA==} - engines: {node: '>=18'} - - '@jimp/plugin-blur@1.6.0': - resolution: {integrity: sha512-zrM7iic1OTwUCb0g/rN5y+UnmdEsT3IfuCXCJJNs8SZzP0MkZ1eTvuwK9ZidCuMo4+J3xkzCidRwYXB5CyGZTw==} - engines: {node: '>=18'} - - '@jimp/plugin-circle@1.6.0': - resolution: {integrity: sha512-xt1Gp+LtdMKAXfDp3HNaG30SPZW6AQ7dtAtTnoRKorRi+5yCJjKqXRgkewS5bvj8DEh87Ko1ydJfzqS3P2tdWw==} - engines: {node: '>=18'} - - '@jimp/plugin-color@1.6.0': - resolution: {integrity: sha512-J5q8IVCpkBsxIXM+45XOXTrsyfblyMZg3a9eAo0P7VPH4+CrvyNQwaYatbAIamSIN1YzxmO3DkIZXzRjFSz1SA==} - engines: {node: '>=18'} - - '@jimp/plugin-contain@1.6.0': - resolution: {integrity: sha512-oN/n+Vdq/Qg9bB4yOBOxtY9IPAtEfES8J1n9Ddx+XhGBYT1/QTU/JYkGaAkIGoPnyYvmLEDqMz2SGihqlpqfzQ==} - engines: {node: '>=18'} - - '@jimp/plugin-cover@1.6.0': - resolution: {integrity: sha512-Iow0h6yqSC269YUJ8HC3Q/MpCi2V55sMlbkkTTx4zPvd8mWZlC0ykrNDeAy9IJegrQ7v5E99rJwmQu25lygKLA==} - engines: {node: '>=18'} - - '@jimp/plugin-crop@1.6.0': - resolution: {integrity: sha512-KqZkEhvs+21USdySCUDI+GFa393eDIzbi1smBqkUPTE+pRwSWMAf01D5OC3ZWB+xZsNla93BDS9iCkLHA8wang==} - engines: {node: '>=18'} - - '@jimp/plugin-displace@1.6.0': - resolution: {integrity: sha512-4Y10X9qwr5F+Bo5ME356XSACEF55485j5nGdiyJ9hYzjQP9nGgxNJaZ4SAOqpd+k5sFaIeD7SQ0Occ26uIng5Q==} - engines: {node: '>=18'} - - '@jimp/plugin-dither@1.6.0': - resolution: {integrity: sha512-600d1RxY0pKwgyU0tgMahLNKsqEcxGdbgXadCiVCoGd6V6glyCvkNrnnwC0n5aJ56Htkj88PToSdF88tNVZEEQ==} - engines: {node: '>=18'} - - '@jimp/plugin-fisheye@1.6.0': - resolution: {integrity: sha512-E5QHKWSCBFtpgZarlmN3Q6+rTQxjirFqo44ohoTjzYVrDI6B6beXNnPIThJgPr0Y9GwfzgyarKvQuQuqCnnfbA==} - engines: {node: '>=18'} - - '@jimp/plugin-flip@1.6.0': - resolution: {integrity: sha512-/+rJVDuBIVOgwoyVkBjUFHtP+wmW0r+r5OQ2GpatQofToPVbJw1DdYWXlwviSx7hvixTWLKVgRWQ5Dw862emDg==} - engines: {node: '>=18'} - - '@jimp/plugin-hash@1.6.0': - resolution: {integrity: sha512-wWzl0kTpDJgYVbZdajTf+4NBSKvmI3bRI8q6EH9CVeIHps9VWVsUvEyb7rpbcwVLWYuzDtP2R0lTT6WeBNQH9Q==} - engines: {node: '>=18'} - - '@jimp/plugin-mask@1.6.0': - resolution: {integrity: sha512-Cwy7ExSJMZszvkad8NV8o/Z92X2kFUFM8mcDAhNVxU0Q6tA0op2UKRJY51eoK8r6eds/qak3FQkXakvNabdLnA==} - engines: {node: '>=18'} - - '@jimp/plugin-print@1.6.0': - resolution: {integrity: sha512-zarTIJi8fjoGMSI/M3Xh5yY9T65p03XJmPsuNet19K/Q7mwRU6EV2pfj+28++2PV2NJ+htDF5uecAlnGyxFN2A==} - engines: {node: '>=18'} - - '@jimp/plugin-quantize@1.6.0': - resolution: {integrity: sha512-EmzZ/s9StYQwbpG6rUGBCisc3f64JIhSH+ncTJd+iFGtGo0YvSeMdAd+zqgiHpfZoOL54dNavZNjF4otK+mvlg==} - engines: {node: '>=18'} - - '@jimp/plugin-resize@1.6.0': - resolution: {integrity: sha512-uSUD1mqXN9i1SGSz5ov3keRZ7S9L32/mAQG08wUwZiEi5FpbV0K8A8l1zkazAIZi9IJzLlTauRNU41Mi8IF9fA==} - engines: {node: '>=18'} - - '@jimp/plugin-rotate@1.6.0': - resolution: {integrity: sha512-JagdjBLnUZGSG4xjCLkIpQOZZ3Mjbg8aGCCi4G69qR+OjNpOeGI7N2EQlfK/WE8BEHOW5vdjSyglNqcYbQBWRw==} - engines: {node: '>=18'} - - '@jimp/plugin-threshold@1.6.0': - resolution: {integrity: sha512-M59m5dzLoHOVWdM41O8z9SyySzcDn43xHseOH0HavjsfQsT56GGCC4QzU1banJidbUrePhzoEdS42uFE8Fei8w==} - engines: {node: '>=18'} - - '@jimp/types@1.6.0': - resolution: {integrity: sha512-7UfRsiKo5GZTAATxm2qQ7jqmUXP0DxTArztllTcYdyw6Xi5oT4RaoXynVtCD4UyLK5gJgkZJcwonoijrhYFKfg==} - engines: {node: '>=18'} - - '@jimp/utils@1.6.0': - resolution: {integrity: sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA==} - engines: {node: '>=18'} - '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -17267,6 +18890,9 @@ packages: '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} @@ -17279,138 +18905,18 @@ packages: peerDependencies: tslib: '2' - '@jsonjoy.com/base64@17.67.0': - resolution: {integrity: sha512-5SEsJGsm15aP8TQGkDfJvz9axgPwAEm98S5DxOuYe8e1EbfajcDmgeXXzccEjh+mLnjqEKrkBdjHWS5vFNwDdw==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/buffers@1.2.1': - resolution: {integrity: sha512-12cdlDwX4RUM3QxmUbVJWqZ/mrK6dFQH4Zxq6+r1YXKXYBNgZXndx2qbCJwh3+WWkCSn67IjnlG3XYTvmvYtgA==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/buffers@17.67.0': - resolution: {integrity: sha512-tfExRpYxBvi32vPs9ZHaTjSP4fHAfzSmcahOfNxtvGHcyJel+aibkPlGeBB+7AoC6hL7lXIE++8okecBxx7lcw==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/codegen@1.0.0': - resolution: {integrity: sha512-E8Oy+08cmCf0EK/NMxpaJZmOxPqM+6iSe2S4nlSBrPZOORoDJILxtbSUEDKQyTamm/BVAhIGllOBNU79/dwf0g==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/codegen@17.67.0': - resolution: {integrity: sha512-idnkUplROpdBOV0HMcwhsCUS5TRUi9poagdGs70A6S4ux9+/aPuKbh8+UYRTLYQHtXvAdNfQWXDqZEx5k4Dj2Q==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-core@4.64.0': - resolution: {integrity: sha512-zs2TAq7Six5jgMuoMNjpspAvOP3mhtgq/k1UyQodEzCtQi/N83y2/y+zcvnZSGp/Rxq96DBN+bValOBQAyn/ew==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-fsa@4.64.0': - resolution: {integrity: sha512-nMWOVbkLFyEgmXZih3wyvxA9XpgyyqyfrINMHvEFqhi7uqfRl7c9ERJt6yX7vgMPrB9Uo+OJO+Spa0cFzPD01w==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-node-builtins@4.64.0': - resolution: {integrity: sha512-/o7WRFhUWaM/fOrslwLZGnzn4RmRILykn+lAL+mNObqqRNw+CQSiij6hpCeZ+C7buhdoVo7go/OYqzaSUfDYmA==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-node-to-fsa@4.64.0': - resolution: {integrity: sha512-WDD9WVs0hb7UAEKTgZW2f66WDrbj7gIIWwpP3spbLyXa0rghtUaFTB8L4gdR3ZCWwiKIsj38/CNijpVmpnuPUw==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-node-utils@4.64.0': - resolution: {integrity: sha512-k5Indsx9hWW9xSF7Y6oSKKwtCUNhzZxadub3owhIlitc+iMRVlPPdX2duTKQWBL3qNWpXya8jykgaaWpheeS4w==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-node@4.64.0': - resolution: {integrity: sha512-dO+NNkODbUli4uV42bcNrrLvq5rE7SNpdZ5TNd0dtbLsAaNK3MDiIC9lUi+brboGoIjW6vd2fB1qao60nrk5xA==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-print@4.64.0': - resolution: {integrity: sha512-PHZFccchvkhWrwPWHjmVAhbC3vSHCtyZvlZfJJ3ho2bnzl450hXri6/8e6pbkWdH+SkmLXNml0sV8e5HDAfxKw==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/fs-snapshot@4.64.0': - resolution: {integrity: sha512-oM7UDeL83q6NBzzsfKAsYKXKVXlykKFqqOLh4xZZKAzzROTlInkPbc6LTDGThEOnPiFiUzA7tYziHG9xavd76Q==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - '@jsonjoy.com/json-pack@1.1.1': resolution: {integrity: sha512-osjeBqMJ2lb/j/M8NCPjs1ylqWIcTRTycIhVB5pt6LgzgeRSb0YRZ7j9RfA8wIUrsr/medIuhVyonXRZWLyfdw==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' - '@jsonjoy.com/json-pack@1.21.0': - resolution: {integrity: sha512-+AKG+R2cfZMShzrF2uQw34v3zbeDYUqnQ+jg7ORic3BGtfw9p/+N6RJbq/kkV8JmYZaINknaEQ2m0/f693ZPpg==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/json-pack@17.67.0': - resolution: {integrity: sha512-t0ejURcGaZsn1ClbJ/3kFqSOjlryd92eQY465IYrezsXmPcfHPE/av4twRSxf6WE+TkZgLY+71vCZbiIiFKA/w==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/json-pointer@1.0.2': - resolution: {integrity: sha512-Fsn6wM2zlDzY1U+v4Nc8bo3bVqgfNTGcn6dMgs6FjrEnt4ZCe60o6ByKRjOGlI2gow0aE/Q41QOigdTqkyK5fg==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/json-pointer@17.67.0': - resolution: {integrity: sha512-+iqOFInH+QZGmSuaybBUNdh7yvNrXvqR+h3wjXm0N/3JK1EyyFAeGJvqnmQL61d1ARLlk/wJdFKSL+LHJ1eaUA==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - '@jsonjoy.com/util@1.5.0': resolution: {integrity: sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' - '@jsonjoy.com/util@1.9.0': - resolution: {integrity: sha512-pLuQo+VPRnN8hfPqUTLTHk126wuYdXVxE6aDmjSeV4NCAgyxWbiOIeNJVtID3h1Vzpoi9m4jXezf73I6LgabgQ==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@jsonjoy.com/util@17.67.0': - resolution: {integrity: sha512-6+8xBaz1rLSohlGh68D1pdw3AwDi9xydm8QNlAFkvnavCJYSze+pxoW2VKP8p308jtlMRLs5NTHfPlZLd4w7ew==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - - '@kwsites/file-exists@1.1.1': - resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} - - '@kwsites/promise-deferred@1.1.1': - resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} - '@leichtgewicht/ip-codec@2.0.5': resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} @@ -17530,41 +19036,6 @@ packages: '@lix-js/server-protocol-schema@0.1.1': resolution: {integrity: sha512-jBeALB6prAbtr5q4vTuxnRZZv1M2rKe8iNqRQhFJ4Tv7150unEa0vKyz0hs8Gl3fUGsWaNJBh3J8++fpbrpRBQ==} - '@lmdb/lmdb-darwin-arm64@3.5.1': - resolution: {integrity: sha512-tpfN4kKrrMpQ+If1l8bhmoNkECJi0iOu6AEdrTJvWVC+32sLxTARX5Rsu579mPImRP9YFWfWgeRQ5oav7zApQQ==} - cpu: [arm64] - os: [darwin] - - '@lmdb/lmdb-darwin-x64@3.5.1': - resolution: {integrity: sha512-+a2tTfc3rmWhLAolFUWRgJtpSuu+Fw/yjn4rF406NMxhfjbMuiOUTDRvRlMFV+DzyjkwnokisskHbCWkS3Ly5w==} - cpu: [x64] - os: [darwin] - - '@lmdb/lmdb-linux-arm64@3.5.1': - resolution: {integrity: sha512-aoERa5B6ywXdyFeYGQ1gbQpkMkDbEo45qVoXE5QpIRavqjnyPwjOulMkmkypkmsbJ5z4Wi0TBztON8agCTG0Vg==} - cpu: [arm64] - os: [linux] - - '@lmdb/lmdb-linux-arm@3.5.1': - resolution: {integrity: sha512-0EgcE6reYr8InjD7V37EgXcYrloqpxVPINy3ig1MwDSbl6LF/vXTYRH9OE1Ti1D8YZnB35ZH9aTcdfSb5lql2A==} - cpu: [arm] - os: [linux] - - '@lmdb/lmdb-linux-x64@3.5.1': - resolution: {integrity: sha512-SqNDY1+vpji7bh0sFH5wlWyFTOzjbDOl0/kB5RLLYDAFyd/uw3n7wyrmas3rYPpAW7z18lMOi1yKlTPv967E3g==} - cpu: [x64] - os: [linux] - - '@lmdb/lmdb-win32-arm64@3.5.1': - resolution: {integrity: sha512-50v0O1Lt37cwrmR9vWZK5hRW0Aw+KEmxJJ75fge/zIYdvNKB/0bSMSVR5Uc2OV9JhosIUyklOmrEvavwNJ8D6w==} - cpu: [arm64] - os: [win32] - - '@lmdb/lmdb-win32-x64@3.5.1': - resolution: {integrity: sha512-qwosvPyl+zpUlp3gRb7UcJ3H8S28XHCzkv0Y0EgQToXjQP91ZD67EHSCDmaLjtKhe+GVIW5om1KUpzVLA0l6pg==} - cpu: [x64] - os: [win32] - '@loaderkit/resolve@1.0.4': resolution: {integrity: sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==} @@ -17617,40 +19088,20 @@ packages: resolution: {integrity: sha512-JwqeCQ1U3fvccttHZq7Tk0m/TMC6WcFAQZdukypW3AzlJYKYTGNVd1ANU2GuhKnv4UQuOFj3oAl0LLG/gxFN1w==} engines: {node: '>=16'} - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.4': - resolution: {integrity: sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ==} - cpu: [arm64] - os: [darwin] - - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.4': - resolution: {integrity: sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w==} - cpu: [x64] - os: [darwin] - - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.4': - resolution: {integrity: sha512-dgX0P/9wGPJeHFBG+ZmhgE6bmtMt7NP5CRBGyyktpopdk/mW4POnrpQsSLtKI1dwpc+pPLuXHDh6vvskyQE/sw==} - cpu: [arm64] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.4': - resolution: {integrity: sha512-Tg3yX65f5GbtXLkrYEHE5oibZG9epyYWas7FogTTEJeDEF9JlXJzKgXaNhT3UXlTOeA+AfZpYZYZ0uPj7Cfquw==} - cpu: [arm] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.4': - resolution: {integrity: sha512-8TNXMEjJc3QEy7R/x1INhgiU+XakDAFUzBhaz7+Rbrs8NH5UQeHQxxmzsSBJGyV6I1jW79undiQm8tOI+D+8FQ==} - cpu: [x64] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': - resolution: {integrity: sha512-CmCXPQrkbwExx3j946/PtHWHbYJiCRBRDl4BlkRQcJB/YOwQxJRTpoo7aTsortjgoJ1x7opzTSxn7C+ASSLVjQ==} - cpu: [x64] - os: [win32] + '@msw/playwright@0.6.7': + resolution: {integrity: sha512-q7m2JtnN1Iz25xauqx5lkD+tbbDM3oXZBg67aXr4EbxK7IZKTh6c71bbTCnDi/F2SuHq/jPUfS8NJXPcdroARA==} + engines: {node: '>=20.0.0'} + peerDependencies: + msw: ^2.12.10 '@mswjs/interceptors@0.37.6': resolution: {integrity: sha512-wK+5pLK5XFmgtH3aQ2YVvA3HohS3xqV/OxuVOdNx9Wpnz7VE/fnC+e1A7ln6LFYeck7gOJ/dsZV6OLplOtAJ2w==} engines: {node: '>=18'} + '@mswjs/interceptors@0.41.9': + resolution: {integrity: sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==} + engines: {node: '>=18'} + '@mui/core-downloads-tracker@6.4.7': resolution: {integrity: sha512-XjJrKFNt9zAKvcnoIIBquXyFyhfrHYuttqMsoDS7lM7VwufYG4fAPw4kINjBFg++fqXM2BNAuWR9J7XVIuKIKg==} @@ -17662,8 +19113,8 @@ packages: '@emotion/styled': ^11.3.0 '@mui/material-pigment-css': ^6.4.7 '@types/react': ^19.2.8 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@emotion/react': optional: true @@ -17679,7 +19130,7 @@ packages: engines: {node: '>=14.0.0'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -17690,7 +19141,7 @@ packages: peerDependencies: '@emotion/react': ^11.4.1 '@emotion/styled': ^11.3.0 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@emotion/react': optional: true @@ -17704,7 +19155,7 @@ packages: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@emotion/react': optional: true @@ -17726,301 +19177,230 @@ packages: engines: {node: '>=14.0.0'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true - '@napi-rs/nice-android-arm-eabi@1.1.1': - resolution: {integrity: sha512-kjirL3N6TnRPv5iuHw36wnucNqXAO46dzK9oPb0wj076R5Xm8PfUVA9nAFB5ZNMmfJQJVKACAPd/Z2KYMppthw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/nice-android-arm64@1.1.1': - resolution: {integrity: sha512-blG0i7dXgbInN5urONoUCNf+DUEAavRffrO7fZSeoRMJc5qD+BJeNcpr54msPF6qfDD6kzs9AQJogZvT2KD5nw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/nice-darwin-arm64@1.1.1': - resolution: {integrity: sha512-s/E7w45NaLqTGuOjC2p96pct4jRfo61xb9bU1unM/MJ/RFkKlJyJDx7OJI/O0ll/hrfpqKopuAFDV8yo0hfT7A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/nice-darwin-x64@1.1.1': - resolution: {integrity: sha512-dGoEBnVpsdcC+oHHmW1LRK5eiyzLwdgNQq3BmZIav+9/5WTZwBYX7r5ZkQC07Nxd3KHOCkgbHSh4wPkH1N1LiQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/nice-freebsd-x64@1.1.1': - resolution: {integrity: sha512-kHv4kEHAylMYmlNwcQcDtXjklYp4FCf0b05E+0h6nDHsZ+F0bDe04U/tXNOqrx5CmIAth4vwfkjjUmp4c4JktQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': - resolution: {integrity: sha512-E1t7K0efyKXZDoZg1LzCOLxgolxV58HCkaEkEvIYQx12ht2pa8hoBo+4OB3qh7e+QiBlp1SRf+voWUZFxyhyqg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/nice-linux-arm64-gnu@1.1.1': - resolution: {integrity: sha512-CIKLA12DTIZlmTaaKhQP88R3Xao+gyJxNWEn04wZwC2wmRapNnxCUZkVwggInMJvtVElA+D4ZzOU5sX4jV+SmQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@napi-rs/nice-linux-arm64-musl@1.1.1': - resolution: {integrity: sha512-+2Rzdb3nTIYZ0YJF43qf2twhqOCkiSrHx2Pg6DJaCPYhhaxbLcdlV8hCRMHghQ+EtZQWGNcS2xF4KxBhSGeutg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@napi-rs/nice-linux-ppc64-gnu@1.1.1': - resolution: {integrity: sha512-4FS8oc0GeHpwvv4tKciKkw3Y4jKsL7FRhaOeiPei0X9T4Jd619wHNe4xCLmN2EMgZoeGg+Q7GY7BsvwKpL22Tg==} - engines: {node: '>= 10'} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@napi-rs/nice-linux-riscv64-gnu@1.1.1': - resolution: {integrity: sha512-HU0nw9uD4FO/oGCCk409tCi5IzIZpH2agE6nN4fqpwVlCn5BOq0MS1dXGjXaG17JaAvrlpV5ZeyZwSon10XOXw==} - engines: {node: '>= 10'} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@napi-rs/nice-linux-s390x-gnu@1.1.1': - resolution: {integrity: sha512-2YqKJWWl24EwrX0DzCQgPLKQBxYDdBxOHot1KWEq7aY2uYeX+Uvtv4I8xFVVygJDgf6/92h9N3Y43WPx8+PAgQ==} - engines: {node: '>= 10'} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@napi-rs/nice-linux-x64-gnu@1.1.1': - resolution: {integrity: sha512-/gaNz3R92t+dcrfCw/96pDopcmec7oCcAQ3l/M+Zxr82KT4DljD37CpgrnXV+pJC263JkW572pdbP3hP+KjcIg==} - engines: {node: '>= 10'} + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} + engines: {node: ^22.20 || ^24.12 || >=25} cpu: [x64] os: [linux] libc: [glibc] - '@napi-rs/nice-linux-x64-musl@1.1.1': - resolution: {integrity: sha512-xScCGnyj/oppsNPMnevsBe3pvNaoK7FGvMjT35riz9YdhB2WtTG47ZlbxtOLpjeO9SqqQ2J2igCmz6IJOD5JYw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@napi-rs/nice-openharmony-arm64@1.1.1': - resolution: {integrity: sha512-6uJPRVwVCLDeoOaNyeiW0gp2kFIM4r7PL2MczdZQHkFi9gVlgm+Vn+V6nTWRcu856mJ2WjYJiumEajfSm7arPQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [openharmony] - - '@napi-rs/nice-win32-arm64-msvc@1.1.1': - resolution: {integrity: sha512-uoTb4eAvM5B2aj/z8j+Nv8OttPf2m+HVx3UjA5jcFxASvNhQriyCQF1OB1lHL43ZhW+VwZlgvjmP5qF3+59atA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/nice-win32-ia32-msvc@1.1.1': - resolution: {integrity: sha512-CNQqlQT9MwuCsg1Vd/oKXiuH+TcsSPJmlAFc5frFyX/KkOh0UpBLEj7aoY656d5UKZQMQFP7vJNa1DNUNORvug==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/nice-win32-x64-msvc@1.1.1': - resolution: {integrity: sha512-vB+4G/jBQCAh0jelMTY3+kgFy00Hlx2f2/1zjMoH821IbplbWZOkLiTYXQkygNTzQJTq5cvwBDgn2ppHD+bglQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/nice@1.1.1': - resolution: {integrity: sha512-xJIPs+bYuc9ASBl+cvGsKbGrJmS6fAKaSZCnT0lhahT5rhA2VVy9/EcIgd2JhtEuFOJNx7UHNn/qiTPTY4nrQw==} - engines: {node: '>= 10'} - '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - '@napi-rs/wasm-runtime@1.1.4': - resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} + '@napi-rs/wasm-runtime@1.1.6': + resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@nativescript-community/react@19.0.0': - resolution: {integrity: sha512-YVgy9QADIfGqq3GqHdzk8UpKxglqYwL0rD1K+5hLPZY/ad3xhDmhCbP1LqTxypvjlRWSa+lb9oDKEpVejlgR1A==} - peerDependencies: - '@nativescript/core': '>=8.6.2' - dominative: ^0.1.2 - react: ^19.2.3 - undom-ng: ^1.1.2 - - '@nativescript/android@9.0.5': - resolution: {integrity: sha512-X68BZJDZtnSU3NL13k3giUriCDvZPCS5rRcRBM77RyTKbK78bHsyP9Yl6REg4L35xORK2cX2HOl1NCec7lS2eA==} - - '@nativescript/core@9.0.20': - resolution: {integrity: sha512-zx+4mGO6aUCeVIV3c6x+b3H+ZTBJAvHAYqtjpOYJGiPZc0AG3OwVzXhp4qyAteWha8cnFFHU5+trnve9O0q2xg==} - - '@nativescript/doctor@2.0.17': - resolution: {integrity: sha512-+S3nL9/OwsrQ75MkolXtLYOuzzjc2W9EEqys7hg8FLFJbcQc47TYmpGLf/v7bdwx6Rh8G3HTcKy0QSkjInL1WQ==} - - '@nativescript/hook@3.0.5': - resolution: {integrity: sha512-MzL7R/nPZU2qnvDWWuJ8RB7H3luEwANgFX/d/ILdg7bSYxl6uANCfzlueHnWgrQmBxu6dTkvPsFW2WNVUxlhUg==} - - '@nativescript/ios@9.0.3': - resolution: {integrity: sha512-1IE9OIkBac4D8IPeFZ7kNxQRUr9s7BgFwOoS8XwhX5RvJHE/oSqjbSp+ag9A7MennpyDs/qxduGkwpS1EmmxOg==} - - '@nativescript/types-android@9.0.0': - resolution: {integrity: sha512-Az64E1m6jd7CKX/QKOZi3uSxQEXZbPW5NlmMNP9VGCP9UobHLd5GgqpEIyeBB4Jep4rckA2Z4LEEpjbu/my63Q==} - - '@nativescript/types-ios@9.0.0': - resolution: {integrity: sha512-A13VLFFKNrkYqS7JU0V+R4wxKIE66VvYiHK1+vrVXqiK6l+95BxgEgRPD8FlXN7W2iXXqYLapo8nVMtWArpscg==} - - '@nativescript/types@9.0.0': - resolution: {integrity: sha512-fR9ot7Si9L0StcsOZpAEThggeQb8cQxCL0BwRKuWHbm+SdlinuOWSl6lS3bKuIIcCzJem2cWP3UrzgweRnOe/A==} - - '@nativescript/vite@2.0.3': - resolution: {integrity: sha512-YHyPEspViqw2zdw1LOT0r2balwBM5uldiArmLrlQ7XEmOldZu6R2Rnr30sXsh3QkOUXIY+/Yoy6Us5SH2OGAQw==} - hasBin: true - '@neon-rs/load@0.0.4': resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==} - '@netlify/api@14.0.7': - resolution: {integrity: sha512-smSD3MnyUwi+rdcvRlD2EAGEpzK9RRMiGxaXzKW7FGqIlZSEe08aPySuC0d5BXwl/7EmT43hOkBHH4KtP8DxcQ==} - engines: {node: '>=18.14.0'} + '@netlify/ai@1.0.1': + resolution: {integrity: sha512-jicymJwSK2/PPi0c3TjWRSp2h1Q/R+SrDd2NMY6bjckFYJJ6jyfToJj+gaypMycknSWI5LCgFwnJS209CMXtMw==} + engines: {node: '>=22.12.0'} + + '@netlify/api@15.1.2': + resolution: {integrity: sha512-mwDpddsem/KJw0CDAKUBnzKsM9UUfgUgRntvL3yyOZ+L12amaXmj38T/1ndnxmRIx1rIJtfbq4eEzxloaniylA==} + engines: {node: '>=22.12.0'} '@netlify/binary-info@1.0.0': resolution: {integrity: sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==} - '@netlify/blobs@10.1.0': - resolution: {integrity: sha512-dFpqDc6/x5LEu9L7kblCQu00CFEchH8J42jmQoXPuhKoE7avajzeLTbVKA8Olk3S/c2m9ejegrgbhL8NRA2Jyw==} - engines: {node: ^14.16.0 || >=16.0.0} + '@netlify/blobs@11.0.3': + resolution: {integrity: sha512-Z8IXQtQC8BQjm76i1bN+l12TTyKQ/s1R92Ajhou7+fpP0KSxnJ65QzLEb5WuFuFutn8ORrcd4mlF8A2xhw8dzA==} + engines: {node: '>=22.12.0'} - '@netlify/cache@3.3.0': - resolution: {integrity: sha512-rKHmfPreOJhOz0FEKzqFdykIAdO2fC98hNXab6JuIKycySWZtLq+YtythuR/qL6AWBtdn1DQTAsOh8zBz7va7w==} - engines: {node: '>=20.6.1'} + '@netlify/cache@4.0.0': + resolution: {integrity: sha512-tRWkLmO6pyqZetFkhYgtX6LH1umqaJAZN5mRNOJubca/+Mqm0VTUyl51FeS0UbVfetLwiwgpzbGmABpc5gGHyg==} + engines: {node: '>=22.12.0'} - '@netlify/config@23.2.0': - resolution: {integrity: sha512-zlI792/efPUY1XKtBML2OJBgKMyfNQIeGEYibH8SqeDxPjNuCy0qELE0U9Sc6+Ss34XryPBUPdV60tYhSoe6lw==} - engines: {node: '>=18.14.0'} + '@netlify/config@25.2.5': + resolution: {integrity: sha512-VqJeiQk2eZ9o3ls7C57e2TEalQdR2U3oLjI/Rlo9njU0l8bD3Cr6kBTU5shGIPQgeJVGU9rQLaX24Yd7WXrWVA==} + engines: {node: '>=22.12.0'} hasBin: true - '@netlify/dev-utils@4.3.0': - resolution: {integrity: sha512-vZAL8pMuj3yPQlmHSgyaA/UQFxc6pZgU0LucFJ1+IPWGJtIzBXHRvuR4acpoP72HtyQPUHJ42s7U9GaaSGVNHg==} - engines: {node: ^18.14.0 || >=20} + '@netlify/database-dev@1.0.1': + resolution: {integrity: sha512-Zu8cM4AeXNuQI/cNAI6vrammtdDnWIGO6PYKDAECDMzsb3IcoTsVOZAePup7cGdjaGcBBVdi1qx/PoI5hNZcxg==} + engines: {node: '>=22.12.0'} - '@netlify/dev@4.6.3': - resolution: {integrity: sha512-PT23zofsvrH/y28HwdLpa3VDsXaJPG+aauJ9MTWC2xQBUlMvlhuLBB+WtjxbnEuQUTzxQ7sgVXnt2o5WyqWb7A==} - engines: {node: '>=20.6.1'} + '@netlify/dev-utils@6.0.1': + resolution: {integrity: sha512-q5g70dO3q/M/XTBQz7uIECJxVlJoS8UBlzpjf22DV6q61UzXa8EONTPXPmvisrFcUi1I3AUKplPcHGQYZZj+Vw==} + engines: {node: '>=22.12.0'} - '@netlify/edge-bundler@14.7.0': - resolution: {integrity: sha512-EvjYzhY0qrDhapJQ8n/fXvEsjImai36VKs6kuVey20Qos5jC0oljdUBOeQ35nXTxiWi2Vo91IhjIWEQCLcUNdQ==} - engines: {node: '>=18.14.0'} + '@netlify/dev@5.1.0': + resolution: {integrity: sha512-g4fIVlz62NXshbLMx+UjHkcF/cr28AXAU/xpTJiFntkKddsoO5ahQjtBEoiKSQsBPtUrT7a7vMk6VFlrB3RDrg==} + engines: {node: '>=22.12.0'} + + '@netlify/edge-bundler@16.0.4': + resolution: {integrity: sha512-J7joSRuOIwg7bSMQBc+zq7Lb3p6gwsLMU/NYSFbXNIZtk6gSQnY3ZwnAncEhRqvN8lKsKx+27bn+4B2+B0N8ag==} + engines: {node: '>=22.12.0'} '@netlify/edge-functions-bootstrap@2.16.0': resolution: {integrity: sha512-v8QQihSbBHj3JxtJsHoepXALpNumD9M7egHoc8z62FYl5it34dWczkaJoFFopEyhiBVKi4K/n0ZYpdzwfujd6g==} - '@netlify/edge-functions-dev@1.0.0': - resolution: {integrity: sha512-bAUOuyxkqjEnX64Xel2QKqa7RNA13axrHYI089Vh9w5/+MCtf+CEuwexQ0Y3RoCyefjg8arHShL7lBccWFh4cg==} - engines: {node: '>=20.6.1'} + '@netlify/edge-functions-dev@2.0.1': + resolution: {integrity: sha512-IIIBoBhbqoOeOQLEfYLmW55IHOAxXc9athsUH7ZHKUUs3agi7ehVaZYZwhkQxB+l/K9/vRYHUnAZD715auIDpA==} + engines: {node: '>=22.12.0'} - '@netlify/edge-functions@3.0.0': - resolution: {integrity: sha512-qvwxrrOFeB9phD4zok/8FDWCXtipYpmLav/B2M6mUyjwB+XTZA769WfNWRElTG4cSUgrNM+GkyLuFHU2D0aY4Q==} - engines: {node: '>=18.0.0'} + '@netlify/edge-functions@4.0.0': + resolution: {integrity: sha512-0jerPQQ5mLczl7jwCRfTJsLcaiXbvPOC+Whtxxk7IHdz24OvZGjUtVHAxhppjT8wcX48I7C6oAff04QdQDMTfw==} + engines: {node: '>=22.12.0'} - '@netlify/functions-dev@1.0.0': - resolution: {integrity: sha512-Ws/NZiSjz2X2KW4fpZIPkfKGwoFcTFItm6iAgpY06TOol+n+sy2+qgvvjvF6Plm1l7mT2kttxXdsk6kVnR31Qg==} - engines: {node: '>=20.6.1'} + '@netlify/functions-dev@2.0.5': + resolution: {integrity: sha512-SSlmwe5GMfQmTDPbHfVTPe4h6lI3kbcepRxT2CKN30L9gx0NmwTGoMgns36DV64fHvabT5gNzzRxOx5sxYgzNg==} + engines: {node: '>=22.12.0'} - '@netlify/functions@5.0.0': - resolution: {integrity: sha512-gyKzl+P5SPp6P4iqykwPagSy7ODgRoQqi9TkjFJjM74FVJgxdiBQoLAmz+Pjl7kE5avJWtIvlQ+akAFaChekQQ==} - engines: {node: '>=18.0.0'} + '@netlify/functions@6.0.0': + resolution: {integrity: sha512-Pee+FoFnAtdejTkl62a7mZxj6Wx4eqVNuYyDc5T4XPJN9GaAWaUf4cZQFlf2m4Fqq0HoghjtcPKo+BZviVPPKA==} + engines: {node: '>=22.12.0'} - '@netlify/headers-parser@9.0.2': - resolution: {integrity: sha512-86YEGPxVemhksY1LeSr8NSOyH11RHvYHq+FuBJnTlPZoRDX+TD+0TAxF6lwzAgVTd1VPkyFEHlNgUGqw7aNzRQ==} - engines: {node: '>=18.14.0'} + '@netlify/headers-parser@10.1.1': + resolution: {integrity: sha512-ooiSc/eN/ktuugZmY4GVPh6nBYz2um0zpemokDvTLLQPF12QyXil8N6fr82wdLi03WNowwiL98eultZkTyHlyw==} + engines: {node: '>=22.12.0'} - '@netlify/headers@2.1.0': - resolution: {integrity: sha512-+7MgRPBYhRjizrd6JHxlD9KCjUyYk5yMqa16Ib3VNOSWYzaYiQi8Muyb1pn1pQVfBN2oPeK/q7J3pEdc/PWznQ==} - engines: {node: '>=20.6.1'} + '@netlify/headers@3.0.1': + resolution: {integrity: sha512-LcEu16gy28dkEp2+pa5EafauTfmFl6hkwiPqmoMBY+GiLLWQC00X8L4O1ZUrPqbKynsraSqEeKEfocC2FktrEQ==} + engines: {node: '>=22.12.0'} - '@netlify/images@1.3.0': - resolution: {integrity: sha512-edQefgR4aeL04oSgkGyjza3CObdU2C24EmRuF/FPXIR1GHa/TkEKMamppxFjZ6qj1i5tX0RGTLKvnREmtW34NA==} - engines: {node: '>=20.6.1'} + '@netlify/images@2.0.1': + resolution: {integrity: sha512-47DzR/PqIJqbUIef6P7EmhbNQbUOD4IuGNhTG7h3+xcynhQdBLBkCaBwY2DXOzUloA1MxYhKGYV2z4R3pO36hg==} + engines: {node: '>=22.12.0'} - '@netlify/open-api@2.40.0': - resolution: {integrity: sha512-Dp4lilDnkRKGWnljGkFVxfoh1wsWqxheE5/ZOf/sMZPsh3jGu5QZ4hVLEidzXYB/zIKFFqLaUbP2XYVxTqWqyQ==} + '@netlify/open-api@2.57.1': + resolution: {integrity: sha512-4YKcf35SKDp8N1JPw5cN/P0n/rJmVg8igL3UQUtAPIA9lBea6IigUknWRAXZEHhmXHAyR2ptiejSuQk+YFmlEA==} engines: {node: '>=14.8.0'} - '@netlify/redirect-parser@15.0.3': - resolution: {integrity: sha512-/HB3fcRRNgf6O/pbLn4EYNDHrU2kiadMMnazg8/OjvQK2S9i4y61vQcrICvDxYKUKQdgeEaABUuaCNAJFnfD9w==} - engines: {node: '>=18.14.0'} + '@netlify/otel@7.0.2': + resolution: {integrity: sha512-MHEsRJTZtOCrLa2fR+Y3GN51rvgxUHazuRVxuWuG7R1qzwynXAZB20Ufwp7BxKSTKcp7LNVEnKAZ/k2ytVmYvQ==} + engines: {node: '>=22.12.0'} - '@netlify/redirects@3.1.0': - resolution: {integrity: sha512-Eo50oNaTybEfB/4W6JFWdzQ1EbpObbaf83sIpT6H0DzfBgQIzPc3azdb7eD9eEFi3IAQjR5kZ6bOb2i4wbFDHQ==} - engines: {node: '>=20.6.1'} + '@netlify/redirect-parser@16.1.1': + resolution: {integrity: sha512-2Wg2em5rUi9EXKz5z4MAUb2Pfoyxm+jJpERYyIuYOwm6pfQHQCBjOD+HoW2CzDS859c0FlxNdnxq50bkfdKiLA==} + engines: {node: '>=22.12.0'} - '@netlify/runtime-utils@2.2.0': - resolution: {integrity: sha512-K3kWIxIMucibzQsATU2xw2JI+OpS9PZfPW/a+81gmeLC8tLv5YAxTVT0NFY/3imk1kcOJb9g7658jPLqDJaiAw==} - engines: {node: ^18.14.0 || >=20} + '@netlify/redirects@4.0.2': + resolution: {integrity: sha512-4Qpz6FpwrLITrScg34zjK9Iv0BiyyPVAGO7HvUZg0txihHPgKBRtLMByEwfP6mhuzTExoxMXYklqgHg2xtbPxA==} + engines: {node: '>=22.12.0'} - '@netlify/runtime@4.1.1': - resolution: {integrity: sha512-5qnHsri4X5r2spdD2tvdbU78grFV4fq7uVh/rMXF19qlgcHiuo0yr1JBEim1oINs/w+pyjusXMfnFEZjvV2qlQ==} - engines: {node: '>=20.6.1'} + '@netlify/runtime-utils@3.0.0': + resolution: {integrity: sha512-OHo40+V3QZkR+UrDjqhN+LekrAby/dSSJxsvyYs9i88E/mSl3goB/ysoL+VYROm190egxmQyRYlHK7vL4GeHBQ==} + engines: {node: '>=22.12.0'} - '@netlify/serverless-functions-api@2.7.1': - resolution: {integrity: sha512-NQcLB8BHbIsgSBPk9A/OBR5mGpc6dOAg1iRsYHWK0IoKsvwQ9a7bZc2+E40nE41Mnk24UjfK09vDLxP85O/zwA==} + '@netlify/runtime@5.0.3': + resolution: {integrity: sha512-MGoAWvFDuD0BbpIo8pwYPxxWsfMGBiiI4HetQOMkrx7ytnEZjq/qKKfzNCQKJg0Ed86XdQefKToVcP10wc38IQ==} + engines: {node: '>=22.12.0'} + + '@netlify/server-dev@0.1.1': + resolution: {integrity: sha512-yA+uMfscw2Unz8JvC0dRP9z5P0lnCOy//9YICFF4nzDijYXe80bsnvrblB8wOPYBq0/KmVhl4s0gCP/3roTp4w==} + engines: {node: '>=22.12.0'} + + '@netlify/serverless-functions-api@2.18.0': + resolution: {integrity: sha512-Uo5XyMFZOinq6AonHu6dUOkLvVydn+SaldoVkB4yQSpDrtqYWi56CoA26IIOur1EMJqRdt6JIzjzIe4jpzYdhQ==} engines: {node: '>=18.0.0'} - '@netlify/static@3.1.0': - resolution: {integrity: sha512-XbxiXpHaAakBASBFL5qc0SJhLlJdzYD0MYdM9sfCnRI38YJdvr0F2eHQlQDF016gn/iXhG6fJDxcWHEt2hEFDA==} - engines: {node: '>=20.6.1'} + '@netlify/serverless-functions-api@2.21.2': + resolution: {integrity: sha512-hlWyAXqwPXXujQ59fago956xft8EykD9jBncM6h+M/06mBR6E4stO1r1tDgAqRYm+XqgA7ZZNZU5TtBD+ZhLVw==} + engines: {node: '>=18.0.0'} - '@netlify/types@2.1.0': - resolution: {integrity: sha512-ktUb5d58pt1lQGXO5E9S0F1ljM0g+CoQuGTVII0IxBc0apmPq5RI0o3OWLY7U3ZERRiYTg5UfjiMihBEzuZsuw==} + '@netlify/static@4.0.0': + resolution: {integrity: sha512-YJcyaByknJ/JMmcqUFb9XId2NLgZitJlQC2FGP1a6mqndiMzAd9qoKtHxNRHX4NefI49+UABGtKF4UkL5rM8tw==} + engines: {node: '>=22.12.0'} + + '@netlify/types@2.8.0': + resolution: {integrity: sha512-8/g0Pt6y6wXj5Ia5eeYLiXhRfWeqZXGXpGFeCiiQdUOem+FPtXdA4+YdGxqzWc7D0AvptKSO01KGeeVWHSu8Kg==} engines: {node: ^18.14.0 || >=20} - '@netlify/vite-plugin-tanstack-start@1.1.4': - resolution: {integrity: sha512-GahhrKT7B1LRi4Bnj+O+Yhs2Bu4N6AfILzz/b06YxXEO7rRfX2yUDRBtv7/AFVLkyVOtkypkFZhZBbK9craVEA==} - engines: {node: ^22.12.0} + '@netlify/types@3.0.0': + resolution: {integrity: sha512-zRCidsQgI4CZWrZB/kmwdPf0QbSNljakfNSLizFvrsSA3UcUrTWSBNMVKmZnob92/8ESeUN0ewXLOlffJU+ATQ==} + engines: {node: '>=22.12.0'} + + '@netlify/vite-plugin-tanstack-start@1.3.19': + resolution: {integrity: sha512-qLrbU7ZWyHtoCdtmTUOUc9VQwMRHfJ5EqAVOwZyXHbp4okdFGeJkpcpwNGa1pHDOvdrVf8dyIK0Plc0KvX829g==} + engines: {node: ^22.12.0 || >=24.0.0} peerDependencies: '@tanstack/react-start': workspace:* '@tanstack/solid-start': workspace:* - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: '@tanstack/react-start': optional: true '@tanstack/solid-start': optional: true - '@netlify/vite-plugin@2.7.4': - resolution: {integrity: sha512-Eid41kWWruhONKA7eS+bGMs+JjEXaBhQEkH82+SyjeSVj+FhHQGSHdrejMI0nj1jSgVUa3JMh+l57OgRB6Lvkg==} - engines: {node: ^20.6.1 || >=22} + '@netlify/vite-plugin@3.0.1': + resolution: {integrity: sha512-63vL+KpnbfJv+xQSfOn37j8aSOWjiljeaFL9g/HY+YNJpDJ3Y5BPPW1VExx4dcPqXBkggBHm5Y6HpTvBeTSx3Q==} + engines: {node: '>=22.12.0'} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 - '@netlify/zip-it-and-ship-it@14.1.11': - resolution: {integrity: sha512-5Ed9XH1JVPL7pAdq9zpC2WHjqHhHkaghuV3r2bvTTpx9JrTdzZxPeNnjZRjJMkjQAi8xSped5hNFJuD0QYmOuw==} - engines: {node: '>=18.14.0'} + '@netlify/zip-it-and-ship-it@15.5.1': + resolution: {integrity: sha512-ECHwLIHkSgfkxqF+q40xLMTTSxir1/pDGK6d55oKvwKidrW4qyTyHCAkuKtjOTJ30A+E238X2iiRyI+SCDjTuA==} + engines: {node: '>=22.12.0'} hasBin: true - '@ngtools/webpack@21.2.19': - resolution: {integrity: sha512-CT7P2yCXIMgSldgA1HQoEtdyYuZ994nnDkPuXJXXry/qfwlHL6FN1se641ZSxdutLgHQL7GRrV+0vhpUieEd3Q==} - engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - '@angular/compiler-cli': ^21.0.0 - typescript: '>=5.9 <6.0' - webpack: ^5.54.0 + '@next/env@16.3.4': + resolution: {integrity: sha512-cjWZnUUa6jZq2kFaNe/ZyJdZonOZ/QoN0Zka2nz/FLOrfx14pQuM9c5RaSVkWMqgdt4ksgPAMWPyHSs/CyV48Q==} + + '@next/swc-darwin-arm64@16.3.4': + resolution: {integrity: sha512-iBr3I5LZNk5/bgl5//iTgD2tcym14MX0Xo7fD//u9dYAEgGzza1y9oywluPtf74YnOswVdH1908aK9xVz7zQTw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@next/swc-darwin-x64@16.3.4': + resolution: {integrity: sha512-2dpiSyl2Jw/NrBPaU2MAKGSa+2MR82pJIn4Sm5Rjr+gxAeuh0z158Su3Z2O8zn7UNNq+ej4bToed6RcRN/Lydg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@next/swc-linux-arm64-gnu@16.3.4': + resolution: {integrity: sha512-+t+U8HZT+fApePCS5h89CSH3datz29MkzyfCn+6fpsZBG/oiEOhINcb9rtkv6sdpToLGFn2e6146NzaKCXkqrA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@next/swc-linux-arm64-musl@16.3.4': + resolution: {integrity: sha512-mx03GNs1ocQA5JQ4FxDMmIsNkdrZh8cuezKCrId28e5/gIPU/l7Kcy2+vmCCzdjnnmXJy+iOAu+7K0QppO6Urg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@next/swc-linux-x64-gnu@16.3.4': + resolution: {integrity: sha512-YIhGY6fSMfha52bnVxnzc9zaVBzJg+cqQTOD8tXIBSx4fuv0pVMxQTE0PaS59YhnMOiYiG09IMwxJAf/CFm/Dw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@next/swc-linux-x64-musl@16.3.4': + resolution: {integrity: sha512-+eaaX6axpDb0yF1GCpiERe6njplvdC+nks/fKfcHu3XPGRrald8P3/X7yv7QLdjA51knnxwl9pxdIJsg+w1L+Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@next/swc-win32-arm64-msvc@16.3.4': + resolution: {integrity: sha512-0jcXW7Xs/uzICrmgV3MhDYDeRy++1CqnpDIerlPIqYO4bhzB4WNbX/aRnQclustsAyTkFKB0z6rbcjmNg5tR8A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@next/swc-win32-x64-msvc@16.3.4': + resolution: {integrity: sha512-vvBzwu1pYQCp92maZCFCIw/XgOTMR5tur9GjakwIo2cmwRTMKajRZZDS9+e4KsUZWKu1E007WUeAFXRRjZeuzw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] '@noble/ciphers@2.2.0': resolution: {integrity: sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA==} @@ -18046,123 +19426,62 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@npmcli/agent@4.0.2': - resolution: {integrity: sha512-EUEuWAxnL07Sp5/iC/1X6Xj+XThUvnbei9zfRWZdEXa7lss9RTHMhAHBeg+MZ5To9s/gGaSI+UwZTPdYMvKSeg==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/arborist@9.1.8': - resolution: {integrity: sha512-TYAzq0oaXQU+uLfXFbR2wYx62qHIOSg/TYhGWJSphJDypyjdNXC7B/+k29ElC2vWlWfX4OJnhmSY5DTwSFiNpg==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - - '@npmcli/fs@5.0.0': - resolution: {integrity: sha512-7OsC1gNORBEawOa5+j2pXN9vsicaIOH5cPXxoR6fJOmH6/EXpJB2CajXOu1fPRFun2m1lktEFX11+P89hqO/og==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/git@7.0.2': - resolution: {integrity: sha512-oeolHDjExNAJAnlYP2qzNjMX/Xi9bmu78C9dIGr4xjobrSKbuMYCph8lTzn4vnW3NjIqVmw/f8BCfouqyJXlRg==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/installed-package-contents@4.0.0': - resolution: {integrity: sha512-yNyAdkBxB72gtZ4GrwXCM0ZUedo9nIbOMKfGjt6Cu6DXf0p8y1PViZAKDC8q8kv/fufx0WTjRBdSlyrvnP7hmA==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - - '@npmcli/map-workspaces@5.0.3': - resolution: {integrity: sha512-o2grssXo1e774E5OtEwwrgoszYRh0lqkJH+Pb9r78UcqdGJRDRfhpM8DvZPjzNLLNYeD/rNbjOKM3Ss5UABROw==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/metavuln-calculator@9.0.3': - resolution: {integrity: sha512-94GLSYhLXF2t2LAC7pDwLaM4uCARzxShyAQKsirmlNcpidH89VA4/+K1LbJmRMgz5gy65E/QBBWQdUvGLe2Frg==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/name-from-folder@4.0.0': - resolution: {integrity: sha512-qfrhVlOSqmKM8i6rkNdZzABj8MKEITGFAY+4teqBziksCQAOLutiAxM1wY2BKEd8KjUSpWmWCYxvXr0y4VTlPg==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/node-gyp@5.0.0': - resolution: {integrity: sha512-uuG5HZFXLfyFKqg8QypsmgLQW7smiRjVc45bqD/ofZZcR/uxEjgQU8qDPv0s9TEeMUiAAU/GC5bR6++UdTirIQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/package-json@7.0.5': - resolution: {integrity: sha512-iVuTlG3ORq2iaVa1IWUxAO/jIp77tUKBhoMjuzYW2kL4MLN1bi/ofqkZ7D7OOwh8coAx1/S2ge0rMdGv8sLSOQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/promise-spawn@9.0.1': - resolution: {integrity: sha512-OLUaoqBuyxeTqUvjA3FZFiXUfYC1alp3Sa99gW3EUDz3tZ3CbXDdcZ7qWKBzicrJleIgucoWamWH1saAmH/l2Q==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/query@5.0.0': - resolution: {integrity: sha512-8TZWfTQOsODpLqo9SVhVjHovmKXNpevHU0gO9e+y4V4fRIOneiXy0u0sMP9LmS71XivrEWfZWg50ReH4WRT4aQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/redact@4.0.0': - resolution: {integrity: sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@npmcli/run-script@10.0.4': - resolution: {integrity: sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@nstudio/trapezedev-project@7.2.3': - resolution: {integrity: sha512-EIxEGjwPeMfBVkxvRvf8GY+pD3lfu8CP2sh/AD5eV4fgW/gpgRYE9WKbW4QJLj7WIRgQbn6Oos9NXq1OfTmzhA==} - - '@nx/devkit@22.7.5': - resolution: {integrity: sha512-/63ziS7kdHXYTLLhwWBu9hFwoFFT8xf+PkcQjsNdPqc5JmkYkSew0cE/vp5ORgBpGLWWnFPJgmfqjbJoO2C7jA==} + '@nx/devkit@24.0.0': + resolution: {integrity: sha512-t5E5VOCoNECLFMMp6qUczUx5kYduyvMMsHFGvuXPCKX32Ny4aFbeIrYNqCrsNKr9KgzMr0tOvRA+EMT0v7BXEA==} peerDependencies: - nx: '>= 21 <= 23 || ^22.0.0-0' + nx: '>= 23 <= 25 || ^24.0.0-0' - '@nx/nx-darwin-arm64@22.7.5': - resolution: {integrity: sha512-eoPtwx0qZqvRUD+VVOHm150AlSYwYoPxkDHBBGqKCn5nzPspb0lLWw8q83crM/L1M928YgK0WmGf3C++7eqsTA==} + '@nx/nx-darwin-arm64@24.0.0': + resolution: {integrity: sha512-ZHXmqkMVF7aA6QShvc5lVkCU6JHjGV19m8eplw0pL06AFgNdQ9u16013HJPm+Ys6fKnltYDWl/Ef7meQjT+u3Q==} cpu: [arm64] os: [darwin] - '@nx/nx-darwin-x64@22.7.5': - resolution: {integrity: sha512-VLOn/ZoEn3HfjSj+yIHLCM56/el79r+9I28CkZNHaSXJQWZ3edSkcgcfYjVxCurpN2VEwDQHLBeFCH8M+lQ7wQ==} + '@nx/nx-darwin-x64@24.0.0': + resolution: {integrity: sha512-a+cpg/VQvD/vF7BJsl70vulc1GxCamtU0XwzkGOzzDATn3JcKBNpBFx0Iqp5frJYN0X00Supz4zhgCEe9LpCow==} cpu: [x64] os: [darwin] - '@nx/nx-freebsd-x64@22.7.5': - resolution: {integrity: sha512-LEVer/E2xfGvK9Go+imMQoEninOoq/38Z2bhV1SD3AThXrp1xaLFVkW5jQ6juebeVkAeztEoMLFlr576egS0vw==} + '@nx/nx-freebsd-x64@24.0.0': + resolution: {integrity: sha512-PAGVaLbJxEzBXSQvg82g/8mDoqoMQFIX/EchuJbJGekIiz3BM2Xgyiy5qAD2/2meLVOTFtbkBQR+4ZSymgqGWw==} cpu: [x64] os: [freebsd] - '@nx/nx-linux-arm-gnueabihf@22.7.5': - resolution: {integrity: sha512-NP27EFGpmFJM6RL1Ey/AFJ7gA2xuqtIHaw6jjSNGvfrnZRUNaway30GrVaGGeODf0DsvAty/unqoBMPy6kDHbw==} + '@nx/nx-linux-arm-gnueabihf@24.0.0': + resolution: {integrity: sha512-WOWBIlTb+1FNP86GcodUF4BHdjVyGCwrVH/lqUvNAmT/FPopirCzVLdoj1P5kfWC/F0II/qAu7X698yKzIu71A==} cpu: [arm] os: [linux] - '@nx/nx-linux-arm64-gnu@22.7.5': - resolution: {integrity: sha512-QLnkJl3HkHsPfpLiNiAiMfpfAeFpic0U1diAxF8RqChOkCpQ7ulvyBVgE1UrQxvhd+gFQ3ed5RNDxtCRw8nTiw==} + '@nx/nx-linux-arm64-gnu@24.0.0': + resolution: {integrity: sha512-vASWIfOijXd5cdOn0Z6Wcd2iwtFxlBoBre6w+c8wuLLLPN3r4SRQyL+jAEB+eHkUHz39mMxSwa8DY+VlS9luVw==} cpu: [arm64] os: [linux] libc: [glibc] - '@nx/nx-linux-arm64-musl@22.7.5': - resolution: {integrity: sha512-cEP6KmwBgnb38+jTTaibWCjwXcHmigqhTfy0tN1be7WZr6bHxbqNLsXqKRN70PSNA3HouZcxw1cdRL8tqbPBBA==} + '@nx/nx-linux-arm64-musl@24.0.0': + resolution: {integrity: sha512-ZiG9Kjq1AvYmFK3p03OOjCcYXwiBpF2Z7Ih/QnKsRMcnT7GbjDpfuO3FkSMtuE0OWoAdAt9Kb2yXBP3L9IZc6w==} cpu: [arm64] os: [linux] libc: [musl] - '@nx/nx-linux-x64-gnu@22.7.5': - resolution: {integrity: sha512-tbaX1tZCSpGifDNBfDdEZAMxVF3Yg4bhFP/bm1needc0diqb+Zflc0u5tM5/6BWDMITQDwenJVsNiQ8ZdtJURA==} + '@nx/nx-linux-x64-gnu@24.0.0': + resolution: {integrity: sha512-FstnaQtRkxD0RGYtCJb7QYq9Sgzu+vCKYO+p3/uq+q2kKLwlu4ovvzUeDctTuCIjx1tFamp/Uu8n+bHavUE7KQ==} cpu: [x64] os: [linux] libc: [glibc] - '@nx/nx-linux-x64-musl@22.7.5': - resolution: {integrity: sha512-H0M7csOZIgPT822LqjxSXzf4MXRND15vIkAQe3F3Jlr3Si8LC3tzbL52aVcRfgb8MF/xOB5U47mSwxWt1M2bPQ==} + '@nx/nx-linux-x64-musl@24.0.0': + resolution: {integrity: sha512-dBFcWaSOhl17ZzZ+ybi9ctPlYPwDTlJjGgkpV5e/O6D7V9MFziJ4xZG/mVgacYbW3f5HS6QRVno9yPtSyLj2MA==} cpu: [x64] os: [linux] libc: [musl] - '@nx/nx-win32-arm64-msvc@22.7.5': - resolution: {integrity: sha512-JTcZch9YAnDL1gbhqePz3DZ4x7iYemLn1yJzrjbbXAmXju2eiiJiZvJJHbV06+SP9HKXDT8RjTKuAWTdVxnHug==} + '@nx/nx-win32-arm64-msvc@24.0.0': + resolution: {integrity: sha512-u2t4v71qCT7Nj4QbxuJ8X3iii881goaXJ7fjTcYw4EhSk1FemF6lh7mlSaHSczQ+/JFbiVppu649NYaVlIxGcw==} cpu: [arm64] os: [win32] - '@nx/nx-win32-x64-msvc@22.7.5': - resolution: {integrity: sha512-ngcMyHdBJ9FSz2nHdbZ7gtJlFq0O2b05sPAsVMkZ18CKzdaA1qrBDJfsMO49hPCny505eiT766+CkKdaCDl5kA==} + '@nx/nx-win32-x64-msvc@24.0.0': + resolution: {integrity: sha512-Rv464/mLVw3lKdsxhFJXk3WI2KyaCoGbTNUzLi8nlzEuZ0ZcBK4VKxAxlvVCAVrxPIZkbUFDYE7vRvdZ2DGikg==} cpu: [x64] os: [win32] @@ -18188,281 +19507,77 @@ packages: '@open-draft/deferred-promise@2.2.0': resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + '@open-draft/deferred-promise@3.0.0': + resolution: {integrity: sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==} + '@open-draft/logger@0.3.0': resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + '@opentelemetry/api-logs@0.221.0': + resolution: {integrity: sha512-OlanaW1vv7ufTqQ3/fPLI4arGt5ZoM+P8abOMki6uEYnpRazepSWDwDnnw+la7kE26SHVC18//SMccrDvLKOXQ==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/api@1.8.0': + resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/api@1.9.1': + resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/context-async-hooks@2.10.0': + resolution: {integrity: sha512-bvyMcgLEkozzSzpEEEo1OMoeQ97bxj6Qs2uN3mPrSdDvObMI1myffD/BPqcLlzZO9//d1SqQA/WPw7Cz2AiqhA==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/core@2.10.0': + resolution: {integrity: sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/instrumentation@0.221.0': + resolution: {integrity: sha512-cCk80Z/iRDf/5gfsKMB4f74LqVA5yKETB/9ojPzVW/6/f70iu89nJvGxsFCxx4XfSohaOofkU19kiYm84AiAlw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/resources@2.10.0': + resolution: {integrity: sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-base@2.10.0': + resolution: {integrity: sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ==} + engines: {node: ^18.19.0 || >=20.6.0} + deprecated: Use @opentelemetry/sdk-trace package + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-node@2.10.0': + resolution: {integrity: sha512-GZK/G6oZyBLGlH1pUgeDch7D91KoHd2uotUGIkWCPi9GI5T9X0p4L7nNAMDR1BQjkRYoDqo+ddfVx9t5Uhys+Q==} + engines: {node: ^18.19.0 || >=20.6.0} + deprecated: Use @opentelemetry/sdk-trace package + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/sdk-trace@2.10.0': + resolution: {integrity: sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + '@opentelemetry/semantic-conventions@1.41.1': resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==} engines: {node: '>=14'} - '@oxc-minify/binding-android-arm-eabi@0.110.0': - resolution: {integrity: sha512-43fMTO8/5bMlqfOiNSZNKUzIqeLIYuB9Hr1Ohyf58B1wU11S2dPGibTXOGNaWsfgHy99eeZ1bSgeIHy/fEYqbw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [android] - - '@oxc-minify/binding-android-arm64@0.110.0': - resolution: {integrity: sha512-5oQrnn9eK/ccOp80PTrNj0Vq893NPNNRryjGpOIVsYNgWFuoGCfpnKg68oEFcN8bArizYAqw4nvgHljEnar69w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@oxc-minify/binding-darwin-arm64@0.110.0': - resolution: {integrity: sha512-dqBDgTG9tF2z2lrZp9E8wU+Godz1i8gCGSei2eFKS2hRploBOD5dmOLp1j4IMornkPvSQmbwB3uSjPq7fjx4EA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@oxc-minify/binding-darwin-x64@0.110.0': - resolution: {integrity: sha512-U0AqabqaooDOpYmeeOye8wClv8PSScELXgOfYqyqgrwH9J9KrpCE1jL8Rlqgz68QbL4mPw3V6sKiiHssI4CLeQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@oxc-minify/binding-freebsd-x64@0.110.0': - resolution: {integrity: sha512-H0w8o/Wo1072WSdLfhwwrpFpwZnPpjQODlHuRYkTfsSSSJbTxQtjJd4uxk7YJsRv5RQp69y0I7zvdH6f8Xueyw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@oxc-minify/binding-linux-arm-gnueabihf@0.110.0': - resolution: {integrity: sha512-qd6sW0AvEVYZhbVVMGtmKZw3b1zDYGIW+54Uh42moWRAj6i4Jhk/LGr6r9YNZpOINeuvZfkFuEeDD/jbu7xPUA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-minify/binding-linux-arm-musleabihf@0.110.0': - resolution: {integrity: sha512-7WXP0aXMrWSn0ScppUBi3jf68ebfBG0eri8kxLmBOVSBj6jw1repzkHMITJMBeLr5d0tT/51qFEptiAk2EP2iA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-minify/binding-linux-arm64-gnu@0.110.0': - resolution: {integrity: sha512-LYfADrq5x1W5gs+u9OIbMbDQNYkAECTXX0ufnAuf3oGmO51rF98kGFR5qJqC/6/csokDyT3wwTpxhE0TkcF/Og==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@oxc-minify/binding-linux-arm64-musl@0.110.0': - resolution: {integrity: sha512-53GjCVY8kvymk9P6qNDh6zyblcehF5QHstq9QgCjv13ONGRnSHjeds0PxIwiihD7h295bxsWs84DN39syLPH4Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@oxc-minify/binding-linux-ppc64-gnu@0.110.0': - resolution: {integrity: sha512-li8XcN81dxbJDMBESnTgGhoiAQ+CNIdM0QGscZ4duVPjCry1RpX+5FJySFbGqG3pk4s9ZzlL/vtQtbRzZIZOzg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@oxc-minify/binding-linux-riscv64-gnu@0.110.0': - resolution: {integrity: sha512-SweKfsnLKShu6UFV8mwuj1d1wmlNoL/FlAxPUzwjEBgwiT2HQkY24KnjBH+TIA+//1O83kzmWKvvs4OuEhdIEQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@oxc-minify/binding-linux-riscv64-musl@0.110.0': - resolution: {integrity: sha512-oH8G4aFMP8XyTsEpdANC5PQyHgSeGlopHZuW1rpyYcaErg5YaK0vXjQ4EM5HVvPm+feBV24JjxgakTnZoF3aOQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@oxc-minify/binding-linux-s390x-gnu@0.110.0': - resolution: {integrity: sha512-W9na+Vza7XVUlpf8wMt4QBfH35KeTENEmnpPUq3NSlbQHz8lSlSvhAafvo43NcKvHAXV3ckD/mUf2VkqSdbklg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@oxc-minify/binding-linux-x64-gnu@0.110.0': - resolution: {integrity: sha512-XJdA4mmmXOjJxSRgNJXsDP7Xe8h3gQhmb56hUcCrvq5d+h5UcEi2pR8rxsdIrS8QmkLuBA3eHkGK8E27D7DTgQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@oxc-minify/binding-linux-x64-musl@0.110.0': - resolution: {integrity: sha512-QqzvALuOTtSckI8x467R4GNArzYDb/yEh6aNzLoeaY1O7vfT7SPDwlOEcchaTznutpeS9Dy8gUS/AfqtUHaufw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@oxc-minify/binding-openharmony-arm64@0.110.0': - resolution: {integrity: sha512-gAMssLs2Q3+uhLZxanh1DF+27Kaug3cf4PXb9AB7XK81DR+LVcKySXaoGYoOs20Co0fFSphd6rRzKge2qDK3dA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@oxc-minify/binding-wasm32-wasi@0.110.0': - resolution: {integrity: sha512-7Wqi5Zjl022bs2zXq+ICdalDPeDuCH/Nhbi8q2isLihAonMVIT0YH2hqqnNEylRNGYck+FJ6gRZwMpGCgrNxPg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@oxc-minify/binding-win32-arm64-msvc@0.110.0': - resolution: {integrity: sha512-ZPx+0Tj4dqn41ecyoGotlvekQKy6JxJCixn9Rw7h/dafZ3eDuBcEVh3c2ZoldXXsyMIt5ywI8IWzFZsjNedd5Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@oxc-minify/binding-win32-ia32-msvc@0.110.0': - resolution: {integrity: sha512-H0Oyd3RWBfpEyvJIrFK94RYiY7KKSQl11Ym7LMDwLEagelIAfRCkt1amHZhFa/S3ZRoaOJFXzEw4YKeSsjVFsg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ia32] - os: [win32] - - '@oxc-minify/binding-win32-x64-msvc@0.110.0': - resolution: {integrity: sha512-Hr3nK90+qXKJ2kepXwFIcNfQQIOBecB4FFCyaMMypthoEEhVP08heRynj4eSXZ8NL9hLjs3fQzH8PJXfpznRnQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@oxc-parser/binding-android-arm-eabi@0.121.0': - resolution: {integrity: sha512-n07FQcySwOlzap424/PLMtOkbS7xOu8nsJduKL8P3COGHKgKoDYXwoAHCbChfgFpHnviehrLWIPX0lKGtbEk/A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [android] - - '@oxc-parser/binding-android-arm64@0.121.0': - resolution: {integrity: sha512-/Dd1xIXboYAicw+twT2utxPD7bL8qh7d3ej0qvaYIMj3/EgIrGR+tSnjCUkiCT6g6uTC0neSS4JY8LxhdSU/sA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@oxc-parser/binding-darwin-arm64@0.121.0': - resolution: {integrity: sha512-A0jNEvv7QMtCO1yk205t3DWU9sWUjQ2KNF0hSVO5W9R9r/R1BIvzG01UQAfmtC0dQm7sCrs5puixurKSfr2bRQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@oxc-parser/binding-darwin-x64@0.121.0': - resolution: {integrity: sha512-SsHzipdxTKUs3I9EOAPmnIimEeJOemqRlRDOp9LIj+96wtxZejF51gNibmoGq8KoqbT1ssAI5po/E3J+vEtXGA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@oxc-parser/binding-freebsd-x64@0.121.0': - resolution: {integrity: sha512-v1APOTkCp+RWOIDAHRoaeW/UoaHF15a60E8eUL6kUQXh+i4K7PBwq2Wi7jm8p0ymID5/m/oC1w3W31Z/+r7HQw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@oxc-parser/binding-linux-arm-gnueabihf@0.121.0': - resolution: {integrity: sha512-PmqPQuqHZyFVWA4ycr0eu4VnTMmq9laOHZd+8R359w6kzuNZPvmmunmNJ8ybkm769A0nCoVp3TJ6dUz7B3FYIQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-parser/binding-linux-arm-musleabihf@0.121.0': - resolution: {integrity: sha512-vF24htj+MOH+Q7y9A8NuC6pUZu8t/C2Fr/kDOi2OcNf28oogr2xadBPXAbml802E8wRAVfbta6YLDQTearz+jw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-parser/binding-linux-arm64-gnu@0.121.0': - resolution: {integrity: sha512-wjH8cIG2Lu/3d64iZpbYr73hREMgKAfu7fqpXjgM2S16y2zhTfDIp8EQjxO8vlDtKP5Rc7waZW72lh8nZtWrpA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@oxc-parser/binding-linux-arm64-musl@0.121.0': - resolution: {integrity: sha512-qT663J/W8yQFw3dtscbEi9LKJevr20V7uWs2MPGTnvNZ3rm8anhhE16gXGpxDOHeg9raySaSHKhd4IGa3YZvuw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@oxc-parser/binding-linux-ppc64-gnu@0.121.0': - resolution: {integrity: sha512-mYNe4NhVvDBbPkAP8JaVS8lC1dsoJZWH5WCjpw5E+sjhk1R08wt3NnXYUzum7tIiWPfgQxbCMcoxgeemFASbRw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@oxc-parser/binding-linux-riscv64-gnu@0.121.0': - resolution: {integrity: sha512-+QiFoGxhAbaI/amqX567784cDyyuZIpinBrJNxUzb+/L2aBRX67mN6Jv40pqduHf15yYByI+K5gUEygCuv0z9w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@oxc-parser/binding-linux-riscv64-musl@0.121.0': - resolution: {integrity: sha512-9ykEgyTa5JD/Uhv2sttbKnCfl2PieUfOjyxJC/oDL2UO0qtXOtjPLl7H8Kaj5G7p3hIvFgu3YWvAxvE0sqY+hQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@oxc-parser/binding-linux-s390x-gnu@0.121.0': - resolution: {integrity: sha512-DB1EW5VHZdc1lIRjOI3bW/wV6R6y0xlfvdVrqj6kKi7Ayu2U3UqUBdq9KviVkcUGd5Oq+dROqvUEEFRXGAM7EQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@oxc-parser/binding-linux-x64-gnu@0.121.0': - resolution: {integrity: sha512-s4lfobX9p4kPTclvMiH3gcQUd88VlnkMTF6n2MTMDAyX5FPNRhhRSFZK05Ykhf8Zy5NibV4PbGR6DnK7FGNN6A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@oxc-parser/binding-linux-x64-musl@0.121.0': - resolution: {integrity: sha512-P9KlyTpuBuMi3NRGpJO8MicuGZfOoqZVRP1WjOecwx8yk4L/+mrCRNc5egSi0byhuReblBF2oVoDSMgV9Bj4Hw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@oxc-parser/binding-openharmony-arm64@0.121.0': - resolution: {integrity: sha512-R+4jrWOfF2OAPPhj3Eb3U5CaKNAH9/btMveMULIrcNW/hjfysFQlF8wE0GaVBr81dWz8JLgQlsxwctoL78JwXw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@oxc-parser/binding-wasm32-wasi@0.121.0': - resolution: {integrity: sha512-5TFISkPTymKvsmIlKasPVTPuWxzCcrT8pM+p77+mtQbIZDd1UC8zww4CJcRI46kolmgrEX6QpKO8AvWMVZ+ifw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@oxc-parser/binding-win32-arm64-msvc@0.121.0': - resolution: {integrity: sha512-V0pxh4mql4XTt3aiEtRNUeBAUFOw5jzZNxPABLaOKAWrVzSr9+XUaB095lY7jqMf5t8vkfh8NManGB28zanYKw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@oxc-parser/binding-win32-ia32-msvc@0.121.0': - resolution: {integrity: sha512-4Ob1qvYMPnlF2N9rdmKdkQFdrq16QVcQwBsO8yiPZXof0fHKFF+LmQV501XFbi7lHyrKm8rlJRfQ/M8bZZPVLw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ia32] - os: [win32] - - '@oxc-parser/binding-win32-x64-msvc@0.121.0': - resolution: {integrity: sha512-BOp1KCzdboB1tPqoCPXgntgFs0jjeSyOXHzgxVFR7B/qfr3F8r4YDacHkTOUNXtDgM8YwKnkf3rE5gwALYX7NA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@oxc-project/types@0.113.0': - resolution: {integrity: sha512-Tp3XmgxwNQ9pEN9vxgJBAqdRamHibi76iowQ38O2I4PMpcvNRQNVsU2n1x1nv9yh0XoTrGFzf7cZSGxmixxrhA==} - - '@oxc-project/types@0.115.0': - resolution: {integrity: sha512-4n91DKnebUS4yjUHl2g3/b2T+IUdCfmoZGhmwsovZCDaJSs+QkVAM+0AqqTxHSsHfeiMuueT75cZaZcT/m0pSw==} - - '@oxc-project/types@0.121.0': - resolution: {integrity: sha512-CGtOARQb9tyv7ECgdAlFxi0Fv7lmzvmlm2rpD/RdijOO9rfk/JvB1CjT8EnoD+tjna/IYgKKw3IV7objRb+aYw==} - - '@oxc-project/types@0.132.0': - resolution: {integrity: sha512-FESMOxil5Se014ui/Eq8fT5uHJo6nIRwH0PfJrZJXs6Gek3ZVFOrpUv3YIZT20m+extU98Hg1Ym72U58rlsxUQ==} + '@oxc-project/types@0.153.0': + resolution: {integrity: sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==} '@oxc-resolver/binding-android-arm-eabi@11.19.1': resolution: {integrity: sha512-aUs47y+xyXHUKlbhqHUjBABjvycq6YSD7bpxSW7vplUmdzAlJ93yXY6ZR0c1o1x5A/QKbENCvs3+NlY8IpIVzg==} @@ -18572,133 +19687,6 @@ packages: cpu: [x64] os: [win32] - '@oxc-transform/binding-android-arm-eabi@0.110.0': - resolution: {integrity: sha512-sE9dxvqqAax1YYJ3t7j+h5ZSI9jl6dYuDfngl6ieZUrIy5P89/8JKVgAzgp8o3wQSo7ndpJvYsi1K4ZqrmbP7w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [android] - - '@oxc-transform/binding-android-arm64@0.110.0': - resolution: {integrity: sha512-nqtbP4aMCtsCZ6qpHlHaQoWVHSBtlKzwaAgwEOvR+9DWqHjk31BHvpGiDXlMeed6CVNpl3lCbWgygb3RcSjcfw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@oxc-transform/binding-darwin-arm64@0.110.0': - resolution: {integrity: sha512-oeSeHnL4Z4cMXtc8V0/rwoVn0dgwlS9q0j6LcHn9dIhtFEdp3W0iSBF8YmMQA+E7sILeLDjsHmHE4Kp0sOScXw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@oxc-transform/binding-darwin-x64@0.110.0': - resolution: {integrity: sha512-nL9K5x7OuZydobAGPylsEW9d4APs2qEkIBLMgQPA+kY8dtVD3IR87QsTbs4l4DBQYyun/+ay6qVCDlxqxdX2Jg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@oxc-transform/binding-freebsd-x64@0.110.0': - resolution: {integrity: sha512-GS29zXXirDQhZEUq8xKJ1azAWMuUy3Ih3W5Bc5ddk12LRthO5wRLFcKIyeHpAXCoXymQ+LmxbMtbPf84GPxouw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@oxc-transform/binding-linux-arm-gnueabihf@0.110.0': - resolution: {integrity: sha512-glzDHak8ISyZJemCUi7RCvzNSl+MQ1ly9RceT2qRufhUsvNZ4C/2QLJ1HJwd2N6E88bO4laYn+RofdRzNnGGEA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-transform/binding-linux-arm-musleabihf@0.110.0': - resolution: {integrity: sha512-8JThvgJ2FRoTVfbp7e4wqeZqCZbtudM06SfZmNzND9kPNu/LVYygIR+72RWs+xm4bWkuYHg/islo/boNPtMT5Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxc-transform/binding-linux-arm64-gnu@0.110.0': - resolution: {integrity: sha512-IRh21Ub/g4bkHoErZ0AUWMlWfoZaS0A6EaOVtbcY70RSYIMlrsbjiFwJCzM+b/1DD1rXbH5tsGcH7GweTbfRqg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@oxc-transform/binding-linux-arm64-musl@0.110.0': - resolution: {integrity: sha512-e5JN94/oy+wevk76q+LMr+2klTTcO60uXa+Wkq558Ms7mdF2TvkKFI++d/JeiuIwJLTi/BxQ4qdT5FWcsHM/ug==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@oxc-transform/binding-linux-ppc64-gnu@0.110.0': - resolution: {integrity: sha512-Y3/Tnnz1GvDpmv8FXBIKtdZPsdZklOEPdrL6NHrN5i2u54BOkybFaDSptgWF53wOrJlTrcmAVSE6fRKK9XCM2Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@oxc-transform/binding-linux-riscv64-gnu@0.110.0': - resolution: {integrity: sha512-Y0E35iA9/v9jlkNcP6tMJ+ZFOS0rLsWDqG6rU9z+X2R3fBFJBO9UARIK6ngx8upxk81y1TFR2CmBFhupfYdH6Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@oxc-transform/binding-linux-riscv64-musl@0.110.0': - resolution: {integrity: sha512-JOUSYFfHjBUs7xp2FHmZHb8eTYD/oEu0NklS6JgUauqnoXZHiTLPLVW2o2uVCqldnabYHcomuwI2iqVFYJNhTw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@oxc-transform/binding-linux-s390x-gnu@0.110.0': - resolution: {integrity: sha512-7blgoXF9D3Ngzb7eun23pNrHJpoV/TtE6LObwlZ3Nmb4oZ6Z+yMvBVaoW68NarbmvNGfZ95zrOjgm6cVETLYBA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@oxc-transform/binding-linux-x64-gnu@0.110.0': - resolution: {integrity: sha512-YQ2joGWCVDZVEU2cD/r/w49hVjDm/Qu1BvC/7zs8LvprzdLS/HyMXGF2oA0puw0b+AqgYaz3bhwKB2xexHyITQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@oxc-transform/binding-linux-x64-musl@0.110.0': - resolution: {integrity: sha512-fkjr5qE632ULmNgvFXWDR/8668WxERz3tU7TQFp6JebPBneColitjSkdx6VKNVXEoMmQnOvBIGeP5tUNT384oA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@oxc-transform/binding-openharmony-arm64@0.110.0': - resolution: {integrity: sha512-HWH9Zj+lMrdSTqFRCZsvDWMz7OnMjbdGsm3xURXWfRZpuaz0bVvyuZNDQXc4FyyhRDsemICaJbU1bgeIpUJDGw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@oxc-transform/binding-wasm32-wasi@0.110.0': - resolution: {integrity: sha512-ejdxHmYfIcHDPhZUe3WklViLt9mDEJE5BzcW7+R1vc5i/5JFA8D0l7NUSsHBJ7FB8Bu9gF+5iMDm6cXGAgaghw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@oxc-transform/binding-win32-arm64-msvc@0.110.0': - resolution: {integrity: sha512-9VTwpXCZs7xkV+mKhQ62dVk7KLnLXtEUxNS2T4nLz3iMl1IJbA4h5oltK0JoobtiUAnbkV53QmMVGW8+Nh3bDQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@oxc-transform/binding-win32-ia32-msvc@0.110.0': - resolution: {integrity: sha512-5y0fzuNON7/F2hh2P94vANFaRPJ/3DI1hVl5rseCT8VUVqOGIjWaza0YS/D1g6t1WwycW2LWDMi2raOKoWU5GQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ia32] - os: [win32] - - '@oxc-transform/binding-win32-x64-msvc@0.110.0': - resolution: {integrity: sha512-QROrowwlrApI1fEScMknGWKM6GTM/Z2xwMnDqvSaEmzNazBsDUlE08Jasw610hFEsYAVU2K5sp/YaCa9ORdP4A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - '@panva/hkdf@1.2.1': resolution: {integrity: sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==} @@ -18768,8 +19756,8 @@ packages: os: [linux] libc: [musl] - '@parcel/watcher-wasm@2.5.1': - resolution: {integrity: sha512-RJxlQQLkaMMIuWRozy+z2vEqbaQlCuaCgVZIUCzQLYggY22LZbP5Y1+ia+FD724Ids9e+XIyOLXLrLgQSHIthw==} + '@parcel/watcher-wasm@2.6.0': + resolution: {integrity: sha512-dtjbDxKSDPQ8AmA+pS4OFaHE1FKrjtGpLGBxw85uKFkRorjNbvDM/aFPgqosu40wprbp1xw2ZSxIKqghCUHe2w==} engines: {node: '>= 10.0.0'} bundledDependencies: - napi-wasm @@ -18850,9 +19838,9 @@ packages: engines: {node: '>=22.6.0'} hasBin: true - '@playwright/test@1.61.1': - resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==} - engines: {node: '>=18'} + '@playwright/test@1.63.0': + resolution: {integrity: sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==} + engines: {node: '>=20'} hasBin: true '@polka/url@1.0.0-next.28': @@ -18861,8 +19849,8 @@ packages: '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} - '@poppinss/colors@4.1.5': - resolution: {integrity: sha512-FvdDqtcRCtz6hThExcFOgW0cWX+xwSMWcRuQe5ZEb2m7cVQOAVZOIMt+/v9RxGiD9/OY16qJBXK4CVKWAPalBw==} + '@poppinss/colors@4.1.6': + resolution: {integrity: sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==} '@poppinss/dumper@0.6.5': resolution: {integrity: sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==} @@ -18870,9 +19858,6 @@ packages: '@poppinss/exception@1.2.2': resolution: {integrity: sha512-m7bpKCD4QMlFCjA/nKTs23fuvoVFoA83brRKmObCUNmi/9tVu8Ve3w4YQAnJu4q3Tjf5fr685HYIC/IA2zHRSg==} - '@prettier/plugin-xml@2.2.0': - resolution: {integrity: sha512-UWRmygBsyj4bVXvDiqSccwT1kmsorcwQwaIy30yVh8T+Gspx4OlC0shX1y+ZuwXZvgnafmpRYKks0bAu9urJew==} - '@prisma/adapter-libsql@7.0.0': resolution: {integrity: sha512-RspyVP5FgvNhsb4XdpbcUfiWWh/JXucTxzLUVKlrL/sLYQ50Mxx855cElncWjl9u1chaLC5AOLqYC4wNH8XOzA==} @@ -18928,8 +19913,8 @@ packages: resolution: {integrity: sha512-SXCcgFvo/SC6/11kEOaQghJgCWNEWZUvPYKn/gpvMB9HLSG/5M8If7dWZtEQHhchvl8bh9A89Hw6mEKpsXFimA==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -18979,8 +19964,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -18992,8 +19977,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19005,8 +19990,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19018,8 +20003,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19031,8 +20016,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19044,8 +20029,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19057,8 +20042,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19070,8 +20055,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19083,8 +20068,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19095,7 +20080,7 @@ packages: resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19105,8 +20090,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19117,7 +20102,7 @@ packages: resolution: {integrity: sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19127,8 +20112,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19139,7 +20124,7 @@ packages: resolution: {integrity: sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19149,8 +20134,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19162,8 +20147,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19174,7 +20159,7 @@ packages: resolution: {integrity: sha512-fyjAACV62oPV925xFCrH8DR5xWhg9KYtJT4s3u54jxp+L/hbpTY2kIeEFFbFe+a/HCE94zGQMZLIpVTPVZDhaA==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19184,8 +20169,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19197,8 +20182,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19210,8 +20195,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19222,7 +20207,7 @@ packages: resolution: {integrity: sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19232,8 +20217,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19245,8 +20230,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19258,8 +20243,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19271,8 +20256,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19284,8 +20269,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19297,8 +20282,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19310,8 +20295,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19323,8 +20308,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19336,8 +20321,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19349,8 +20334,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19362,8 +20347,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19375,8 +20360,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19388,8 +20373,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19401,8 +20386,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19414,8 +20399,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19427,8 +20412,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19439,7 +20424,7 @@ packages: resolution: {integrity: sha512-ujc+V6r0HNDviYqIK3rW4ffgYiZ8g5DEHrGJVk4x7kTlLXRDILnKX9vAUYeIsLOoDpDJ0ujpqMkjH4w2ofuo6w==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19449,8 +20434,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19462,8 +20447,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19475,8 +20460,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19488,8 +20473,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19501,8 +20486,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19514,8 +20499,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19527,8 +20512,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19539,7 +20524,7 @@ packages: resolution: {integrity: sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19548,7 +20533,7 @@ packages: resolution: {integrity: sha512-YnEXIy8/ga01Y1PN0VfaNH//MhA91JlEGVBDxDzROqwrAtG5Yr2QGEPz8A/rJA3C7ZAHryOYGaUv8fLSW2H/mg==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19557,7 +20542,7 @@ packages: resolution: {integrity: sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19566,7 +20551,7 @@ packages: resolution: {integrity: sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19575,7 +20560,7 @@ packages: resolution: {integrity: sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19584,7 +20569,7 @@ packages: resolution: {integrity: sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19593,7 +20578,7 @@ packages: resolution: {integrity: sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19603,8 +20588,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -19619,306 +20604,130 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@rigor789/resolve-package-path@1.0.7': - resolution: {integrity: sha512-/JqGCvHpj0PxS9cyZPP5LpiEy1pYszgWor/JTyreHQwLPQQdxO1mUYTtRribYcVosxH7FFs0GJBtJ652nlwKyw==} + '@rolldown/binding-android-arm-eabi@1.2.13': + resolution: {integrity: sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] - '@rolldown/binding-android-arm64@1.0.0-rc.4': - resolution: {integrity: sha512-vRq9f4NzvbdZavhQbjkJBx7rRebDKYR9zHfO/Wg486+I7bSecdUapzCm5cyXoK+LHokTxgSq7A5baAXUZkIz0w==} + '@rolldown/binding-android-arm64@1.2.13': + resolution: {integrity: sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-android-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-lcJL0bN5hpgJfSIz/8PIf02irmyL43P+j1pTCfbD1DbLkmGRuFIA4DD3B3ZOvGqG0XiVvRznbKtN0COQVaKUTg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-android-arm64@1.0.2': - resolution: {integrity: sha512-ZS4D1JPGn/MYQN/SYDWftIE/nVsM8j/AFOYEzAoOE2O3NktQOZru+/vYXGbR/qtdLdIfGCP0lcoJiYVzsEz+iQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-darwin-arm64@1.0.0-rc.4': - resolution: {integrity: sha512-kFgEvkWLqt3YCgKB5re9RlIrx9bRsvyVUnaTakEpOPuLGzLpLapYxE9BufJNvPg8GjT6mB1alN4yN1NjzoeM8Q==} + '@rolldown/binding-darwin-arm64@1.2.13': + resolution: {integrity: sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-J7Zk3kLYFsLtuH6U+F4pS2sYVzac0qkjcO5QxHS7OS7yZu2LRs+IXo+uvJ/mvpyUljDJ3LROZPoQfgBIpCMhdQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-arm64@1.0.2': - resolution: {integrity: sha512-vdFA9+C/rekyGce7WqHs/xoT0ioZEWaOFyZLIV1mEeNFaFDUQrPIo8Vs2GvJ6eetb3rzDUtUBgzto3ExpXJB3w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.0-rc.4': - resolution: {integrity: sha512-JXmaOJGsL/+rsmMfutcDjxWM2fTaVgCHGoXS7nE8Z3c9NAYjGqHvXrAhMUZvMpHS/k7Mg+X7n/MVKb7NYWKKww==} + '@rolldown/binding-darwin-x64@1.2.13': + resolution: {integrity: sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-rc.9': - resolution: {integrity: sha512-iwtmmghy8nhfRGeNAIltcNXzD0QMNaaA5U/NyZc1Ia4bxrzFByNMDoppoC+hl7cDiUq5/1CnFthpT9n+UtfFyg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.2': - resolution: {integrity: sha512-BewSOwTHazv77DTYiAZXSqqKZ4KP/KonFisDMVU7PImxoWfB2aepnPhd2E4SWz3zDzYgDNbs6jBmTdgNnF02GA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-freebsd-x64@1.0.0-rc.4': - resolution: {integrity: sha512-ep3Catd6sPnHTM0P4hNEvIv5arnDvk01PfyJIJ+J3wVCG1eEaPo09tvFqdtcaTrkwQy0VWR24uz+cb4IsK53Qw==} + '@rolldown/binding-freebsd-x64@1.2.13': + resolution: {integrity: sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-freebsd-x64@1.0.0-rc.9': - resolution: {integrity: sha512-DLFYI78SCiZr5VvdEplsVC2Vx53lnA4/Ga5C65iyldMVaErr86aiqCoNBLl92PXPfDtUYjUh+xFFor40ueNs4Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-freebsd-x64@1.0.2': - resolution: {integrity: sha512-m41o7M0YWtUdqk61Tb+jnKb2rN++iRdIASlExkUoKfIAH30DOHCB8fVLzSUpbWHHU8esmEioY62PxzexE8MBuA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.4': - resolution: {integrity: sha512-LwA5ayKIpnsgXJEwWc3h8wPiS33NMIHd9BhsV92T8VetVAbGe2qXlJwNVDGHN5cOQ22R9uYvbrQir2AB+ntT2w==} + '@rolldown/binding-linux-arm-gnueabihf@1.2.13': + resolution: {integrity: sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.9': - resolution: {integrity: sha512-CsjTmTwd0Hri6iTw/DRMK7kOZ7FwAkrO4h8YWKoX/kcj833e4coqo2wzIFywtch/8Eb5enQ/lwLM7w6JX1W5RQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.2': - resolution: {integrity: sha512-jcojB9H7W/jS29pMKWAK1N+fU99vXodHDTatS3b3y/XSOCiHo0kkA74pL3jJmkoQtYpOCxDvaKs1fo2Ij/1X5w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.4': - resolution: {integrity: sha512-AC1WsGdlV1MtGay/OQ4J9T7GRadVnpYRzTcygV1hKnypbYN20Yh4t6O1Sa2qRBMqv1etulUknqXjc3CTIsBu6A==} + '@rolldown/binding-linux-arm64-gnu@1.2.13': + resolution: {integrity: sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-2x9O2JbSPxpxMDhP9Z74mahAStibTlrBMW0520+epJH5sac7/LwZW5Bmg/E6CXuEF53JJFW509uP+lSedaUNxg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-gnu@1.0.2': - resolution: {integrity: sha512-1jn6qDU5iiOgFgygDzKUuKP0maTi0/f1+sBLgvij/76C77Nm3ts6ufz9Bjg5q5dduxiUIxtq86JIoBvo1xQ4Ig==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.4': - resolution: {integrity: sha512-lU+6rgXXViO61B4EudxtVMXSOfiZONR29Sys5VGSetUY7X8mg9FCKIIjcPPj8xNDeYzKl+H8F/qSKOBVFJChCQ==} + '@rolldown/binding-linux-arm64-musl@1.2.13': + resolution: {integrity: sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.9': - resolution: {integrity: sha512-JA1QRW31ogheAIRhIg9tjMfsYbglXXYGNPLdPEYrwFxdbkQCAzvpSCSHCDWNl4hTtrol8WeboCSEpjdZK8qrCg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-arm64-musl@1.0.2': - resolution: {integrity: sha512-QVLO/czFMdoMFSqlX3bcswcJNm/23r+qoa/jgtmFc/qEp6/jXmIkDjF/XIo8dPfGaiwy1xfQn8o77L79GeXFgw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-aOKU9dJheda8Kj8Y3w9gnt9QFOO+qKPAl8SWd7JPHP+Cu0EuDAE5wokQubLzIDQWg2myXq2XhTpOVS07qqvT+w==} + '@rolldown/binding-linux-ppc64-gnu@1.2.13': + resolution: {integrity: sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-ppc64-gnu@1.0.2': - resolution: {integrity: sha512-hgO5Abm0w5UL6FEa2iFnZqo2KlK7TQ5QhV5x09hujBf7t5KzHQ1VmfPuTpqRy/rNlSxua3eWH374xxiVrP+lcA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-OalO94fqj7IWRn3VdXWty75jC5dk4C197AWEuMhIpvVv2lw9fiPhud0+bW2ctCxb3YoBZor71QHbY+9/WToadA==} + '@rolldown/binding-linux-s390x-gnu@1.2.13': + resolution: {integrity: sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.0.2': - resolution: {integrity: sha512-fy8rXxuYEu602abC8MUNaPjYLIFzReOaEIEMKMUa0rFEUxNpVXhs15KSSQ4qlqSaM7B6rcj9rDZgADh/IGDzLQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.4': - resolution: {integrity: sha512-DZaN1f0PGp/bSvKhtw50pPsnln4T13ycDq1FrDWRiHmWt1JeW+UtYg9touPFf8yt993p8tS2QjybpzKNTxYEwg==} + '@rolldown/binding-linux-x64-gnu@1.2.13': + resolution: {integrity: sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-cVEl1vZtBsBZna3YMjGXNvnYYrOJ7RzuWvZU0ffvJUexWkukMaDuGhUXn0rjnV0ptzGVkvc+vW9Yqy6h8YX4pg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.0.2': - resolution: {integrity: sha512-0+bOkiQ779+r1WpoHOWHqncvyySci0vKph+myNDYb+im6meJAzHQXay6oEgnkHuUGouM1LKTZwqKpBow6Kj7CQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-musl@1.0.0-rc.4': - resolution: {integrity: sha512-RnGxwZLN7fhMMAItnD6dZ7lvy+TI7ba+2V54UF4dhaWa/p8I/ys1E73KO6HmPmgz92ZkfD8TXS1IMV8+uhbR9g==} + '@rolldown/binding-linux-x64-musl@1.2.13': + resolution: {integrity: sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-linux-x64-musl@1.0.0-rc.9': - resolution: {integrity: sha512-UzYnKCIIc4heAKgI4PZ3dfBGUZefGCJ1TPDuLHoCzgrMYPb5Rv6TLFuYtyM4rWyHM7hymNdsg5ik2C+UD9VDbA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-x64-musl@1.0.2': - resolution: {integrity: sha512-mjSkrzZK5Qsl0a9d1JgILOiuZOSDTVdKENcSXBoqbzSrspLR/4/IRVDo5wd2GgZjNss/viBFJdeq+j7qH2nypw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-openharmony-arm64@1.0.0-rc.4': - resolution: {integrity: sha512-6lcI79+X8klGiGd8yHuTgQRjuuJYNggmEml+RsyN596P23l/zf9FVmJ7K0KVKkFAeYEdg0iMUKyIxiV5vebDNQ==} + '@rolldown/binding-openharmony-arm64@1.2.13': + resolution: {integrity: sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-openharmony-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-+6zoiF+RRyf5cdlFQP7nm58mq7+/2PFaY2DNQeD4B87N36JzfF/l9mdBkkmTvSYcYPE8tMh/o3cRlsx1ldLfog==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-openharmony-arm64@1.0.2': - resolution: {integrity: sha512-1v5vHasdfQAZoEHakBV72LIFAC9JjnymsiKxp+GEr/ma3+NJCPSaYK+qavInOovJkgwFrs7GccX2d6IgDA3Z5w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-wasm32-wasi@1.0.0-rc.4': - resolution: {integrity: sha512-wz7ohsKCAIWy91blZ/1FlpPdqrsm1xpcEOQVveWoL6+aSPKL4VUcoYmmzuLTssyZxRpEwzuIxL/GDsvpjaBtOw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@rolldown/binding-wasm32-wasi@1.0.0-rc.9': - resolution: {integrity: sha512-rgFN6sA/dyebil3YTlL2evvi/M+ivhfnyxec7AccTpRPccno/rPoNlqybEZQBkcbZu8Hy+eqNJCqfBR8P7Pg8g==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@rolldown/binding-wasm32-wasi@1.0.2': - resolution: {integrity: sha512-mb1VobWn6NheziTk5/WEaR6AKVbrwT5sOi6C7zk3gy/pD1qtJfU1j4PgTo2NJnOtbL9Dl3Aeei8w9jJ7qC2jZQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [wasm32] - - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.4': - resolution: {integrity: sha512-cfiMrfuWCIgsFmcVG0IPuO6qTRHvF7NuG3wngX1RZzc6dU8FuBFb+J3MIR5WrdTNozlumfgL4cvz+R4ozBCvsQ==} + '@rolldown/binding-win32-arm64-msvc@1.2.13': + resolution: {integrity: sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.9': - resolution: {integrity: sha512-lHVNUG/8nlF1IQk1C0Ci574qKYyty2goMiPlRqkC5R+3LkXDkL5Dhx8ytbxq35m+pkHVIvIxviD+TWLdfeuadA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-arm64-msvc@1.0.2': - resolution: {integrity: sha512-SqKonF56vA/L2yHwHYcEp2P34URpOZ7d1fS635cTkpDnUtEGdUbhI6NzsPdqeSWvAAeGDrxjWjNmibDIdFf9/A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.4': - resolution: {integrity: sha512-p6UeR9y7ht82AH57qwGuFYn69S6CZ7LLKdCKy/8T3zS9VTrJei2/CGsTUV45Da4Z9Rbhc7G4gyWQ/Ioamqn09g==} + '@rolldown/binding-win32-x64-msvc@1.2.13': + resolution: {integrity: sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.9': - resolution: {integrity: sha512-G0oA4+w1iY5AGi5HcDTxWsoxF509hrFIPB2rduV5aDqS9FtDg1CAfa7V34qImbjfhIcA8C+RekocJZA96EarwQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.2': - resolution: {integrity: sha512-v7qRI7gXLRINcOGXt+7YmAZ6iFuyZVMIoXAxhd8oP+DR9dLfL9GfNIx7PLMxmhZdvq8waUJBQiWN9EKNy+TRBQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/pluginutils@1.0.0': - resolution: {integrity: sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ==} - - '@rolldown/pluginutils@1.0.0-beta.19': - resolution: {integrity: sha512-3FL3mnMbPu0muGOCaKAhhFEYmqv9eTfPSJRJmANrCwtgK8VuxpsZDGK+m0LYAGoyO8+0j5uRe4PeyPDK1yA/hA==} - - '@rolldown/pluginutils@1.0.0-beta.27': - resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==} + '@rolldown/plugin-babel@0.2.3': + resolution: {integrity: sha512-+zEk16yGlz1F9STiRr6uG9hmIXb6nprjLczV/htGptYuLoCuxb+itZ03RKCEeOhBpDDd1NU7qF6x1VLMUp62bw==} + engines: {node: '>=22.12.0 || ^24.0.0'} + peerDependencies: + '@babel/core': ^7.29.0 || ^8.0.0-rc.1 + '@babel/plugin-transform-runtime': ^7.29.0 || ^8.0.0-rc.1 + '@babel/runtime': ^7.27.0 || ^8.0.0-rc.1 + rolldown: ^1.0.0-rc.5 + vite: ^8.3.4 + peerDependenciesMeta: + '@babel/plugin-transform-runtime': + optional: true + '@babel/runtime': + optional: true + vite: + optional: true '@rolldown/pluginutils@1.0.0-rc.2': resolution: {integrity: sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==} - '@rolldown/pluginutils@1.0.0-rc.3': - resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==} - - '@rolldown/pluginutils@1.0.0-rc.4': - resolution: {integrity: sha512-1BrrmTu0TWfOP1riA8uakjFc9bpIUGzVKETsOtzY39pPga8zELGDl8eu1Dx7/gjM5CAz14UknsUMpBO8L+YntQ==} - '@rolldown/pluginutils@1.0.0-rc.7': resolution: {integrity: sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==} @@ -19928,69 +20737,6 @@ packages: '@rolldown/pluginutils@1.0.1': resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} - '@rollup/plugin-alias@6.0.0': - resolution: {integrity: sha512-tPCzJOtS7uuVZd+xPhoy5W4vThe6KWXNmsFCNktaAh5RTqcLiSfT4huPQIXkgJ6YCOjJHvecOAzQxLFhPxKr+g==} - engines: {node: '>=20.19.0'} - peerDependencies: - rollup: '>=4.0.0' - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-commonjs@29.0.0': - resolution: {integrity: sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==} - engines: {node: '>=16.0.0 || 14 >= 14.17'} - peerDependencies: - rollup: ^2.68.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-inject@5.0.5': - resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-json@6.1.0': - resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-node-resolve@16.0.3': - resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-replace@6.0.3': - resolution: {integrity: sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-terser@0.4.4': - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - '@rollup/pluginutils@5.1.4': resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} engines: {node: '>=14.0.0'} @@ -20000,146 +20746,146 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.56.0': - resolution: {integrity: sha512-LNKIPA5k8PF1+jAFomGe3qN3bbIgJe/IlpDBwuVjrDKrJhVWywgnJvflMt/zkbVNLFtF1+94SljYQS6e99klnw==} + '@rollup/rollup-android-arm-eabi@4.63.1': + resolution: {integrity: sha512-UZ8sUxPTiHWYX9QNdJedb1kDZSpS1t/VPWBWGSgqHNi9w3Cu6IXvu2mzbhiTiPvtrqgTQJ+zqiAq2iPIPilpaQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.56.0': - resolution: {integrity: sha512-lfbVUbelYqXlYiU/HApNMJzT1E87UPGvzveGg2h0ktUNlOCxKlWuJ9jtfvs1sKHdwU4fzY7Pl8sAl49/XaEk6Q==} + '@rollup/rollup-android-arm64@4.63.1': + resolution: {integrity: sha512-cQ4nFQABN5cDvDpbvJ7bMStCpnaVxynZrRMfUJYgxcIk9Sh54FIO1vtfkg0B69REjER77ioZ/ov+eAApx/KmLQ==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.56.0': - resolution: {integrity: sha512-EgxD1ocWfhoD6xSOeEEwyE7tDvwTgZc8Bss7wCWe+uc7wO8G34HHCUH+Q6cHqJubxIAnQzAsyUsClt0yFLu06w==} + '@rollup/rollup-darwin-arm64@4.63.1': + resolution: {integrity: sha512-FQNqd1lRy/0QhDk3xeRIkSBiCpXCiDnZO3YLVdcDKN1UBiKToNftCzcXYNLshmPDUMlu2TdeS8tGcsU6f3YF1Q==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.56.0': - resolution: {integrity: sha512-1vXe1vcMOssb/hOF8iv52A7feWW2xnu+c8BV4t1F//m9QVLTfNVpEdja5ia762j/UEJe2Z1jAmEqZAK42tVW3g==} + '@rollup/rollup-darwin-x64@4.63.1': + resolution: {integrity: sha512-pvD16V939D3CloK0+qikpGaxiPrDUXTe7Y5cWOMkMSy7m1cawa8EGy/kXYi/G/cKAC4HDAbSnzCIk1WmsoOKXg==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.56.0': - resolution: {integrity: sha512-bof7fbIlvqsyv/DtaXSck4VYQ9lPtoWNFCB/JY4snlFuJREXfZnm+Ej6yaCHfQvofJDXLDMTVxWscVSuQvVWUQ==} + '@rollup/rollup-freebsd-arm64@4.63.1': + resolution: {integrity: sha512-pcFGeL2345VwdTnJhA6zLbew+YgWB0qBG2+dMtXjCicf6+rm6kO6cOoh5VnTe0ZMrMRgRyuHmCJxZWrIdzYuOw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.56.0': - resolution: {integrity: sha512-KNa6lYHloW+7lTEkYGa37fpvPq+NKG/EHKM8+G/g9WDU7ls4sMqbVRV78J6LdNuVaeeK5WB9/9VAFbKxcbXKYg==} + '@rollup/rollup-freebsd-x64@4.63.1': + resolution: {integrity: sha512-mRJlqSRulVzcKq/LKA6ICSIc3K/l4fzlVn/gePn2nXIHy8seRi5z/eeRE0d/XMBxcMldiXtQTSpRj0tkkC3g8Q==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.56.0': - resolution: {integrity: sha512-E8jKK87uOvLrrLN28jnAAAChNq5LeCd2mGgZF+fGF5D507WlG/Noct3lP/QzQ6MrqJ5BCKNwI9ipADB6jyiq2A==} + '@rollup/rollup-linux-arm-gnueabihf@4.63.1': + resolution: {integrity: sha512-YDUNvVM85TI3g/1OpnqKP1h4NeW/j64DfWMf+G3M809xNk1bJSnpFp4sh83NpmVE5DXnkh8ULor4LTVZKoYLHw==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.56.0': - resolution: {integrity: sha512-jQosa5FMYF5Z6prEpTCCmzCXz6eKr/tCBssSmQGEeozA9tkRUty/5Vx06ibaOP9RCrW1Pvb8yp3gvZhHwTDsJw==} + '@rollup/rollup-linux-arm-musleabihf@4.63.1': + resolution: {integrity: sha512-7Mcn71p9ZuQFAj+h+dhQXy/yeLePRS2yKRnmW1DijA9thKO5qap0GNOIQK4yQ6iP3SU0Mrb/yWo8h8vgRba8lw==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.56.0': - resolution: {integrity: sha512-uQVoKkrC1KGEV6udrdVahASIsaF8h7iLG0U0W+Xn14ucFwi6uS539PsAr24IEF9/FoDtzMeeJXJIBo5RkbNWvQ==} + '@rollup/rollup-linux-arm64-gnu@4.63.1': + resolution: {integrity: sha512-4YiLQTX6U4CSl0L9cluep9A9W6UmTfqBDc2/CH6wlu54pl4E7Jn3cOD8oxzvBDEGk/JMKgJ47C8g+radF7mwvg==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.56.0': - resolution: {integrity: sha512-vLZ1yJKLxhQLFKTs42RwTwa6zkGln+bnXc8ueFGMYmBTLfNu58sl5/eXyxRa2RarTkJbXl8TKPgfS6V5ijNqEA==} + '@rollup/rollup-linux-arm64-musl@4.63.1': + resolution: {integrity: sha512-2ra8F7w8OquwZN9z2/fKFnli69wa8PLwaVzRMIPGb13ByMJwC28Fbp8YcVGoUhlYMTt7j5j9bNgpysrN2UM+vw==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.56.0': - resolution: {integrity: sha512-FWfHOCub564kSE3xJQLLIC/hbKqHSVxy8vY75/YHHzWvbJL7aYJkdgwD/xGfUlL5UV2SB7otapLrcCj2xnF1dg==} + '@rollup/rollup-linux-loong64-gnu@4.63.1': + resolution: {integrity: sha512-Sy20ncyhjmBP0Ml+UvQbimjlk6VFgjW5uNP+qqwHB00mTE8Bl2C1TuHTlRwK2YoXeZbee5lP2XevBWVkAQAtSQ==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.56.0': - resolution: {integrity: sha512-z1EkujxIh7nbrKL1lmIpqFTc/sr0u8Uk0zK/qIEFldbt6EDKWFk/pxFq3gYj4Bjn3aa9eEhYRlL3H8ZbPT1xvA==} + '@rollup/rollup-linux-loong64-musl@4.63.1': + resolution: {integrity: sha512-noITLp8oNjYliPnGWmLyelIHwULGqbHloQHGw1rtxbWhTuWooRpnZarZQJ1y9EUC4szuCusCc+HEpUtxpIwYvA==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.56.0': - resolution: {integrity: sha512-iNFTluqgdoQC7AIE8Q34R3AuPrJGJirj5wMUErxj22deOcY7XwZRaqYmB6ZKFHoVGqRcRd0mqO+845jAibKCkw==} + '@rollup/rollup-linux-ppc64-gnu@4.63.1': + resolution: {integrity: sha512-hlxxXd+F1mWiAcaFR7Sv9ZQT6m6UfI8+Vy/kFJzztq2pDMU/0wZ9sish0iszNZvsQDo8Gc0i5yuFEOz5dDf6fA==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.56.0': - resolution: {integrity: sha512-MtMeFVlD2LIKjp2sE2xM2slq3Zxf9zwVuw0jemsxvh1QOpHSsSzfNOTH9uYW9i1MXFxUSMmLpeVeUzoNOKBaWg==} + '@rollup/rollup-linux-ppc64-musl@4.63.1': + resolution: {integrity: sha512-EF7OpqQTQ/BvGqLzUi4rEHuagCV9MugAUXSHemwPW5vxZ75RR+jxO/2j95Ph2dalMpFHSVECjRoioHZgA9zOYA==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.56.0': - resolution: {integrity: sha512-in+v6wiHdzzVhYKXIk5U74dEZHdKN9KH0Q4ANHOTvyXPG41bajYRsy7a8TPKbYPl34hU7PP7hMVHRvv/5aCSew==} + '@rollup/rollup-linux-riscv64-gnu@4.63.1': + resolution: {integrity: sha512-wQO3JesW9PRkwlabQ27y7sPfVOOTLRG73I4F2UYHG5PXun3J9U3y+b7ezVKSYbsvSKGQ1k1cq8Qlun4C9kLt3w==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.56.0': - resolution: {integrity: sha512-yni2raKHB8m9NQpI9fPVwN754mn6dHQSbDTwxdr9SE0ks38DTjLMMBjrwvB5+mXrX+C0npX0CVeCUcvvvD8CNQ==} + '@rollup/rollup-linux-riscv64-musl@4.63.1': + resolution: {integrity: sha512-ouAGwhO6wHRXdnOVCOsB0tRFkA7nhNB2Nwax6oECXN0YiN8EYUTBAOudADOB1PI+yDL61TeNx/u7MVCzksNbkQ==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.56.0': - resolution: {integrity: sha512-zhLLJx9nQPu7wezbxt2ut+CI4YlXi68ndEve16tPc/iwoylWS9B3FxpLS2PkmfYgDQtosah07Mj9E0khc3Y+vQ==} + '@rollup/rollup-linux-s390x-gnu@4.63.1': + resolution: {integrity: sha512-q2R38Sn+1J8RxhfJ+T54wSWmyKXWec+9jgDfqO2AtArEqHO5R2aeayp5H5OYLr5UYDVGsVaZPEFUooMhYCdz5A==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.56.0': - resolution: {integrity: sha512-MVC6UDp16ZSH7x4rtuJPAEoE1RwS8N4oK9DLHy3FTEdFoUTCFVzMfJl/BVJ330C+hx8FfprA5Wqx4FhZXkj2Kw==} + '@rollup/rollup-linux-x64-gnu@4.63.1': + resolution: {integrity: sha512-gfI5T24WLLuFfSKw7Go/zDXjAAV0fny0swTaDv+WjK7vqcw4cRhFfdsyKL1n+ukI+ooBxn3bVQnyrn06WpI50w==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.56.0': - resolution: {integrity: sha512-ZhGH1eA4Qv0lxaV00azCIS1ChedK0V32952Md3FtnxSqZTBTd6tgil4nZT5cU8B+SIw3PFYkvyR4FKo2oyZIHA==} + '@rollup/rollup-linux-x64-musl@4.63.1': + resolution: {integrity: sha512-4h6XqthmB4Hspji84wvgk+ElodTsGj+dbZqHJHHtKxj4mYq0ANSEEPX9ys3moJueqsRjwpaJYH7874Itwnj2ow==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.56.0': - resolution: {integrity: sha512-O16XcmyDeFI9879pEcmtWvD/2nyxR9mF7Gs44lf1vGGx8Vg2DRNx11aVXBEqOQhWb92WN4z7fW/q4+2NYzCbBA==} + '@rollup/rollup-openbsd-x64@4.63.1': + resolution: {integrity: sha512-dlfCOa87o1VAYegLQ9EKilx2JCeRofiyPGhTCmqnuXZ6bMPiycO1rq1+sKoulAp7pGLIsTIw+1x5R+zgh5LhhA==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.56.0': - resolution: {integrity: sha512-LhN/Reh+7F3RCgQIRbgw8ZMwUwyqJM+8pXNT6IIJAqm2IdKkzpCh/V9EdgOMBKuebIrzswqy4ATlrDgiOwbRcQ==} + '@rollup/rollup-openharmony-arm64@4.63.1': + resolution: {integrity: sha512-cjkLbOlfcm3QGhMM1J5zaZjsw1GggbN6rw9UTSSRrPrR1KkcXnN7Uq9rPw34xImQ9VOY9GN+6u2Zj80B9ptkcw==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.56.0': - resolution: {integrity: sha512-kbFsOObXp3LBULg1d3JIUQMa9Kv4UitDmpS+k0tinPBz3watcUiV2/LUDMMucA6pZO3WGE27P7DsfaN54l9ing==} + '@rollup/rollup-win32-arm64-msvc@4.63.1': + resolution: {integrity: sha512-Li1KdUnWGE4N3e1F/B4RTB1ms+nG4WBgjByO46pkeBVX/2UBsY53xf5vK9WygVmnH3RwncIST7lkSdLSY6P9lg==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.56.0': - resolution: {integrity: sha512-vSSgny54D6P4vf2izbtFm/TcWYedw7f8eBrOiGGecyHyQB9q4Kqentjaj8hToe+995nob/Wv48pDqL5a62EWtg==} + '@rollup/rollup-win32-ia32-msvc@4.63.1': + resolution: {integrity: sha512-t4ZYOSoLTgwhuFMrmTMLx/+i1DQVK7HYqMc6kY46EApwi8X0nIVphzdNoThU3xt6n+N5urG1/gxBdCaKDLavfg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.56.0': - resolution: {integrity: sha512-FeCnkPCTHQJFbiGG49KjV5YGW/8b9rrXAM2Mz2kiIoktq2qsJxRD5giEMEOD2lPdgs72upzefaUvS+nc8E3UzQ==} + '@rollup/rollup-win32-x64-gnu@4.63.1': + resolution: {integrity: sha512-RgroPfMmKlD1RzSDxvwgcPiy2HNQKoYV7OmwIXDsk73uKW5t6B/V8KIy27SMv/FNXFo/oSBtWc9J0X7t91ezZg==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.56.0': - resolution: {integrity: sha512-H8AE9Ur/t0+1VXujj90w0HrSOuv0Nq9r1vSZF2t5km20NTfosQsGGUXDaKdQZzwuLts7IyL1fYT4hM95TI9c4g==} + '@rollup/rollup-win32-x64-msvc@4.63.1': + resolution: {integrity: sha512-at8QVep6S3h5Y6gSbdGU06bRY5WJkf6WUduM9YtvYMbYhB1MOFfUgc6kehitQXzOtMSaT70q7f9ydPhpqu821w==} cpu: [x64] os: [win32] - '@rsbuild/core@2.0.1': - resolution: {integrity: sha512-5TwUpb10Y+VYaYH8oLL/rfJGrhxrk16BiGzv101kzaMPT60MtOXgjEUTxztbjRuq0ifbtRJ/w7rsIZQ4VziWYg==} + '@rsbuild/core@2.3.1': + resolution: {integrity: sha512-dv5tL7djb8ex5z4sqnDmUbd5PnGNr/CXuFfiMD4RkUsF1JEZZkGH8lc+QW4fqYQIHM7RTvcMUakgvwVU/O9WMw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -20148,31 +20894,6 @@ packages: core-js: optional: true - '@rsbuild/core@2.0.14': - resolution: {integrity: sha512-SSPer6vM+v82CV6JXIOzyyT++A1ECgsVvvUuveD5rfGxX/W58vWGnB+zWcYbMfYOjTntD+9ve6QGGh6kBjPx6A==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - core-js: '>= 3.0.0' - peerDependenciesMeta: - core-js: - optional: true - - '@rsbuild/core@2.0.8': - resolution: {integrity: sha512-V5Bhn3zqljsaB5grw9oMkSk6XZFvMkr6UpIYPZnDmOWsRAT1fNQ6XF6cn8fVUKv/KILblBrKLUZf0DpvDt3exw==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - core-js: '>= 3.0.0' - peerDependenciesMeta: - core-js: - optional: true - - '@rsbuild/plugin-babel@1.0.6': - resolution: {integrity: sha512-tWnqG938MedKJx7U4F1lHb156VDtNzj7mSsi2ZoxZVBnECQE01/V6QTN1XKw7nWunGyGoETb+nQBGc+fkVZjvw==} - peerDependencies: - '@rsbuild/core': 1.x - '@rsbuild/plugin-babel@1.1.2': resolution: {integrity: sha512-qIZzosQlkj7VyFz8mmz1vAKDFlk79xrIvCRYzROqNwQHDXep+gd91nCnUPJdRPHrktzN8Yqa190CPTii3rON6w==} peerDependencies: @@ -20189,6 +20910,14 @@ packages: '@rsbuild/core': optional: true + '@rsbuild/plugin-sass@2.0.1': + resolution: {integrity: sha512-BZRpVTZW+za+sv84nYYdIjR7XwVqyS8+1wAha/7BvQ1igdzlmT6xPd6h4jTWfNzdHuzIHZsuWY7kPS/ybzcndA==} + peerDependencies: + '@rsbuild/core': ^2.0.0 + peerDependenciesMeta: + '@rsbuild/core': + optional: true + '@rsbuild/plugin-solid@1.1.1': resolution: {integrity: sha512-IMlxjAVDrgPPx7KHQXyiJiQn5x11jibC7WIVIkZg7uxkcgBuHyE6InmVNc+C6M3Y1djXYL7GG2M7CH4Jdg+RUw==} peerDependencies: @@ -20197,10 +20926,10 @@ packages: '@rsbuild/core': optional: true - '@rsbuild/plugin-vue-jsx@1.1.1': - resolution: {integrity: sha512-6QHm0dmx5cdgpvMXv7bSrTzuDi1uDBw7SaydmN8kQ/uhaxRPWMNMU3g6rGYKhu+6ExHKwtXOf8CI2YtXwDaP9Q==} + '@rsbuild/plugin-tailwindcss@2.0.3': + resolution: {integrity: sha512-sl7mN0fyoP0W+zEyFR2xEMVAS2cZPlOAqsXwI8Ei9tUSvV7V4G8Xw2WBVCOQ/B4KEFfJ6H1+TEuPlAzHLEfc4g==} peerDependencies: - '@rsbuild/core': 1.x + '@rsbuild/core': ^2.0.0 peerDependenciesMeta: '@rsbuild/core': optional: true @@ -20213,11 +20942,6 @@ packages: '@rsbuild/core': optional: true - '@rsbuild/plugin-vue@1.2.2': - resolution: {integrity: sha512-BVCejQjVIxsaG0WF3WSBy1jyVjoLjmrWyslSi0eq1zGxLB4BlyEkIvBQguXI9YsxKxKg0VsXIJQjXus03Rzqkg==} - peerDependencies: - '@rsbuild/core': 1.x - '@rsbuild/plugin-vue@1.2.7': resolution: {integrity: sha512-epDSChyeR4U+gwq2vfTARV9hbfrmdFTdmhBWIcv7MFyckn3yxJhweJVwdx14Wf3d8s1p4XZzDpqmphDyvX443Q==} peerDependencies: @@ -20226,188 +20950,168 @@ packages: '@rsbuild/core': optional: true - '@rspack/binding-darwin-arm64@2.0.0': - resolution: {integrity: sha512-ICBHDKYyndFqljLhjxvKfWWZu39RJSH2jkSmbceXl0kmptLSE0cLWpvk+eGSzLqtxKN0jVchwCw+5P5mWCzwAw==} + '@rspack/binding-darwin-arm64@2.2.7': + resolution: {integrity: sha512-m0ijteZwZfUZeFcbyxwTe6N+I7aceV5/iW39b7fIIoMN/mSv9zL0ieeRzwuFe7mTYGwCuwNieDZHXfMFdp2Q2w==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-arm64@2.0.5': - resolution: {integrity: sha512-++wjLQjQ20GcR0DwbzQmVXg9qy4XCX5NlfSzkzj2icHoDxr3KkrXhyVrQkdWuNG6l/bQrGLPnvLEAqkroC2Y7A==} + '@rspack/binding-darwin-arm64@2.3.1': + resolution: {integrity: sha512-koLyL2r8PUcLD0StjuZ/n5XM6GJ0C8dzJN0IuIV9d7nQcibJxwjjSAWEPGVz6bm8WuzypvuVKNoa1+GGAHeMQA==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-arm64@2.0.8': - resolution: {integrity: sha512-vCgbgH7B7qom+uID+RCZsTCOYFb9wC4/4+1U6rMfytrXGVJ72eNQs2tbdjOl0lb18CT3N/n+VkWynUiLk84GwA==} - cpu: [arm64] - os: [darwin] - - '@rspack/binding-darwin-x64@2.0.0': - resolution: {integrity: sha512-YQ96LMmzIzhZt9cZWUDWXSxS9UWWHWoLxJyZ5f42DSaVPVelBg5ThbVORDwOP5QDA2xFXj60rVnmmcZLzg/aDA==} + '@rspack/binding-darwin-x64@2.2.7': + resolution: {integrity: sha512-f27/OubIeCe5Hzze1bm+k/CQ2XX9hk3E/FuK4lym1bjqZ9spWSuolC3sK/yU/Pc3kwMPuf53byUm3FM+QC/blw==} cpu: [x64] os: [darwin] - '@rspack/binding-darwin-x64@2.0.5': - resolution: {integrity: sha512-JBD5mCN3JKjV64Mh9nDYx8lLUrWDfEl5tLBuMkREUnqEKbo+z4nfwotyqHHM8/XgZwL+Gr7ps4GLWuQQrZB8+Q==} + '@rspack/binding-darwin-x64@2.3.1': + resolution: {integrity: sha512-YK39JLiu1YC6+3BMxkP7e848pHD7e2T/0OSNogDi7whfiZNg95wa9Ncd7I5ppAf0nhmV+FNew/sCBIFp5h67Jw==} cpu: [x64] os: [darwin] - '@rspack/binding-darwin-x64@2.0.8': - resolution: {integrity: sha512-satPm2PD4B7jDTVlVAdvMVdUszwLvWUEnUDzLb77mvVkezKNDZmuhb+e8s+FfKs8hJpNbZ9VAejuA2rr8o985w==} - cpu: [x64] - os: [darwin] - - '@rspack/binding-linux-arm64-gnu@2.0.0': - resolution: {integrity: sha512-Ufn33gzkIV7JY69k6vJQEdOzRvBqThIgH46pwXksHSMwRZp8IbJhXfyYIAVsRWCk8fXpr9t1nAvCDvJXT2EeyA==} + '@rspack/binding-linux-arm64-gnu@2.2.7': + resolution: {integrity: sha512-uGEX6kY/Pi3wPZgaEk6vTevZOHjKw8qmd5pqWVwRmpLhwvPB7LGqVqx5BMnNYBjsndVUWJQQRlGL8DoVG5IXXQ==} cpu: [arm64] os: [linux] libc: [glibc] - '@rspack/binding-linux-arm64-gnu@2.0.5': - resolution: {integrity: sha512-JI8+//woanJPNsfL7iGjX39zyiWumnrKHznWQM/7lEtE5nPmk+j+X7TYXxczSWC9zfZegiqI74D3L5JPDC84Fw==} + '@rspack/binding-linux-arm64-gnu@2.3.1': + resolution: {integrity: sha512-Q+RCA/KM2tn6m6R5U4lktXDs5cCRm3SyleQk86iqqUFX7wKzVRUvr5BTsreg6K9of3gpYmQ6+g1PGT5cwo0rLA==} cpu: [arm64] os: [linux] libc: [glibc] - '@rspack/binding-linux-arm64-gnu@2.0.8': - resolution: {integrity: sha512-pSI+npPQE/uDtiboqvcOIRJbEV2+B+H1xffmko/gw50la92oTUW60kVULFwsb6L0+GVCzIcwX3yq60GtYIn+Ug==} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rspack/binding-linux-arm64-musl@2.0.0': - resolution: {integrity: sha512-CZbvFKlNY9UC0C+Czz6i8JFCzGpuL9oX8gEqcJA1+84Y6eEEBH50UiTzeCewxKW3dOofkZdvT5vgNMXz6aMUmg==} + '@rspack/binding-linux-arm64-musl@2.2.7': + resolution: {integrity: sha512-qBvztXsOgdi69zi8BhIUz+yc/alqR/wQVmcdCh+1SbhcsNpMsFUndxvVoR1tOboBsEo//gxOG4GxH8zlemhbUA==} cpu: [arm64] os: [linux] libc: [musl] - '@rspack/binding-linux-arm64-musl@2.0.5': - resolution: {integrity: sha512-5LujilxLtJFRiiPz5i5iWcWJriK9oy4gN7gZtTo8YRB7wwmwA8LMypTjjO0GLbkPS4/KeCfY4fDfTC29KmK+tA==} + '@rspack/binding-linux-arm64-musl@2.3.1': + resolution: {integrity: sha512-He+muVDON1fohGtdYamh3zHVwf6/E6fZu/+iEAkxjclE0P94bsCfYVcZW/a4/l1tJ2zvLZtB4jD7Qr6r4vG/WA==} cpu: [arm64] os: [linux] libc: [musl] - '@rspack/binding-linux-arm64-musl@2.0.8': - resolution: {integrity: sha512-igjJ43yxWQ72GZqjDDZSSHax9/Vg+6rLMmOvFglTJUkQpB4Tyvu/YjW+WRjYj2xRw6blOjLxUSJWASvuSqqlvg==} - cpu: [arm64] + '@rspack/binding-linux-ppc64-gnu@2.2.7': + resolution: {integrity: sha512-t+/tOPoMu3ZZF8I1Wvqd4Jrib1teOOgb0S4jGb4nSVryuDIWgjny0FLGv5xc8RC7e4esVF93D4wF62Kt9Pxfvw==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-ppc64-gnu@2.3.1': + resolution: {integrity: sha512-blIZUgyPt4FcSHkZL6sJ2xbzc7ACgDeU49An4mXLSebwdgnlhTzxeSFnh2VeJDlGza8CUaZYB/zS/6oZ2kCDcw==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-riscv64-gnu@2.2.7': + resolution: {integrity: sha512-ZkN6K4PRTPqfYI7gPYv1PqgUXKsZDeeFPFoQ4LLiFxhIGczdJY5XAPPoHN+N7d91hAGWi6u+UHYrUp1HvudBOw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-riscv64-gnu@2.3.1': + resolution: {integrity: sha512-3FtW2DUFmXxhBORUA3zSc+ot4d6R/1/U6z/48TDN4jeIYDUG9VqYBF6LUohX4vBY6IP0DCyXb2N9WayD/9QXoA==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-riscv64-musl@2.2.7': + resolution: {integrity: sha512-ywcmeNAC59HtVJ4a5jy5cEUA4JNa19QlVtTW09Pzh0+luNEasWaDfOaXJpYJTGWcycVwzMm3A9aNN3MqvO87EQ==} + cpu: [riscv64] os: [linux] libc: [musl] - '@rspack/binding-linux-x64-gnu@2.0.0': - resolution: {integrity: sha512-dPjFGpoCvZfFpJBsWAUR+PR7mWYxpou6L026qIOpAVkz7WiTzErwKD3P1jVrpP4dM9yLb3fVE+PHHjTglhTJ4g==} + '@rspack/binding-linux-riscv64-musl@2.3.1': + resolution: {integrity: sha512-+5qNgdNdXzp/K8f8BjgJ3m7tcbBKPENN7WPDfBcSHvWb5GF4+o/pbrX26c0+LEugo0bYUOAoitBNd94AwcNvpA==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rspack/binding-linux-s390x-gnu@2.2.7': + resolution: {integrity: sha512-U/np+nOj9mka5CdM9FKNkrAShw0UoaarBLzOxbBHu4sqMt3iXQCi91fblLdhUDoWuIQrnV/WrqygFeIP2qAHIw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-s390x-gnu@2.3.1': + resolution: {integrity: sha512-yNcg/y1+MV0wZ984CVU4d1HAYYwMcDPXoQO0xynU+K5YuBxPWALHOxuRRCKCcykBdL1GIEshAIewEFrsW/cmJg==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-x64-gnu@2.2.7': + resolution: {integrity: sha512-PkryZX3GZeBQfzvKEhwGGd9m43PwqcsqWd14kmsVADeBCqHLxJahMGiGmajd28vSa42xbw7HTb8yY4jXzv5QtA==} cpu: [x64] os: [linux] libc: [glibc] - '@rspack/binding-linux-x64-gnu@2.0.5': - resolution: {integrity: sha512-241wqE132jh+/U/pn97qUPV4KpIy4bSrTH0tqfzQCocgw+8hrUj02GqNG+3MXVC3qtwaQeJFYgEBy3TqFKsrIQ==} + '@rspack/binding-linux-x64-gnu@2.3.1': + resolution: {integrity: sha512-ffclKBuH8wwimOBd6xGUxrBfVKKY5Ow4E7OFdHZeg4xffm2O8auGszmOgvFu1eoDoOYHaVJn+cEV6UD0KwZk8A==} cpu: [x64] os: [linux] libc: [glibc] - '@rspack/binding-linux-x64-gnu@2.0.8': - resolution: {integrity: sha512-zrkoEOnqj1hOEBO5T2I/2Ts2HSJsYFh1qXwMpK4dMJFGGNWDfNeUa6/LF5uq3VINF3JUl7RL47AgrucoSZJXPA==} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rspack/binding-linux-x64-musl@2.0.0': - resolution: {integrity: sha512-4fgDTMWt0mJDiugdia2mdOjTbnm7yM1Drzl1JpPqlUlOr113byOhc+qgN57LURSGypz2yz/h/Zad7/UnVAxYJw==} + '@rspack/binding-linux-x64-musl@2.2.7': + resolution: {integrity: sha512-atJn62IgXnc/RhWiFgEiNx7IHAJbHunttzjMpWJLjWiFuJ2c+tLQrTBIiqO3VAIXh+haN1jZLHXuMVj5/J+edA==} cpu: [x64] os: [linux] libc: [musl] - '@rspack/binding-linux-x64-musl@2.0.5': - resolution: {integrity: sha512-BhaXZD064Lci3Kia0kLDAb4TyxO2C+0UidMlj44e8+ctasxIfFZgnrhCJrhTFHAtOiAwqhU3FHun2UuxPqX0Eg==} + '@rspack/binding-linux-x64-musl@2.3.1': + resolution: {integrity: sha512-qcDwwuyxR7TMtrW+r5Y9RIW25boXd1Ip/9jz04jhdq/OiU/Am7rCP2X90CH8sWdzovIF9UNmsGjY4KklR0F2Mg==} cpu: [x64] os: [linux] libc: [musl] - '@rspack/binding-linux-x64-musl@2.0.8': - resolution: {integrity: sha512-6CtDaGZjNDvJd9TBp7a9zABbrPORO21W96+3ZcGBn0YNUPUk4ARxIxrTTpeJ/1F41QDM8AYIkGDdqEYMqTYBsA==} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rspack/binding-wasm32-wasi@2.0.0': - resolution: {integrity: sha512-ANk73ZKtPrZf9gdtyRK2nQUfhi1uXoC5P2KF89pyVAE8+zcoLBnYtZGYpWa/cmNi5BcO5g4Z+v2l1UA3bUPLQQ==} + '@rspack/binding-wasm32-wasi@2.2.7': + resolution: {integrity: sha512-SRDYrqWnD8Y+VNj8+11KggFaVMFSbyu+9WC2f9sygzjFu78GmF0kLKaHNQMaJv6MUMSBk/OhtEbUB4hmH7czVQ==} cpu: [wasm32] - '@rspack/binding-wasm32-wasi@2.0.5': - resolution: {integrity: sha512-duEkRoXrl9SW8uGHv7JURJ5lgKu87qFDQ4Exy6UQPvsUJVXhtRXTfvMHCb/CejVJuW2Bw2D632/axZq3qRSuBQ==} + '@rspack/binding-wasm32-wasi@2.3.1': + resolution: {integrity: sha512-3dr6zjFaCK3A920ftCriSJkiRhEfhHtat7LtBdj6g0mcV5Rt+iealmli0vjeAvD0UdpE1u8EKWlfw82JLgFLSQ==} cpu: [wasm32] - '@rspack/binding-wasm32-wasi@2.0.8': - resolution: {integrity: sha512-Yf4SiqTUroT5Ju+te0YAY2xxKOb35tECsO21v7hYyGa705wrgoAK/MmF7enOvs9GR1iZIqgiLD/wxsIxl8GjJw==} - cpu: [wasm32] - - '@rspack/binding-win32-arm64-msvc@2.0.0': - resolution: {integrity: sha512-IHZFRtJ85ONbM+BCtF4TeYXS2Fu9X0IJS2phX1rPibYq9iEtHGfBt4cNlnsJPhbPAXVvi4Oli/yiLRJ1zxtCIg==} + '@rspack/binding-win32-arm64-msvc@2.2.7': + resolution: {integrity: sha512-etHFjzSP/jnnrVYuim9C/nhSlN0/tQowVz0CSJOUHtDH7ZZiUsvWtkH9Zx3tDaZOB7sAw9cbL36mbmdkb4U6cw==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-arm64-msvc@2.0.5': - resolution: {integrity: sha512-q2WT3HFoWL+2g84l3s2kY7CiE1gEZ1bwB3txx3eZzQQ6YKP7bE82z6sl6S/pTOHGjHdAO4snQXpSaHwUt3LX5g==} + '@rspack/binding-win32-arm64-msvc@2.3.1': + resolution: {integrity: sha512-AZbuLPylt1xvWssN93AsirbYs3WgfcrA8tMsqHmVJIHahLu9E+JPKZ3Gmsw6IYEZk3EfnV3ujQzeQ1/VfF0Vsw==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-arm64-msvc@2.0.8': - resolution: {integrity: sha512-8NCuiQsAhXrwRBy57QZoypqrws/zLBkaQVGiB8hksr6v++8hNigNjqpQARLbd0iyMuHsQQ++8+auGk6xlDXmzw==} - cpu: [arm64] - os: [win32] - - '@rspack/binding-win32-ia32-msvc@2.0.0': - resolution: {integrity: sha512-n4tbIqacq/FhNJflMlgZV50AeQFTLh5hnDS3v4W+rJWa3IW1VfgB0+XppdeW+Dqhw7QcMIsCmro01kwNdlXZDQ==} + '@rspack/binding-win32-ia32-msvc@2.2.7': + resolution: {integrity: sha512-26HiMUQk8QKVw477gW9HorIQ3r0le3AL4OFigJr1/HAumi5qyOPazck+wWtUDh1R9bSf8etZjkuseBGtjN5+KQ==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-ia32-msvc@2.0.5': - resolution: {integrity: sha512-nMJGIY7kvgbyMolEE7tXDe+Z9jSItDshTIqMQQkkD3WTHdjlBQozHxk4kBtKLsunO+3NkCLe5Oa3hXg1yyStIg==} + '@rspack/binding-win32-ia32-msvc@2.3.1': + resolution: {integrity: sha512-R5NVU68TePZcgRdYUzrQX9YFNxmcyXZEPwaPv40AAgsqNyacG3iRaYVmV79jt3rWYfa0QJaqvRLUchDe2SZ6zQ==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-ia32-msvc@2.0.8': - resolution: {integrity: sha512-bxiekytbX7V9KFAra+HkwtNWC6pYfHEBBZFpiT0xUs3mCFOmAAFVBsBSQsoCP9AdCEXoMAvNdnrHNw3iov4OZw==} - cpu: [ia32] - os: [win32] - - '@rspack/binding-win32-x64-msvc@2.0.0': - resolution: {integrity: sha512-cJOgikIW2t3S+42TQZsv+DJriJt2m6lnUk+pUFu/fO93rrMvNrx8gfMxR8W5zDTreBX0cfMx2pw6EVmyi/YzsQ==} + '@rspack/binding-win32-x64-msvc@2.2.7': + resolution: {integrity: sha512-ut8tVSXP8DWQE/JUwQ1oqwuAaAgySgYF66HpWmxfR9J4nLzGmhd7CnnaCTT3vUyQQNmLKFida/AbiqJ/gWmPrw==} cpu: [x64] os: [win32] - '@rspack/binding-win32-x64-msvc@2.0.5': - resolution: {integrity: sha512-vP0BR6fxdPL9cb02HAuZATg/CjR07aecWel3s1vqRwW1aDffgXh9PVmqEKIHTgyaNsNR55kSKNJsB9AcQ8/QrA==} + '@rspack/binding-win32-x64-msvc@2.3.1': + resolution: {integrity: sha512-5T9DYjNPQpLbrNXjCssGd2B6xMQPlc3LxVOKHGUA1O0GV+88vBkTXAcryJ+Fo+yVEMPCzp4VvwBMGAVDpCjcSA==} cpu: [x64] os: [win32] - '@rspack/binding-win32-x64-msvc@2.0.8': - resolution: {integrity: sha512-7zPs8YCe/ZVJTwd+5lpB0CP0tkn2pONf/T1ycmVY76u21Nrwt8mXQGc/2yH2eWP4B7fikYBr3hGr7mpR2fajqQ==} - cpu: [x64] - os: [win32] + '@rspack/binding@2.2.7': + resolution: {integrity: sha512-opY7Sw6iwtBa23CeNj18GOqKBlaJUZXp52kNIGyNq+7jpCQKrJYeX5wiK7uBn8/ZpHQfhwNL2xxu5yzG4JFH1g==} - '@rspack/binding@2.0.0': - resolution: {integrity: sha512-WA2f9eQpejkvf5Vrnf6wNCn1m8RT1p08NjgOZpKhsCzr0uBjWeRvGduawlrFFHZh/jPnWZTVaVdQ08FEAWbwGw==} + '@rspack/binding@2.3.1': + resolution: {integrity: sha512-pfCJGBFNK2tnNnoDP6ZoTbOjxbKr1U2eGFDJ8bIuZQai4FBNhWQlKFmNup+X5K935XYRulZBomIBAL6GL6W2YQ==} - '@rspack/binding@2.0.5': - resolution: {integrity: sha512-Ta1y4WXJA87wM1OstqaMddoPsBGv7Cu779bYToKxEAqR/Yy9DxLkp7bdgBaAx2JH++BwVjV+toWts2V9AaiTFQ==} - - '@rspack/binding@2.0.8': - resolution: {integrity: sha512-3uZ+y8aQxq33ty2srMxg2Nu0XuBI6vVrG50rkDaXqwWqOohfgGUSfFuQK7EnSUNy4aFUQlCG6NHialQHJov0wg==} - - '@rspack/core@2.0.0': - resolution: {integrity: sha512-WD1mJM9LbZ7Z399Rbv9dE3BNEV0+3sE5OzDdzV8hOxUb3mX++ynK5n9kil8w60B6nGdcKeV9ly5aN4PgqiwWUg==} - engines: {node: ^20.19.0 || >=22.12.0} - peerDependencies: - '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 - '@swc/helpers': '>=0.5.1' - peerDependenciesMeta: - '@module-federation/runtime-tools': - optional: true - '@swc/helpers': - optional: true - - '@rspack/core@2.0.5': - resolution: {integrity: sha512-9tv2HAnSiTote5WPH2tmz1hLZ1zKbzkiZc1eYp7LP/8jcsiJBuf40ihiWidAgbbuYtJo3kWET6q+qOm5UhNiGA==} + '@rspack/core@2.2.7': + resolution: {integrity: sha512-kWKd4lYp13GPAQy2eQITLTvPbl+ST7ffG/MCGHoX138o5eTetMQMe/oc7UAZAfjervAM6UOzEhiiCirPTpRBUQ==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 @@ -20418,8 +21122,8 @@ packages: '@swc/helpers': optional: true - '@rspack/core@2.0.8': - resolution: {integrity: sha512-+NLGJf8gZxihDmMFzjlly3toc2SMjeDmuvz0/Cai9AMdV4F+Pqcnt2BA9V4e3SY2jmhJQtPwgyyLtR1RiJO77g==} + '@rspack/core@2.3.1': + resolution: {integrity: sha512-9BWfaiEJLgLK9U53Q4WVruBZ19Mu/XWHXHEu0UFla4lUtH8Z+/ET2m044tiqbtyIgqQyG58fMrxHeVIAiXMXHg==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 @@ -20560,7 +21264,7 @@ packages: resolution: {integrity: sha512-vMfGz7x3Ahplcdm0RlEtTNUZ08qpUSr3NRJMQ6duUDxxe0Mqo6DisyQWNQKSROZ7BtLCJUfio6/LRGpkRUoo8A==} engines: {node: '>=18'} peerDependencies: - react: ^19.2.3 + react: ~19.2.9 '@sentry/solid@10.32.0': resolution: {integrity: sha512-T+i0L+uB67Z+ttJJwETLQuXhBOor3mC82YqXBBxFX8H4hLZ0Idpbuw2Vmqd5+E1vQFxgsoHnuu3uBR6LblafFQ==} @@ -20604,36 +21308,6 @@ packages: pinia: optional: true - '@sigstore/bundle@4.0.0': - resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@sigstore/core@3.2.1': - resolution: {integrity: sha512-qRsxPnCrbC/puegGxKuynfnxgLiHqWStrSjxkoB4YKqq3Z3s4cyZyj42ZdWFAEblNP65C+rBH8EuREHIXoi83g==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@sigstore/protobuf-specs@0.5.1': - resolution: {integrity: sha512-/ScWUhhoFasJsSRGTVBwId1loQjjnjAfE4djL6ZhrXRpNCmPTnUKF5Jokd58ILseOMjzET3UrMOtJPS9sYeI0g==} - engines: {node: ^18.17.0 || >=20.5.0} - - '@sigstore/sign@4.1.1': - resolution: {integrity: sha512-Hf4xglukg0XXQ2RiD5vSoLjdPe8OBUPA8XeVjUObheuDcWdYWrnH/BNmxZCzkAy68MzmNCxXLeurJvs6hcP2OQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@sigstore/tuf@4.0.2': - resolution: {integrity: sha512-TCAzTy0xzdP79EnxSjq9KQ3eaR7+FmudLC6eRKknVKZbV7ZNlGLClAAQb/HMNJ5n2OBNk2GT1tEmU0xuPr+SLQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@sigstore/verify@3.1.1': - resolution: {integrity: sha512-qv7+G3J2cc6wwFj3yKvXOamzqhMwSk1ogPGmhpS8iXllcPrJaIIBA+4HbttlHVu1pqWTdmaCH/WE7UOC51kdoA==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@simple-git/args-pathspec@1.0.3': - resolution: {integrity: sha512-ngJMaHlsWDTfjyq9F3VIQ8b7NXbBLq5j9i5bJ6XLYtD6qlDXT7fdKY2KscWWUF8t18xx052Y/PUO1K1TRc9yKA==} - - '@simple-git/argv-parser@1.1.1': - resolution: {integrity: sha512-Q9lBcfQ+VQCpQqGJFHe5yooOS5hGdLFFbJ5R+R5aDsnkPCahtn1hSkMcORX65J2Z5lxSkD0lQorMsncuBQxYUw==} - '@sinclair/typebox@0.31.28': resolution: {integrity: sha512-/s55Jujywdw/Jpan+vsy6JZs1z2ZTGxTmbZTPiuSL2wz9mfzA2gN1zzaqmvfi4pq+uOt7Du85fkiwv5ymW84aQ==} @@ -20645,10 +21319,6 @@ packages: resolution: {integrity: sha512-7F/yz2IphV39hiS2zB4QYVkivrptHHh0K8qJJd9HhuWSdvf8AN7NpebW3CcDZDBQsUPMoDKWsY2WWgW7bqOcfA==} engines: {node: '>=18'} - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} - '@so-ric/colorspace@1.1.6': resolution: {integrity: sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw==} @@ -20792,6 +21462,11 @@ packages: '@supabase/supabase-js@2.48.1': resolution: {integrity: sha512-VMD+CYk/KxfwGbI4fqwSUVA7CLr1izXpqfFerhnYPSi6LEKD8GoR4kuO5Cc8a+N43LnfSQwLJu4kVm2e4etEmA==} + '@sveltejs/acorn-typescript@1.0.13': + resolution: {integrity: sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==} + peerDependencies: + acorn: ^8.9.0 + '@swc-node/core@1.14.1': resolution: {integrity: sha512-jrt5GUaZUU6cmMS+WTJEvGvaB6j1YNKPHPzC2PUi2BjaFbtxURHj6641Az6xN7b665hNniAIdvjxWcRml5yCnw==} engines: {node: '>= 10'} @@ -20901,9 +21576,6 @@ packages: '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - '@swc/helpers@0.5.21': - resolution: {integrity: sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==} - '@swc/helpers@0.5.23': resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==} @@ -20913,36 +21585,69 @@ packages: '@tailwindcss/node@4.2.2': resolution: {integrity: sha512-pXS+wJ2gZpVXqFaUEjojq7jzMpTGf8rU6ipJz5ovJV6PUGmlJ+jvIwGrzdHdQ80Sg+wmQxUFuoW1UAAwHNEdFA==} + '@tailwindcss/node@4.3.1': + resolution: {integrity: sha512-6NDaqRoAMSXD1mr/RXu0HBvNE9a2n5tHPsxu9XHLws8o4Twes5rBM2205SUUiJ9goAtadrN6xTGX0UDEwp/N4A==} + '@tailwindcss/oxide-android-arm64@4.2.2': resolution: {integrity: sha512-dXGR1n+P3B6748jZO/SvHZq7qBOqqzQ+yFrXpoOWWALWndF9MoSKAT3Q0fYgAzYzGhxNYOoysRvYlpixRBBoDg==} engines: {node: '>= 20'} cpu: [arm64] os: [android] + '@tailwindcss/oxide-android-arm64@4.3.1': + resolution: {integrity: sha512-SVlyf61g374l5cHyg8x9kf5xmLcOaxvOTsbsqDnSsDJaKOEFZ7GCvi84VAVGpxojYOs1+3K6M0UjXfqPU8vmOQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [android] + '@tailwindcss/oxide-darwin-arm64@4.2.2': resolution: {integrity: sha512-iq9Qjr6knfMpZHj55/37ouZeykwbDqF21gPFtfnhCCKGDcPI/21FKC9XdMO/XyBM7qKORx6UIhGgg6jLl7BZlg==} engines: {node: '>= 20'} cpu: [arm64] os: [darwin] + '@tailwindcss/oxide-darwin-arm64@4.3.1': + resolution: {integrity: sha512-hVnWLwv+e/l7c4WKyVtHVrIPvYdqWHjRB3MDIqARynzFtnQg85kmQEFCbV9Ja0VVx4xXTIiDWY60Y7iz/iNoDA==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [darwin] + '@tailwindcss/oxide-darwin-x64@4.2.2': resolution: {integrity: sha512-BlR+2c3nzc8f2G639LpL89YY4bdcIdUmiOOkv2GQv4/4M0vJlpXEa0JXNHhCHU7VWOKWT/CjqHdTP8aUuDJkuw==} engines: {node: '>= 20'} cpu: [x64] os: [darwin] + '@tailwindcss/oxide-darwin-x64@4.3.1': + resolution: {integrity: sha512-Cf7abu0WVgbhU7ANgPUnSAvm7nCvMweusHb8FnaHlLfv/Caq4GYaEZg7ZImzzmjx4lIAfuS8q+eLIS7A7IzxIg==} + engines: {node: '>= 20'} + cpu: [x64] + os: [darwin] + '@tailwindcss/oxide-freebsd-x64@4.2.2': resolution: {integrity: sha512-YUqUgrGMSu2CDO82hzlQ5qSb5xmx3RUrke/QgnoEx7KvmRJHQuZHZmZTLSuuHwFf0DJPybFMXMYf+WJdxHy/nQ==} engines: {node: '>= 20'} cpu: [x64] os: [freebsd] + '@tailwindcss/oxide-freebsd-x64@4.3.1': + resolution: {integrity: sha512-ZZqzX2Y+GXtXXfqSfpJhDm60OoZfvLHLCgm+J7NVqgHHJjG/m9ugZI77RwTsVd4fnBJuCFP6Ae6kTJb71UdS8g==} + engines: {node: '>= 20'} + cpu: [x64] + os: [freebsd] + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.2': resolution: {integrity: sha512-FPdhvsW6g06T9BWT0qTwiVZYE2WIFo2dY5aCSpjG/S/u1tby+wXoslXS0kl3/KXnULlLr1E3NPRRw0g7t2kgaQ==} engines: {node: '>= 20'} cpu: [arm] os: [linux] + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.1': + resolution: {integrity: sha512-/Ah/xik0LaMYfv9DZ0S/t4pBlBNYOcqtRwusjgovHkvT8ixueWCLyJjsaF5kQIckjb4IT8Q6K6p/iPmZMixYgg==} + engines: {node: '>= 20'} + cpu: [arm] + os: [linux] + '@tailwindcss/oxide-linux-arm64-gnu@4.2.2': resolution: {integrity: sha512-4og1V+ftEPXGttOO7eCmW7VICmzzJWgMx+QXAJRAhjrSjumCwWqMfkDrNu1LXEQzNAwz28NCUpucgQPrR4S2yw==} engines: {node: '>= 20'} @@ -20950,6 +21655,13 @@ packages: os: [linux] libc: [glibc] + '@tailwindcss/oxide-linux-arm64-gnu@4.3.1': + resolution: {integrity: sha512-gqdFoVJlw444GvpnheZLHmvTzSxI/cOUUh2KSNejQjTcYkW062SVD+En0rUgD+QV91bz1XGIGtt1HJd48xUGbQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [glibc] + '@tailwindcss/oxide-linux-arm64-musl@4.2.2': resolution: {integrity: sha512-oCfG/mS+/+XRlwNjnsNLVwnMWYH7tn/kYPsNPh+JSOMlnt93mYNCKHYzylRhI51X+TbR+ufNhhKKzm6QkqX8ag==} engines: {node: '>= 20'} @@ -20957,6 +21669,13 @@ packages: os: [linux] libc: [musl] + '@tailwindcss/oxide-linux-arm64-musl@4.3.1': + resolution: {integrity: sha512-Bwv9KwOvE0VKa86xPFif9b9c3Y1NxOV1P0gLti/IYaWEsQYZXDlxfGEtA8mdDZ7SG3wyNXAWYT5SIn3giL57oA==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [musl] + '@tailwindcss/oxide-linux-x64-gnu@4.2.2': resolution: {integrity: sha512-rTAGAkDgqbXHNp/xW0iugLVmX62wOp2PoE39BTCGKjv3Iocf6AFbRP/wZT/kuCxC9QBh9Pu8XPkv/zCZB2mcMg==} engines: {node: '>= 20'} @@ -20964,6 +21683,13 @@ packages: os: [linux] libc: [glibc] + '@tailwindcss/oxide-linux-x64-gnu@4.3.1': + resolution: {integrity: sha512-Ymi8O8T15HYQdOUWUtTI6ldN0neHP85FC+Qz32xTcZ7iJXtem/x8ITev0o1e9e5rkqj4lONZfTRLvkmin1+tKg==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [glibc] + '@tailwindcss/oxide-linux-x64-musl@4.2.2': resolution: {integrity: sha512-XW3t3qwbIwiSyRCggeO2zxe3KWaEbM0/kW9e8+0XpBgyKU4ATYzcVSMKteZJ1iukJ3HgHBjbg9P5YPRCVUxlnQ==} engines: {node: '>= 20'} @@ -20971,6 +21697,13 @@ packages: os: [linux] libc: [musl] + '@tailwindcss/oxide-linux-x64-musl@4.3.1': + resolution: {integrity: sha512-M+P/91qJ6uILLw4k2G93GMDRAXj61SMvFQYt39AqvUqYgExXpLL5aepfns7sj4HiAQeolirQF9E0lzRvdf4zPQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [musl] + '@tailwindcss/oxide-wasm32-wasi@4.2.2': resolution: {integrity: sha512-eKSztKsmEsn1O5lJ4ZAfyn41NfG7vzCg496YiGtMDV86jz1q/irhms5O0VrY6ZwTUkFy/EKG3RfWgxSI3VbZ8Q==} engines: {node: '>=14.0.0'} @@ -20983,29 +21716,68 @@ packages: - '@emnapi/wasi-threads' - tslib + '@tailwindcss/oxide-wasm32-wasi@4.3.1': + resolution: {integrity: sha512-zsM8uOeqvVGHsAXsJxsT28ttosFahLJKCLOTUBqRAtKnVgGSRitds9T432QiT8b77Yga7JIBkulIRRlJPtYhRA==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + bundledDependencies: + - '@napi-rs/wasm-runtime' + - '@emnapi/core' + - '@emnapi/runtime' + - '@tybys/wasm-util' + - '@emnapi/wasi-threads' + - tslib + '@tailwindcss/oxide-win32-arm64-msvc@4.2.2': resolution: {integrity: sha512-qPmaQM4iKu5mxpsrWZMOZRgZv1tOZpUm+zdhhQP0VhJfyGGO3aUKdbh3gDZc/dPLQwW4eSqWGrrcWNBZWUWaXQ==} engines: {node: '>= 20'} cpu: [arm64] os: [win32] + '@tailwindcss/oxide-win32-arm64-msvc@4.3.1': + resolution: {integrity: sha512-aiNvSq9BsVk8V513lDKlrCFAgf8qBMPZTpgEhInL+NwQqs97mYmupVMrPrgBBSL8Pv/0zXu9MrMF9rMun1ZeNg==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [win32] + '@tailwindcss/oxide-win32-x64-msvc@4.2.2': resolution: {integrity: sha512-1T/37VvI7WyH66b+vqHj/cLwnCxt7Qt3WFu5Q8hk65aOvlwAhs7rAp1VkulBJw/N4tMirXjVnylTR72uI0HGcA==} engines: {node: '>= 20'} cpu: [x64] os: [win32] + '@tailwindcss/oxide-win32-x64-msvc@4.3.1': + resolution: {integrity: sha512-xDEyu1rg290472FEGaKHnzyDyh5QH+AlWvsU5hMoMtPpzmKlRI0jaYKCgSHDYtaQWZOYbMaduSyCwFwY4n1HmA==} + engines: {node: '>= 20'} + cpu: [x64] + os: [win32] + '@tailwindcss/oxide@4.2.2': resolution: {integrity: sha512-qEUA07+E5kehxYp9BVMpq9E8vnJuBHfJEC0vPC5e7iL/hw7HR61aDKoVoKzrG+QKp56vhNZe4qwkRmMC0zDLvg==} engines: {node: '>= 20'} + '@tailwindcss/oxide@4.3.1': + resolution: {integrity: sha512-yVPyo8RNkabVr3O2EhHEE0Rewu7YKzc1DhIqfL46LKveFrmu9XbDazNOJY7/GRuvw1h6u3utWnR29H/p5JPlgA==} + engines: {node: '>= 20'} + '@tailwindcss/postcss@4.2.2': resolution: {integrity: sha512-n4goKQbW8RVXIbNKRB/45LzyUqN451deQK0nzIeauVEqjlI49slUlgKYJM2QyUzap/PcpnS7kzSUmPb1sCRvYQ==} '@tailwindcss/vite@4.2.2': resolution: {integrity: sha512-mEiF5HO1QqCLXoNEfXVA1Tzo+cYsrqV7w9Juj2wdUFyW07JRenqMG225MvPwr3ZD9N1bFQj46X7r33iHxLUW0w==} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 + + '@tailwindcss/webpack@4.3.1': + resolution: {integrity: sha512-HM33EjYPbkMlBGcYoVA/pk/hML3wAn2JOnjF79eDWVLuktOhRczDwWsSBQBOWV6LLBVAgGZS/pZ519OHUF8vKg==} + peerDependencies: + '@rspack/core': ^1.0.0 || ^2.0.0 + webpack: ^5.0.0 + peerDependenciesMeta: + '@rspack/core': + optional: true + webpack: + optional: true '@tanstack/devtools-client@0.0.4': resolution: {integrity: sha512-LefnH9KE9uRDEWifc3QDcooskA8ikfs41bybDTgpYQpyTUspZnaEdUdya9Hry0KYxZ8nos0S3nNbsP79KHqr6Q==} @@ -21061,8 +21833,8 @@ packages: resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==} engines: {node: '>=12'} - '@tanstack/query-core@5.99.0': - resolution: {integrity: sha512-3Jv3WQG0BCcH7G+7lf/bP8QyBfJOXeY+T08Rin3GZ1bshvwlbPt7NrDHMEzGdKIOmOzvIQmxjk28YEQX60k7pQ==} + '@tanstack/query-core@5.102.0': + resolution: {integrity: sha512-tvBzr11Q7StuMCEsIJdqX8TAWt6WZIzfw/yrSAjObZDerwTTPeCxeLXN2R8ZSn4ZxFpQV819Xn8QmoO+vtnDvw==} '@tanstack/query-devtools@5.67.2': resolution: {integrity: sha512-O4QXFFd7xqp6EX7sdvc9tsVO8nm4lpWBqwpgjpVLW5g7IeOY6VnS/xvs/YzbRhBVkKTMaJMOUGU7NhSX+YGoNg==} @@ -21079,37 +21851,37 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@tanstack/react-query-devtools@5.67.2': resolution: {integrity: sha512-cmj2DxBc+/9btQ66n5xI8wTtAma2BLVa403K7zIYiguzJ/kV201jnGensYqJeu1Rd8uRMLLRM74jLVMLDWNRJA==} peerDependencies: - '@tanstack/react-query': ^5.99.0 - react: ^19.2.3 + '@tanstack/react-query': ^5.102.0 + react: ~19.2.9 '@tanstack/react-query-devtools@5.90.2': resolution: {integrity: sha512-vAXJzZuBXtCQtrY3F/yUNJCV4obT/A/n81kb3+YqLbro5Z2+phdAbceO+deU3ywPw8B42oyJlp4FhO0SoivDFQ==} peerDependencies: - '@tanstack/react-query': ^5.99.0 - react: ^19.2.3 + '@tanstack/react-query': ^5.102.0 + react: ~19.2.9 - '@tanstack/react-query@5.99.0': - resolution: {integrity: sha512-OY2bCqPemT1LlqJ8Y2CUau4KELnIhhG9Ol3ZndPbdnB095pRbPo1cHuXTndg8iIwtoHTgwZjyaDnQ0xD0mYwAw==} + '@tanstack/react-query@5.102.0': + resolution: {integrity: sha512-0GyVyEcGt9M7jHPCua16hNVtstUXE2R4HsnNubFYcDs7DJaLzh1dSiXsADDU/cNn/SqrLfa0vRKyjUmbx4rZLA==} peerDependencies: - react: ^19.2.3 + react: ~19.2.9 - '@tanstack/react-store@0.9.3': - resolution: {integrity: sha512-y2iHd/N9OkoQbFJLUX1T9vbc2O9tjH0pQRgTcx1/Nz4IlwLvkgpuglXUx+mXt0g5ZDFrEeDnONPqkbfxXJKwRg==} + '@tanstack/react-store@0.11.2': + resolution: {integrity: sha512-oj5O5DmiMWE+ih+SioX2ayC1kbK7d3fpLx0B75fPJr9nY3zU+hoW010yr64qXsY/9fyiLVE2bn5mGNV3owm8RQ==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@tanstack/react-virtual@3.13.0': resolution: {integrity: sha512-CchF0NlLIowiM2GxtsoKBkXA4uqSnY2KvnXo+kyUFD4a4ll6+J0qzoRsUPMwXV/H26lRsxgJIr/YmjYum2oEjg==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 '@tanstack/solid-devtools@0.7.14': resolution: {integrity: sha512-hyaB29d1fU2n9v2XeFEB6t2k5gKionK8mxxb9MNtF7qJheZ6z9259jU8OsBdA/f6v2oYck1K1Ia9+ooJsdy4jg==} @@ -21120,11 +21892,11 @@ packages: '@tanstack/solid-query-devtools@5.90.4': resolution: {integrity: sha512-ygyAiXZ+NR1tw33jVibpjiWB1IoAQWCeqSLmO/6PoSWrI9yDTwaPNAXheniEMrO6/a/vTQq2tB4N+FPNjhGaNw==} peerDependencies: - '@tanstack/solid-query': ^5.99.0 + '@tanstack/solid-query': ^5.102.0 solid-js: 1.9.12 - '@tanstack/solid-query@5.99.0': - resolution: {integrity: sha512-XZxt95MYWivATb6ykmUobhtzR0l8uW3CNQt7FKkV1AgMR8YDirDoHoXBbNGRQidN30g3lqDxgFWdbi6HrZqDdg==} + '@tanstack/solid-query@5.102.0': + resolution: {integrity: sha512-76mXTuap9xt/l+nHBTT2/EZhw+0dDMDdi5shFuR8lASuNEvDapMGYHIrmD27Tw5WUNPLRYMMoakVtujpJPLj4Q==} peerDependencies: solid-js: 1.9.12 @@ -21133,8 +21905,8 @@ packages: peerDependencies: solid-js: 1.9.12 - '@tanstack/store@0.9.3': - resolution: {integrity: sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw==} + '@tanstack/store@0.11.2': + resolution: {integrity: sha512-sJ4mjol8uQsHV0gOJzzjwXfh2Fwm+Sz0+8deqiTm4jGbMdjzNSW+xZCFm0kUa870uhd8yi+DpKnZb5Kc4apa0Q==} '@tanstack/virtual-core@3.13.0': resolution: {integrity: sha512-NBKJP3OIdmZY3COJdWkSonr50FMVIi+aj5ZJ7hI/DTpEKg2RMfo/KvP8A3B/zOSpMgIe52B5E2yn7rryULzA6g==} @@ -21149,22 +21921,22 @@ packages: resolution: {integrity: sha512-cTswDmoTn5UZA5pV2z/IWhGYgb8NS0zPRYYLv5q9JxHY4WxL/l/Riy6Aq76QttH8w6IHAIO/ZGwHBfF/OV0Kcw==} engines: {node: '>=18'} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 '@tanstack/vue-query-devtools@5.91.0': resolution: {integrity: sha512-Kn6p5ffEKUj+YGEP+BapoPI8kUiPtNnFDyzjTvUx6GHbyfzfefQPhYoRtFiWeyrGHjUB/Mvtnr7Rosbzs/ngVg==} peerDependencies: - '@tanstack/vue-query': ^5.99.0 + '@tanstack/vue-query': ^5.102.0 vue: ^3.3.0 '@tanstack/vue-query-devtools@6.1.2': resolution: {integrity: sha512-1E886RHorY432aOJU3dyzLbI67PhqQzvAPQyp8hU6UR4EVXKZSVzVT0O0utmTT2jnBpbbUiCFt2uNSs8W3grHw==} peerDependencies: - '@tanstack/vue-query': ^5.99.0 + '@tanstack/vue-query': ^5.102.0 vue: ^3.3.0 - '@tanstack/vue-query@5.99.0': - resolution: {integrity: sha512-okrHNkouasL5cjo7O8hUxul22DiIL335KUQus/cfoAdCOUytF/OIv3BpNDevfqE6zHqqJ651Fb9OkUJPUCL0ZQ==} + '@tanstack/vue-query@5.102.0': + resolution: {integrity: sha512-etqK2+b1pvilfdmcKl5Be+A5vHe8OY2dQoBx1VbhGqN8bMZ4g1+prP91cYr92Q+0KGbPf3F7lTeBhhPMZfpXUQ==} peerDependencies: '@vue/composition-api': ^1.1.2 vue: ^2.6.0 || ^3.3.0 @@ -21172,8 +21944,8 @@ packages: '@vue/composition-api': optional: true - '@tanstack/vue-store@0.9.3': - resolution: {integrity: sha512-YZb5SAR3f2kLt58Ip6gig2+z8vRAfSkJK30Bq7enZ7cG4epyygmRsbrrDMxvmoYSJu33CY5uJ6MvI74KGP0ZvQ==} + '@tanstack/vue-store@0.11.2': + resolution: {integrity: sha512-wZmkfsvc0dNvOg/Xb/a7uTPKejleI0dR3HHi0t3ZyVM/23MJ7AC0bH6C7rp2seSY4mIYo0pLLbGJGZ/UpO93Zw==} peerDependencies: '@vue/composition-api': ^1.2.1 vue: ^2.5.0 || ^3.0.0 @@ -21198,6 +21970,16 @@ packages: resolution: {integrity: sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==} engines: {node: '>=14', npm: '>=6', yarn: '>=1'} + '@testing-library/jest-dom@7.0.1': + resolution: {integrity: sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==} + engines: {node: '>=22', npm: '>=6', yarn: '>=1'} + peerDependencies: + '@testing-library/dom': '>=10 <11' + vitest: '>= 0.32' + peerDependenciesMeta: + vitest: + optional: true + '@testing-library/react@16.2.0': resolution: {integrity: sha512-2cSskAvA1QNtKc8Y9VJQRv0tm3hLVgxRGDB+KYhIaPQJ1I+RHbhIXcM+zClKXzMes/wshsMVzf4B9vS4IZpqDQ==} engines: {node: '>=18'} @@ -21205,8 +21987,8 @@ packages: '@testing-library/dom': ^10.0.0 '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -21220,8 +22002,8 @@ packages: '@testing-library/dom': ^10.0.0 '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -21238,12 +22020,6 @@ packages: '@vue/compiler-sfc': optional: true - '@tokenizer/token@0.3.0': - resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} - - '@trapezedev/gradle-parse@7.1.3': - resolution: {integrity: sha512-WQVF5pEJ5o/mUyvfGTG9nBKx9Te/ilKM3r2IT69GlbaooItT5ao7RyF1MUTBNjHLPk/xpGUY3c6PyVnjDlz0Vw==} - '@trpc/client@11.4.3': resolution: {integrity: sha512-i2suttUCfColktXT8bqex5kHW5jpT15nwUh0hGSDiW1keN621kSUQKcLJ095blqQAUgB+lsmgSqSMmB4L9shQQ==} peerDependencies: @@ -21258,41 +22034,15 @@ packages: '@trpc/tanstack-react-query@11.4.3': resolution: {integrity: sha512-aYPp12wE9IrakccGWoQU/waZuWr3FLw9RtagsqJmX9NKHpQOVzoDvHA1W0amwyTQSAfL98Bn5rWmD7KTdr5AWg==} peerDependencies: - '@tanstack/react-query': ^5.99.0 + '@tanstack/react-query': ^5.102.0 '@trpc/client': 11.4.3 '@trpc/server': 11.4.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 typescript: '>=5.7.2' - '@ts-morph/common@0.22.0': - resolution: {integrity: sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw==} - - '@ts-morph/common@0.26.1': - resolution: {integrity: sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA==} - - '@tsconfig/node10@1.0.12': - resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} - - '@tsconfig/node12@1.0.11': - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - - '@tsconfig/node14@1.0.3': - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - - '@tsconfig/node16@1.0.4': - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - - '@tufjs/canonical-json@2.0.0': - resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} - engines: {node: ^16.14.0 || >=18.0.0} - - '@tufjs/models@4.1.0': - resolution: {integrity: sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww==} - engines: {node: ^20.17.0 || >=22.9.0} - - '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} + '@tybys/wasm-util@0.10.3': + resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} '@tybys/wasm-util@0.9.0': resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} @@ -21354,6 +22104,9 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/express-serve-static-core@4.19.6': resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} @@ -21366,9 +22119,6 @@ packages: '@types/express@5.0.6': resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==} - '@types/fs-extra@8.1.5': - resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} - '@types/html-minifier-terser@6.1.0': resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} @@ -21430,9 +22180,6 @@ packages: '@types/react@19.2.9': resolution: {integrity: sha512-Lpo8kgb/igvMIPeNV2rsYKTgaORYdO1XGVZ4Qz3akwOj0ySGYMPlQWa8BaLn0G63D1aSaAQ5ldR06wCpChQCjA==} - '@types/resolve@1.20.2': - resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - '@types/retry@0.12.2': resolution: {integrity: sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==} @@ -21448,8 +22195,8 @@ packages: '@types/serve-static@2.2.0': resolution: {integrity: sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==} - '@types/slice-ansi@4.0.0': - resolution: {integrity: sha512-+OpjSaq85gvlZAYINyzKpLeiFkSC4EsC6IIiT6v6TLSU5k5U83fHGj9Lel8oKEXM0HqgrMVCjXPDPVICtxF7EQ==} + '@types/set-cookie-parser@2.4.10': + resolution: {integrity: sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==} '@types/sockjs@0.3.36': resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} @@ -21457,6 +22204,9 @@ packages: '@types/statuses@2.0.5': resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} + '@types/statuses@2.0.6': + resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} + '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} @@ -21466,15 +22216,6 @@ packages: '@types/ws@8.5.14': resolution: {integrity: sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==} - '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - - '@types/yargs@17.0.33': - resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - - '@types/yauzl@2.10.3': - resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@8.44.1': resolution: {integrity: sha512-molgphGqOBT7t4YKCSkbasmu1tb1MgrZ2szGzHbclF7PNmOkSTQVHy+2jXOSnxvR3+Xe1yySHFZoqMpz3TfQsw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -21576,13 +22317,6 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.23.0': - resolution: {integrity: sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^9.22.0 - typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/type-utils@8.44.1': resolution: {integrity: sha512-KdEerZqHWXsRNKjF9NYswNISnFzXfXNDfPxoTh7tqohU/PRIbwTmsjGK6V9/RTYWau7NZvfo52lgVk+sJh0K3g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -21681,6 +22415,130 @@ packages: resolution: {integrity: sha512-YWnmJkXbofiz9KbnbbwuA2rpGkFPLbAIetcCNO6mJ8gdhdZ/v7WDXsoGFAJuM6ikUFKTlSQnjWnVO4ux+UzS6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + + '@typescript/typescript6@6.0.2': + resolution: {integrity: sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==} + hasBin: true + '@unrs/resolver-binding-android-arm-eabi@1.11.1': resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==} cpu: [arm] @@ -21784,66 +22642,31 @@ packages: cpu: [x64] os: [win32] - '@vercel/nft@0.29.4': - resolution: {integrity: sha512-6lLqMNX3TuycBPABycx7A9F1bHQR7kiQln6abjFbPrf5C/05qHM9M5E4PeTE59c7z8g6vHnx1Ioihb2AQl7BTA==} - engines: {node: '>=18'} - hasBin: true - - '@vercel/nft@1.3.0': - resolution: {integrity: sha512-i4EYGkCsIjzu4vorDUbqglZc5eFtQI2syHb++9ZUDm6TU4edVywGpVnYDein35x9sevONOn9/UabfQXuNXtuzQ==} + '@vercel/nft@1.3.1': + resolution: {integrity: sha512-ihNT1rswiq3cy4WKQAV5kJi6UjWX1vLUzlLc+Vvq83G8CU9nMgfDWz5f1tOnSlS8LeC4Wp4qTB3+HGj/ccUrFQ==} engines: {node: '>=20'} hasBin: true - '@vitejs/plugin-basic-ssl@2.1.4': - resolution: {integrity: sha512-HXciTXN/sDBYWgeAD4V4s0DN0g72x5mlxQhHxtYu3Tt8BLa6MzcJZUyDVFCdtjNs3bfENVHVzOsmooTVuNgAAw==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - peerDependencies: - vite: ^8.0.14 - - '@vitejs/plugin-react@4.3.4': - resolution: {integrity: sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^8.0.14 - - '@vitejs/plugin-react@4.6.0': - resolution: {integrity: sha512-5Kgff+m8e2PB+9j51eGHEpn5kUzRKH2Ry0qGoe8ItJg7pqnkPrYPkDQZGgGmTa0EGarHrkjLvOdU3b1fzI8otQ==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^8.0.14 - - '@vitejs/plugin-react@4.7.0': - resolution: {integrity: sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^8.0.14 - - '@vitejs/plugin-react@5.2.0': - resolution: {integrity: sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==} - engines: {node: ^20.19.0 || >=22.12.0} - peerDependencies: - vite: ^8.0.14 - '@vitejs/plugin-react@6.0.1': resolution: {integrity: sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 babel-plugin-react-compiler: ^1.0.0 - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: '@rolldown/plugin-babel': optional: true babel-plugin-react-compiler: optional: true - '@vitejs/plugin-rsc@0.5.20': - resolution: {integrity: sha512-JHPqfR8SSE2oNzCDRoyzEpbgxCxDks0PJAlo0KpK+OldYUxvozHroYpn0QtSdbZWq9YQ/ok1JUJ3GMc1xOmN0g==} + '@vitejs/plugin-rsc@0.5.39': + resolution: {integrity: sha512-hRa6CK119r1NkwgPWlPRiDP8e4rELCsIZwjGmQK0sOnayAkYPBkyJMip0GhYEt2ukBZaO0Uw3ICHHO9T692OFw==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 react-server-dom-webpack: '*' - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: react-server-dom-webpack: optional: true @@ -21852,28 +22675,23 @@ packages: resolution: {integrity: sha512-DSTrmrdLp+0LDNF77fqrKfx7X0ErRbOcUAgJL/HbSesqQwoUvUQ4uYQqaex+rovqgGcoPqVk+AwUh3v9CuiYIw==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 vue: ^3.0.0 '@vitejs/plugin-vue-jsx@5.1.5': resolution: {integrity: sha512-jIAsvHOEtWpslLOI2MeElGFxH7M8pM83BU/Tor4RLyiwH0FM4nUW3xdvbw20EeU9wc5IspQwMq225K3CMnJEpA==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 vue: ^3.0.0 '@vitejs/plugin-vue@6.0.5': resolution: {integrity: sha512-bL3AxKuQySfk1iGcBsQnoRVexTPJq0Z/ixFVM8OhVJAP6ZXXXLtM7NFKWhLl30Kg7uTBqIaPXbh+nuQCuBDedg==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 vue: ^3.2.25 - '@vitest/browser@4.1.4': - resolution: {integrity: sha512-TrNaY/yVOwxtrxNsDUC/wQ56xSwplpytTeRAqF/197xV/ZddxxulBsxR6TrhVMyniJmp9in8d5u0AcDaNRY30w==} - peerDependencies: - vitest: 4.1.4 - '@vitest/expect@4.1.4': resolution: {integrity: sha512-iPBpra+VDuXmBFI3FMKHSFXp3Gx5HfmSCE8X67Dn+bwephCnQCaB7qWK2ldHa+8ncN8hJU8VTMcxjPpyMkUjww==} @@ -21881,7 +22699,18 @@ packages: resolution: {integrity: sha512-R9HTZBhW6yCSGbGQnDnH3QHfJxokKN4KB+Yvk9Q1le7eQNYwiCyKxmLmurSpFy6BzJanSLuEUDrD+j97Q+ZLPg==} peerDependencies: msw: ^2.4.9 - vite: ^8.0.14 + vite: ^8.3.4 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/mocker@5.0.4': + resolution: {integrity: sha512-tqAlrYWce4iUxhr3ncNohejtCTOcHeE8XWrSNZY3OhPoDn01yeGv+gnaBy64ATp7o6pb03eIbBAjzmibpc9vIQ==} + peerDependencies: + msw: ^2.4.9 || ^3.0.0 + vite: ^8.3.4 peerDependenciesMeta: msw: optional: true @@ -21891,6 +22720,9 @@ packages: '@vitest/pretty-format@4.1.4': resolution: {integrity: sha512-ddmDHU0gjEUyEVLxtZa7xamrpIefdEETu3nZjWtHeZX4QxqJ7tRxSteHVXJOcr8jhiLoGAhkK4WJ3WqBpjx42A==} + '@vitest/pretty-format@5.0.4': + resolution: {integrity: sha512-kh/bp0oLr6w18kt4MFn5/zS+Hpc5k3bsf6S2m2Qksj7sKHrnc7Tu90UVYyiXnRvkYruN6kSCHQ3RR+SBE6FinA==} + '@vitest/runner@4.1.4': resolution: {integrity: sha512-xTp7VZ5aXP5ZJrn15UtJUWlx6qXLnGtF6jNxHepdPHpMfz/aVPx+htHtgcAL2mDXJgKhpoo2e9/hVJsIeFbytQ==} @@ -21900,16 +22732,24 @@ packages: '@vitest/spy@4.1.4': resolution: {integrity: sha512-XxNdAsKW7C+FLydqFJLb5KhJtl3PGCMmYwFRfhvIgxJvLSXhhVI1zM8f1qD3Zg7RCjTSzDVyct6sghs9UEgBEQ==} + '@vitest/spy@5.0.4': + resolution: {integrity: sha512-MZKk/gSkm2q+ICobMxCpH1mA+cCAWm8WV7UhxlqGjq/sJ3AGc1BqFOs5CRVXxH78wQtme9q/NAAgBquj4AcyMw==} + '@vitest/ui@4.1.4': resolution: {integrity: sha512-EgFR7nlj5iTDYZYCvavjFokNYwr3c3ry0sFiCg+N7B233Nwp+NNx7eoF/XvMWDCKY71xXAG3kFkt97ZHBJVL8A==} peerDependencies: vitest: 4.1.4 + '@vitest/ui@5.0.4': + resolution: {integrity: sha512-L40ToOGwFgeZ+JVPMKHb7T0b671mqcmCpMUh9P68xq9YZ+TXM72rkDf9ljuv02e5Y1zj8ww0CnWIUnqs3FEWKQ==} + peerDependencies: + vitest: 5.0.4 + '@vitest/utils@4.1.4': resolution: {integrity: sha512-13QMT+eysM5uVGa1rG4kegGYNp6cnQcsTc67ELFbhNLQO+vgsygtYJx2khvdt4gVQqSSpC/KT5FZZxUpP3Oatw==} - '@volar/language-core@2.4.23': - resolution: {integrity: sha512-hEEd5ET/oSmBC6pi1j6NaNYRWoAiDhINbT8rmwtINugR39loROSlufGdYMF9TaKGfz+ViGs1Idi3mAhnuPcoGQ==} + '@vitest/utils@5.0.4': + resolution: {integrity: sha512-hgpnyMuMqCz2PARmk3v62FxUr8jHIkY13ygvUeh8s+dmQxfnvkB/sgtoZFzG4lMitnEdnrg/lCvDbtVzuAsGWQ==} '@volar/language-core@2.4.26': resolution: {integrity: sha512-hH0SMitMxnB43OZpyF1IFPS9bgb2I3bpCh76m2WEK7BE0A0EzpYsRp0CCH2xNKshr7kacU5TQBLYn4zj7CG60A==} @@ -21917,23 +22757,27 @@ packages: '@volar/language-core@2.4.28': resolution: {integrity: sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==} - '@volar/source-map@2.4.23': - resolution: {integrity: sha512-Z1Uc8IB57Lm6k7q6KIDu/p+JWtf3xsXJqAX/5r18hYOTpJyBn0KXUR8oTJ4WFYOcDzWC9n3IflGgHowx6U6z9Q==} - '@volar/source-map@2.4.26': resolution: {integrity: sha512-JJw0Tt/kSFsIRmgTQF4JSt81AUSI1aEye5Zl65EeZ8H35JHnTvFGmpDOBn5iOxd48fyGE+ZvZBp5FcgAy/1Qhw==} '@volar/source-map@2.4.28': resolution: {integrity: sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==} - '@volar/typescript@2.4.23': - resolution: {integrity: sha512-lAB5zJghWxVPqfcStmAP1ZqQacMpe90UrP5RJ3arDyrhy4aCUQqmxPPLB2PWDKugvylmO41ljK7vZ+t6INMTag==} - '@volar/typescript@2.4.26': resolution: {integrity: sha512-N87ecLD48Sp6zV9zID/5yuS1+5foj0DfuYGdQ6KHj/IbKvyKv1zNX6VCmnKYwtmHadEO6mFc2EKISiu3RDPAvA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true '@volar/typescript@2.4.28': resolution: {integrity: sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true '@vue/babel-helper-vue-transform-on@1.5.0': resolution: {integrity: sha512-0dAYkerNhhHutHZ34JtTl2czVQHUNWv6xEbkdF5W+Yrv5pCWsqjeORdOgbtW2I9gWlt+wBmVn+ttqN9ZxR5tzA==} @@ -21993,24 +22837,8 @@ packages: typescript: optional: true - '@vue/language-core@3.1.5': - resolution: {integrity: sha512-FMcqyzWN+sYBeqRMWPGT2QY0mUasZMVIuHvmb5NT3eeqPrbHBYtCP8JWEUCDCgM+Zr62uuWY/qoeBrPrzfa78w==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@vue/language-core@3.1.8': - resolution: {integrity: sha512-PfwAW7BLopqaJbneChNL6cUOTL3GL+0l8paYP5shhgY5toBNidWnMXWM+qDwL7MC9+zDtzCF2enT8r6VPu64iw==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@vue/language-core@3.3.7': - resolution: {integrity: sha512-LzmkKinXAMMoh8Jfi/jMUSDUjuPdv8mynH5WJGKfXyZtDw3hQ6GBaoI6Bcnl/Xqlu32q/0Z6i/trp4VXykzyLw==} + '@vue/language-core@3.3.8': + resolution: {integrity: sha512-ieGT8jJdhhy0mGzStZhsg/qPw5bQZJg5yF+3+XU6saf4sM7yo9ZXy3h+nCwrm2+b4qS/SypkNdR2jAF3uei9tA==} '@vue/reactivity@3.5.25': resolution: {integrity: sha512-5xfAypCQepv4Jog1U4zn8cZIcbKKFka3AgWHEFQeK65OW+Ys4XybP6z2kKgws4YB43KGpqp5D/K3go2UPPunLA==} @@ -22106,20 +22934,20 @@ packages: resolution: {integrity: sha512-LOtTn+JgJvX8WfBVJtF08TGrdjuFzGJc4mkP8EdDI8ADbvO7kiexYep1o8dwnt0okb0jYclCDXF13xU7Ge4zSw==} engines: {node: '>=18.0.0'} - '@whatwg-node/fetch@0.10.11': - resolution: {integrity: sha512-eR8SYtf9Nem1Tnl0IWrY33qJ5wCtIWlt3Fs3c6V4aAaTFLtkEQErXu3SSZg/XCHrj9hXSJ8/8t+CdMk5Qec/ZA==} + '@whatwg-node/fetch@0.10.13': + resolution: {integrity: sha512-b4PhJ+zYj4357zwk4TTuF2nEe0vVtOrwdsrNo5hL+u1ojXNhh1FgJ6pg1jzDlwlT4oBdzfSwaBwMCtFCsIWg8Q==} engines: {node: '>=18.0.0'} - '@whatwg-node/node-fetch@0.8.1': - resolution: {integrity: sha512-cQmQEo7IsI0EPX9VrwygXVzrVlX43Jb7/DBZSmpnC7xH4xkyOnn/HykHpTaQk7TUs7zh59A5uTGqx3p2Ouzffw==} + '@whatwg-node/node-fetch@0.8.6': + resolution: {integrity: sha512-BDMdYFcerLQkwA2RTldxOqRCs6ZQD1S7UgP3pUdGUkcbgTrP/V5ko77ZkCww9DHmC4lpoYuwigGfQYj285gMvA==} engines: {node: '>=18.0.0'} '@whatwg-node/promise-helpers@1.3.2': resolution: {integrity: sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==} engines: {node: '>=16.0.0'} - '@whatwg-node/server@0.10.13': - resolution: {integrity: sha512-Otmxo+0mp8az3B48pLI1I4msNOXPIoP7TLm6h5wOEQmynqHt8oP9nR6NJUeJk6iI5OtFpQtkbJFwfGkmplvc3Q==} + '@whatwg-node/server@0.11.0': + resolution: {integrity: sha512-VSdkwnJRr8Yv9UgB2aXB3VUPWwd6Oqnn0hycFwhg9pZgWxJXb7JmhsiXe9tmpMwjHFxli12PGcz9aI63YYloGQ==} engines: {node: '>=18.0.0'} '@workos-inc/node@8.0.0': @@ -22136,15 +22964,8 @@ packages: peerDependencies: '@tanstack/react-router': workspace:* '@tanstack/react-start': workspace:* - react: ^19.2.3 - react-dom: ^19.2.3 - - '@xml-tools/parser@1.0.11': - resolution: {integrity: sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==} - - '@xmldom/xmldom@0.8.13': - resolution: {integrity: sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==} - engines: {node: '>=10.0.0'} + react: ~19.2.9 + react-dom: ~19.2.9 '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -22167,10 +22988,6 @@ packages: resolution: {integrity: sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==} engines: {node: ^18.17.0 || >=20.5.0} - abbrev@4.0.0: - resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==} - engines: {node: ^20.17.0 || >=22.9.0} - abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -22191,21 +23008,11 @@ packages: peerDependencies: acorn: ^8 - acorn-import-phases@1.0.4: - resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} - engines: {node: '>=10.13.0'} - peerDependencies: - acorn: ^8.14.0 - acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-walk@8.3.5: - resolution: {integrity: sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==} - engines: {node: '>=0.4.0'} - acorn@8.14.1: resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} engines: {node: '>=0.4.0'} @@ -22216,9 +23023,10 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - adjust-sourcemap-loader@4.0.0: - resolution: {integrity: sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==} - engines: {node: '>=8.9'} + acorn@8.18.0: + resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} + engines: {node: '>=0.4.0'} + hasBin: true agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} @@ -22282,9 +23090,6 @@ packages: ajv@8.18.0: resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} - alien-signals@3.1.1: - resolution: {integrity: sha512-ogkIWbVrLwKtHY6oOAXaYkAxP+cTH7V5FZ5+Tm4NZFd8VDZ6uNMDrfzqctTZ42eTMCSR3ne3otpcxmqSnFfPYA==} - alien-signals@3.2.1: resolution: {integrity: sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==} @@ -22292,13 +23097,16 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + ansi-escapes@7.0.0: resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} engines: {node: '>=18'} ansi-html-community@0.0.8: resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} - engines: {'0': node >= 0.8.0} hasBin: true ansi-regex@5.0.1: @@ -22309,10 +23117,6 @@ packages: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -22325,13 +23129,10 @@ packages: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} - ansis@4.1.0: - resolution: {integrity: sha512-BGcItUBWSMRgOCe+SVZJ+S7yTRG0eGt9cXAHev72yuGcY23hnLA7Bky5L/xLyPINoSN95geovfBkqoTlNZYa7w==} + ansis@4.3.1: + resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} engines: {node: '>=14'} - any-base@1.1.0: - resolution: {integrity: sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==} - any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} @@ -22339,16 +23140,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} - archiver-utils@5.0.2: - resolution: {integrity: sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==} - engines: {node: '>= 14'} - - archiver@7.0.1: - resolution: {integrity: sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==} - engines: {node: '>= 14'} - - arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + archiver@8.0.0: + resolution: {integrity: sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==} + engines: {node: '>=18'} argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -22395,10 +23189,6 @@ packages: resolution: {integrity: sha512-WHw67kLXYbZuHTmcdbIrVArCq5wxo6NEuj3hiYAWr8mwJeC+C2mMCIBIWCiDoCye/OF/xelc+teJ1ERoWmnEIA==} engines: {node: '>=18'} - astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} - async-mutex@0.5.0: resolution: {integrity: sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==} @@ -22411,25 +23201,17 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - at-least-node@1.0.0: - resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} - engines: {node: '>= 4.0.0'} - atomic-sleep@1.0.0: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} + atomically@2.1.1: + resolution: {integrity: sha512-P4w9o2dqARji6P7MHprklbfiArZAWvo07yW7qs3pdljb3BWr12FIB7W+p0zJiuiVsUpRO0iZn1kFFcpPegg0tQ==} + autocannon@8.0.0: resolution: {integrity: sha512-fMMcWc2JPFcUaqHeR6+PbmEpTxCrPZyBUM95oG4w3ngJ8NfBNas/ZXA+pTHXLqJ0UlFVTcy05GC25WxKx/M20A==} hasBin: true - autoprefixer@10.4.27: - resolution: {integrity: sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==} - engines: {node: ^10 || ^12 || >=14} - hasBin: true - peerDependencies: - postcss: ^8.1.0 - available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -22437,20 +23219,10 @@ packages: avvio@9.1.0: resolution: {integrity: sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==} - await-to-js@3.0.0: - resolution: {integrity: sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g==} - engines: {node: '>=6.0.0'} - aws-ssl-profiles@1.1.2: resolution: {integrity: sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==} engines: {node: '>= 6.0.0'} - axios@1.16.0: - resolution: {integrity: sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==} - - axios@1.17.0: - resolution: {integrity: sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==} - axios@1.18.1: resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==} @@ -22476,25 +23248,8 @@ packages: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} - babel-plugin-polyfill-corejs2@0.4.17: - resolution: {integrity: sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - - babel-plugin-polyfill-corejs3@0.13.0: - resolution: {integrity: sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - - babel-plugin-polyfill-corejs3@0.14.2: - resolution: {integrity: sha512-coWpDLJ410R781Npmn/SIBZEsAetR4xVi0SxLMXPaMO4lSf1MwnkGYMtkFxew0Dn8B3/CpbpYxN0JCgg8mn67g==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - - babel-plugin-polyfill-regenerator@0.6.8: - resolution: {integrity: sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-react-compiler@1.0.0: + resolution: {integrity: sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==} babel-plugin-vue-jsx-hmr@1.0.0: resolution: {integrity: sha512-XRq+XTD4bub6HkavELMhihvLX2++JkSBAxRXlqQK32b+Tb0S9PEqxrDSMpOEZ1iGyOaJZj9Y0uU/FzICdyL9MA==} @@ -22515,8 +23270,9 @@ packages: resolution: {integrity: sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==} engines: {node: 20 || >=22} - bare-events@2.5.4: - resolution: {integrity: sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} bare-events@2.9.1: resolution: {integrity: sha512-Z0oHEHAFDZkffN8Qc39zNZjQlMDkPJRyyyZieU1VH7u8c5S+qHZ2S8ixdKIAxEjfHO7FJxXmJWgteOghVanIsg==} @@ -22562,17 +23318,14 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - baseline-browser-mapping@2.9.8: - resolution: {integrity: sha512-Y1fOuNDowLfgKOypdc9SPABfoWXuZHBOyCS4cD52IeZBhr4Md6CLLs6atcxVrzRmQ06E7hSlm5bHHApPKR/byA==} + baseline-browser-mapping@2.11.23: + resolution: {integrity: sha512-le521dGVfxM7yRX0EikCoSz+rOK+hHzdDt/E7mG1jOJB/6WAAUuwVroLwaB7ApaUsz5Q0kFlDXLSA9MheUIfRQ==} + engines: {node: '>=6.0.0'} hasBin: true batch@0.6.1: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - beasties@0.4.1: - resolution: {integrity: sha512-2Imdcw3LznDuxAbJM26RHniOLAzE6WgrK8OuvVXCQtNBS8rsnD9zsSEa3fHl4hHpUY7BYTlrpvtPVbvu9G6neg==} - engines: {node: '>=18.0.0'} - better-ajv-errors@1.2.0: resolution: {integrity: sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==} engines: {node: '>= 12.13.0'} @@ -22595,8 +23348,8 @@ packages: next: ^14.0.0 || ^15.0.0 || ^16.0.0 pg: ^8.0.0 prisma: ^5.0.0 || ^6.0.0 || ^7.0.0 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 solid-js: 1.9.12 svelte: ^4.0.0 || ^5.0.0 vitest: ^2.0.0 || ^3.0.0 || ^4.0.0 @@ -22656,17 +23409,9 @@ packages: bidi-js@1.0.3: resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} - big-integer@1.6.52: - resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} - engines: {node: '>=0.6'} - big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} - bin-links@6.0.2: - resolution: {integrity: sha512-frE1t78WOwJ45PKV2cF2tNPjTcs9L1J9s6VkrV59wanRP4GlaomuxYPVma7BwthMg8WnfSory4w5PTE6FZZ81w==} - engines: {node: ^20.17.0 || >=22.9.0} - binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -22683,9 +23428,6 @@ packages: blake3-wasm@2.1.5: resolution: {integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==} - bmp-ts@1.0.9: - resolution: {integrity: sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==} - body-parser@1.20.5: resolution: {integrity: sha512-3grm+/2tUOvu2cjJkvsIxrv/wVpfXQW4PsQHYm7yk4vfpu7Ekl6nEsYBoJUL6qDwZUx8wUhQ8tR2qz+ad9c9OA==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -22700,29 +23442,19 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - bplist-creator@0.1.0: - resolution: {integrity: sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==} - - bplist-creator@0.1.1: - resolution: {integrity: sha512-Ese7052fdWrxp/vqSJkydgx/1MdBnNOCV2XVfbmdGWD2H6EYza+Q4pyYSuVSnCUD22hfI/BFI4jHaC3NLXLlJQ==} - - bplist-parser@0.3.1: - resolution: {integrity: sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==} - engines: {node: '>= 5.10.0'} - - bplist-parser@0.3.2: - resolution: {integrity: sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==} - engines: {node: '>= 5.10.0'} - brace-expansion@1.1.15: resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} brace-expansion@2.1.1: resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} - brace-expansion@5.0.6: - resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} - engines: {node: 18 || 20 || >=22} + brace-expansion@5.0.12: + resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==} + engines: {node: 20 || >=22} + + brace-expansion@5.0.9: + resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} + engines: {node: 20 || >=22} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -22738,9 +23470,6 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - buffer-crc32@0.2.13: - resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} - buffer-crc32@1.0.0: resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} engines: {node: '>=8.0.0'} @@ -22757,9 +23486,6 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - bufferpack@0.0.6: - resolution: {integrity: sha512-MTWvLHElqczrIVhge9qHtqgNigJFyh0+tCDId5yCbFAfuekHWIG+uAgvoHVflwrDPuY/e47JE1ki5qcM7w4uLg==} - bun-types@1.2.22: resolution: {integrity: sha512-hwaAu8tct/Zn6Zft4U9BsZcXkYomzpHJX28ofvx7k0Zz2HNz54n1n+tDgxoWFGB4PcFvJXJQloPhaV2eP3Q6EA==} peerDependencies: @@ -22769,10 +23495,6 @@ packages: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} - byline@5.0.0: - resolution: {integrity: sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==} - engines: {node: '>=0.10.0'} - bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -22789,17 +23511,9 @@ packages: magicast: optional: true - c12@3.3.3: - resolution: {integrity: sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q==} - peerDependencies: - magicast: '*' - peerDependenciesMeta: - magicast: - optional: true - - cacache@20.0.4: - resolution: {integrity: sha512-M3Lab8NPYlZU2exsL3bMVvMrMqgwCnMWfdZbK28bn3pK6APT/Te/I8hjRPNu1uwORY9a1eEQoifXbKPQMfMTOA==} - engines: {node: ^20.17.0 || >=22.9.0} + cac@7.1.0: + resolution: {integrity: sha512-LMDU/U2yA4IPIY8KT0NsNPWEYZvAMkbgyspxJ6btJaYV+WMDOHAZCmB0lsTObiHaRS1V/ztKAl7+TSkTqXyeoA==} + engines: {node: '>=20.19.0'} call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} @@ -22823,24 +23537,21 @@ packages: camel-case@4.1.2: resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - caniuse-lite@1.0.30001696: resolution: {integrity: sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==} - caniuse-lite@1.0.30001806: - resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} + caniuse-lite@1.0.30001760: + resolution: {integrity: sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw==} - chai@6.2.2: - resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} + cf@1.0.0-beta.28: + resolution: {integrity: sha512-sMt4G50Mvz0+wvp6ScckPmmJSrEtfN3BeYJbtJ9yN5wAgECgFUGy0twoup1KySG9Md4Ow4ifSkllPLBFQV9ePw==} + engines: {node: ^22.23.0 || ^24.22.0 || ^26.12.0} + hasBin: true + + chai@6.3.0: + resolution: {integrity: sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==} engines: {node: '>=18'} - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} @@ -22853,6 +23564,10 @@ packages: resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + chalk@6.0.0: + resolution: {integrity: sha512-2uNTXIuTTxk7ciZgAU1BQcgnchcG0xXnrs6jzkQfj9SsRa9M2s5zE8WT96hS6KmG4MzWHSrvH43DF1m4XRkrFg==} + engines: {node: '>=22'} + char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -22873,9 +23588,6 @@ packages: chevrotain@10.5.0: resolution: {integrity: sha512-Pkv5rBY3+CsHOYfV5g/Vs5JY9WTHHDEKOlohI2XeygaZhUeqhAlldZ8Hz9cRmxu709bvS08YzxHdTPHhffc13A==} - chevrotain@7.1.1: - resolution: {integrity: sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==} - chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -22899,9 +23611,15 @@ packages: citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + citty@0.2.2: + resolution: {integrity: sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==} + cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cjs-module-lexer@2.2.1: + resolution: {integrity: sha512-Ca8swihM+/4yKecYHY52kgJd300hi2lADU/a1RxNTRe+RJ9jvqQlESpbz9DnG9mowez8qwXHB8qYdIUw9e+F5Q==} + classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} @@ -22913,10 +23631,6 @@ packages: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} - cli-highlight@2.1.11: resolution: {integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==} engines: {node: '>=8.0.0', npm: '>=5.0.0'} @@ -22926,28 +23640,20 @@ packages: resolution: {integrity: sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==} engines: {node: '>=6'} - cli-spinners@3.4.0: - resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} - engines: {node: '>=18.20'} + cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} cli-table3@0.6.5: resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} engines: {node: 10.* || >= 12.*} - cli-truncate@5.2.0: - resolution: {integrity: sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==} - engines: {node: '>=20'} - cli-width@4.1.0: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} - clipboardy@4.0.0: - resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==} - engines: {node: '>=18'} - - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + client-only@0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -22956,10 +23662,6 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} - cliui@9.0.1: - resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} - engines: {node: '>=20'} - clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} @@ -22972,23 +23674,10 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - cluster-key-slot@1.1.2: - resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} + cluster-key-slot@1.1.1: + resolution: {integrity: sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw==} engines: {node: '>=0.10.0'} - cmd-shim@8.0.0: - resolution: {integrity: sha512-Jk/BK6NCapZ58BKUxlSI+ouKRbjH1NLZCgJkYoab+vEHUY3f6OzpNBN9u7HFSv9J6TRDGs4PLOHezoKGaFRSCA==} - engines: {node: ^20.17.0 || >=22.9.0} - - code-block-writer@12.0.0: - resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} - - code-block-writer@13.0.3: - resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==} - - color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -22997,9 +23686,6 @@ packages: resolution: {integrity: sha512-fasDH2ont2GqF5HpyO4w0+BcewlhHEZOFn9c1ckZdHpJ56Qb7MHhH/IcJZbBGgvdtwdwNbLvxiBEdg336iA9Sg==} engines: {node: '>=14.6'} - color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -23007,9 +23693,6 @@ packages: resolution: {integrity: sha512-1bPaDNFm0axzE4MEAzKPuqKWeRaT43U/hyxKPBdqTfmPF+d6n7FSoTFxLVULUJOmiLp01KjhIPPH+HrXZJN4Rg==} engines: {node: '>=12.20'} - color-string@1.9.1: - resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} - color-string@2.1.2: resolution: {integrity: sha512-RxmjYxbWemV9gKu4zPgiZagUxbH3RQpEIO77XoSSX0ivgABDZ+h8Zuash/EMFLTI4N9QgFPOJ6JQpPZKFxa+dA==} engines: {node: '>=18'} @@ -23018,10 +23701,6 @@ packages: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true - color@4.2.3: - resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} - engines: {node: '>=12.5.0'} - color@5.0.2: resolution: {integrity: sha512-e2hz5BzbUPcYlIRHo8ieAhYgoajrJr+hWoceg6E345TPsATMUKqDgzt8fSXZJJbxfpiPzkWyphz8yn8At7q3fA==} engines: {node: '>=18'} @@ -23029,6 +23708,9 @@ packages: colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + colorjs.io@0.7.1: + resolution: {integrity: sha512-LY7OHnJZxHwT5UlzNa9bbhHHDbzB6yE5+3MIPwJEQKRvSCt/T4G7epsj+9j2BExUIIfXFIJGsIXUKdfrK9Q5tA==} + combinate@1.1.11: resolution: {integrity: sha512-+2MNAQ29HtNejOxkgaTQPC2Bm+pQvFuqf7o18uObl/Bx3daX06kjLUNY/qa9f+YSqzqm/ic3SdrlfN0fvTlw2g==} @@ -23063,9 +23745,6 @@ packages: resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} engines: {node: '>= 12.0.0'} - common-ancestor-path@1.0.1: - resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} - common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} @@ -23073,18 +23752,12 @@ packages: resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} engines: {node: '>=4.0.0'} - commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - compare-versions@6.1.1: resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} - compatx@0.2.0: - resolution: {integrity: sha512-6gLRNt4ygsi5NyMVhceOCFv14CIdDFN7fQjX1U4+47qVE/+kjPoXMK65KWK+dWxmFzMTuKazoQ9sch6pM0p5oA==} - - compress-commons@6.0.2: - resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} - engines: {node: '>= 14'} + compress-commons@7.0.1: + resolution: {integrity: sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ==} + engines: {node: '>=18'} compressible@2.0.18: resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} @@ -23160,7 +23833,7 @@ packages: '@standard-schema/spec': ^1.0.0 convex: ^1.24.0 hono: ^4.0.5 - react: ^19.2.3 + react: ~19.2.9 typescript: ^5.5 zod: ^3.22.4 || ^4.0.15 peerDependenciesMeta: @@ -23188,8 +23861,8 @@ packages: peerDependencies: '@auth0/auth0-react': ^2.0.1 '@clerk/clerk-react': ^4.12.8 || ^5.0.0 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@auth0/auth0-react': optional: true @@ -23207,7 +23880,7 @@ packages: peerDependencies: '@auth0/auth0-react': ^2.0.1 '@clerk/clerk-react': ^4.12.8 || ^5.0.0 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@auth0/auth0-react': optional: true @@ -23216,11 +23889,8 @@ packages: react: optional: true - cookie-es@1.2.2: - resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} - - cookie-es@2.0.0: - resolution: {integrity: sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg==} + cookie-es@1.2.3: + resolution: {integrity: sha512-lXVyvUvrNXblMqzIRrxHb57UUVmqsSWlxqt3XIjCkUP0wDAf6uicO6KMbEgYrMNtEvWgWHwe42CKxPu9MYAnWw==} cookie-es@3.1.1: resolution: {integrity: sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==} @@ -23240,22 +23910,18 @@ packages: resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} engines: {node: '>=18'} - copy-anything@2.0.6: - resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==} + cookie@1.1.1: + resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==} + engines: {node: '>=18'} + + cookie@2.0.1: + resolution: {integrity: sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==} + engines: {node: '>=22'} copy-file@11.1.0: resolution: {integrity: sha512-X8XDzyvYaA6msMyAM575CUoygY5b44QzLcGRKsK3MFmXcOvQa518dNPLsKYwkYsn72g3EiW+LE0ytd/FlqWmyw==} engines: {node: '>=18'} - copy-webpack-plugin@14.0.0: - resolution: {integrity: sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==} - engines: {node: '>= 20.9.0'} - peerDependencies: - webpack: ^5.1.0 - - core-js-compat@3.49.0: - resolution: {integrity: sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==} - core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -23277,20 +23943,13 @@ packages: engines: {node: '>=0.8'} hasBin: true - crc32-stream@6.0.0: - resolution: {integrity: sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==} - engines: {node: '>= 14'} + crc32-stream@7.0.1: + resolution: {integrity: sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g==} + engines: {node: '>=18'} - create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - - cron-parser@4.9.0: - resolution: {integrity: sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==} - engines: {node: '>=12.0.0'} - - croner@9.1.0: - resolution: {integrity: sha512-p9nwwR4qyT5W996vBZhdvBCnMhicY5ytZkR4D1Xj0wuTDEiMnjwR57Q3RXYY/s0EpX6Ay3vgIcfaR+ewGHsi+g==} - engines: {node: '>=18.0'} + cron-parser@5.10.1: + resolution: {integrity: sha512-pKRrRagItwk9rGIStcUyMxFX34x56zoX3KDf9HJ4ttwkXIK1qxK63EvXvEDmlxI9AdPJ+Y7TEKRftRlW5eSS7A==} + engines: {node: '>=18'} cross-argv@2.0.0: resolution: {integrity: sha512-YIaY9TR5Nxeb8SMdtrU8asWVM4jqJDNDYlKV21LxtYcfNJhp1kEsgSa6qXwXgzN0WQWGODps0+TlGp2xQSHwOg==} @@ -23300,15 +23959,6 @@ packages: engines: {node: '>=20'} hasBin: true - cross-env@10.1.0: - resolution: {integrity: sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==} - engines: {node: '>=20'} - hasBin: true - - cross-spawn@6.0.6: - resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} - engines: {node: '>=4.8'} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -23316,24 +23966,8 @@ packages: crossws@0.3.5: resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==} - crossws@0.4.3: - resolution: {integrity: sha512-lmf5mtwHiToP3HumOx53cqS0T5TK8GMBpsbSCXRB5OuszbltTgGOO4B1WhrDYqTeXOk3BAemibNjJx8E0/ecNw==} - peerDependencies: - srvx: '>=0.7.1' - peerDependenciesMeta: - srvx: - optional: true - - crossws@0.4.4: - resolution: {integrity: sha512-w6c4OdpRNnudVmcgr7brb/+/HmYjMQvYToO/oTrprTwxRUiom3LYWU1PMWuD006okbUWpII1Ea9/+kwpUfmyRg==} - peerDependencies: - srvx: '>=0.7.1' - peerDependenciesMeta: - srvx: - optional: true - - crossws@0.4.5: - resolution: {integrity: sha512-wUR89x/Rw7/8t+vn0CmGDYM9TD6VtARGb0LD5jq2wjtMy1vCP4M+sm6N6TigWeTYvnA8MoW29NqqXD0ep0rfBA==} + crossws@0.4.12: + resolution: {integrity: sha512-aypfsr6t0uNvkqaZc6zvBfXzC6pLI0/sIulpkV6RwCVtZqG5ebBzv4weImKK0VNCj91Wl9F5j7p5WU4MNrybng==} peerDependencies: srvx: '>=0.11.5' peerDependenciesMeta: @@ -23352,27 +23986,12 @@ packages: webpack: optional: true - css-loader@7.1.3: - resolution: {integrity: sha512-frbERmjT0UC5lMheWpJmMilnt9GEhbZJN/heUb7/zaJYeIzj5St9HvDcfshzzOqbsS+rYpMk++2SD3vGETDSyA==} - engines: {node: '>= 18.12.0'} - peerDependencies: - '@rspack/core': 0.x || 1.x - webpack: ^5.27.0 - peerDependenciesMeta: - '@rspack/core': - optional: true - webpack: - optional: true - css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} - css-select@6.0.0: - resolution: {integrity: sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==} - css-tree@2.2.1: resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} @@ -23385,10 +24004,6 @@ packages: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - css-what@7.0.0: - resolution: {integrity: sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==} - engines: {node: '>= 6'} - css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} @@ -23441,32 +24056,8 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} - date-format@4.0.14: - resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} - engines: {node: '>=4.0'} - - db0@0.3.4: - resolution: {integrity: sha512-RiXXi4WaNzPTHEOu8UPQKMooIbqOEyqA1t7Z6MsdxSCeb8iUC9ko3LcmsLmeUt2SM5bctfArZKkRQggKZz7JNw==} - peerDependencies: - '@electric-sql/pglite': '*' - '@libsql/client': '*' - better-sqlite3: '*' - drizzle-orm: '*' - mysql2: '*' - sqlite3: '*' - peerDependenciesMeta: - '@electric-sql/pglite': - optional: true - '@libsql/client': - optional: true - better-sqlite3: - optional: true - drizzle-orm: - optional: true - mysql2: - optional: true - sqlite3: - optional: true + db0@0.4.1: + resolution: {integrity: sha512-6RBY/bSn42UrqATwsiULj2uYFyEykB3XeA/NLIVQeHNXlYV6D4Idxx3/aa6k5Y45Dwzx7sygeLotnqHWSeURYA==} de-indent@1.0.2: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} @@ -23491,13 +24082,6 @@ packages: decache@4.6.2: resolution: {integrity: sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==} - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - - decimal.js@10.5.0: - resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} - decimal.js@10.6.0: resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} @@ -23509,8 +24093,8 @@ packages: babel-plugin-macros: optional: true - dedent@1.7.0: - resolution: {integrity: sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==} + dedent@1.7.2: + resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: @@ -23532,18 +24116,14 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - default-browser-id@5.0.0: - resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} engines: {node: '>=18'} default-browser@5.2.1: resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} engines: {node: '>=18'} - default-browser@5.5.0: - resolution: {integrity: sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==} - engines: {node: '>=18'} - defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -23551,10 +24131,6 @@ packages: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} - define-lazy-prop@2.0.0: - resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} - engines: {node: '>=8'} - define-lazy-prop@3.0.0: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} @@ -23566,6 +24142,9 @@ packages: defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + delay@5.0.0: resolution: {integrity: sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==} engines: {node: '>=10'} @@ -23614,10 +24193,6 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} - detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} - detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} @@ -23673,16 +24248,8 @@ packages: dexie@4.2.1: resolution: {integrity: sha512-Ckej0NS6jxQ4Po3OrSQBFddayRhTCic2DoCAG5zacOfOVB9P2Q5Xc5uL/nVa7ZVs+HdMnvUPzLFCB/JwpB6Csg==} - diff@4.0.4: - resolution: {integrity: sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==} - engines: {node: '>=0.3.1'} - - diff@5.2.2: - resolution: {integrity: sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==} - engines: {node: '>=0.3.1'} - - diff@8.0.2: - resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==} + diff@9.0.0: + resolution: {integrity: sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==} engines: {node: '>=0.3.1'} dir-glob@3.0.1: @@ -23722,12 +24289,6 @@ packages: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} - dominative@0.1.3: - resolution: {integrity: sha512-MGDB5HFb8u+pOanUMfz26yibMd0piiq0TDk1q4z7qJNGKQWMI1CKDaJh6H8dtLDBJoO1sjwC/5WPhBYHga27zQ==} - peerDependencies: - '@nativescript/core': '>=8.6.2' - undom-ng: ^1.1.2 - domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} @@ -23737,10 +24298,6 @@ packages: dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} - dot-prop@10.1.0: - resolution: {integrity: sha512-MVUtAugQMOff5RnBy2d9N31iG0lNwg1qAoAOn7pOK5wf94WIaE3My2p3uwTQuvS2AcqchkcR3bHByjaM0mmi7Q==} - engines: {node: '>=20'} - dot-prop@9.0.0: resolution: {integrity: sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ==} engines: {node: '>=18'} @@ -23761,10 +24318,6 @@ packages: resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==} engines: {node: '>=12'} - dotenv@17.4.2: - resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} - engines: {node: '>=12'} - dotenv@8.6.0: resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} engines: {node: '>=10'} @@ -23773,9 +24326,6 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - duplexer@0.1.2: - resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} - eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -23804,13 +24354,6 @@ packages: electron-to-chromium@1.5.90: resolution: {integrity: sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==} - email-validator@2.0.4: - resolution: {integrity: sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==} - engines: {node: '>4.0'} - - emoji-regex@10.6.0: - resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -23853,13 +24396,13 @@ packages: resolution: {integrity: sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==} engines: {node: '>=10.13.0'} - enhanced-resolve@5.20.1: - resolution: {integrity: sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==} + enhanced-resolve@5.21.6: + resolution: {integrity: sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==} engines: {node: '>=10.13.0'} - enquirer@2.3.6: - resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} - engines: {node: '>=8.6'} + enhanced-resolve@5.24.5: + resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} + engines: {node: '>=10.13.0'} enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} @@ -23876,10 +24419,6 @@ packages: resolution: {integrity: sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==} engines: {node: '>=0.12'} - entities@7.0.1: - resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} - engines: {node: '>=0.12'} - entities@8.0.0: resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==} engines: {node: '>=20.19.0'} @@ -23892,14 +24431,9 @@ packages: resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - env-runner@0.1.6: - resolution: {integrity: sha512-fSb7X1zdda8k6611a6/SdSQpDe7a/bqMz2UWdbHjk9YWzpUR4/fn9YtE/hqgGQ2nhvVN0zUtcL1SRMKwIsDbAA==} + env-runner@0.2.3: + resolution: {integrity: sha512-S8EFBKyznRwPVwayK187cYjvnpgC92xy+q0BIF++V965pfjMVVRbQ/HoTYGA/1EHmZ7E68k6Heq+4WnvVhOL5w==} hasBin: true - peerDependencies: - miniflare: ^4.0.0 - peerDependenciesMeta: - miniflare: - optional: true envinfo@7.14.0: resolution: {integrity: sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==} @@ -23910,13 +24444,6 @@ packages: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} - err-code@2.0.3: - resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} - - errno@0.1.8: - resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} - hasBin: true - error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -23940,12 +24467,14 @@ packages: es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} - es-module-lexer@2.0.0: - resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + es-module-lexer@2.3.2: + resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} - es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} - engines: {node: '>= 0.4'} + es-module-lexer@3.0.3: + resolution: {integrity: sha512-yWGe1O/j+almnV4hOYrmZo8u58JdnmXEMneRQAYkWtqSiT86yoMIEKF4rpqEDj52tbYl3xceBD3DQIBwcsC9Pw==} + + es-module-lexer@3.0.4: + resolution: {integrity: sha512-BldNY5mwkVu+cQ5Ymn3e6hB9Sx8XHx4ZevWbiUyZbfKxJxYO27Hf0wfzkxIaD5CAJMaGl3YspKELj0ff/7nCMA==} es-object-atoms@1.1.2: resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} @@ -23979,11 +24508,6 @@ packages: sass: optional: true - esbuild-wasm@0.28.1: - resolution: {integrity: sha512-p/GD4E8oYRjg3kjdKrnMb0s4PzXgJF42e0MF4H0+ACyK/kIlFRp3e0fzOleIG+wBBm6MM3XQrbpe7soEA+vJIA==} - engines: {node: '>=18'} - hasBin: true - esbuild@0.23.0: resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} engines: {node: '>=18'} @@ -24202,6 +24726,7 @@ packages: eslint@9.22.0: resolution: {integrity: sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true peerDependencies: jiti: '*' @@ -24259,9 +24784,6 @@ packages: eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} - eventemitter3@5.0.4: - resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} - events-universal@1.0.1: resolution: {integrity: sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==} @@ -24269,28 +24791,14 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - execa@1.0.0: - resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==} - engines: {node: '>=6'} - - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} - exif-parser@0.1.12: - resolution: {integrity: sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==} - - expect-type@1.3.0: - resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} engines: {node: '>=12.0.0'} - exponential-backoff@3.1.3: - resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==} - express@4.22.2: resolution: {integrity: sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==} engines: {node: '>= 0.10.0'} @@ -24299,20 +24807,15 @@ packages: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} - exsolve@1.0.7: - resolution: {integrity: sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==} + exsolve@1.1.1: + resolution: {integrity: sha512-9U/jZUgjnSGyntRr6y5Muu1MJcwFl6kPu7k8qLF0IMNfLqvw0NZ4nnVDq0RVoZ0RvCyumib4Ez3KYrVfilrw+g==} - exsolve@1.0.8: - resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} + exsolve@1.2.0: + resolution: {integrity: sha512-h1pQPR9XoeSMdntRNCjyTznaume4UpfXrULBnlkZ2CUM/G5eSa+pBByGldO5uR8dxbPC+OuJXsPPNf+JZ81ADg==} extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - extract-zip@2.0.1: - resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} - engines: {node: '>= 10.17.0'} - hasBin: true - fast-check@3.23.2: resolution: {integrity: sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==} engines: {node: '>=8.0.0'} @@ -24348,9 +24851,18 @@ packages: fast-sha256@1.3.0: resolution: {integrity: sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==} + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + fast-uri@3.0.6: resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} + fast-wrap-ansi@0.2.0: + resolution: {integrity: sha512-rLV8JHxTyhVmFYhBJuMujcrHqOT2cnO5Zxj37qROj23CP39GXubJRBUFF0z8KFK77Uc0SukZUf7JZhsVEQ6n8w==} + fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} @@ -24365,9 +24877,6 @@ packages: resolution: {integrity: sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==} engines: {node: '>=0.8.0'} - fd-slicer@1.1.0: - resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -24384,11 +24893,8 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} - fetchdts@0.1.7: - resolution: {integrity: sha512-YoZjBdafyLIop9lSxXVI33oLD5kN31q4Td+CasofLLYeLXRFeOsuOw0Uo+XNRi9PZlbfdlN2GmRtm4tCEQ9/KA==} - - fflate@0.8.2: - resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + fetchdts@0.2.0: + resolution: {integrity: sha512-PJb4ZTGT2/wK78RmVrxZITStWabhZlKBsL52VOgq+c7clEkdHdEB+0rtzrXCbZJqeYJj+IwNWYqB5/G6vouA6A==} fflate@0.8.3: resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} @@ -24405,10 +24911,6 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - file-type@16.5.4: - resolution: {integrity: sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==} - engines: {node: '>=10'} - file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} @@ -24447,10 +24949,6 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - find-up@6.3.0: - resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - find-up@7.0.0: resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} engines: {node: '>=18'} @@ -24469,6 +24967,9 @@ packages: flatted@3.4.2: resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} + flatted@3.4.4: + resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} + fn.name@1.1.0: resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} @@ -24481,10 +24982,6 @@ packages: debug: optional: true - font-finder@1.1.0: - resolution: {integrity: sha512-wpCL2uIbi6GurJbU7ZlQ3nGd61Ho+dSU6U83/xJT5UPFfN35EeCW/rOtS+5k+IuEZu2SYmHzDIPL9eA5tSYRAw==} - engines: {node: '>8.0.0'} - for-each@0.3.5: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} @@ -24493,14 +24990,14 @@ packages: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.1: - resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} - engines: {node: '>= 6'} - form-data@4.0.5: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + form-data@4.0.6: + resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==} + engines: {node: '>= 6'} + formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -24509,15 +25006,12 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} - fraction.js@5.3.4: - resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} - framer-motion@11.18.2: resolution: {integrity: sha512-5F5Och7wrvtLVElIpclDT0CBzMVg3dL22B64aZwHtsIY8RB4mXICLrkajK4G9R+ieSAGcgrLeae2SeUTg2pr6w==} peerDependencies: '@emotion/is-prop-valid': '*' - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@emotion/is-prop-valid': optional: true @@ -24545,19 +25039,6 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} - fs-extra@9.1.0: - resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} - engines: {node: '>=10'} - - fs-minipass@3.0.3: - resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -24584,10 +25065,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.6.0: - resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} - engines: {node: '>=18'} - get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -24610,32 +25087,13 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - get-stream@4.1.0: - resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} - engines: {node: '>=6'} - - get-stream@5.2.0: - resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} - engines: {node: '>=8'} - - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - get-system-fonts@2.0.2: - resolution: {integrity: sha512-zzlgaYnHMIEgHRrfC7x0Qp0Ylhw/sHpM6MHXeVBTYIsvGf5GpbnClB+Q6rAPdn+0gd2oZZIo6Tj3EaWrt4VhDQ==} - engines: {node: '>8.0.0'} - get-tsconfig@4.10.1: resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} - gifwrap@0.10.1: - resolution: {integrity: sha512-2760b1vpJHNmLzZ/ubTtNnEx5WApN/PYWJvXvgS+tL1egTTthayFYIQQNi136FLEDcN/IyEY2EcGpIITD6eYUw==} - giget@2.0.0: resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} hasBin: true @@ -24651,12 +25109,6 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob-to-regex.js@1.2.0: - resolution: {integrity: sha512-QMwlOQKU/IzqMUOAZWubUOT8Qft+Y0KQWnX9nK3ch0CJg0tTp4TvGZsTfudYKv2NzoQSyPcnA6TYeIQ3jGichQ==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} @@ -24693,10 +25145,6 @@ packages: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} - globby@16.1.0: - resolution: {integrity: sha512-+A4Hq7m7Ze592k9gZRy4gJ27DrXRNnC1vPjxTt1qQxEY8RxagBkBxivkCwg7FxSTG0iLLEMaUx13oOr0R2/qcQ==} - engines: {node: '>=20'} - globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -24717,10 +25165,6 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - gradle-to-js@2.0.1: - resolution: {integrity: sha512-is3hDn9zb8XXnjbEeAEIqxTpLHUiGBqjegLmXPuyMBfKAggpadWFku4/AP8iYAGBX6qR9/5UIUIp47V0XI3aMw==} - hasBin: true - grammex@3.1.11: resolution: {integrity: sha512-HNwLkgRg9SqTAd1N3Uh/MnKwTBTzwBxTOPbXQ8pb0tpwydjk90k4zRE8JUn9fMUiRwKtXFZ1TWFmms3dZHN+Fg==} @@ -24731,41 +25175,24 @@ packages: resolution: {integrity: sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - gzip-size@7.0.0: - resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + graphql@16.14.2: + resolution: {integrity: sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - h3@1.15.5: - resolution: {integrity: sha512-xEyq3rSl+dhGX2Lm0+eFQIAzlDN6Fs0EcC4f7BNUmzaRX/PTzeuM+Tr2lHB8FoXggsQIeXLj8EDVgs5ywxyxmg==} + h3@1.15.11: + resolution: {integrity: sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==} - h3@2.0.1-rc.14: - resolution: {integrity: sha512-163qbGmTr/9rqQRNuqMqtgXnOUAkE4KTdauiC9y0E5iG1I65kte9NyfWvZw5RTDMt6eY+DtyoNzrQ9wA2BfvGQ==} + h3@2.0.1-rc.32: + resolution: {integrity: sha512-Epg1E85L8yIKd9UeAQAVdm6QVrnHbppMsQ641EjpNi4c0IlAg+PJlwp4Xw03Z1loRXPQaH9k64gJT5qDELqm+g==} engines: {node: '>=20.11.1'} hasBin: true peerDependencies: - crossws: ^0.4.1 + crossws: ^0.4.12 + ocache: '>=0.3.0' peerDependenciesMeta: crossws: optional: true - - h3@2.0.1-rc.16: - resolution: {integrity: sha512-h+pjvyujdo9way8qj6FUbhaQcHlR8FEq65EhTX9ViT5pK8aLj68uFl4hBkF+hsTJAH+H1END2Yv6hTIsabGfag==} - engines: {node: '>=20.11.1'} - hasBin: true - peerDependencies: - crossws: ^0.4.1 - peerDependenciesMeta: - crossws: - optional: true - - h3@2.0.1-rc.20: - resolution: {integrity: sha512-28ljodXuUp0fZovdiSRq4G9OgrxCztrJe5VdYzXAB7ueRvI7pIUqLU14Xi3XqdYJ/khXjfpUOOD2EQa6CmBgsg==} - engines: {node: '>=20.11.1'} - hasBin: true - peerDependencies: - crossws: ^0.4.1 - peerDependenciesMeta: - crossws: + ocache: optional: true handle-thing@2.0.1: @@ -24778,10 +25205,6 @@ packages: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} engines: {node: '>= 0.4'} - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -24823,6 +25246,9 @@ packages: headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} + headers-polyfill@5.0.1: + resolution: {integrity: sha512-1TJ6Fih/b8h5TIcv+1+Hw0PDQWJTKDKzFZzcKOiW1wJza3XoAQlkCuXLbymPYB8+ZQyw8mHvdw560e8zVFIWyA==} + hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} @@ -24832,15 +25258,21 @@ packages: hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} + hono-sessions@0.8.1: + resolution: {integrity: sha512-YLSKuIP13yhXTQe2x3sCc1JWsqt1Z3WZB2DWE+oX+YpOsC3lv8uCHnCoNHcY9DPyflDw4XQJN+MFVvcp5QwWdw==} + peerDependencies: + hono: ^4.0.0 + + hono@4.13.9: + resolution: {integrity: sha512-7dMkQmZoC4E6F7AtaQSPhlWAdnBti+j7rreMZl8QB4jFiEhP9TWbGWUMi8WYzBCgmgulxuvLQupKqo+Co6Omyg==} + engines: {node: '>=16.9.0'} + hono@4.7.10: resolution: {integrity: sha512-QkACju9MiN59CKSY5JsGZCYmPZkA6sIW6OFCUp7qDjZu6S6KHtJHhAc9Uy9mV9F8PJ1/HQ3ybZF2yjCa/73fvQ==} engines: {node: '>=16.9.0'} - hookable@5.5.3: - resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} - - hookable@6.1.0: - resolution: {integrity: sha512-ZoKZSJgu8voGK2geJS+6YtYjvIzu9AOM/KZXsBxr83uhLL++e9pEv/dlgwgy3dvHg06kTz6JOh1hk3C8Ceiymw==} + hookable@6.1.2: + resolution: {integrity: sha512-+abwxtiEA52GCVIsQqut3S/uKTbUwYIp4Pe/vv+6py5XiXBCqMZHg6pA6Y5qhgLSEys0/cYuPbO0z1QFj5ZCmg==} hosted-git-info@7.0.2: resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} @@ -24888,18 +25320,12 @@ packages: webpack: optional: true - htmlparser2@10.1.0: - resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==} - htmlparser2@6.1.0: resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} htmlparser2@9.1.0: resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} - http-cache-semantics@4.2.0: - resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} - http-deceiver@1.2.7: resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} @@ -24935,10 +25361,6 @@ packages: resolution: {integrity: sha512-GLZZm1X38BPY4lkXA01jhwxvDoOkkXqjgVyUzVxiEK4iuRu03PZoYHhHRwxnfhQMDuaxi3vVri0YgSro/1oWqg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - http-proxy-middleware@3.0.7: - resolution: {integrity: sha512-iwbQltVlx8bCrqePUM8C+hllHvdawVhQJaLrj1X7qllkvFQdXFsr16pW/mo9+JDVjN+QO2XUx9jd8SmoFkE5qw==} - engines: {node: ^14.18.0 || ^16.10.0 || >=18.0.0} - http-proxy@1.18.1: resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} engines: {node: '>=8.0.0'} @@ -24958,20 +25380,13 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - httpxy@0.1.7: - resolution: {integrity: sha512-pXNx8gnANKAndgga5ahefxc++tJvNL87CXoRwxn1cJE2ZkWEojF3tNfQIEhZX/vfpt+wzeAzpUI4qkediX1MLQ==} - - httpxy@0.3.1: - resolution: {integrity: sha512-XjG/CEoofEisMrnFr0D6U6xOZ4mRfnwcYQ9qvvnT4lvnX8BoeA3x3WofB75D+vZwpaobFVkBIHrZzoK40w8XSw==} + httpxy@0.5.5: + resolution: {integrity: sha512-uDjmnPyp1q4Sgzf3w+J/Fc6UqcCEj0x4Wjp7OqK5dGhNeDgpyrAmnS6ey8QWrX3SWDon2DMKf9sBa5X9+CVyMA==} human-id@4.1.1: resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==} hasBin: true - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} @@ -24995,10 +25410,6 @@ packages: resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} engines: {node: '>=0.10.0'} - iconv-lite@0.7.3: - resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} - engines: {node: '>=0.10.0'} - icss-utils@5.1.0: resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} engines: {node: ^10 || ^12 || >= 14} @@ -25011,14 +25422,14 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore-walk@8.0.0: - resolution: {integrity: sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==} - engines: {node: ^20.17.0 || >=22.9.0} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} + ignore@7.0.12: + resolution: {integrity: sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==} + engines: {node: '>= 4'} + ignore@7.0.5: resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} @@ -25026,29 +25437,23 @@ packages: image-meta@0.2.2: resolution: {integrity: sha512-3MOLanc3sb3LNGWQl1RlQlNWURE5g32aUphrDyFeCsxBTk08iE3VNe4CwsUZ0Qs1X+EfX0+r29Sxdpza4B+yRA==} - image-q@4.0.0: - resolution: {integrity: sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==} - - image-size@0.5.5: - resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} - engines: {node: '>=0.10.0'} - hasBin: true - - image-size@2.0.2: - resolution: {integrity: sha512-IRqXKlaXwgSMAMtpNzZa1ZAe8m+Sa1770Dhk8VkSsP9LS+iHD62Zd8FQKs8fbPiagBE7BzoFX23cxFnwshpV6w==} - engines: {node: '>=16.x'} - hasBin: true - immer@10.1.1: resolution: {integrity: sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==} immutable@5.1.4: resolution: {integrity: sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==} + immutable@5.1.9: + resolution: {integrity: sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==} + import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import-in-the-middle@3.5.1: + resolution: {integrity: sha512-mPKuL8bPQzecui2KK6Gb+M8JvJoHnhS1FeYGa22QopBmlevF5F0FE6ued/B5EgHDeIoMTONIpDWWFKUPOG0DBQ==} + engines: {node: '>=18'} + import-lazy@4.0.0: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} engines: {node: '>=8'} @@ -25083,14 +25488,6 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - ini@2.0.0: - resolution: {integrity: sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==} - engines: {node: '>=10'} - - ini@6.0.0: - resolution: {integrity: sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==} - engines: {node: ^20.17.0 || >=22.9.0} - inline-style-parser@0.2.4: resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} @@ -25098,34 +25495,14 @@ packages: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - interpret@1.4.0: - resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} - engines: {node: '>= 0.10'} - interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} - ioredis@5.9.2: - resolution: {integrity: sha512-tAAg/72/VxOUW7RQSX1pIxJVucYKcjFjfvj60L57jrZpYCHC3XN0WCQ3sNYL4Gmvv+7GPvTAjc+KSdeNuE8oWQ==} + ioredis@5.11.1: + resolution: {integrity: sha512-ehuGcf94bQXhfagULNXrJdfnWO38v070jxSx/qE87Kjzmu2fU7ro5EFAb+OPituLqgfyuQaym5DlrNydW2sJ9A==} engines: {node: '>=12.22.0'} - ios-device-lib@0.9.4: - resolution: {integrity: sha512-UoR3+JZ4Ox9xSbp4sM6kMQu7JL5RLqgSS4gLy39hAYYtZqMpNB/u47uN63ZEq/RhqtrNFub/w7t3QicLLQ9bvg==} - - ios-mobileprovision-finder@1.2.1: - resolution: {integrity: sha512-9g1AJFRjWdCVdNKn7FpGv/t3EK5wFqP6EEhFVdUk7Pr8n4cVkFGyKa+l/XQdfjVUN5PnLHj5MY3x31Q3X8r80g==} - hasBin: true - - ios-sim-portable@4.5.1: - resolution: {integrity: sha512-g7qWaHXiFw7MuMrbwSQjeBpPl5zoHyhA6xArT2yhYg3U+WsoEy6d7x1Mgf6J77B+tvBJDWMjf2fjpuRBbQZggA==} - engines: {node: '>=6.0.0'} - hasBin: true - - ip-address@10.2.0: - resolution: {integrity: sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==} - engines: {node: '>= 12'} - ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -25138,6 +25515,10 @@ packages: resolution: {integrity: sha512-7Xnt54Dco7uYkfdAw0r2vCly3z0rSaVhEXMzPvl3FndsTVm5p26j+PO+gyinkYmcsEUvX2Rh7OGK7KzYWRu6BA==} hasBin: true + iron-session@9.0.1: + resolution: {integrity: sha512-ELSZdcLvA0AMhxUCY+rwKCh42UV88SqEb1ia/bHLF9G+6kScikO6mShtlIq+OtF2UlkZP0dmI2dMdG9vh4rebA==} + engines: {node: '>=22.13.0'} + iron-webcrypto@1.2.1: resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} @@ -25155,9 +25536,6 @@ packages: is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-arrayish@0.3.4: - resolution: {integrity: sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==} - is-bigint@1.1.0: resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} engines: {node: '>= 0.4'} @@ -25182,11 +25560,6 @@ packages: resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} - is-docker@2.2.1: - resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} - engines: {node: '>=8'} - hasBin: true - is-docker@3.0.0: resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -25200,10 +25573,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@5.1.0: - resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} - engines: {node: '>=18'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -25218,10 +25587,6 @@ packages: eslint: ^9.22.0 typescript: '>=4.7.4' - is-in-ssh@1.0.0: - resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} - engines: {node: '>=20'} - is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -25231,17 +25596,10 @@ packages: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} - is-interactive@2.0.0: - resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} - engines: {node: '>=12'} - is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} - is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - is-network-error@1.1.0: resolution: {integrity: sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==} engines: {node: '>=16'} @@ -25290,12 +25648,6 @@ packages: is-property@1.0.2: resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} - - is-reference@3.0.3: - resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} - is-regex@1.2.1: resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} @@ -25308,10 +25660,6 @@ packages: resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} engines: {node: '>= 0.4'} - is-stream@1.1.0: - resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} - engines: {node: '>=0.10.0'} - is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -25359,9 +25707,6 @@ packages: resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} engines: {node: '>= 0.4'} - is-what@3.14.1: - resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==} - is-what@4.1.16: resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} @@ -25370,18 +25715,10 @@ packages: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - is-wsl@2.2.0: - resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} - engines: {node: '>=8'} - - is-wsl@3.1.1: - resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + is-wsl@3.1.0: + resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} engines: {node: '>=16'} - is64bit@2.0.0: - resolution: {integrity: sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==} - engines: {node: '>=18'} - isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} @@ -25395,22 +25732,10 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isexe@4.0.0: - resolution: {integrity: sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==} - engines: {node: '>=20'} - isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} - - istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} - engines: {node: '>=10'} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -25418,10 +25743,6 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} - jimp@1.6.0: - resolution: {integrity: sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg==} - engines: {node: '>=18'} - jiti@2.6.1: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true @@ -25433,19 +25754,12 @@ packages: jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - joi@18.2.3: - resolution: {integrity: sha512-N5A3KTWQpPWT4ExxxPlUx7WmykGXRzhNidWhV41d6Abu9YfI2NyWCJuxdPnslJCPWtbRpSVOWSnSS6GakLM/Rg==} - engines: {node: '>= 20'} - jose@6.1.0: resolution: {integrity: sha512-TTQJyoEoKcC1lscpVDCSsVgYzUDg/0Bt3WE//WiTPK6uOCQC2KZS4MpugbMWt/zyjkopgZoXhZuCi00gLudfUA==} jose@6.1.3: resolution: {integrity: sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==} - jpeg-js@0.4.4: - resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==} - js-base64@3.7.8: resolution: {integrity: sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==} @@ -25458,18 +25772,15 @@ packages: resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} engines: {node: '>=14'} - js-image-generator@1.0.4: - resolution: {integrity: sha512-ckb7kyVojGAnArouVR+5lBIuwU1fcrn7E/YYSd0FK7oIngAkMmRvHASLro9Zt5SQdWToaI66NybG+OGxPw/HlQ==} - js-sha256@0.11.1: resolution: {integrity: sha512-o6WSo/LUvY2uC4j7mO50a2ms7E/EAdbP0swigLV+nzHKTTaYnaLIWJ02VdXrsJX0vGedDESQnLsOekr94ryfjg==} + js-tokens@10.0.0: + resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-tokens@9.0.1: - resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -25520,10 +25831,6 @@ packages: json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-parse-even-better-errors@5.0.0: - resolution: {integrity: sha512-ZF1nxZ28VhQouRWhUcVlUIN3qwSgPuswK05s/HIaoetAoE/9tngVmCHjSxmSQPav1nd+lPtTL0YZ/2AFdR/iYQ==} - engines: {node: ^20.17.0 || >=22.9.0} - json-schema-ref-resolver@3.0.0: resolution: {integrity: sha512-hOrZIVL5jyYFjzk7+y7n5JDzGlU8rfWDuYyHwGa2WA8/pcmMHezp2xsVwxrebD/Q9t8Nc5DboieySDpCp4WG4A==} @@ -25536,53 +25843,34 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - json-stringify-nice@1.1.4: - resolution: {integrity: sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==} - json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true - jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - jsonfile@6.2.1: - resolution: {integrity: sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==} - - jsonparse@1.3.1: - resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} - jsonpointer@5.0.1: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} - jsonwebtoken@9.0.2: - resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} + jsonwebtoken@9.0.3: + resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} engines: {node: '>=12', npm: '>=6'} junk@4.0.1: resolution: {integrity: sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==} engines: {node: '>=12.20'} - just-diff-apply@5.5.0: - resolution: {integrity: sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==} + jwa@2.0.1: + resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} - just-diff@6.0.2: - resolution: {integrity: sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==} - - jwa@1.4.2: - resolution: {integrity: sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==} - - jws@3.2.2: - resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} + jws@4.0.1: + resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} jwt-decode@3.1.2: resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==} @@ -25591,9 +25879,6 @@ packages: resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==} engines: {node: '>=18'} - karma-source-map-support@1.4.0: - resolution: {integrity: sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==} - kebab-case@1.0.2: resolution: {integrity: sha512-7n6wXq4gNgBELfDCpzKc+mRrZFs7D+wgfF5WRFLNAr4DA/qtr9Js8uOAVAfHhuLMfAcQ0pRKqbpjx+TcJVdE1Q==} @@ -25604,21 +25889,10 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} - kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - klona@2.0.6: - resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} - engines: {node: '>= 8'} - - knitwork@1.3.0: - resolution: {integrity: sha512-4LqMNoONzR43B1W0ek0fhXMsDNW/zxa1NdFAVMY+k28pgZLovR4G3PB5MrpTxCy1QaZCqNoiaKPr5w5qZHfSNw==} - known-css-properties@0.30.0: resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} @@ -25652,24 +25926,6 @@ packages: resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} engines: {node: '>= 0.6.3'} - less-loader@12.3.1: - resolution: {integrity: sha512-JZZmG7gMzoDP3VGeEG8Sh6FW5wygB5jYL7Wp29FFihuRTsIBacqO3LbRPr2yStYD11riVf13selLm/CPFRDBRQ==} - engines: {node: '>= 18.12.0'} - peerDependencies: - '@rspack/core': 0.x || ^1.0.0 || ^2.0.0-0 - less: ^3.5.0 || ^4.0.0 - webpack: ^5.0.0 - peerDependenciesMeta: - '@rspack/core': - optional: true - webpack: - optional: true - - less@4.4.2: - resolution: {integrity: sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==} - engines: {node: '>=14'} - hasBin: true - leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -25688,14 +25944,6 @@ packages: cpu: [x64, arm64, wasm32, arm] os: [darwin, linux, win32] - license-webpack-plugin@4.0.2: - resolution: {integrity: sha512-771TFWFD70G1wLTC4oU2Cw4qvtmNrIw+wRvBtn+okgHl7slJVi7zfNcdmqDL72BojM30VNJ2UHylr1o77U37Jw==} - peerDependencies: - webpack: '*' - peerDependenciesMeta: - webpack: - optional: true - light-my-request@6.6.0: resolution: {integrity: sha512-CHYbu8RtboSIoVsHZ6Ye4cj4Aw/yg2oAFimlF7mNvfDV192LR7nDiKtSIfCuLT7KokPSTn/9kfVLm5OGN0A28A==} @@ -25705,30 +25953,60 @@ packages: cpu: [arm64] os: [android] + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + lightningcss-darwin-arm64@1.32.0: resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + lightningcss-darwin-x64@1.32.0: resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + lightningcss-freebsd-x64@1.32.0: resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + lightningcss-linux-arm-gnueabihf@1.32.0: resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + lightningcss-linux-arm64-gnu@1.32.0: resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} engines: {node: '>= 12.0.0'} @@ -25736,6 +26014,13 @@ packages: os: [linux] libc: [glibc] + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} @@ -25743,6 +26028,13 @@ packages: os: [linux] libc: [musl] + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} @@ -25750,6 +26042,13 @@ packages: os: [linux] libc: [glibc] + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} @@ -25757,22 +26056,45 @@ packages: os: [linux] libc: [musl] + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + lightningcss-win32-x64-msvc@1.32.0: resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + lightningcss@1.32.0: resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -25784,42 +26106,27 @@ packages: resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - listhen@1.9.0: - resolution: {integrity: sha512-I8oW2+QL5KJo8zXNWX046M134WchxsXC7SawLPvRQpogCbkyQIaFxPE89A2HiwR7vAK2Dm2ERBAmyjTYGYEpBg==} - hasBin: true - - listr2@9.0.5: - resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} - engines: {node: '>=20.0.0'} - - lmdb@3.5.1: - resolution: {integrity: sha512-NYHA0MRPjvNX+vSw8Xxg6FLKxzAG+e7Pt8RqAQA/EehzHVXq9SxDqJIN3JL1hK0dweb884y8kIh6rkWvPyg9Wg==} + listhen@1.10.1: + resolution: {integrity: sha512-6nt/86SkqUQSLW1ofz8MxC6RhRMqOl3ONISe6qqvJ3xj09aJWQx6DhgSZpugs3PX4PXdOas/WD6A9jx6J2N19A==} hasBin: true + peerDependencies: + '@parcel/watcher': ^2.5.6 + peerDependenciesMeta: + '@parcel/watcher': + optional: true loader-runner@4.3.0: resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} engines: {node: '>=6.11.5'} - loader-runner@4.3.1: - resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} - engines: {node: '>=6.11.5'} - loader-utils@2.0.4: resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} engines: {node: '>=8.9.0'} - loader-utils@3.3.1: - resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} - engines: {node: '>= 12.13.0'} - local-pkg@0.5.1: resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} - local-pkg@1.1.2: - resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==} - engines: {node: '>=14'} - locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -25841,21 +26148,12 @@ packages: lodash.clonedeep@4.5.0: resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} - lodash.debounce@4.0.8: - resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} - - lodash.defaults@4.2.0: - resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} - lodash.flatten@4.4.0: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} lodash.includes@4.3.0: resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} - lodash.isarguments@3.1.0: - resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} - lodash.isboolean@3.0.3: resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} @@ -25883,28 +26181,10 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - lodash@4.17.23: - resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==} - - lodash@4.18.1: - resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} - log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} - log-symbols@7.0.1: - resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} - engines: {node: '>=18'} - - log-update@6.1.0: - resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} - engines: {node: '>=18'} - - log4js@6.9.1: - resolution: {integrity: sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==} - engines: {node: '>=8.0'} - logform@2.7.0: resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} engines: {node: '>= 12.0.0'} @@ -25922,10 +26202,6 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.2.2: - resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} - engines: {node: 20 || >=22} - lru-cache@11.5.1: resolution: {integrity: sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==} engines: {node: 20 || >=22} @@ -25960,19 +26236,11 @@ packages: resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} engines: {node: '>=12'} - magicast@0.5.1: - resolution: {integrity: sha512-xrHS24IxaLrvuo613F719wvOIv9xPHFWQHuvGUBmPnCA/3MQxKI3b+r7n1jAoDHmsbC5bRhTZYR77invLAxVnw==} + magic-string@1.4.3: + resolution: {integrity: sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==} - make-dir@2.1.0: - resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} - engines: {node: '>=6'} - - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - - make-fetch-happen@15.0.6: - resolution: {integrity: sha512-Je0fLJ0F5atA7F+eIlLzk+Wkcl57JDf4kf+EW8xiP5E31xOQxkIxTbgf1Oi1Lw9tRI9UEMRdI5Vz2xTzoNU1Jw==} - engines: {node: ^20.17.0 || >=22.9.0} + magic-string@1.4.5: + resolution: {integrity: sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==} manage-path@2.0.0: resolution: {integrity: sha512-NJhyB+PJYTpxhxZJ3lecIGgh4kwIY2RAh44XvAz9UlqthlQwtPBf62uBVR8XaD8CRuSjQ6TnZH2lNJkbLPZM2A==} @@ -25990,11 +26258,6 @@ packages: peerDependencies: marked: '>=1 <16' - marked@15.0.12: - resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==} - engines: {node: '>= 18'} - hasBin: true - marked@17.0.1: resolution: {integrity: sha512-boeBdiS0ghpWcSwoNm/jJBwdpFaMnZWRzjA6SkUMYb40SVaN1x7mmfGKp0jvexGcx+7y2La5zRZsYFZI6Qpypg==} engines: {node: '>= 20'} @@ -26027,11 +26290,6 @@ packages: resolution: {integrity: sha512-4eirfZ7thblFmqFjywlTmuWVSvccHAJbn1r8qQLzmTO11qcqpohOjmY2mFce6x7x7WtskzRqApPD0hv+Oa74jg==} engines: {node: '>= 4.0.0'} - memfs@4.64.0: - resolution: {integrity: sha512-Kw72fgY7Wn+sD8KmtNWSafl1dz0UvAsE/PHs3YVfLiaZuA3HxNm9sRLqAu0ATiBGJvME1PxZXbBZPv5GycDeAw==} - peerDependencies: - tslib: '2' - merge-anything@5.1.7: resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==} engines: {node: '>=12.13'} @@ -26087,16 +26345,6 @@ packages: engines: {node: '>=4'} hasBin: true - mime@3.0.0: - resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} - engines: {node: '>=10.0.0'} - hasBin: true - - mime@4.1.0: - resolution: {integrity: sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==} - engines: {node: '>=16'} - hasBin: true - mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -26105,49 +26353,32 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - mini-css-extract-plugin@2.10.0: - resolution: {integrity: sha512-540P2c5dYnJlyJxTaSloliZexv8rji6rY8FhQN+WF/82iHQfA23j/xtJx97L+mXOML27EqksSek/g4eK7jaL3g==} - engines: {node: '>= 12.13.0'} - peerDependencies: - webpack: ^5.0.0 - miniflare@4.20260317.0: resolution: {integrity: sha512-xuwk5Kjv+shi5iUBAdCrRl9IaWSGnTU8WuTQzsUS2GlSDIMCJuu8DiF/d9ExjMXYiQG5ml+k9SVKnMj8cRkq0w==} engines: {node: '>=18.0.0'} hasBin: true + miniflare@5.20261104.0-beta: + resolution: {integrity: sha512-pYZ2n85+FYUb7s0oIVcQxO63/+wgaknm+A/kQjctJqshvHPJs3UtnzaIZ7xrrHMOk8atD7yAfauf6G9VAv7Upg==} + engines: {node: '>=22.0.0'} + minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - minimatch@10.2.4: - resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} - engines: {node: 18 || 20 || >=22} - minimatch@10.2.5: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} - minimatch@3.0.5: - resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==} - minimatch@3.0.8: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@5.1.9: - resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} - engines: {node: '>=10'} - minimatch@9.0.1: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} engines: {node: '>=16 || 14 >=14.17'} @@ -26159,29 +26390,60 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minipass-collect@2.0.1: - resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} - engines: {node: '>=16 || 14 >=14.17'} - - minipass-fetch@5.0.2: - resolution: {integrity: sha512-2d0q2a8eCi2IRg/IGubCNRJoYbA1+YPXAzQVRFmB45gdGZafyivnZ5YSEfo3JikbjGxOdntGFvBQGqaSMXlAFQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - minipass-flush@1.0.7: - resolution: {integrity: sha512-TbqTz9cUwWyHS2Dy89P3ocAGUGxKjjLuR9z8w4WUTGAVgEj17/4nhgo2Du56i0Fm3Pm30g4iA8Lcqctc76jCzA==} - engines: {node: '>= 8'} - - minipass-pipeline@1.2.4: - resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} - engines: {node: '>=8'} - - minipass-sized@2.0.0: - resolution: {integrity: sha512-zSsHhto5BcUVM2m1LurnXY6M//cGhVaegT71OfOXoprxT6o780GZd792ea6FfrQkuU4usHZIUczAQMRUE2plzA==} - engines: {node: '>=8'} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} + minimizer-webpack-plugin@5.10.0: + resolution: {integrity: sha512-2//60T4S0X1Ug/dqLDOgDaGlZsN1Lv8hf8oB0NOV/KIHSaXlPwXBBIbim79dE2Z7NEs52ES8YHoSv6Lmsk+XNg==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@minify-html/node': '*' + '@napi-rs/image': '*' + '@swc/core': '*' + '@swc/css': '*' + '@swc/html': '*' + clean-css: '*' + cssnano: '*' + csso: '*' + esbuild: '*' + html-minifier-terser: '*' + imagemin: '*' + lightningcss: '*' + postcss: '*' + sharp: '*' + svgo: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@minify-html/node': + optional: true + '@napi-rs/image': + optional: true + '@swc/core': + optional: true + '@swc/css': + optional: true + '@swc/html': + optional: true + clean-css: + optional: true + cssnano: + optional: true + csso: + optional: true + esbuild: + optional: true + html-minifier-terser: + optional: true + imagemin: + optional: true + lightningcss: + optional: true + postcss: + optional: true + sharp: + optional: true + svgo: + optional: true + uglify-js: + optional: true minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} @@ -26208,6 +26470,9 @@ packages: engines: {node: '>=18'} hasBin: true + module-details-from-path@1.0.4: + resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==} + motion-dom@11.18.1: resolution: {integrity: sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw==} @@ -26222,22 +26487,21 @@ packages: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} - mrmime@2.0.1: - resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} - engines: {node: '>=10'} - ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msgpackr-extract@3.0.4: - resolution: {integrity: sha512-4kmO/MdyUIkLIvTPr8VHLil4AtoKIoniWPIEk5+CDy0xnWC84azhSFmuJ7PxZdsYtiP5kEeQsORAVIeMgxT+Hw==} + msw@2.15.0: + resolution: {integrity: sha512-2wQAmKkQKxRuXvYJxVhPGG0wZNBQyD06oJvxqw90XqLvptdqxdlHrFUfEteKkpaNORX3Xzc+HtEl/q0nfmN2wQ==} + engines: {node: '>=18'} hasBin: true - - msgpackr@1.12.1: - resolution: {integrity: sha512-4EUH9tQHnMmEgzW/MdAP0KIfa1T9AF+htl0ffe2n5vb2EKn9y2co8ccpgWko6S52Jy1PQZKwRnx5/KkYjtd9MQ==} + peerDependencies: + typescript: '>= 4.8.x' + peerDependenciesMeta: + typescript: + optional: true msw@2.7.0: resolution: {integrity: sha512-BIodwZ19RWfCbYTxWTUfTXc+sg4OwjCAgxU1ZsgmggX/7S3LdUifsbUPJs61j0rWb19CZRGY5if77duhc0uXzw==} @@ -26260,6 +26524,10 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} + mute-stream@3.0.0: + resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==} + engines: {node: ^20.17.0 || >=22.9.0} + mysql2@3.15.3: resolution: {integrity: sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==} engines: {node: '>= 8.0'} @@ -26276,8 +26544,13 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@3.3.12: - resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} + nanoid@3.3.18: + resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + nanoid@3.3.19: + resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -26290,23 +26563,9 @@ packages: engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} hasBin: true - nativescript-dev-xcode@0.8.1: - resolution: {integrity: sha512-AIHoah4ZEo8CUC6xb7CX0dWTKHcsoO4DL+nYVwIESVd2XQspE1pzSRMmar9/maz4rxbPeFFTEN7eknqn69+aVg==} - engines: {node: '>=14.0.0'} - - nativescript@9.0.6: - resolution: {integrity: sha512-l0FoivFzHhQlivOWb7YdRjgNAHDCriYnsVxwsyg3EKc0AKp2L8vwdJgcFF2LXbmlp5/amJeDnThc2iVSihNCmg==} - engines: {node: '>=20.0.0'} - hasBin: true - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - needle@3.5.0: - resolution: {integrity: sha512-jaQyPKKk2YokHrEg+vFDYxXIHTCBgiZwSHOoVx/8V3GIBS8/VN6NdVRmg8q1ERtPkMvmOvebsgga4sAj5hls/w==} - engines: {node: '>= 4.4.x'} - hasBin: true - negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} @@ -26325,78 +26584,38 @@ packages: netlify-redirector@0.5.0: resolution: {integrity: sha512-4zdzIP+6muqPCuE8avnrgDJ6KW/2+UpHTRcTbMXCIRxiRmyrX+IZ4WSJGZdHPWF3WmQpXpy603XxecZ9iygN7w==} - nf3@0.3.11: - resolution: {integrity: sha512-ObKp/SA3f1g1f/OMeDlRWaZmqGgk7A0NnDIbeO7c/MV4r/quMlpP/BsqMGuTi3lUlXbC1On8YH7ICM2u2bIAOw==} - - nf3@0.3.6: - resolution: {integrity: sha512-/XRUUILTAyuy1XunyVQuqGp8aEmZ2TfRTn8Rji+FA4xqv20qzL4jV7Reqbuey2XucKgPeRVcEYGScmJM0UnB6Q==} - - nice-try@1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - - nitro@3.0.1-alpha.2: - resolution: {integrity: sha512-YviDY5J/trS821qQ1fpJtpXWIdPYiOizC/meHavlm1Hfuhx//H+Egd1+4C5SegJRgtWMnRPW9n//6Woaw81cTQ==} - engines: {node: ^20.19.0 || >=22.12.0} + next@16.3.4: + resolution: {integrity: sha512-/Ztf6CeRH+ejEXUrYtqI4gkS66eFIHuSwqi60RgcpWKodxFZx2/dqVCMKBwILfAHXQ+F1b1vAudgj3mnxqtoIA==} + engines: {node: '>=20.9.0'} hasBin: true peerDependencies: - rolldown: '>=1.0.0-beta.0' - rollup: ^4 - vite: ^8.0.14 - xml2js: ^0.6.2 + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.63.0 + babel-plugin-react-compiler: '*' + react: ~19.2.9 + react-dom: ~19.2.9 + sass: ^1.3.0 peerDependenciesMeta: - rolldown: + '@opentelemetry/api': optional: true - rollup: + '@playwright/test': optional: true - vite: + babel-plugin-react-compiler: optional: true - xml2js: + sass: optional: true - nitro@3.0.260311-beta: - resolution: {integrity: sha512-0o0fJ9LUh4WKUqJNX012jyieUOtMCnadkNDWr0mHzdraoHpJP/1CGNefjRyZyMXSpoJfwoWdNEZu2iGf35TUvQ==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - dotenv: '*' - giget: '*' - jiti: ^2.6.1 - rollup: ^4.59.0 - vite: ^8.0.14 - xml2js: ^0.6.2 - zephyr-agent: ^0.1.15 - peerDependenciesMeta: - dotenv: - optional: true - giget: - optional: true - jiti: - optional: true - rollup: - optional: true - vite: - optional: true - xml2js: - optional: true - zephyr-agent: - optional: true + nf3@0.3.24: + resolution: {integrity: sha512-HxLK4bo+5jNsEETZp4w3tJblHOA9MCBY14IN9nZJJV8JDxt9yNIYxuBuLMjTAR5GFa3HL61+8VQDUrXv3/C8fw==} - nitropack@2.13.1: - resolution: {integrity: sha512-2dDj89C4wC2uzG7guF3CnyG+zwkZosPEp7FFBGHB3AJo11AywOolWhyQJFHDzve8COvGxJaqscye9wW2IrUsNw==} + nitro@3.0.260903-beta: + resolution: {integrity: sha512-54gANPi62O8rfMvepiJUVuIzEIinYfpeHbebywlLxvVTgIYXDwSvpaU9Id+0sJOBjBx0wC1/CVYXJkH7SY+l0g==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - peerDependencies: - xml2js: ^0.6.2 - peerDependenciesMeta: - xml2js: - optional: true no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - node-addon-api@6.1.0: - resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} - node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} @@ -26429,9 +26648,9 @@ packages: resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} engines: {node: '>= 6.13.0'} - node-gyp-build-optional-packages@5.2.2: - resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} - hasBin: true + node-forge@1.4.0: + resolution: {integrity: sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==} + engines: {node: '>= 6.13.0'} node-gyp-build@3.9.0: resolution: {integrity: sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==} @@ -26441,11 +26660,6 @@ packages: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-gyp@12.4.0: - resolution: {integrity: sha512-OMcPNvqTCFUnNaBlmdgq+lfNqY7gTiSmNRDjY3uAXRyudeKZEZxu3CLtjMQrx4zZxCX2b/mpNqTtwuCJgXhHkw==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - node-mock-http@1.0.4: resolution: {integrity: sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==} @@ -26473,15 +26687,14 @@ packages: engines: {node: ^18.17.0 || >=20.5.0} hasBin: true - nopt@9.0.0: - resolution: {integrity: sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - normalize-package-data@6.0.2: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} + normalize-package-data@8.0.0: + resolution: {integrity: sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==} + engines: {node: ^20.17.0 || >=22.9.0} + normalize-path@2.1.1: resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} engines: {node: '>=0.10.0'} @@ -26490,38 +26703,6 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - npm-bundled@5.0.0: - resolution: {integrity: sha512-JLSpbzh6UUXIEoqPsYBvVNVmyrjVZ1fzEFbqxKkTJQkWBO3xFzFT+KDnSKQWwOQNbuWRwt5LSD6HOTLGIWzfrw==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-install-checks@8.0.0: - resolution: {integrity: sha512-ScAUdMpyzkbpxoNekQ3tNRdFI8SJ86wgKZSQZdUxT+bj0wVFpsEMWnkXP0twVe1gJyNF5apBWDJhhIbgrIViRA==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-normalize-package-bin@5.0.0: - resolution: {integrity: sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-package-arg@13.0.2: - resolution: {integrity: sha512-IciCE3SY3uE84Ld8WZU23gAPPV9rIYod4F+rc+vJ7h7cwAJt9Vk6TVsK60ry7Uj3SRS3bqRRIGuTp9YVlk6WNA==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-packlist@10.0.4: - resolution: {integrity: sha512-uMW73iajD8hiH4ZBxEV3HC+eTnppIqwakjOYuvgddnalIw2lJguKviK1pcUJDlIWm1wSJkchpDZDSVVsZEYRng==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-pick-manifest@11.0.3: - resolution: {integrity: sha512-buzyCfeoGY/PxKqmBqn1IUJrZnUi1VVJTdSSRPGI60tJdUhUoSQFhs0zycJokDdOznQentgrpf8LayEHyyYlqQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-registry-fetch@19.1.1: - resolution: {integrity: sha512-TakBap6OM1w0H73VZVDf44iFXsOS3h+L4wVMXmbWOQroZgFhMch0juN6XSzBNlD965yIKvWg2dfu7NSiaYLxtw==} - engines: {node: ^20.17.0 || >=22.9.0} - - npm-run-path@2.0.2: - resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} - engines: {node: '>=4'} - npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -26536,8 +26717,8 @@ packages: nwsapi@2.2.16: resolution: {integrity: sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==} - nx@22.7.5: - resolution: {integrity: sha512-zoxsJabb33jl1QYnalDn0bicryrEBgSzdKp90d7VGGv/jDgzKrcLg/hw2ZxeYiOjWPIT/o8QNT9G9vTs4dv3AQ==} + nx@24.0.0: + resolution: {integrity: sha512-LchM3SyEUYL6qjHUneiSuyYlUscv8t6qpAYWUqnUY5OoSQSLIOLT/xrerLCKUTTcu7Yq1o/TDo9TiwhaBLvM4Q==} hasBin: true peerDependencies: '@swc-node/register': ^1.11.1 @@ -26582,24 +26763,19 @@ packages: obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} - ocache@0.1.2: - resolution: {integrity: sha512-lI34wjM7cahEdrq2I5obbF7MEdE97vULf6vNj6ZCzwEadzyXO1w7QOl2qzzG4IL8cyO7wDtXPj9CqW/aG3mn7g==} + obug@3.0.0: + resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==} + engines: {node: '>=12.20.0'} + + ocache@0.3.0: + resolution: {integrity: sha512-RS/9P0zeBb0gDJmadGERLH8lZNXK7xbufTDhclkXGvFGTsj0G4M5/cLk+mizcERH29mLXNnocfB5wjcK70wGJg==} ofetch@1.5.1: resolution: {integrity: sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA==} - ofetch@2.0.0-alpha.3: - resolution: {integrity: sha512-zpYTCs2byOuft65vI3z43Dd6iSdFbOZZLb9/d21aCpx2rGastVU9dOCv0lu4ykc1Ur1anAYjDi3SUvR0vq50JA==} - ohash@2.0.11: resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} - omggif@1.0.10: - resolution: {integrity: sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==} - - omit.js@2.0.2: - resolution: {integrity: sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==} - on-exit-leak-free@2.1.2: resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} engines: {node: '>=14.0.0'} @@ -26634,62 +26810,27 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} - open@10.1.0: resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} engines: {node: '>=18'} - open@11.0.0: - resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==} - engines: {node: '>=20'} - - open@8.4.2: - resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} - engines: {node: '>=12'} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - ora@5.3.0: - resolution: {integrity: sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==} - engines: {node: '>=10'} - ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} - ora@9.3.0: - resolution: {integrity: sha512-lBX72MWFduWEf7v7uWf5DHp9Jn5BI8bNPGuFgtXMmr2uDz2Gz2749y3am3agSDdkhHPHYmmxEGSKH85ZLGzgXw==} - engines: {node: '>=20'} - - ordered-binary@1.6.1: - resolution: {integrity: sha512-QkCdPooczexPLiXIrbVOPYkR3VO3T6v2OyKRkR1Xbhpy7/LAVXwahnRCgRp78Oe/Ehf0C/HATAxfSr6eA1oX+w==} - outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} - oxc-minify@0.110.0: - resolution: {integrity: sha512-KWGTzPo83QmGrXC4ml83PM9HDwUPtZFfasiclUvTV4i3/0j7xRRqINVkrL77CbQnoWura3CMxkRofjQKVDuhBw==} - engines: {node: ^20.19.0 || >=22.12.0} - - oxc-parser@0.121.0: - resolution: {integrity: sha512-ek9o58+SCv6AV7nchiAcUJy1DNE2CC5WRdBcO0mF+W4oRjNQfPO7b3pLjTHSFECpHkKGOZSQxx3hk8viIL5YCg==} - engines: {node: ^20.19.0 || >=22.12.0} - oxc-resolver@11.19.1: resolution: {integrity: sha512-qE/CIg/spwrTBFt5aKmwe3ifeDdLfA2NESN30E42X/lII5ClF8V7Wt6WIJhcGZjp0/Q+nQ+9vgxGk//xZNX2hg==} - oxc-transform@0.110.0: - resolution: {integrity: sha512-/fymQNzzUoKZweH0nC5yvbI2eR0yWYusT9TEKDYVgOgYrf9Qmdez9lUFyvxKR9ycx+PTHi/reIOzqf3wkShQsw==} - engines: {node: ^20.19.0 || >=22.12.0} - p-event@6.0.1: resolution: {integrity: sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==} engines: {node: '>=16.17'} @@ -26698,10 +26839,6 @@ packages: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} - p-finally@1.0.0: - resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} - engines: {node: '>=4'} - p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -26734,10 +26871,6 @@ packages: resolution: {integrity: sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==} engines: {node: '>=18'} - p-map@7.0.6: - resolution: {integrity: sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg==} - engines: {node: '>=18'} - p-retry@6.2.1: resolution: {integrity: sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ==} engines: {node: '>=16.17'} @@ -26750,10 +26883,6 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - p-wait-for@5.0.2: - resolution: {integrity: sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==} - engines: {node: '>=12'} - package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -26763,11 +26892,6 @@ packages: package-manager-detector@1.6.0: resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==} - pacote@21.0.4: - resolution: {integrity: sha512-RplP/pDW0NNNDh3pnaoIWYPvNenS7UqMbXyvMqJczosiFWTeGGwJC2NQBLqKf4rGLFfwCOnntw1aEp9Jiqm1MA==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} @@ -26778,19 +26902,6 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse-bmfont-ascii@1.0.6: - resolution: {integrity: sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==} - - parse-bmfont-binary@1.0.6: - resolution: {integrity: sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==} - - parse-bmfont-xml@1.1.6: - resolution: {integrity: sha512-0cEliVMZEhrFDwMh4SxIyVJpqYoOWDJ9P895tFuS+XuNzI5UBmBk5U5O4KuJdTnZpSBI4LFA2+ZiJaiwfSwlMA==} - - parse-conflict-json@5.0.1: - resolution: {integrity: sha512-ZHEmNKMq1wyJXNwLxyHnluPfRAFSIliBvbK/UiOceROt4Xh9Pz0fq49NytIaeaCUf5VR86hwQ/34FCcNU5/LKQ==} - engines: {node: ^20.17.0 || >=22.9.0} - parse-gitignore@2.0.0: resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} engines: {node: '>=14'} @@ -26807,13 +26918,6 @@ packages: resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} engines: {node: '>=18'} - parse-node-version@1.0.1: - resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} - engines: {node: '>= 0.10'} - - parse5-html-rewriting-stream@8.0.0: - resolution: {integrity: sha512-wzh11mj8KKkno1pZEu+l2EVeWsuKDfR5KNWZOTsslfUX8lPDZx77m9T0kIoAVkFtD1nx6YF8oh4BnPHvxMtNMw==} - parse5-htmlparser2-tree-adapter@6.0.1: resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} @@ -26823,9 +26927,6 @@ packages: parse5-parser-stream@7.1.2: resolution: {integrity: sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==} - parse5-sax-parser@8.0.0: - resolution: {integrity: sha512-/dQ8UzHZwnrzs3EvDj6IkKrD/jIZyTlB+8XrHJvcjNgRdmWruNdN9i9RK/JtxakmlUdPwKubKPTCqvbTgzGhrw==} - parse5@5.1.1: resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} @@ -26856,10 +26957,6 @@ packages: resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - path-key@2.0.1: - resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} - engines: {node: '>=4'} - path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -26896,30 +26993,17 @@ packages: resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==} engines: {node: '>=18'} - pathe@1.1.2: - resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pbxproj-dom@1.2.0: - resolution: {integrity: sha512-K2czrWqA68AR0q1UXz5EBi/zoxcljrkO4RSJX0jPnVn3iyE0HYnYOzaEEDYMpueczkT/Vtdm3SCc3NM+12kMaQ==} - - peek-readable@4.1.0: - resolution: {integrity: sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==} - engines: {node: '>=8'} - pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - perfect-debounce@2.0.0: - resolution: {integrity: sha512-fkEH/OBiKrqqI/yIgjR92lMfs2K8105zt/VT6+7eTjNwisrsh47CeIED9z58zI7DfKdH3uHAn25ziRZn3kgAow==} - - periscopic@4.0.2: - resolution: {integrity: sha512-sqpQDUy8vgB7ycLkendSKS6HnVz1Rneoc3Rc+ZBUCe2pbqlVuCC5vF52l0NJ1aiMg/r1qfYF9/myz8CZeI2rjA==} + pg-gateway@0.3.0-beta.4: + resolution: {integrity: sha512-CTjsM7Z+0Nx2/dyZ6r8zRsc3f9FScoD5UAOlfUx1Fdv/JOIWvRbF7gou6l6vP+uypXQVoYPgw8xZDXgMGvBa4Q==} picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -26932,8 +27016,8 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} - picomatch@4.0.4: - resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} picoquery@2.5.0: @@ -26957,14 +27041,6 @@ packages: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} - piscina@5.2.0: - resolution: {integrity: sha512-DszUCKeVN/5G5QKo6jAVHL8fmKnkJvQ0ACiVgY7YGCq3TUB2oznAOayvZPIAdEThvhczkXR+qm3IHsNXpFCYfA==} - engines: {node: '>=20.x'} - - pixelmatch@5.3.0: - resolution: {integrity: sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==} - hasBin: true - pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -26979,35 +27055,16 @@ packages: resolution: {integrity: sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==} engines: {node: '>=16.0.0'} - playwright-core@1.61.1: - resolution: {integrity: sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==} - engines: {node: '>=18'} + playwright-core@1.63.0: + resolution: {integrity: sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==} + engines: {node: '>=20'} hasBin: true - playwright@1.61.1: - resolution: {integrity: sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==} - engines: {node: '>=18'} + playwright@1.63.0: + resolution: {integrity: sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==} + engines: {node: '>=20'} hasBin: true - plist-merge-patch@0.2.0: - resolution: {integrity: sha512-JAkxPVP8F+6e28Ppd2T6QpP79/pZWj1BM1mWxE+9TRMRLeAlodmK+I8Db/cp98GPxRWPPwHxUOIKR2vnCX1J4Q==} - - plist@3.0.6: - resolution: {integrity: sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==} - engines: {node: '>=6'} - - plist@3.1.0: - resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==} - engines: {node: '>=10.4.0'} - - pngjs@6.0.0: - resolution: {integrity: sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==} - engines: {node: '>=12.13.0'} - - pngjs@7.0.0: - resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} - engines: {node: '>=14.19.0'} - possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -27025,9 +27082,6 @@ packages: webpack: optional: true - postcss-media-query-parser@0.2.3: - resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==} - postcss-modules-extract-imports@3.1.0: resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} engines: {node: ^10 || ^12 || >= 14} @@ -27052,12 +27106,6 @@ packages: peerDependencies: postcss: ^8.1.0 - postcss-safe-parser@7.0.1: - resolution: {integrity: sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A==} - engines: {node: '>=18.0'} - peerDependencies: - postcss: ^8.4.31 - postcss-selector-parser@6.1.2: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} @@ -27075,12 +27123,12 @@ packages: peerDependencies: postcss: ^8.2.9 - postcss@8.5.12: - resolution: {integrity: sha512-W62t/Se6rA0Az3DfCL0AqJwXuKwBeYg6nOaIgzP+xZ7N5BFCI7DYi1qs6ygUYT6rvfi6t9k65UMLJC+PHZpDAA==} + postcss@8.5.23: + resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.15: - resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} + postcss@8.5.29: + resolution: {integrity: sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==} engines: {node: ^10 || ^12 || >=14} postcss@8.5.3: @@ -27099,10 +27147,6 @@ packages: resolution: {integrity: sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==} engines: {node: '>=12'} - powershell-utils@0.1.0: - resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} - engines: {node: '>=20'} - pprof-format@2.2.1: resolution: {integrity: sha512-p4tVN7iK19ccDqQv8heyobzUmbHyds4N2FI6aBMcXz6y99MglTWDxIyhFkNaLeEXs6IFUEzT0zya0icbSLLY0g==} @@ -27143,34 +27187,25 @@ packages: engines: {node: '>=14'} hasBin: true - prettier@3.5.0: - resolution: {integrity: sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==} - engines: {node: '>=14'} - hasBin: true - prettier@3.6.2: resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} engines: {node: '>=14'} hasBin: true - prettier@3.7.3: - resolution: {integrity: sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==} - engines: {node: '>=14'} - hasBin: true - prettier@3.8.1: resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} engines: {node: '>=14'} hasBin: true + prettier@3.9.6: + resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} + engines: {node: '>=14'} + hasBin: true + pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} - pretty-bytes@7.1.0: - resolution: {integrity: sha512-nODzvTiYVRGRqAOvE84Vk5JDPyyxsVk0/fbA/bq7RqlnhksGpset09XTxbpvLTIjoaF7K8Z8DG8yHtKGTPSYRw==} - engines: {node: '>=20'} - pretty-error@4.0.0: resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==} @@ -27191,10 +27226,6 @@ packages: typescript: optional: true - proc-log@6.1.0: - resolution: {integrity: sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==} - engines: {node: ^20.17.0 || >=22.9.0} - process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27208,35 +27239,13 @@ packages: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} - proggy@4.0.0: - resolution: {integrity: sha512-MbA4R+WQT76ZBm/5JUpV9yqcJt92175+Y0Bodg3HgiXzrmKu7Ggq+bpn6y6wHH+gN9NcyKn3yg1+d47VaKwNAQ==} - engines: {node: ^20.17.0 || >=22.9.0} - progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} - promise-all-reject-late@1.0.1: - resolution: {integrity: sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==} - - promise-call-limit@3.0.2: - resolution: {integrity: sha512-mRPQO2T1QQVw11E7+UdCJu7S61eJVWknzml9sC1heAdj1jxl0fWMBypIt9ZOcLFf8FkG995ZD7RnVk7HH72fZw==} - promise-limit@2.7.0: resolution: {integrity: sha512-7nJ6v5lnJsXwGprnGXga4wx6d1POjvi5Qmf1ivTRxTjH4Z/9Czja/UCMLVmB9N93GeWOU93XaFaEt6jbuoagNw==} - promise-retry@2.0.1: - resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} - engines: {node: '>=10'} - - promise-stream-reader@1.0.1: - resolution: {integrity: sha512-Tnxit5trUjBAqqZCGWwjyxhmgMN4hGrtpW3Oc/tRI4bpm/O2+ej72BB08l6JBnGQgVDGCLvHFGjGgQS6vzhwXg==} - engines: {node: '>8.0.0'} - - prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} - prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} @@ -27265,12 +27274,6 @@ packages: resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} engines: {node: '>=10'} - proxy-lib@0.4.1: - resolution: {integrity: sha512-PvdxnMi+iTIjv5CWDAv5JqWcXthPwVGJ5fp1uWwsCKLsSpjfBlLTFtKIBC5kQyH6EpzxqJuUoapYP25tOpxLWQ==} - - prr@1.0.1: - resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} - psl@1.15.0: resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} @@ -27279,9 +27282,6 @@ packages: engines: {node: '>=18'} hasBin: true - pump@3.0.3: - resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -27296,13 +27296,6 @@ packages: resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} engines: {node: '>=6.0.0'} - qr-image@3.2.0: - resolution: {integrity: sha512-rXKDS5Sx3YipVsqmlMJsJsk6jXylEpiHRC2+nJy66fxA5ExYyGa4PqwteW69SaVmAb2OQ18HbYriT7cGQMbduw==} - - qrcode-terminal@0.12.0: - resolution: {integrity: sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==} - hasBin: true - qs@6.14.0: resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==} engines: {node: '>=0.6'} @@ -27331,8 +27324,8 @@ packages: peerDependencies: '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -27360,17 +27353,17 @@ packages: rc9@2.1.2: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} - react-dom@19.2.3: - resolution: {integrity: sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==} + react-dom@19.2.9: + resolution: {integrity: sha512-YceU74W21fXEHszKBLj16MY0CmvpFKOs60iVrIyW/cCgOPsZJNaB6GVJEtIUqt6AG6EjzKLui5lPRrxAeS328Q==} peerDependencies: - react: ^19.2.3 + react: ~19.2.9 react-hot-toast@2.5.1: resolution: {integrity: sha512-54Gq1ZD1JbmAb4psp9bvFHjS7lje+8ubboUmvKZkCsQBLH6AOpZ9JemfRvIdHcfb9AZXRaFLrb3qUobGYDJhFQ==} engines: {node: '>=10'} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -27385,20 +27378,6 @@ packages: resolution: {integrity: sha512-bYXfxuIVt49+VrmqxUNxjDSbFCUmG85IxH2yc7h5sddlUrVvosOTgOphMvWtBSz39VYZByTBRAE6uKAsHoz0gg==} hasBin: true - react-reconciler@0.32.0: - resolution: {integrity: sha512-2NPMOzgTlG0ZWdIf3qG+dcbLSoAc/uLfOwckc3ofy5sSK0pLJqnQLpUFxvGcN2rlXSjnVtGeeFLNimCQEj5gOQ==} - engines: {node: '>=0.10.0'} - peerDependencies: - react: ^19.2.3 - - react-refresh@0.14.2: - resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} - engines: {node: '>=0.10.0'} - - react-refresh@0.17.0: - resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} - engines: {node: '>=0.10.0'} - react-refresh@0.18.0: resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==} engines: {node: '>=0.10.0'} @@ -27408,7 +27387,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -27418,25 +27397,25 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-rspack@0.0.2: - resolution: {integrity: sha512-PowIm+Z65LkvC3yk4t3YrH2nMejwL361jiBT0BMW2bQCDUaNQknDHMPH0aTgMtJ9ZZ1Gc7KFgBvwB0itSzzELQ==} + react-server-dom-rspack@0.1.1: + resolution: {integrity: sha512-pgL4M/D3jFzn/2Dv8ppgFPrauyJjP29sFCV5EjSCLI29+NHIhumkhxnkiK8x0h5SQLPqUVVZfiAu3dn7Bl1RNg==} engines: {node: '>=0.10.0'} peerDependencies: - '@rspack/core': ^2.0.0-0 - react: ^19.2.3 - react-dom: ^19.2.3 + '@rspack/core': ^2.2.0-0 + react: ~19.2.9 + react-dom: ~19.2.9 react-style-singleton@2.2.3: resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==} engines: {node: '>=10'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -27444,27 +27423,31 @@ packages: react-transition-group@4.4.5: resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 react-tweet@3.3.0: resolution: {integrity: sha512-gSIG2169ZK7UH6rBzuU+j1xnQbH3IlOTLEkuGrRiJJTMgETik+h+26yHyyVKrLkzwrOaYPk4K3OtEKycqKgNLw==} peerDependencies: - react: ^19.2.3 - react-dom: ^19.2.3 + react: ~19.2.9 + react-dom: ~19.2.9 - react@19.2.3: - resolution: {integrity: sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==} + react@19.2.9: + resolution: {integrity: sha512-RuLdAokXv3sRmZa2/N8QH0KmTBIgDKC+buRUikGqow31+mGSGidLCX2o4XFq8OV+xBFWfhM9DVgTq1PPHADH4w==} engines: {node: '>=0.10.0'} - read-cmd-shim@6.0.0: - resolution: {integrity: sha512-1zM5HuOfagXCBWMN83fuFI/x+T/UhZ7k+KIzhrHXcQoeX5+7gmaDYjELQHmmzIodumBHeByBJT4QYS7ufAgs7A==} - engines: {node: ^20.17.0 || >=22.9.0} - read-package-up@11.0.0: resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} engines: {node: '>=18'} + read-package-up@12.0.0: + resolution: {integrity: sha512-Q5hMVBYur/eQNWDdbF4/Wqqr9Bjvtrw2kjGxxBbKLbx8bVCL8gcArjTy8zDUuLGQicftpMuU0riQNcAsbtOVsw==} + engines: {node: '>=20'} + + read-pkg@10.1.0: + resolution: {integrity: sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg==} + engines: {node: '>=20'} + read-pkg@9.0.1: resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} engines: {node: '>=18'} @@ -27484,12 +27467,9 @@ packages: resolution: {integrity: sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - readable-web-to-node-stream@3.0.4: - resolution: {integrity: sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==} - engines: {node: '>=8'} - - readdir-glob@1.1.3: - resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==} + readdir-glob@3.0.0: + resolution: {integrity: sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==} + engines: {node: '>=18'} readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} @@ -27507,10 +27487,6 @@ packages: resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} engines: {node: '>= 12.13.0'} - rechoir@0.6.2: - resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} - engines: {node: '>= 0.10'} - rechoir@0.8.0: resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} engines: {node: '>= 10.13.0'} @@ -27533,22 +27509,15 @@ packages: reduce-configs@1.1.1: resolution: {integrity: sha512-EYtsVGAQarE8daT54cnaY1PIknF2VB78ug6Zre2rs36EsJfC40EG6hmTU2A2P1ZuXnKAt2KI0fzOGHcX7wzdPw==} + reduce-configs@2.0.1: + resolution: {integrity: sha512-H9KTCWTEb1YM1OoOz0f6TeGZYlW82sIT1viNg3W8CjjY0pD3WI4MHs8GifKt5FKTVIfHh/DenfJqqY+FP9jF2A==} + reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} - regenerate-unicode-properties@10.2.2: - resolution: {integrity: sha512-m03P+zhBeQd1RGnYxrGyDAPpWX/epKirLrp8e3qevZdVkKtnCrjjWczIbYc8+xd6vcTStVlqfycTx1KR4LOr0g==} - engines: {node: '>=4'} - - regenerate@1.4.2: - resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} - regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regex-parser@2.3.1: - resolution: {integrity: sha512-yXLRqatcCuKtVHsWrNg0JL3l1zGfdXeEvDa0bdu4tCDQw0RpMDZsqbkyRTUnKMR0tXF627V2oEWjBEaEdqTwtQ==} - regexp-to-ast@0.5.0: resolution: {integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==} @@ -27556,17 +27525,6 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} - regexpu-core@6.4.0: - resolution: {integrity: sha512-0ghuzq67LI9bLXpOX/ISfve/Mq33a4aFRzoQYhnnok1JOFpmE/A2TBGkNVenOGEeSBCjIiWcc6MVOG5HEQv0sA==} - engines: {node: '>=4'} - - regjsgen@0.8.0: - resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} - - regjsparser@0.13.2: - resolution: {integrity: sha512-NgRBy2Nx/bE+9F27nVHnqcN5HjyLmecqsqx2PJHu3/IEtADD4WuxuXIVExD5PoSDFVrl78dOonfcOe5O+5nbzQ==} - hasBin: true - reinterval@1.1.0: resolution: {integrity: sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==} @@ -27593,11 +27551,6 @@ packages: resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} engines: {node: '>=0.10'} - replace@1.2.2: - resolution: {integrity: sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==} - engines: {node: '>= 6'} - hasBin: true - require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -27606,8 +27559,9 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} - require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + require-in-the-middle@8.0.1: + resolution: {integrity: sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ==} + engines: {node: '>=9.3.0 || >=8.10.0 <9.0.0'} require-package-name@2.0.1: resolution: {integrity: sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==} @@ -27630,19 +27584,10 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve-url-loader@5.0.0: - resolution: {integrity: sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==} - engines: {node: '>=12'} - resolve.exports@2.0.3: resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} - engines: {node: '>= 0.4'} - hasBin: true - resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} @@ -27656,10 +27601,6 @@ packages: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} - restore-cursor@5.1.0: - resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} - engines: {node: '>=18'} - ret@0.5.0: resolution: {integrity: sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==} engines: {node: '>=10'} @@ -27675,6 +27616,9 @@ packages: resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} engines: {node: '>= 4'} + rettime@0.11.11: + resolution: {integrity: sha512-ILJRqVWBCTlg9r42fFgwVZx1gnFAcQF8mRoMkbgQfIrjEDf9nbBFDFx00oloOa+Q869FUtaYDXZvEfnecQSCoQ==} + reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -27691,44 +27635,21 @@ packages: engines: {node: 20 || >=22} hasBin: true - rolldown@1.0.0-rc.4: - resolution: {integrity: sha512-V2tPDUrY3WSevrvU2E41ijZlpF+5PbZu4giH+VpNraaadsJGHa4fR6IFwsocVwEXDoAdIv5qgPPxgrvKAOIPtA==} + rolldown@1.2.13: + resolution: {integrity: sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - rolldown@1.0.0-rc.9: - resolution: {integrity: sha512-9EbgWge7ZH+yqb4d2EnELAntgPTWbfL8ajiTW+SyhJEC4qhBbkCKbqFV4Ge4zmu5ziQuVbWxb/XwLZ+RIO7E8Q==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - rolldown@1.0.2: - resolution: {integrity: sha512-oZx5zVDtVB44AW3eaifgDml1gWRDZGvjcfdxonE4swNPG98PrrXjaO/KrnUjzlMnztCCRVlUueA1kCXhARGk6g==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - rollup-plugin-visualizer@6.0.5: - resolution: {integrity: sha512-9+HlNgKCVbJDs8tVtjQ43US12eqaiHyyiLMdBwQ7vSZPiHMysGNo2E88TAp1si5wx8NAoYriI2A5kuKfIakmJg==} - engines: {node: '>=18'} - hasBin: true - peerDependencies: - rolldown: 1.x || ^1.0.0-beta - rollup: 2.x || 3.x || 4.x - peerDependenciesMeta: - rolldown: - optional: true - rollup: - optional: true - - rollup@4.56.0: - resolution: {integrity: sha512-9FwVqlgUHzbXtDg9RCMgodF3Ua4Na6Gau+Sdt9vyCN4RhHfVKX2DCHy3BjMLTDd47ITDhYAnTwGulWTblJSDLg==} + rollup@4.63.1: + resolution: {integrity: sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true rou3@0.7.12: resolution: {integrity: sha512-iFE4hLDuloSWcD7mjdCDhx2bKcIsYbtOTpfH5MHHLSKMOUyjqQXTeZVa289uuwEGEKFoE/BAPbhaU4B774nceg==} - rou3@0.8.1: - resolution: {integrity: sha512-ePa+XGk00/3HuCqrEnK3LxJW7I0SdNg6EFzKUJG73hMAdDcOUC/i/aSz7LSDwLrGr33kal/rqOGydzwl6U7zBA==} + rou3@0.9.2: + resolution: {integrity: sha512-3SOzvaAg8rkHrXtRjpCvCvbyO5to9oOO27Z/XqHEYXfMRVSw/qMIVdmaOk9W2lcRLtR6dlqTjo9hDeJk70QBYQ==} router@2.2.0: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} @@ -27740,17 +27661,10 @@ packages: rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} - rspack-vue-loader@17.4.4: - resolution: {integrity: sha512-T4rkTZWg9hC7DZapTaJcIphser4ogsTffH/rwnX0pwMpNKjv1XKLBPa5Icd/xNPOh1NiKVxoxcT+gb8NQliukA==} + rsbuild-plugin-cloudflare@0.0.4: + resolution: {integrity: sha512-YIKJGwcvMJNMo922/kNCdK/P7tk+D861SG41sMl1Y/M/BnlzX3b0UMoJZcPeEV1sfDrDBLYCPaqsBPEYC5Ya1g==} peerDependencies: - '@vue/compiler-sfc': '*' - vue: '*' - webpack: ^4.1.0 || ^5.0.0-0 - peerDependenciesMeta: - '@vue/compiler-sfc': - optional: true - vue: - optional: true + '@rsbuild/core': ^2.2.10 rspack-vue-loader@17.5.0: resolution: {integrity: sha512-hJrL2+jytfTs6ORHBOKTh5lU7BVZvmv7afELuQfyEpGC1ll7MKj1BxlgAIbhd6pZwoEwfdH79Lewtwe4VOlfCQ==} @@ -27766,8 +27680,8 @@ packages: vue: optional: true - run-applescript@7.0.0: - resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} engines: {node: '>=18'} run-parallel@1.2.0: @@ -27803,37 +27717,133 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass-loader@16.0.7: - resolution: {integrity: sha512-w6q+fRHourZ+e+xA1kcsF27iGM6jdB8teexYCfdUw0sYgcDNeZESnDNT9sUmmPm3ooziwUJXGwZJSTF3kOdBfA==} - engines: {node: '>= 18.12.0'} - peerDependencies: - '@rspack/core': 0.x || ^1.0.0 || ^2.0.0-0 - node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 - sass: ^1.3.0 - sass-embedded: '*' - webpack: ^5.0.0 - peerDependenciesMeta: - '@rspack/core': - optional: true - node-sass: - optional: true - sass: - optional: true - sass-embedded: - optional: true - webpack: - optional: true + sass-embedded-all-unknown@1.105.1: + resolution: {integrity: sha512-kN0G03K9KoUbSf72t7ZvxAudcB4Wbf0M0XFaPc1gaF94jEPUb0xLCQUIPIDPH2Kx8vpYZ/GzzgF7USsB6rUYfw==} + cpu: ['!arm', '!arm64', '!riscv64', '!x64'] + + sass-embedded-android-arm64@1.105.1: + resolution: {integrity: sha512-lWnIFmW3gL4ZDfZgjeUfxazmA0zlwSS/ADe2q9XmP0W2UfM9kuvrXdWvp6KjZOCv0CrTYVQMrIUj8Of1L2M24Q==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [android] + + sass-embedded-android-arm@1.105.1: + resolution: {integrity: sha512-WYltUXkUP9jDaUq4uUiLgZXyYO5c72sa/TvpO4E2MMRdS+WJWgrPUDyvO+DpMR9gKWIm0QQ5cCEYnPDgovjVJw==} + engines: {node: '>=14.0.0'} + cpu: [arm] + os: [android] + + sass-embedded-android-riscv64@1.105.1: + resolution: {integrity: sha512-lWity0qhyQyPgkHUfZz+4IeD0r6mcAqG9KzOwVSjUrcSR9xAfWFKYAtHTA05R28ymyXf2Sf2+XfNV7YkxLgkUQ==} + engines: {node: '>=14.0.0'} + cpu: [riscv64] + os: [android] + + sass-embedded-android-x64@1.105.1: + resolution: {integrity: sha512-FRGZuIZ9eS3qutYPFqz8u12Ti9ccyWKWb7F7rKRI1BkIEmLZV1rC862dUGnTV2d9Tk9qbSAXL71t8alUR+fzIA==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [android] + + sass-embedded-darwin-arm64@1.105.1: + resolution: {integrity: sha512-75qVpHj0qwJKWOo+ZA5NPVFnOGfRrUiBdnLR0dPqsvzp3acvb5gBevptqTtJjVWubpYRIjcRdDDjmeWoXnfacQ==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [darwin] + + sass-embedded-darwin-x64@1.105.1: + resolution: {integrity: sha512-5TV8xyZrOO89ky752favkTuyz9O2hOB2aMoiUpMTk0rFr+UVANcXdIrEvJ9WKoqTHaszim7un3jADumunpW7zQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [darwin] + + sass-embedded-linux-arm64@1.105.1: + resolution: {integrity: sha512-arALlVQkXjxN1RPaQR41vbDYXrTIdXwPtEzBWRkOg7FdIN/dSohY8ik96M6M3MSc+niV/UIC7BO47PcspzJGpw==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + libc: glibc + + sass-embedded-linux-arm@1.105.1: + resolution: {integrity: sha512-Ng9GWIF6heTrwc9r/FFY9oUSoaylV2zcS296Qo2re3tJfLMWR37O2JUMyzPT+vtkRs8k3JOE6jTFVlXYnz4EAA==} + engines: {node: '>=14.0.0'} + cpu: [arm] + os: [linux] + libc: glibc + + sass-embedded-linux-musl-arm64@1.105.1: + resolution: {integrity: sha512-KizYVR3d70U67iLgKdF+HCKBdQYUxYiv0YWCS3zl6GwNGIbGXlkOtnjxus41CKTA4oOK0KsSus9P5zwhOBjiYA==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + libc: musl + + sass-embedded-linux-musl-arm@1.105.1: + resolution: {integrity: sha512-7u932XawHxGZvuYV4pOqcCvQi05yMONDmNDxVNh8Q7KmpytQP7mnyxBOYWStiw/p665AVL6BYGe7WY/vzCcWGw==} + engines: {node: '>=14.0.0'} + cpu: [arm] + os: [linux] + libc: musl + + sass-embedded-linux-musl-riscv64@1.105.1: + resolution: {integrity: sha512-gs84BgRBVNMX5fHRU3wxc3HuJjl0dUmZFpcVIaDDEVhnp5oXFLQp+gEu0xBBAurTzCHVpPU6GlGK6B1gRKmbhg==} + engines: {node: '>=14.0.0'} + cpu: [riscv64] + os: [linux] + libc: musl + + sass-embedded-linux-musl-x64@1.105.1: + resolution: {integrity: sha512-jFSRc1BSoCo0bw6GXmBWQMzdj0FBl2FTKSRqQSye3vmlI9O466DwBK4OQL9HRp6MGdY9IQFFMZLPZo5LJWIPsQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + libc: musl + + sass-embedded-linux-riscv64@1.105.1: + resolution: {integrity: sha512-tkZs6OvA+omJgSf8EaPQavq6M7bJNLm88eKt3yzYnBy0dVGMao4+lyRb/EnsgIq2R/B2lhxUHhSVNWAcY5bgXw==} + engines: {node: '>=14.0.0'} + cpu: [riscv64] + os: [linux] + libc: glibc + + sass-embedded-linux-x64@1.105.1: + resolution: {integrity: sha512-YF4OyymSlm26OcdPovIZL1blzjTxf5yN/rzgTmoGqAjEk57+yIuYo+7jBCgSQZFov8Rn4uHhZT+u0cpzxNFMRg==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + libc: glibc + + sass-embedded-unknown-all@1.105.1: + resolution: {integrity: sha512-bd2zDf+MdoPdRDH1awSQ+IL67vHvCbiKsWJ95XchPg3I67zQlXjTSf9KqRiE6twjNT1fRV82JUKoc0Hf6CUmfQ==} + os: ['!android', '!darwin', '!linux', '!win32'] + + sass-embedded-win32-arm64@1.105.1: + resolution: {integrity: sha512-Zpp/RWYL8ZzpLzBrs+/UVMEHOHx7sw4nlq2R52dKQ0qv/0V8oKemAy41PZyLir3c+S2C+YViYyfnFfQLRTAzuA==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [win32] + + sass-embedded-win32-x64@1.105.1: + resolution: {integrity: sha512-DM8EkMDzEsxnYoy11nyA5I4jr8lOV1TVQ/drNYvFQA9undiMzZD+7SkRA0OnCrgD1uCT+uRArCHSpNiiYVks+g==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [win32] + + sass-embedded@1.105.1: + resolution: {integrity: sha512-9tKxXG4rq+oGTZUlQehWZwHxBTL80EiB8IWk9AEqz8uOqg910t88JIYbN92eMCxokQ5vrYSQxg15bh0o/3hh3w==} + engines: {node: '>=20.19.0'} + hasBin: true + + sass@1.105.1: + resolution: {integrity: sha512-1CnAWPyrrnVQzXGB/DUep1vYCKCm1CIBr+YxjjiW6wk9qtzemnGP4qicH56T2F9S4Hjtv/Ne3jDz8JqfdDU4oA==} + engines: {node: '>=20.19.0'} + hasBin: true sass@1.97.2: resolution: {integrity: sha512-y5LWb0IlbO4e97Zr7c3mlpabcbBtS+ieiZ9iwDooShpFKWXf62zz5pEPdwrLYm+Bxn1fnbwFGzHuCLSA9tBmrw==} engines: {node: '>=14.0.0'} hasBin: true - sass@1.97.3: - resolution: {integrity: sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==} - engines: {node: '>=14.0.0'} - hasBin: true - sax@1.4.1: resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} @@ -27841,9 +27851,6 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.26.0: - resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} - scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -27851,17 +27858,10 @@ packages: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} engines: {node: '>= 10.13.0'} - schema-utils@4.3.0: - resolution: {integrity: sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==} - engines: {node: '>= 10.13.0'} - schema-utils@4.3.3: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} - scule@1.3.0: - resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} - secure-json-parse@4.1.0: resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==} @@ -27872,10 +27872,6 @@ packages: resolution: {integrity: sha512-ftnu3TW4+3eBfLRFnDEkzGxSF/10BJBkaLJuBHZX0kiPS7bRdlpZGu6YGt4KngMkdTwJE6MbjavFpqHvqVt+Ew==} engines: {node: '>=18'} - semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -27895,13 +27891,13 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.7.4: - resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + semver@7.8.2: + resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} engines: {node: '>=10'} hasBin: true - semver@7.8.2: - resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} hasBin: true @@ -27919,27 +27915,30 @@ packages: serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - serialize-javascript@7.0.7: - resolution: {integrity: sha512-YAy8Od6KV+uuwUuU50np8fGB/Aues6Y0nAhA9y/hId74PlKUcme4pXcBD46NWKr1Q4osN/iseZ17YqO1XfmI8g==} - engines: {node: '>=20.0.0'} - seroval-plugins@1.5.4: resolution: {integrity: sha512-S0xQPhUTefAhNvNWFg0c1J8qJArHt5KdtJ/cFAofo06KD1MVSeFWyl4iiu+ApDIuw0WhjpOfCdgConOfAnLgkw==} engines: {node: '>=10'} peerDependencies: seroval: ^1.0 + seroval-plugins@1.6.7: + resolution: {integrity: sha512-4Nk35ttD3DTDJW4hgw5StsVAPeU6qnDFnULAouw6tQ7oLTV/ICXrWpsXo2EE52eSP2joUMazbVf52mFEcADqRw==} + engines: {node: '>=10'} + peerDependencies: + seroval: ^1.0 + seroval@1.5.4: resolution: {integrity: sha512-46uFvgrXTVxZcUorgSSRZ4y+ieqLLQRMlG4bnCZKW3qI6BZm7Rg4ntMW4p1mILEEBZWrFlcpp0AyIIlM6jD9iw==} engines: {node: '>=10'} + seroval@1.6.7: + resolution: {integrity: sha512-AeDcLh0yO2SFm9W71essgnSzLV9DI8ZH0x0knXn2DMnUZj728mpLbxjlbB6IqKCmqh8JA3cEqRyGoNkt584JcQ==} + engines: {node: '>=10'} + serve-index@1.9.1: resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} engines: {node: '>= 0.8.0'} - serve-placeholder@2.0.2: - resolution: {integrity: sha512-/TMG8SboeiQbZJWRlfTCqMs2DD3SZgWp0kDQePz9yUuCnDfDh/92gf7/PxGhzXTKBIPASIHxFcZndoNbp6QOLQ==} - serve-static@1.16.2: resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} engines: {node: '>= 0.8.0'} @@ -27948,9 +27947,6 @@ packages: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - set-cookie-parser@2.7.2: resolution: {integrity: sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==} @@ -27975,26 +27971,32 @@ packages: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} - sharp@0.34.4: - resolution: {integrity: sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - sharp@0.34.5: resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} + sharp@0.35.4: + resolution: {integrity: sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==} + engines: {node: '>=20.9.0'} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + sharp@0.35.5: + resolution: {integrity: sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==} + engines: {node: '>=20.9.0'} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} - shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} @@ -28007,15 +28009,6 @@ packages: resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==} engines: {node: '>= 0.4'} - shelljs@0.10.0: - resolution: {integrity: sha512-Jex+xw5Mg2qMZL3qnzXIfaxEtBaC4n7xifqaqtrZDdlheR70OGkydrPJWT0V1cA1k3nanC86x9FwAmQl6w3Klw==} - engines: {node: '>=18'} - - shelljs@0.9.2: - resolution: {integrity: sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==} - engines: {node: '>=18'} - hasBin: true - side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} engines: {node: '>= 0.4'} @@ -28042,30 +28035,10 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - sigstore@4.1.1: - resolution: {integrity: sha512-endqECJkfhozrXMK5ngu/UAA0xVcVEFdnHJCElGaExypjW+HK5i6zu3NteLoaX/iFbRUbC3+DjttQs0GARr+5w==} - engines: {node: ^20.17.0 || >=22.9.0} - - simple-git@3.36.0: - resolution: {integrity: sha512-cGQjLjK8bxJw4QuYT7gxHw3/IouVESbhahSsHrX97MzCL1gu2u7oy38W6L2ZIGECEfIBG4BabsWDPjBxJENv9Q==} - simple-icons@14.9.0: resolution: {integrity: sha512-d3nebH+gVXaEsHEy3juuX2EJ9H3Es6gHJTyz58Vcx33zAoCwWPQiOC0ONsEHOg7ciwZanFH1FEnJFB4OKzWrdw==} engines: {node: '>=0.12.18'} - simple-plist@1.3.1: - resolution: {integrity: sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==} - - simple-plist@1.4.0: - resolution: {integrity: sha512-Emr2CR0T6cfQlbXxk7KtpU183WpJXWdl9c7D8uTtduX7bzVO1A6yTO6BauGzbWQhdOfpggcc9s0PN8+JyG/2gQ==} - - simple-swizzle@0.2.4: - resolution: {integrity: sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==} - - simple-xml-to-json@1.2.7: - resolution: {integrity: sha512-mz9VXphOxQWX3eQ/uXCtm6upltoN0DLx8Zb5T4TFC4FHB7S9FDPGre8CfLWqPWQQH/GrQYd2AXhhVM5LDpYx6Q==} - engines: {node: '>=20.12.2'} - sirv@3.0.2: resolution: {integrity: sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==} engines: {node: '>=18'} @@ -28081,47 +28054,20 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - slashes@3.0.12: resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} - slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} - - slice-ansi@7.1.2: - resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} - engines: {node: '>=18'} - - slice-ansi@8.0.0: - resolution: {integrity: sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==} - engines: {node: '>=20'} - - smart-buffer@4.2.0: - resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} - engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - - smob@1.5.0: - resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==} - smol-toml@1.6.1: resolution: {integrity: sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==} engines: {node: '>= 18'} + smol-toml@1.9.0: + resolution: {integrity: sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==} + engines: {node: '>= 18'} + sockjs@0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} - socks-proxy-agent@8.0.5: - resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} - engines: {node: '>= 14'} - - socks@2.8.9: - resolution: {integrity: sha512-LJhUYUvItdQ0LkJTmPeaEObWXAqFyfmP85x0tch/ez9cahmhlBBLbIqDFnvBnUJGagb0JbIQrkBs1wJ+yRYpEw==} - engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} - solid-js@1.9.12: resolution: {integrity: sha512-QzKaSJq2/iDrWR1As6MHZQ8fQkdOBf8GReYb7L5iKwMGceg7HxDcaOHk0at66tNgn9U2U7dXo8ZZpLIAmGMzgw==} @@ -28147,11 +28093,9 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - source-map-loader@5.0.0: - resolution: {integrity: sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA==} - engines: {node: '>= 18.12.0'} - peerDependencies: - webpack: ^5.72.1 + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -28183,9 +28127,6 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-expression-parse@4.0.0: - resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} - spdx-license-ids@3.0.22: resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} @@ -28212,30 +28153,16 @@ packages: resolution: {integrity: sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==} engines: {node: '>= 0.6'} - srvx@0.10.0: - resolution: {integrity: sha512-NqIsR+wQCfkvvwczBh8J8uM4wTZx41K2lLSEp/3oMp917ODVVMtW5Me4epCmQ3gH8D+0b+/t4xxkUKutyhimTA==} + srvx@1.0.5: + resolution: {integrity: sha512-KvSKRpgPG/oaq3cyT614OQ2bAa7DynuGamivCZeoZzIUULOdbQz6wUtnnVuC4+DCx2Zglzo8v5gBYmWIWYhDxA==} engines: {node: '>=20.16.0'} hasBin: true - srvx@0.10.1: - resolution: {integrity: sha512-A//xtfak4eESMWWydSRFUVvCTQbSwivnGCEf8YGPe2eHU0+Z6znfUTCPF0a7oV3sObSOcrXHlL6Bs9vVctfXdg==} + srvx@1.0.8: + resolution: {integrity: sha512-ngFS/J6St4PJfHRHGjr78xkPPtbyXtdMOLNE4x/XZunEK3OhV7aGUWMHf9WTUEy6wm1U0W4okkd82ZFFWRVQTw==} engines: {node: '>=20.16.0'} hasBin: true - srvx@0.11.12: - resolution: {integrity: sha512-AQfrGqntqVPXgP03pvBDN1KyevHC+KmYVqb8vVf4N+aomQqdhaZxjvoVp+AOm4u6x+GgNQY3MVzAUIn+TqwkOA==} - engines: {node: '>=20.16.0'} - hasBin: true - - srvx@0.11.15: - resolution: {integrity: sha512-iXsux0UcOjdvs0LCMa2Ws3WwcDUozA3JN3BquNXkaFPP7TpRqgunKdEgoZ/uwb1J6xaYHfxtz9Twlh6yzwM6Tg==} - engines: {node: '>=20.16.0'} - hasBin: true - - ssri@13.0.1: - resolution: {integrity: sha512-QUiRf1+u9wPTL/76GTYlKttDEBWV1ga9ZXW8BG6kfdeyyM8LGPix9gROyg9V2+P0xNyF3X2Go526xKFdMZrHSQ==} - engines: {node: ^20.17.0 || >=22.9.0} - stable-hash-x@0.2.0: resolution: {integrity: sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==} engines: {node: '>=12.0.0'} @@ -28280,28 +28207,16 @@ packages: std-env@3.9.0: resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} - std-env@4.1.0: - resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} + std-env@4.2.0: + resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} - stdin-discarder@0.3.2: - resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} - engines: {node: '>=18'} + std-env@4.3.0: + resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==} stop-iteration-iterator@1.1.0: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} - stream-buffers@2.2.0: - resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==} - engines: {node: '>= 0.10.0'} - - streamroller@3.1.5: - resolution: {integrity: sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==} - engines: {node: '>=8.0'} - - streamx@2.22.0: - resolution: {integrity: sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==} - streamx@2.27.0: resolution: {integrity: sha512-WZ189TKnHoAokYHvwzaAQMpd55cgUmFIcJFzBSgGcb886jau5DL+XdDhTWV4ps3FLvk+OORp0dLRTPsLZ21CSA==} @@ -28323,14 +28238,6 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string-width@8.2.2: - resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==} - engines: {node: '>=20'} - string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -28349,14 +28256,6 @@ packages: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - strip-eof@1.0.0: - resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} - engines: {node: '>=0.10.0'} - - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} @@ -28369,12 +28268,14 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strip-literal@3.1.0: - resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + strip-literal@4.0.0: + resolution: {integrity: sha512-PaqAvfUZKBwc/SLmNZtHmzK+v19Z4O4eS3cKPeGvbIv/U3pnyEq4Tuw3/4v/FwfM8VQaEawsyCcOQ0P+kpwWWw==} - strtok3@6.3.0: - resolution: {integrity: sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==} - engines: {node: '>=10'} + stubborn-fs@2.0.0: + resolution: {integrity: sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==} + + stubborn-utils@1.0.2: + resolution: {integrity: sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==} style-loader@4.0.0: resolution: {integrity: sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==} @@ -28385,6 +28286,19 @@ packages: style-to-object@1.0.8: resolution: {integrity: sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==} + styled-jsx@5.1.6: + resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: ~19.2.9 + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + stylis@4.2.0: resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} @@ -28392,10 +28306,6 @@ packages: resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} engines: {node: '>=18'} - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -28426,14 +28336,18 @@ packages: swr@2.3.4: resolution: {integrity: sha512-bYd2lrhc+VarcpkgWclcUi92wYCpOgMws9Sd1hG1ntAu0NEy+14CbotuFjshBU2kt9rYj9TSmDcybpxpeTU1fg==} peerDependencies: - react: ^19.2.3 + react: ~19.2.9 symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - system-architecture@0.1.0: - resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==} - engines: {node: '>=18'} + sync-child-process@1.0.2: + resolution: {integrity: sha512-8lD+t2KrrScJ/7KXCSyfhT3/hRq78rC0wBFqNJXv3mZyn6hW2ypM05JmlSvtqRbeq6jqA94oHbxAr2vYsJ8vDA==} + engines: {node: '>=16.0.0'} + + sync-message-port@1.2.0: + resolution: {integrity: sha512-gAQ9qrUN/UCypHtGFbbe7Rc/f9bzO88IwrG8TDo/aMKAApKyD6E3W4Cm0EfhfBb6Z6SKt59tTCTfD+n1xmAvMg==} + engines: {node: '>=16.0.0'} tagged-tag@1.0.0: resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==} @@ -28448,12 +28362,15 @@ packages: tailwindcss@4.2.2: resolution: {integrity: sha512-KWBIxs1Xb6NoLdMVqhbhgwZf2PGBpPEiwOqgI4pFIYbNTfBXiKYyWoTsXgBQ9WFg/OlhnvHaY+AEpW7wSmFo2Q==} + tailwindcss@4.3.1: + resolution: {integrity: sha512-hk+TB1m+K8CYNrP6rjQaq/Y+4Zylwpa87mLYBKCunwnnQ9p+fHb7kmSfGqyEJoxF/O6CDyABWVFEafNSYKll+Q==} + tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} - tapable@2.3.0: - resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} tar-stream@2.2.0: @@ -28468,8 +28385,8 @@ packages: engines: {node: '>=18'} deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - tar@7.5.9: - resolution: {integrity: sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==} + tar@7.5.22: + resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==} engines: {node: '>=18'} teex@1.0.1: @@ -28495,35 +28412,16 @@ packages: uglify-js: optional: true - terser-webpack-plugin@5.3.16: - resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} - engines: {node: '>= 10.13.0'} - peerDependencies: - '@swc/core': '*' - esbuild: '*' - uglify-js: '*' - webpack: ^5.1.0 - peerDependenciesMeta: - '@swc/core': - optional: true - esbuild: - optional: true - uglify-js: - optional: true - terser@5.37.0: resolution: {integrity: sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==} engines: {node: '>=10'} hasBin: true - terser@5.46.0: - resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + terser@5.51.2: + resolution: {integrity: sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==} engines: {node: '>=10'} hasBin: true - text-decoder@1.2.3: - resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} - text-decoder@1.2.7: resolution: {integrity: sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==} @@ -28543,12 +28441,6 @@ packages: peerDependencies: tslib: ^2 - thingies@2.6.0: - resolution: {integrity: sha512-rMHRjmlFLM1R96UYPvpmnc3LYtdFrT33JIB7L9hetGue1qAPfn1N2LJeEjxUSidu1Iku+haLZXDuEXUHNGO/lg==} - engines: {node: '>=10.18'} - peerDependencies: - tslib: ^2 - thread-stream@4.0.0: resolution: {integrity: sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA==} engines: {node: '>=20'} @@ -28563,26 +28455,31 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinycolor2@1.6.0: - resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} + tinybench@6.2.2: + resolution: {integrity: sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==} + engines: {node: '>=20.0.0'} + + tinyclip@0.1.15: + resolution: {integrity: sha512-uo33abH+Ays0xYaDysoBt494Hb3hsEczMpcC0MwFl773pazORx4fmvKhclhR1wonUbB6vvpRsvVMwnhfqeMc+A==} + engines: {node: ^16.14.0 || >= 17.3.0} tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyexec@1.0.2: - resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} + tinyexec@1.3.1: + resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==} engines: {node: '>=18'} tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} - tinyglobby@0.2.16: - resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} - tinyrainbow@3.1.0: - resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + tinyrainbow@3.2.0: + resolution: {integrity: sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==} engines: {node: '>=14.0.0'} tldts-core@6.1.76: @@ -28602,10 +28499,6 @@ packages: tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} - tmp@0.2.6: - resolution: {integrity: sha512-5sJPdPjfI5Kx+qbrDesxkglRBxW//g7hCsqspEjwkewGvBMGIKMOTKzLt1hFVJzyadba3lDUN20O9qhvbQUSTA==} - engines: {node: '>=14.14'} - tmp@0.2.7: resolution: {integrity: sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==} engines: {node: '>=14.14'} @@ -28622,12 +28515,9 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} - token-types@4.2.1: - resolution: {integrity: sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==} - engines: {node: '>=10'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + toml@4.3.0: + resolution: {integrity: sha512-lVb8X9BsPVuH0M4BKeS91tXAmJvCjQ5UIyAbQFaxkKGyUFK2RPkhwaFSQH8vbpl1d23eu/IBH+dwVMHWaq9A5A==} + engines: {node: '>=20'} tomlify-j0.4@3.0.0: resolution: {integrity: sha512-2Ulkc8T7mXJ2l0W476YC/A209PR38Nw8PuaCNtk9uI3t1zzFdGQeWYGQvmj2PZkVvRC/Yoi4xQKMRnWc/N29tQ==} @@ -28644,10 +28534,6 @@ packages: resolution: {integrity: sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==} engines: {node: '>=16'} - tough-cookie@6.0.0: - resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==} - engines: {node: '>=16'} - tough-cookie@6.0.1: resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} engines: {node: '>=16'} @@ -28669,20 +28555,10 @@ packages: peerDependencies: tslib: '2' - tree-dump@1.1.0: - resolution: {integrity: sha512-rMuvhU4MCDbcbnleZTFezWsaZXRFemSqAM+7jPnzUl1fo9w3YEKOxAeui0fz3OI4EU4hf23iyA7uQRVko+UaBA==} - engines: {node: '>=10.0'} - peerDependencies: - tslib: '2' - tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true - treeverse@3.0.0: - resolution: {integrity: sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - triple-beam@1.4.1: resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} engines: {node: '>= 14.0.0'} @@ -28699,36 +28575,11 @@ packages: peerDependencies: typescript: '>=4.8.4' - ts-declaration-location@1.0.5: - resolution: {integrity: sha512-WqmlO9IoeYwCqJ2E9kHMcY9GZhhfLYItC3VnHDlPOrg6nNdUWS4wn4hhDZUPt60m1EvtjPIZyprTjpI992Bgzw==} - peerDependencies: - typescript: '>=4.0.0' - ts-declaration-location@1.0.7: resolution: {integrity: sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==} peerDependencies: typescript: '>=4.0.0' - ts-morph@21.0.1: - resolution: {integrity: sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg==} - - ts-morph@25.0.1: - resolution: {integrity: sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ==} - - ts-node@10.9.2: - resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': 25.0.9 - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - ts-pattern@5.6.2: resolution: {integrity: sha512-d4IxJUXROL5NCa3amvMg6VQW2HVtZYmUTPfvVtO7zJWGYLJ+mry9v2OmYm+z67aniQoQ8/yFNadiEwtNS9qQiw==} @@ -28762,16 +28613,8 @@ packages: resolution: {integrity: sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==} engines: {node: '>= 6.0.0'} - tuf-js@4.1.0: - resolution: {integrity: sha512-50QV99kCKH5P/Vs4E2Gzp7BopNV+KzTXqWeaxrfu5IQJBOULRsTIS9seSsOVT8ZnGXzCyx55nYWAi4qJzpZKEQ==} - engines: {node: ^20.17.0 || >=22.9.0} - - tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - - turbo-stream@3.1.0: - resolution: {integrity: sha512-tVI25WEXl4fckNEmrq70xU1XumxUwEx/FZD5AgEcV8ri7Wvrg2o7GEq8U7htrNx3CajciGm+kDyhRf5JB6t7/A==} + turbo-stream@3.2.1: + resolution: {integrity: sha512-BaX0eWz3IrypOVDFqPv3VGD6uZZW8y3oFAOJqZQ+oopmOyQ8/xNm7IMwAJFvxax2DBa8zSk+/AeqA6D6b1PXGg==} type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} @@ -28781,12 +28624,16 @@ packages: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} - type-fest@5.4.1: - resolution: {integrity: sha512-xygQcmneDyzsEuKZrFbRMne5HDqMs++aFzefrJTgEIKjQ3rekM+RPfFCVq2Gp1VIDqddoYeppCj4Pcb+RZW0GQ==} + type-fest@5.9.0: + resolution: {integrity: sha512-yANm3Jr3GiJ1qgJlxGAVxTOIcEOk1rhQHamlXtnrCK7EHP4HeM9OGxtMg/W7HFdrVzw/ZWJKGVIJusVH85sLtw==} engines: {node: '>=20'} type-is@1.6.18: @@ -28797,9 +28644,6 @@ packages: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} - typed-assert@1.0.9: - resolution: {integrity: sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==} - typescript-eslint@8.44.1: resolution: {integrity: sha512-0ws8uWGrUVTjEeN2OM4K1pLKHK/4NiNP/vz6ns+LjT/6sqpaYzIVFajZb1fj/IDwpsrrHb3Jy0Qm5u9CPcKaeg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -28824,11 +28668,6 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - typescript@5.6.1-rc: resolution: {integrity: sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==} engines: {node: '>=14.17'} @@ -28864,11 +28703,13 @@ packages: engines: {node: '>=14.17'} hasBin: true - ufo@1.6.1: - resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true - ufo@1.6.3: - resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==} + ufo@1.6.4: + resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} uint8array-extras@1.5.0: resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==} @@ -28878,59 +28719,42 @@ packages: resolution: {integrity: sha512-dPJyqPzx8preQhqq24bBG1YNkvigm87K8kVEHCD+ruZg24t6IFEFv00xMWfxcC4djmFtiTLdFuADn4+DOz6R7Q==} hasBin: true - ultrahtml@1.6.0: - resolution: {integrity: sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==} - uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} - unctx@2.5.0: - resolution: {integrity: sha512-p+Rz9x0R7X+CYDkT+Xg8/GhpcShTlU8n+cf9OtOEf7zEQsNcCZO1dPKNRDqvUTaq+P32PMMkxWHwfrxkqfqAYg==} - undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} undici-types@7.24.4: resolution: {integrity: sha512-cRaY9PagdEZoRmcwzk3tUV3SVGrVQkR6bcSilav/A0vXsfpW4Lvd0BvgRMwTEDTLLGN+QdyBTG+nnvTgJhdt6w==} - undici@6.27.0: - resolution: {integrity: sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==} + undici@6.21.2: + resolution: {integrity: sha512-uROZWze0R0itiAKVPsYhFov9LxrPMHLMEQFszeI2gCN6bnIIZ8twzBCJcN2LJrBBLfrP0t1FW0g+JmKVl8Vk1g==} engines: {node: '>=18.17'} undici@7.24.4: resolution: {integrity: sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w==} engines: {node: '>=20.18.1'} - undici@7.28.0: - resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==} + undici@7.27.2: + resolution: {integrity: sha512-uZsKNuzQxDMUY6M3pIMvy5tvlGmtq8XJ2oLAkfRKGNu+1VQAIvLy2xIVG5ATZl5wDXl/tddByAWCizRbOme+TA==} engines: {node: '>=20.18.1'} - undom-ng@1.1.2: - resolution: {integrity: sha512-ZYKxr3cM2X4x4D+y1uo82fBHtOM8lNr5od/msdI2AI7YGCwrLkGt/ofOF0RlnDDF9f8gqqSbdMua1eoTc2LbYQ==} + undici@7.29.0: + resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} + engines: {node: '>=20.18.1'} + + undici@7.30.1: + resolution: {integrity: sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==} + engines: {node: '>=20.18.1'} unenv@2.0.0-rc.24: resolution: {integrity: sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==} - unicode-canonical-property-names-ecmascript@2.0.1: - resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} - engines: {node: '>=4'} - unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} engines: {node: '>=4'} - unicode-match-property-ecmascript@2.0.0: - resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} - engines: {node: '>=4'} - - unicode-match-property-value-ecmascript@2.2.1: - resolution: {integrity: sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==} - engines: {node: '>=4'} - - unicode-property-aliases-ecmascript@2.2.0: - resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==} - engines: {node: '>=4'} - unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} @@ -28939,14 +28763,6 @@ packages: resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==} engines: {node: '>=20'} - unimport@5.6.0: - resolution: {integrity: sha512-8rqAmtJV8o60x46kBAJKtHpJDJWkA2xcBqWKPI14MgUb05o1pnpnCnXSxedUXyeq7p8fR5g3pTo2BaswZ9lD9A==} - engines: {node: '>=18.12.0'} - - universal-analytics@0.5.3: - resolution: {integrity: sha512-HXSMyIcf2XTvwZ6ZZQLfxfViRm/yTGoRgDeTbojtq6rezeyKB0sTBcKH2fhddnteAHRcHiKgr/ACpbgjGOC6RQ==} - engines: {node: '>=12.18.2'} - universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -28955,10 +28771,6 @@ packages: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} - universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - unixify@1.0.0: resolution: {integrity: sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==} engines: {node: '>=0.10.0'} @@ -28967,10 +28779,6 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - unplugin-utils@0.3.1: - resolution: {integrity: sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog==} - engines: {node: '>=20.19.0'} - unplugin@1.0.1: resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==} @@ -28978,15 +28786,47 @@ packages: resolution: {integrity: sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==} engines: {node: '>=18.12.0'} - unplugin@3.0.0: - resolution: {integrity: sha512-0Mqk3AT2TZCXWKdcoaufeXNukv2mTrEZExeXlHIOZXdqYoHHr4n51pymnwV8x2BOVxwXbK2HLlI7usrqMpycdg==} + unplugin@3.7.0: + resolution: {integrity: sha512-GrM2uq3DQo3hvLU2FjeYhooJ8BY9N6j1Fbzgx7Pta3VVJevsD3VP4dPjZkZOS0mLvN8w9zzr9OlP+31bSMyuLw==} engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@farmfe/core': '*' + '@rsbuild/core': '*' + '@rspack/core': '*' + bun-types-no-globals: '*' + esbuild: '*' + rolldown: '*' + rollup: '*' + unloader: '*' + vite: ^8.3.4 + webpack: '*' + peerDependenciesMeta: + '@farmfe/core': + optional: true + '@rsbuild/core': + optional: true + '@rspack/core': + optional: true + bun-types-no-globals: + optional: true + esbuild: + optional: true + rolldown: + optional: true + rollup: + optional: true + unloader: + optional: true + vite: + optional: true + webpack: + optional: true unrs-resolver@1.11.1: resolution: {integrity: sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==} - unstorage@1.17.4: - resolution: {integrity: sha512-fHK0yNg38tBiJKp/Vgsq4j0JEsCmgqH58HAn707S7zGkArbZsVr/CwINoi+nh3h98BRCwKvx1K3Xg9u3VV83sw==} + unstorage@1.17.5: + resolution: {integrity: sha512-0i3iqvRfx29hkNntHyQvJTpf5W9dQ9ZadSoRU8+xVlhVtT7jAX57fazYO9EHvcRCfBCyi5YRya7XCDOsbTgkPg==} peerDependencies: '@azure/app-configuration': ^1.8.0 '@azure/cosmos': ^4.2.0 @@ -29047,173 +28887,16 @@ packages: uploadthing: optional: true - unstorage@2.0.0-alpha.5: - resolution: {integrity: sha512-Sj8btci21Twnd6M+N+MHhjg3fVn6lAPElPmvFTe0Y/wR0WImErUdA1PzlAaUavHylJ7uDiFwlZDQKm0elG4b7g==} - peerDependencies: - '@azure/app-configuration': ^1.9.0 - '@azure/cosmos': ^4.7.0 - '@azure/data-tables': ^13.3.1 - '@azure/identity': ^4.13.0 - '@azure/keyvault-secrets': ^4.10.0 - '@azure/storage-blob': ^12.29.1 - '@capacitor/preferences': ^6.0.3 || ^7.0.0 - '@deno/kv': '>=0.12.0' - '@netlify/blobs': ^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0 - '@planetscale/database': ^1.19.0 - '@upstash/redis': ^1.35.6 - '@vercel/blob': '>=0.27.3' - '@vercel/functions': ^2.2.12 || ^3.0.0 - '@vercel/kv': ^1.0.1 - aws4fetch: ^1.0.20 - chokidar: ^4 || ^5 - db0: '>=0.3.4' - idb-keyval: ^6.2.2 - ioredis: ^5.8.2 - lru-cache: ^11.2.2 - mongodb: ^6 || ^7 - ofetch: '*' - uploadthing: ^7.7.4 - peerDependenciesMeta: - '@azure/app-configuration': - optional: true - '@azure/cosmos': - optional: true - '@azure/data-tables': - optional: true - '@azure/identity': - optional: true - '@azure/keyvault-secrets': - optional: true - '@azure/storage-blob': - optional: true - '@capacitor/preferences': - optional: true - '@deno/kv': - optional: true - '@netlify/blobs': - optional: true - '@planetscale/database': - optional: true - '@upstash/redis': - optional: true - '@vercel/blob': - optional: true - '@vercel/functions': - optional: true - '@vercel/kv': - optional: true - aws4fetch: - optional: true - chokidar: - optional: true - db0: - optional: true - idb-keyval: - optional: true - ioredis: - optional: true - lru-cache: - optional: true - mongodb: - optional: true - ofetch: - optional: true - uploadthing: - optional: true + unstorage@2.0.0-alpha.10: + resolution: {integrity: sha512-6h1veZp8gnp4dGllf0tDijoXxDYymJu251IpKKkrSVH+QHL6tXFbwG85KM+CBHSgpkkgtPuIiZ9oLCLP5+1Evw==} - unstorage@2.0.0-alpha.6: - resolution: {integrity: sha512-w5vLYCJtnSx3OBtDk7cG4c1p3dfAnHA4WSZq9Xsurjbl2wMj7zqfOIjaHQI1Bl7yKzUxXAi+kbMr8iO2RhJmBA==} - peerDependencies: - '@azure/app-configuration': ^1.11.0 - '@azure/cosmos': ^4.9.1 - '@azure/data-tables': ^13.3.2 - '@azure/identity': ^4.13.0 - '@azure/keyvault-secrets': ^4.10.0 - '@azure/storage-blob': ^12.31.0 - '@capacitor/preferences': ^6 || ^7 || ^8 - '@deno/kv': '>=0.13.0' - '@netlify/blobs': ^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0 - '@planetscale/database': ^1.19.0 - '@upstash/redis': ^1.36.2 - '@vercel/blob': '>=0.27.3' - '@vercel/functions': ^2.2.12 || ^3.0.0 - '@vercel/kv': ^1.0.1 - aws4fetch: ^1.0.20 - chokidar: ^4 || ^5 - db0: '>=0.3.4' - idb-keyval: ^6.2.2 - ioredis: ^5.9.3 - lru-cache: ^11.2.6 - mongodb: ^6 || ^7 - ofetch: '*' - uploadthing: ^7.7.4 - peerDependenciesMeta: - '@azure/app-configuration': - optional: true - '@azure/cosmos': - optional: true - '@azure/data-tables': - optional: true - '@azure/identity': - optional: true - '@azure/keyvault-secrets': - optional: true - '@azure/storage-blob': - optional: true - '@capacitor/preferences': - optional: true - '@deno/kv': - optional: true - '@netlify/blobs': - optional: true - '@planetscale/database': - optional: true - '@upstash/redis': - optional: true - '@vercel/blob': - optional: true - '@vercel/functions': - optional: true - '@vercel/kv': - optional: true - aws4fetch: - optional: true - chokidar: - optional: true - db0: - optional: true - idb-keyval: - optional: true - ioredis: - optional: true - lru-cache: - optional: true - mongodb: - optional: true - ofetch: - optional: true - uploadthing: - optional: true + until-async@3.0.2: + resolution: {integrity: sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==} - untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - - untun@0.1.3: - resolution: {integrity: sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==} + untun@0.2.2: + resolution: {integrity: sha512-+NnOJcSiEtYsVgJmXUzQbJeRAFXJC4yPJYuh6kF9B0Rm6zunXcs/3GZOTllyocSbUDIxD6Bj7e/4ATw7sph1Sw==} hasBin: true - untyped@2.0.0: - resolution: {integrity: sha512-nwNCjxJTjNuLCgFr42fEak5OcLuB3ecca+9ksPFNvtfYSLpjf+iJqSIaSnIile6ZPbKYxI5k2AfXqeopGudK/g==} - hasBin: true - - unwasm@0.5.3: - resolution: {integrity: sha512-keBgTSfp3r6+s9ZcSma+0chwxQdmLbB5+dAD9vjtB21UTMYuKAxHXCU1K2CbCtnP09EaWeRvACnXk0EJtUx+hw==} - - upath@2.0.1: - resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} - engines: {node: '>=4'} - update-browserslist-db@1.1.2: resolution: {integrity: sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==} hasBin: true @@ -29226,8 +28909,8 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - uqr@0.1.2: - resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} + uqr@0.1.3: + resolution: {integrity: sha512-0rjE8iEJe4YmT9TOhwsZtqCMRLc5DXZUI2UEYUUg63ikBkqqE5EYWaI0etFe/5KUcmcYwLih2RND1kq+hrUJXA==} uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -29246,7 +28929,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -29256,7 +28939,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': ^19.2.8 - react: ^19.2.3 + react: ~19.2.9 peerDependenciesMeta: '@types/react': optional: true @@ -29264,10 +28947,7 @@ packages: use-sync-external-store@1.6.0: resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==} peerDependencies: - react: ^19.2.3 - - utif2@4.1.0: - resolution: {integrity: sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==} + react: ~19.2.9 util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -29287,28 +28967,11 @@ packages: deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true - uuid@11.1.0: - resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} - hasBin: true - - uuid@7.0.3: - resolution: {integrity: sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==} - deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). - hasBin: true - uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true - uuid@9.0.1: - resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} - deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). - hasBin: true - - v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - valibot@1.0.0-beta.15: resolution: {integrity: sha512-BKy8XosZkDHWmYC+cJG74LBzP++Gfntwi33pP3D3RKztz2XV9jmFWnkOi21GoqARP8wAWARwhV6eTr1JcWzjGw==} peerDependencies: @@ -29332,9 +28995,8 @@ packages: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - validate-npm-package-name@7.0.2: - resolution: {integrity: sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==} - engines: {node: ^20.17.0 || >=22.9.0} + varint@6.0.0: + resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} @@ -29345,7 +29007,7 @@ packages: engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: typescript: '*' - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: vite: optional: true @@ -29353,14 +29015,14 @@ packages: vite-plugin-externalize-deps@0.10.0: resolution: {integrity: sha512-eQrtpT/Do7AvDn76l1yL6ZHyXJ+UWH2LaHVqhAes9go54qaAnPZuMbgxcroQ/7WY3ZyetZzYW2quQnDF0DV5qg==} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 vite-plugin-solid@2.11.10: resolution: {integrity: sha512-Yr1dQybmtDtDAHkii6hXuc1oVH9CPcS/Zb2jN/P36qqcrkNnVPsMTzQ06jyzFPFjj3U1IYKMVt/9ZqcwGCEbjw==} peerDependencies: '@testing-library/jest-dom': ^5.16.6 || ^5.17.0 || ^6.* solid-js: 1.9.12 - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: '@testing-library/jest-dom': optional: true @@ -29370,69 +29032,23 @@ packages: peerDependencies: '@testing-library/jest-dom': ^5.16.6 || ^5.17.0 || ^6.* solid-js: 1.9.12 - vite: ^8.0.14 + vite: ^8.3.4 peerDependenciesMeta: '@testing-library/jest-dom': optional: true - vite-plugin-static-copy@3.4.0: - resolution: {integrity: sha512-ekryzCw0ouAOE8tw4RvVL/dfqguXzumsV3FBKoKso4MQ1MUUrUXtl5RI4KpJQUNGqFEsg9kxl4EvDl02YtA9VQ==} - engines: {node: ^18.0.0 || >=20.0.0} - peerDependencies: - vite: ^8.0.14 - vite-tsconfig-paths@6.1.1: resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 - vite@7.3.6: - resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==} + vite@8.3.4: + resolution: {integrity: sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': 25.0.9 - jiti: '>=1.21.0' - less: ^4.0.0 - lightningcss: ^1.21.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: '>=0.54.8' - sugarss: ^5.0.0 - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - - vite@8.0.14: - resolution: {integrity: sha512-s4BJJ+5y1pYL6Otw51FHhVJQhPnuRinKig64g/1+EUNaJsd3gCKdD31IPFvswUgW9/60QT9oFHbZHbQK5imcxw==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - '@types/node': 25.0.9 - '@vitejs/devtools': ^0.1.18 + '@vitejs/devtools': ^0.7.1 esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 @@ -29472,7 +29088,15 @@ packages: vitefu@1.1.1: resolution: {integrity: sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==} peerDependencies: - vite: ^8.0.14 + vite: ^8.3.4 + peerDependenciesMeta: + vite: + optional: true + + vitefu@1.1.3: + resolution: {integrity: sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==} + peerDependencies: + vite: ^8.3.4 peerDependenciesMeta: vite: optional: true @@ -29493,7 +29117,48 @@ packages: '@vitest/ui': 4.1.4 happy-dom: '*' jsdom: '*' - vite: ^8.0.14 + vite: ^8.3.4 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + vitest@5.0.4: + resolution: {integrity: sha512-z0WxZRV2Sg48wF0FSgMq3TFG8JS38/Qr96vZVZdX6+Em9raQTvnXQvdTFJe2m3rfyJnEHeHQ/snceIdi8D1pVg==} + engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': 25.0.9 + '@vitest/browser-playwright': 5.0.4 + '@vitest/browser-preview': 5.0.4 + '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0 + '@vitest/coverage-istanbul': 5.0.4 + '@vitest/coverage-v8': 5.0.4 + '@vitest/ui': 5.0.4 + happy-dom: '*' + jsdom: '*' + vite: ^8.3.4 peerDependenciesMeta: '@edge-runtime/vm': optional: true @@ -29553,20 +29218,8 @@ packages: peerDependencies: eslint: ^9.22.0 - vue-tsc@3.1.5: - resolution: {integrity: sha512-L/G9IUjOWhBU0yun89rv8fKqmKC+T0HfhrFjlIml71WpfBv9eb4E9Bev8FMbyueBIU9vxQqbd+oOsVcDa5amGw==} - hasBin: true - peerDependencies: - typescript: '>=5.0.0' - - vue-tsc@3.1.8: - resolution: {integrity: sha512-deKgwx6exIHeZwF601P1ktZKNF0bepaSN4jBU3AsbldPx9gylUc1JDxYppl82yxgkAgaz0Y0LCLOi+cXe9HMYA==} - hasBin: true - peerDependencies: - typescript: '>=5.0.0' - - vue-tsc@3.3.7: - resolution: {integrity: sha512-+C+rgD49wAQ5bUTl2sp5a8Bzg4YoldMNXM+g7CFe604MYcQ8PrZPMQhIjJSzKXtPBCa+C5ayMipqjbA7splekQ==} + vue-tsc@3.3.8: + resolution: {integrity: sha512-xXmYlVQpcwJDWyGlqbHrGVOl1h3UOsASymRibrHc+iy9j/UNnOrOn4u+fntHz4D6Cs74RtapeqVV6CzJeg+UlA==} hasBin: true peerDependencies: typescript: '>=5.0.0' @@ -29583,27 +29236,10 @@ packages: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} - wait-on@9.0.10: - resolution: {integrity: sha512-rCoJEhvMr0X6alHmwc9abbrA5ZrLZFKpFQVKPNFwl2h7DapXOGdmimIHDtLOWhT4PjhZhxFEtZoQgEXbkDWdZw==} - engines: {node: '>=20.0.0'} - hasBin: true - - walk-up-path@4.0.0: - resolution: {integrity: sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==} - engines: {node: 20 || >=22} - watchpack@2.4.2: resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==} engines: {node: '>=10.13.0'} - watchpack@2.4.4: - resolution: {integrity: sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==} - engines: {node: '>=10.13.0'} - - watchpack@2.5.1: - resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} - engines: {node: '>=10.13.0'} - watchpack@2.5.2: resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==} engines: {node: '>=10.13.0'} @@ -29614,9 +29250,6 @@ packages: wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - weak-lru-cache@1.2.2: - resolution: {integrity: sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==} - web-streams-polyfill@3.3.3: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} @@ -29634,10 +29267,6 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - webidl-conversions@8.0.0: - resolution: {integrity: sha512-n4W4YFyz5JzOfQeA8oN7dUYpR+MBP3PIUsn2jLjWXwK5ASUzt0Jc/A5sAUZoCYFJRGF0FBKJ+1JjN43rNdsQzA==} - engines: {node: '>=20'} - webidl-conversions@8.0.1: resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} engines: {node: '>=20'} @@ -29668,15 +29297,6 @@ packages: webpack: optional: true - webpack-dev-middleware@7.4.5: - resolution: {integrity: sha512-uxQ6YqGdE4hgDKNf7hUiPXOdtkXvBJXrfEGYSx7P7LC8hnUYGK70X6xQXUvXeNyBDDcsiQXpG2m3G9vxowaEuA==} - engines: {node: '>= 18.12.0'} - peerDependencies: - webpack: ^5.0.0 - peerDependenciesMeta: - webpack: - optional: true - webpack-dev-server@5.2.4: resolution: {integrity: sha512-GqDPGZN9bRqKBTkp4aWkobDDHMsrXKoGSdOH56smIri8qR0JG8gfL8/v/f/OZR3/OKXjG8uwJbFVhKm/FNU/UA==} engines: {node: '>= 18.12.0'} @@ -29690,27 +29310,10 @@ packages: webpack-cli: optional: true - webpack-dev-server@5.2.5: - resolution: {integrity: sha512-4wZtCquSuv9CKX8oybo+mqxtxZqWz47uM1Ch94lxowBztOhWCbhqvRbfC/mODOwxgV2brY+JGZpHq58/SuVFYg==} - engines: {node: '>= 18.12.0'} - hasBin: true - peerDependencies: - webpack: ^5.0.0 - webpack-cli: '*' - peerDependenciesMeta: - webpack: - optional: true - webpack-cli: - optional: true - webpack-merge@5.10.0: resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} engines: {node: '>=10.0.0'} - webpack-merge@6.0.1: - resolution: {integrity: sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==} - engines: {node: '>=18.0.0'} - webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} @@ -29719,15 +29322,9 @@ packages: resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} engines: {node: '>=10.13.0'} - webpack-subresource-integrity@5.1.0: - resolution: {integrity: sha512-sacXoX+xd8r4WKsy9MvH/q/vBtEHr86cpImXwyg74pFIpERKt6FmB8cXpeuh0ZLgclOlHI4Wcll7+R5L02xk9Q==} - engines: {node: '>= 12'} - peerDependencies: - html-webpack-plugin: '>= 5.0.0-beta.1 < 6' - webpack: ^5.12.0 - peerDependenciesMeta: - html-webpack-plugin: - optional: true + webpack-sources@3.5.1: + resolution: {integrity: sha512-jyuiGJdtvY434z5bUZrjz67v76/ePNvFZTp9Mdz29IlH4+GPsgyGjiv0fKI+M7BdkU6ADjulUcKAd3tUK3WlEw==} + engines: {node: '>=10.13.0'} webpack-virtual-modules@0.5.0: resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} @@ -29735,18 +29332,8 @@ packages: webpack-virtual-modules@0.6.2: resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} - webpack@5.104.0: - resolution: {integrity: sha512-5DeICTX8BVgNp6afSPYXAFjskIgWGlygQH58bcozPOXgo2r/6xx39Y1+cULZ3gTxUYQP88jmwLj2anu4Xaq84g==} - engines: {node: '>=10.13.0'} - hasBin: true - peerDependencies: - webpack-cli: '*' - peerDependenciesMeta: - webpack-cli: - optional: true - - webpack@5.105.2: - resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} + webpack@5.110.3: + resolution: {integrity: sha512-GuizBzRvo9YPpyoNMf3ag7AzxbaW85qrRSqTha345KyJbAFPt3/cMzBM0h+RWg7SK/7DdzRLINP3LvQ0hvr4hg==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -29801,6 +29388,9 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + when-exit@2.1.5: + resolution: {integrity: sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==} + which-boxed-primitive@1.1.1: resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} engines: {node: '>= 0.4'} @@ -29809,25 +29399,18 @@ packages: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} engines: {node: '>= 0.4'} - which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-typed-array@1.1.19: resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} engines: {node: '>= 0.4'} - which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true - which@6.0.1: - resolution: {integrity: sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==} - engines: {node: ^20.17.0 || >=22.9.0} + which@3.0.1: + resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} hasBin: true why-is-node-running@2.3.0: @@ -29835,12 +29418,14 @@ packages: engines: {node: '>=8'} hasBin: true + why-is-node-running@3.2.1: + resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==} + engines: {node: '>=20.11'} + hasBin: true + wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} - winreg@1.2.5: - resolution: {integrity: sha512-uf7tHf+tw0B1y+x+mKTLHkykBgK2KMs3g+KlzmyMbLvICSHQyB/xOFjTT8qZ3oeTFyU7Bbj4FzXitGG6jvKhYw==} - winston-transport@4.9.0: resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} engines: {node: '>= 12.0.0'} @@ -29858,6 +29443,11 @@ packages: engines: {node: '>=16'} hasBin: true + workerd@1.20261104.1: + resolution: {integrity: sha512-JuiKY9k/4V4UE2xsupaTvZ1SF6o2a8sg+/zfq/DaSDwvH+o7t2ZEFuIWNEnryfeFdP47/tz/p828Kvl4ptPlrA==} + engines: {node: '>=16'} + hasBin: true + wrangler@4.75.0: resolution: {integrity: sha512-Efk1tcnm4eduBYpH1sSjMYydXMnIFPns/qABI3+fsbDrUk5GksNYX8nYGVP4sFygvGPO7kJc36YJKB5ooA7JAg==} engines: {node: '>=20.0.0'} @@ -29880,21 +29470,9 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.2: - resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} - engines: {node: '>=18'} - wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - write-file-atomic@7.0.1: - resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} - engines: {node: ^20.17.0 || >=22.9.0} - ws@8.18.0: resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} @@ -29907,18 +29485,6 @@ packages: utf-8-validate: optional: true - ws@8.18.3: - resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.20.0: resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==} engines: {node: '>=10.0.0'} @@ -29931,17 +29497,17 @@ packages: utf-8-validate: optional: true - wsl-utils@0.3.1: - resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==} - engines: {node: '>=20'} - - xcode@3.0.1: - resolution: {integrity: sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==} + ws@8.21.0: + resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} - - xml-js@1.6.11: - resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==} - hasBin: true + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} @@ -29951,44 +29517,18 @@ packages: resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} engines: {node: '>=18'} - xml-parse-from-string@1.0.1: - resolution: {integrity: sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==} - - xml2js@0.5.0: - resolution: {integrity: sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==} - engines: {node: '>=4.0.0'} - - xml2js@0.6.2: - resolution: {integrity: sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==} - engines: {node: '>=4.0.0'} - xmlbuilder2@4.0.3: resolution: {integrity: sha512-bx8Q1STctnNaaDymWnkfQLKofs0mGNN7rLLapJlGuV3VlvegD7Ls4ggMjE3aUSWItCCzU0PEv45lI87iSigiCA==} engines: {node: '>=20.0'} - xmlbuilder@11.0.1: - resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} - engines: {node: '>=4.0'} - - xmlbuilder@15.1.1: - resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==} - engines: {node: '>=8.0'} - xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} - xpath@0.0.32: - resolution: {integrity: sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==} - engines: {node: '>=0.6.0'} - xss@1.0.15: resolution: {integrity: sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==} engines: {node: '>= 0.10.0'} hasBin: true - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -30012,10 +29552,6 @@ packages: engines: {node: '>= 14.6'} hasBin: true - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -30024,44 +29560,18 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - yargs-parser@22.0.0: - resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} - engines: {node: ^20.19.0 || ^22.12.0 || >=23} - - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} - yargs@17.7.1: - resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} - engines: {node: '>=12'} - yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} - yargs@18.0.0: - resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=23} - - yauzl@2.10.0: - resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} - - yauzl@3.2.0: - resolution: {integrity: sha512-Ow9nuGZE+qp1u4JIPvg+uCiUr7xGQWdff7JQSk5VGYTAZMDe2q8lxJ10ygv10qmSj031Ty/6FNJpLO4o1Sgc+w==} + yauzl@3.4.0: + resolution: {integrity: sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw==} engines: {node: '>=12'} - yazl@3.3.1: - resolution: {integrity: sha512-BbETDVWG+VcMUle37k5Fqp//7SDOK2/1+T7X8TD96M3D9G8jK5VLUdQVdVjGi8im7FGkazX7kk5hkU8X4L5Bng==} - - yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -30070,12 +29580,8 @@ packages: resolution: {integrity: sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==} engines: {node: '>=12.20'} - yoctocolors-cjs@2.1.3: - resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} - engines: {node: '>=18'} - - yoctocolors@2.1.2: - resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} + yoctocolors-cjs@2.1.2: + resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} engines: {node: '>=18'} youch-core@0.3.3: @@ -30084,18 +29590,12 @@ packages: youch@4.1.0-beta.10: resolution: {integrity: sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==} - youch@4.1.0-beta.13: - resolution: {integrity: sha512-3+AG1Xvt+R7M7PSDudhbfbwiyveW6B8PLBIwTyEC598biEYIjHhC89i6DBEvR0EZUjGY3uGSnC429HpIa2Z09g==} - zeptomatch@2.0.2: resolution: {integrity: sha512-H33jtSKf8Ijtb5BW6wua3G5DhnFjbFML36eFu+VdOoVY4HD9e7ggjqdM6639B+L87rjnR6Y+XeRzBXZdy52B/g==} - zimmerframe@1.1.4: - resolution: {integrity: sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==} - - zip-stream@6.0.1: - resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} - engines: {node: '>= 14'} + zip-stream@7.0.5: + resolution: {integrity: sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w==} + engines: {node: '>=18'} zod@3.25.57: resolution: {integrity: sha512-6tgzLuwVST5oLUxXTmBqoinKMd3JeesgbgseXeFasKKj8Q1FCZrHnbqJOyiEvr4cVAlbug+CgIsmJ8cl/pU5FA==} @@ -30106,13 +29606,19 @@ packages: zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zod@4.5.4: + resolution: {integrity: sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==} + + zod@4.6.6: + resolution: {integrity: sha512-4UmzQUF5fxvfcYHlbjBmejU+w+hbDnWFx4aS8kBx7nPBHcO2SqPbpAG8snbdg+Xse4pRefR98hgjFgIMCI/UhA==} + zustand@5.0.12: resolution: {integrity: sha512-i77ae3aZq4dhMlRhJVCYgMLKuSiZAaUPAct2AksxQ+gOtimhGMdXljRT21P5BNpeT4kXlLIckvkPM029OljD7g==} engines: {node: '>=12.20.0'} peerDependencies: '@types/react': ^19.2.8 immer: '>=9.0.6' - react: ^19.2.3 + react: ~19.2.9 use-sync-external-store: '>=1.2.0' peerDependenciesMeta: '@types/react': @@ -30130,215 +29636,8 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - - '@analogjs/vite-plugin-angular@2.6.3(@angular-devkit/build-angular@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(tailwindcss@4.2.2)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0))(@angular/build@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0))(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - magic-string: 0.30.21 - obug: 2.1.1 - oxc-parser: 0.121.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - tinyglobby: 0.2.16 - ts-morph: 21.0.1 - optionalDependencies: - '@angular-devkit/build-angular': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(tailwindcss@4.2.2)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0) - '@angular/build': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0) - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - '@andrewbranch/untar.js@1.0.3': {} - '@angular-devkit/architect@0.2102.19(chokidar@5.0.0)': - dependencies: - '@angular-devkit/core': 21.2.19(chokidar@5.0.0) - rxjs: 7.8.2 - transitivePeerDependencies: - - chokidar - - '@angular-devkit/build-angular@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(tailwindcss@4.2.2)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0)': - dependencies: - '@ampproject/remapping': 2.3.0 - '@angular-devkit/architect': 0.2102.19(chokidar@5.0.0) - '@angular-devkit/build-webpack': 0.2102.19(chokidar@5.0.0)(webpack-dev-server@5.2.5(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - '@angular-devkit/core': 21.2.19(chokidar@5.0.0) - '@angular/build': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0) - '@angular/compiler-cli': 21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2) - '@babel/core': 7.29.7 - '@babel/generator': 7.29.1 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/plugin-transform-async-generator-functions': 7.29.0(@babel/core@7.29.7) - '@babel/plugin-transform-async-to-generator': 7.28.6(@babel/core@7.29.7) - '@babel/plugin-transform-runtime': 7.29.0(@babel/core@7.29.7) - '@babel/preset-env': 7.29.2(@babel/core@7.29.7) - '@babel/runtime': 7.29.2 - '@discoveryjs/json-ext': 0.6.3 - '@ngtools/webpack': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(typescript@6.0.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - ansi-colors: 4.1.3 - autoprefixer: 10.4.27(postcss@8.5.12) - babel-loader: 10.0.0(@babel/core@7.29.7)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - browserslist: 4.28.1 - copy-webpack-plugin: 14.0.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - css-loader: 7.1.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - esbuild-wasm: 0.28.1 - http-proxy-middleware: 3.0.7 - istanbul-lib-instrument: 6.0.3 - jsonc-parser: 3.3.1 - karma-source-map-support: 1.4.0 - less: 4.4.2 - less-loader: 12.3.1(less@4.4.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - license-webpack-plugin: 4.0.2(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - loader-utils: 3.3.1 - mini-css-extract-plugin: 2.10.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - open: 11.0.0 - ora: 9.3.0 - picomatch: 4.0.4 - piscina: 5.2.0 - postcss: 8.5.12 - postcss-loader: 8.2.0(postcss@8.5.12)(typescript@6.0.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - resolve-url-loader: 5.0.0 - rxjs: 7.8.2 - sass: 1.97.3 - sass-loader: 16.0.7(sass@1.97.3)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - semver: 7.7.4 - source-map-loader: 5.0.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - source-map-support: 0.5.21 - terser: 5.46.0 - tinyglobby: 0.2.15 - tree-kill: 1.2.2 - tslib: 2.8.1 - typescript: 6.0.2 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - webpack-dev-middleware: 7.4.5(tslib@2.8.1)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - webpack-dev-server: 5.2.5(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - webpack-merge: 6.0.1 - webpack-subresource-integrity: 5.1.0(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - optionalDependencies: - esbuild: 0.28.1 - tailwindcss: 4.2.2 - transitivePeerDependencies: - - '@angular/compiler' - - '@emnapi/core' - - '@emnapi/runtime' - - '@rspack/core' - - '@swc/core' - - '@types/node' - - '@vitejs/devtools' - - bufferutil - - chokidar - - debug - - html-webpack-plugin - - jiti - - node-sass - - sass-embedded - - stylus - - sugarss - - supports-color - - tsx - - uglify-js - - utf-8-validate - - vitest - - webpack-cli - - yaml - - '@angular-devkit/build-webpack@0.2102.19(chokidar@5.0.0)(webpack-dev-server@5.2.5(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1))': - dependencies: - '@angular-devkit/architect': 0.2102.19(chokidar@5.0.0) - rxjs: 7.8.2 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - webpack-dev-server: 5.2.5(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - transitivePeerDependencies: - - chokidar - - '@angular-devkit/core@21.2.19(chokidar@5.0.0)': - dependencies: - ajv: 8.18.0 - ajv-formats: 3.0.1(ajv@8.18.0) - jsonc-parser: 3.3.1 - picomatch: 4.0.4 - rxjs: 7.8.2 - source-map: 0.7.6 - optionalDependencies: - chokidar: 5.0.0 - - '@angular/build@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0)': - dependencies: - '@ampproject/remapping': 2.3.0 - '@angular-devkit/architect': 0.2102.19(chokidar@5.0.0) - '@angular/compiler': 21.2.18 - '@angular/compiler-cli': 21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2) - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-split-export-declaration': 7.24.7 - '@inquirer/confirm': 5.1.21(@types/node@25.0.9) - '@vitejs/plugin-basic-ssl': 2.1.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - beasties: 0.4.1 - browserslist: 4.28.1 - esbuild: 0.28.1 - https-proxy-agent: 7.0.6 - istanbul-lib-instrument: 6.0.3 - jsonc-parser: 3.3.1 - listr2: 9.0.5 - magic-string: 0.30.21 - mrmime: 2.0.1 - parse5-html-rewriting-stream: 8.0.0 - picomatch: 4.0.4 - piscina: 5.2.0 - rolldown: 1.0.0-rc.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - sass: 1.97.3 - semver: 7.7.4 - source-map-support: 0.5.21 - tinyglobby: 0.2.15 - tslib: 2.8.1 - typescript: 6.0.2 - undici: 7.28.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - watchpack: 2.5.1 - optionalDependencies: - less: 4.4.2 - lmdb: 3.5.1 - postcss: 8.5.12 - tailwindcss: 4.2.2 - vitest: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - '@types/node' - - '@vitejs/devtools' - - chokidar - - jiti - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - - '@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2)': - dependencies: - '@angular/compiler': 21.2.18 - '@babel/core': 7.29.7 - '@jridgewell/sourcemap-codec': 1.5.5 - chokidar: 5.0.0 - convert-source-map: 1.9.0 - reflect-metadata: 0.2.2 - semver: 7.8.2 - tslib: 2.8.1 - yargs: 18.0.0 - optionalDependencies: - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@angular/compiler@21.2.18': - dependencies: - tslib: 2.8.1 - '@arethetypeswrong/cli@0.18.4': dependencies: '@arethetypeswrong/core': 0.18.4 @@ -30356,7 +29655,7 @@ snapshots: cjs-module-lexer: 1.4.3 fflate: 0.8.3 lru-cache: 11.5.1 - semver: 7.8.2 + semver: 7.8.5 typescript: 5.6.1-rc validate-npm-package-name: 5.0.1 @@ -30380,7 +29679,7 @@ snapshots: '@csstools/css-color-parser': 3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) '@csstools/css-tokenizer': 3.0.4 - lru-cache: 11.2.2 + lru-cache: 11.5.1 '@asamuzakjp/css-color@5.1.11': dependencies: @@ -30396,7 +29695,7 @@ snapshots: bidi-js: 1.0.3 css-tree: 3.2.1 is-potential-custom-element-name: 1.0.1 - lru-cache: 11.2.2 + lru-cache: 11.5.1 '@asamuzakjp/dom-selector@7.1.1': dependencies: @@ -30420,18 +29719,6 @@ snapshots: preact: 10.24.3 preact-render-to-string: 6.5.11(preact@10.24.3) - '@babel/code-frame@7.27.1': - dependencies: - '@babel/helper-validator-identifier': 7.28.5 - js-tokens: 4.0.0 - picocolors: 1.1.1 - - '@babel/code-frame@7.29.0': - dependencies: - '@babel/helper-validator-identifier': 7.28.5 - js-tokens: 4.0.0 - picocolors: 1.1.1 - '@babel/code-frame@7.29.7': dependencies: '@babel/helper-validator-identifier': 7.29.7 @@ -30444,103 +29731,83 @@ snapshots: '@babel/compat-data@7.29.7': {} - '@babel/core@7.28.5': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helpers': 7.28.4 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - '@jridgewell/remapping': 2.3.5 - convert-source-map: 2.0.0 - debug: 4.4.3 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/core@7.29.0': - dependencies: - '@babel/code-frame': 7.29.0 - '@babel/generator': 7.29.1 - '@babel/helper-compilation-targets': 7.28.6 - '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0) - '@babel/helpers': 7.29.2 - '@babel/parser': 7.29.2 - '@babel/template': 7.28.6 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - '@jridgewell/remapping': 2.3.5 - convert-source-map: 2.0.0 - debug: 4.4.3 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/core@7.29.7': + '@babel/core@7.28.5(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 - '@babel/generator': 7.29.7 - '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helpers': 7.29.7 - '@babel/parser': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helpers': 7.28.4 + '@babel/parser': 7.29.8 '@babel/template': 7.29.7 - '@babel/traverse': 7.29.7 - '@babel/types': 7.29.7 + '@babel/traverse': 7.28.5(supports-color@10.2.2) + '@babel/types': 7.29.8 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.28.5': + '@babel/core@7.29.0(supports-color@10.2.2)': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.29.0 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.28.6 + '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helpers': 7.29.2 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.0(supports-color@10.2.2) + '@babel/types': 7.29.8 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3(supports-color@10.2.2) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color - '@babel/generator@7.29.1': + '@babel/core@7.29.7(supports-color@10.2.2)': dependencies: - '@babel/parser': 7.29.2 - '@babel/types': 7.29.0 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helpers': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3(supports-color@10.2.2) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color - '@babel/generator@7.29.7': + '@babel/generator@7.29.8': dependencies: - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 '@babel/helper-annotate-as-pure@7.27.3': dependencies: - '@babel/types': 7.29.0 - - '@babel/helper-annotate-as-pure@7.29.7': - dependencies: - '@babel/types': 7.29.7 + '@babel/types': 7.29.8 '@babel/helper-compilation-targets@7.27.2': dependencies: '@babel/compat-data': 7.27.5 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.24.4 + browserslist: 4.28.1 lru-cache: 5.1.1 semver: 6.3.1 @@ -30560,998 +29827,323 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.28.5)': + '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.28.5 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/traverse': 7.29.8(supports-color@10.2.2) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-class-features-plugin@7.28.5(@babel/core@7.28.5)': + '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/helper-member-expression-to-functions': 7.27.1(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.28.5 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/traverse': 7.29.8(supports-color@10.2.2) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-class-features-plugin@7.28.6(@babel/core@7.28.5)': + '@babel/helper-create-class-features-plugin@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/helper-member-expression-to-functions': 7.28.5(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.28.6(@babel/core@7.28.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.29.0 + '@babel/helper-replace-supers': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/traverse': 7.29.8(supports-color@10.2.2) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-class-features-plugin@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.28.6(@babel/core@7.29.0) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.29.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/helper-create-class-features-plugin@7.28.6(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.28.6(@babel/core@7.29.7) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.29.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/helper-create-class-features-plugin@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.29.7 - '@babel/helper-member-expression-to-functions': 7.29.7 - '@babel/helper-optimise-call-expression': 7.29.7 - '@babel/helper-replace-supers': 7.29.7(@babel/core@7.29.7) - '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - '@babel/traverse': 7.29.7 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/helper-create-regexp-features-plugin@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.29.7 - regexpu-core: 6.4.0 - semver: 6.3.1 - - '@babel/helper-define-polyfill-provider@0.6.8(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-compilation-targets': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 - debug: 4.4.3 - lodash.debounce: 4.0.8 - resolve: 1.22.11 - transitivePeerDependencies: - - supports-color - '@babel/helper-globals@7.28.0': {} '@babel/helper-globals@7.29.7': {} - '@babel/helper-member-expression-to-functions@7.27.1': + '@babel/helper-member-expression-to-functions@7.27.1(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.28.5': + '@babel/helper-member-expression-to-functions@7.28.5(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-member-expression-to-functions@7.29.7': - dependencies: - '@babel/traverse': 7.29.7 - '@babel/types': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color '@babel/helper-module-imports@7.18.6': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 - '@babel/helper-module-imports@7.27.1': + '@babel/helper-module-imports@7.27.1(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.28.6': + '@babel/helper-module-imports@7.28.6(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.29.7': + '@babel/helper-module-imports@7.29.7(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.29.7 - '@babel/types': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.28.3(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-module-imports': 7.28.6 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.29.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.29.7 + '@babel/core': 7.28.5(supports-color@10.2.2) + '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.28.6(@babel/core@7.29.0(supports-color@10.2.2))(supports-color@10.2.2)': + dependencies: + '@babel/core': 7.29.0(supports-color@10.2.2) + '@babel/helper-module-imports': 7.28.6(supports-color@10.2.2) + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': + dependencies: + '@babel/core': 7.28.5(supports-color@10.2.2) + '@babel/helper-module-imports': 7.29.7(supports-color@10.2.2) + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': + dependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-module-imports': 7.29.7(supports-color@10.2.2) + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color '@babel/helper-optimise-call-expression@7.27.1': dependencies: - '@babel/types': 7.29.0 - - '@babel/helper-optimise-call-expression@7.29.7': - dependencies: - '@babel/types': 7.29.7 + '@babel/types': 7.29.8 '@babel/helper-plugin-utils@7.27.1': {} '@babel/helper-plugin-utils@7.28.6': {} - '@babel/helper-plugin-utils@7.29.7': {} - - '@babel/helper-remap-async-to-generator@7.29.7(@babel/core@7.29.7)': + '@babel/helper-replace-supers@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.29.7 - '@babel/helper-wrap-function': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-replace-supers@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) + '@babel/helper-member-expression-to-functions': 7.28.5(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.28.6(@babel/core@7.28.5)': + '@babel/helper-replace-supers@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-member-expression-to-functions': 7.28.5(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.28.6(@babel/core@7.29.0)': + '@babel/helper-replace-supers@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 - '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-member-expression-to-functions': 7.28.5(supports-color@10.2.2) '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.28.6(@babel/core@7.29.7)': + '@babel/helper-skip-transparent-expression-wrappers@7.27.1(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.7 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.29.0 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-member-expression-to-functions': 7.29.7 - '@babel/helper-optimise-call-expression': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': - dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-skip-transparent-expression-wrappers@7.29.7': - dependencies: - '@babel/traverse': 7.29.7 - '@babel/types': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-split-export-declaration@7.24.7': - dependencies: - '@babel/types': 7.29.0 - - '@babel/helper-string-parser@7.27.1': {} - '@babel/helper-string-parser@7.29.7': {} - '@babel/helper-validator-identifier@7.28.5': {} - '@babel/helper-validator-identifier@7.29.7': {} '@babel/helper-validator-option@7.27.1': {} '@babel/helper-validator-option@7.29.7': {} - '@babel/helper-wrap-function@7.29.7': - dependencies: - '@babel/template': 7.29.7 - '@babel/traverse': 7.29.7 - '@babel/types': 7.29.7 - transitivePeerDependencies: - - supports-color - '@babel/helpers@7.28.4': dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.29.0 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 '@babel/helpers@7.29.2': dependencies: - '@babel/template': 7.28.6 - '@babel/types': 7.29.0 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 '@babel/helpers@7.29.7': dependencies: '@babel/template': 7.29.7 - '@babel/types': 7.29.7 + '@babel/types': 7.29.8 '@babel/parser@7.28.5': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 - '@babel/parser@7.29.2': + '@babel/parser@7.29.8': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 - '@babel/parser@7.29.7': + '@babel/plugin-proposal-decorators@7.29.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/types': 7.29.7 - - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - '@babel/plugin-transform-optional-chaining': 7.29.7(@babel/core@7.29.7) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-decorators@7.28.0(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-decorators': 7.27.1(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-decorators@7.29.0(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/plugin-syntax-decorators': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-decorators': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.29.7)': + '@babel/plugin-syntax-decorators@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: - '@babel/core': 7.29.7 - - '@babel/plugin-syntax-decorators@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/plugin-syntax-decorators@7.28.6(@babel/core@7.29.0)': + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))': dependencies: - '@babel/core': 7.29.0 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-syntax-import-assertions@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-syntax-import-attributes@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.29.0)': + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.29.7)': + '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.28.5)': + '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.0)': + '@babel/plugin-transform-class-properties@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-arrow-functions@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-async-generator-functions@7.29.0(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-remap-async-to-generator': 7.29.7(@babel/core@7.29.7) - '@babel/traverse': 7.29.0 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-async-to-generator@7.28.6(@babel/core@7.29.7)': + '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-remap-async-to-generator': 7.29.7(@babel/core@7.29.7) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-block-scoped-functions@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-block-scoping@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-class-properties@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) + '@babel/core': 7.28.5(supports-color@10.2.2) + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-class-properties@7.28.6(@babel/core@7.29.0)': + '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.0) - '@babel/helper-plugin-utils': 7.28.6 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-class-properties@7.28.6(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.28.6 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-class-static-block@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-class-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-classes@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.29.7 - '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-globals': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-replace-supers': 7.29.7(@babel/core@7.29.7) - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-computed-properties@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/template': 7.29.7 - - '@babel/plugin-transform-destructuring@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-dotall-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-duplicate-keys@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-dynamic-import@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-explicit-resource-management@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-transform-destructuring': 7.29.7(@babel/core@7.29.7) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-exponentiation-operator@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-export-namespace-from@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-for-of@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-function-name@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-json-strings@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-literals@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-logical-assignment-operators@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-member-expression-literals@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-modules-amd@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.29.0)': + '@babel/plugin-transform-typescript@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.29.0) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-modules-commonjs@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-modules-systemjs@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-modules-umd@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-named-capturing-groups-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-new-target@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-nullish-coalescing-operator@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-numeric-separator@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-object-rest-spread@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-transform-destructuring': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-parameters': 7.29.7(@babel/core@7.29.7) - '@babel/traverse': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-object-super@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-replace-supers': 7.29.7(@babel/core@7.29.7) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-optional-catch-binding@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-optional-chaining@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-parameters@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-private-methods@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-class-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-private-property-in-object@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-annotate-as-pure': 7.29.7 - '@babel/helper-create-class-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-property-literals@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-react-jsx-self@7.25.9(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-react-jsx-source@7.25.9(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-regenerator@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-regexp-modifiers@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-reserved-words@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-runtime@7.29.0(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 - babel-plugin-polyfill-corejs2: 0.4.17(@babel/core@7.29.7) - babel-plugin-polyfill-corejs3: 0.13.0(@babel/core@7.29.7) - babel-plugin-polyfill-regenerator: 0.6.8(@babel/core@7.29.7) - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-shorthand-properties@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-spread@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-sticky-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-template-literals@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-typeof-symbol@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-typescript@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.28.5) + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2)) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-typescript@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-typescript@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5) + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-typescript@7.28.6(@babel/core@7.28.5)': + '@babel/plugin-transform-typescript@7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.28.5) + '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.28.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-typescript@7.28.6(@babel/core@7.29.0)': + '@babel/preset-typescript@7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.0) - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-unicode-escapes@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-unicode-property-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-unicode-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/plugin-transform-unicode-sets-regex@7.29.7(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-create-regexp-features-plugin': 7.29.7(@babel/core@7.29.7) - '@babel/helper-plugin-utils': 7.29.7 - - '@babel/preset-env@7.29.2(@babel/core@7.29.7)': - dependencies: - '@babel/compat-data': 7.29.0 - '@babel/core': 7.29.7 - '@babel/helper-compilation-targets': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.29.7) - '@babel/plugin-syntax-import-assertions': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-syntax-import-attributes': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.29.7) - '@babel/plugin-transform-arrow-functions': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-async-generator-functions': 7.29.0(@babel/core@7.29.7) - '@babel/plugin-transform-async-to-generator': 7.28.6(@babel/core@7.29.7) - '@babel/plugin-transform-block-scoped-functions': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-block-scoping': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-class-properties': 7.28.6(@babel/core@7.29.7) - '@babel/plugin-transform-class-static-block': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-classes': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-computed-properties': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-destructuring': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-dotall-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-duplicate-keys': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-dynamic-import': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-explicit-resource-management': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-exponentiation-operator': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-export-namespace-from': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-for-of': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-function-name': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-json-strings': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-literals': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-logical-assignment-operators': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-member-expression-literals': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-modules-amd': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-modules-commonjs': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-modules-systemjs': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-modules-umd': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-named-capturing-groups-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-new-target': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-nullish-coalescing-operator': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-numeric-separator': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-object-rest-spread': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-object-super': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-optional-catch-binding': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-optional-chaining': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-parameters': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-private-methods': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-private-property-in-object': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-property-literals': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-regenerator': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-regexp-modifiers': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-reserved-words': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-shorthand-properties': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-spread': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-sticky-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-template-literals': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-typeof-symbol': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-unicode-escapes': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-unicode-property-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-unicode-regex': 7.29.7(@babel/core@7.29.7) - '@babel/plugin-transform-unicode-sets-regex': 7.29.7(@babel/core@7.29.7) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.29.7) - babel-plugin-polyfill-corejs2: 0.4.17(@babel/core@7.29.7) - babel-plugin-polyfill-corejs3: 0.14.2(@babel/core@7.29.7) - babel-plugin-polyfill-regenerator: 0.6.8(@babel/core@7.29.7) - core-js-compat: 3.49.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.29.7)': - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/types': 7.29.0 - esutils: 2.0.3 - - '@babel/preset-typescript@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2)) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/preset-typescript@7.28.5(@babel/core@7.28.5)': + '@babel/preset-typescript@7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.28.5) + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/preset-typescript@7.28.5(@babel/core@7.29.0)': + '@babel/preset-typescript@7.28.5(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.0) - '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -31559,127 +30151,100 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/runtime@7.29.2': {} - - '@babel/template@7.27.2': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/parser': 7.28.5 - '@babel/types': 7.29.0 - - '@babel/template@7.28.6': - dependencies: - '@babel/code-frame': 7.29.0 - '@babel/parser': 7.29.2 - '@babel/types': 7.29.0 - '@babel/template@7.29.7': dependencies: '@babel/code-frame': 7.29.7 - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 - '@babel/traverse@7.28.5': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.29.1 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.29.2 - '@babel/template': 7.27.2 - '@babel/types': 7.29.0 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - '@babel/traverse@7.29.0': - dependencies: - '@babel/code-frame': 7.29.0 - '@babel/generator': 7.29.1 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.29.2 - '@babel/template': 7.28.6 - '@babel/types': 7.29.0 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - '@babel/traverse@7.29.7': + '@babel/traverse@7.28.5(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 - '@babel/generator': 7.29.7 - '@babel/helper-globals': 7.29.7 - '@babel/parser': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.29.8 '@babel/template': 7.29.7 - '@babel/types': 7.29.7 - debug: 4.4.3 + '@babel/types': 7.29.8 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/types@7.28.4': + '@babel/traverse@7.29.0(supports-color@10.2.2)': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + debug: 4.4.3(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color - '@babel/types@7.28.5': + '@babel/traverse@7.29.8(supports-color@10.2.2)': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + debug: 4.4.3(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color - '@babel/types@7.29.0': - dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - - '@babel/types@7.29.7': + '@babel/types@7.29.8': dependencies: '@babel/helper-string-parser': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0)': + '@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0)': dependencies: '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 '@opentelemetry/semantic-conventions': 1.41.1 '@standard-schema/spec': 1.1.0 - better-call: 1.3.6(zod@4.4.3) + better-call: 1.3.6(zod@4.5.4) jose: 6.1.3 kysely: 0.29.2 nanostores: 1.3.0 - zod: 4.4.3 + zod: 4.5.4 + optionalDependencies: + '@opentelemetry/api': 1.9.1 - '@better-auth/drizzle-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': + '@better-auth/drizzle-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 - '@better-auth/kysely-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(kysely@0.29.2)': + '@better-auth/kysely-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(kysely@0.29.2)': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 optionalDependencies: kysely: 0.29.2 - '@better-auth/memory-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': + '@better-auth/memory-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 - '@better-auth/mongo-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': + '@better-auth/mongo-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 - '@better-auth/prisma-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))': + '@better-auth/prisma-adapter@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 optionalDependencies: - '@prisma/client': 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) - prisma: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) + '@prisma/client': 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) + prisma: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) - '@better-auth/telemetry@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)': + '@better-auth/telemetry@1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)': dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 @@ -31689,14 +30254,14 @@ snapshots: '@better-fetch/fetch@1.3.1': {} - '@blazediff/core@1.9.1': {} - '@braidai/lang@1.1.2': {} '@bramus/specificity@2.4.2': dependencies: css-tree: 3.2.1 + '@bufbuild/protobuf@2.16.0': {} + '@bundled-es-modules/cookie@2.0.1': dependencies: cookie: 0.7.2 @@ -31724,7 +30289,7 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.8.2 + semver: 7.8.5 '@changesets/assemble-release-plan@6.0.9': dependencies: @@ -31733,7 +30298,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - semver: 7.8.2 + semver: 7.8.5 '@changesets/changelog-git@0.2.1': dependencies: @@ -31798,7 +30363,7 @@ snapshots: '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 picocolors: 1.1.1 - semver: 7.8.2 + semver: 7.8.5 '@changesets/get-github-info@0.8.0': dependencies: @@ -31883,9 +30448,21 @@ snapshots: '@chevrotain/utils@10.5.0': {} - '@clerk/backend@2.18.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clack/core@1.4.3': dependencies: - '@clerk/shared': 3.28.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + fast-wrap-ansi: 0.2.0 + sisteransi: 1.0.5 + + '@clack/prompts@1.7.0': + dependencies: + '@clack/core': 1.4.3 + fast-string-width: 3.0.2 + fast-wrap-ansi: 0.2.0 + sisteransi: 1.0.5 + + '@clerk/backend@2.18.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': + dependencies: + '@clerk/shared': 3.28.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@clerk/types': 4.95.0 cookie: 1.0.2 standardwebhooks: 1.0.0 @@ -31894,82 +30471,82 @@ snapshots: - react - react-dom - '@clerk/backend@2.29.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/backend@2.29.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/shared': 3.42.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/types': 4.101.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 3.42.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/types': 4.101.10(react-dom@19.2.9(react@19.2.9))(react@19.2.9) standardwebhooks: 1.0.0 tslib: 2.8.1 transitivePeerDependencies: - react - react-dom - '@clerk/clerk-react@5.53.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/clerk-react@5.53.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/shared': 3.28.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 3.28.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@clerk/types': 4.95.0 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) tslib: 2.8.1 - '@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/shared': 3.42.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@clerk/shared': 3.42.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) tslib: 2.8.1 - '@clerk/shared@3.28.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/shared@3.28.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@clerk/types': 4.95.0 dequal: 2.0.3 glob-to-regexp: 0.4.1 js-cookie: 3.0.5 std-env: 3.10.0 - swr: 2.3.4(react@19.2.3) + swr: 2.3.4(react@19.2.9) optionalDependencies: - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) - '@clerk/shared@3.42.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/shared@3.42.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: csstype: 3.1.3 dequal: 2.0.3 glob-to-regexp: 0.4.1 js-cookie: 3.0.5 std-env: 3.10.0 - swr: 2.3.4(react@19.2.3) + swr: 2.3.4(react@19.2.9) optionalDependencies: - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) - '@clerk/tanstack-react-start@0.19.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/tanstack-react-start@0.19.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/backend': 2.18.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/clerk-react': 5.53.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/shared': 3.28.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/backend': 2.18.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/clerk-react': 5.53.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/shared': 3.28.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@clerk/types': 4.95.0 '@tanstack/react-router': link:packages/react-router '@tanstack/react-start': link:packages/react-start - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) tslib: 2.8.1 - '@clerk/tanstack-react-start@0.27.14(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/tanstack-react-start@0.27.14(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/backend': 2.29.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/clerk-react': 5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/shared': 3.42.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/types': 4.101.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/backend': 2.29.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/clerk-react': 5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/shared': 3.42.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@clerk/types': 4.101.10(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@tanstack/react-router': link:packages/react-router '@tanstack/react-start': link:packages/react-start - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) tslib: 2.8.1 - '@clerk/types@4.101.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/types@4.101.10(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@clerk/shared': 3.42.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 3.42.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9) transitivePeerDependencies: - react - react-dom @@ -31978,20 +30555,62 @@ snapshots: dependencies: csstype: 3.1.3 + '@cloudflare/build-output-utils@0.9.10': + dependencies: + '@cloudflare/config': 0.30.2 + + '@cloudflare/config@0.30.2': + dependencies: + zod: 4.6.6 + '@cloudflare/kv-asset-handler@0.4.2': {} + '@cloudflare/runtime-types@0.1.23(@types/node@25.0.9)': + dependencies: + miniflare: 5.20261104.0-beta(@types/node@25.0.9) + workerd: 1.20261104.1 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - utf-8-validate + '@cloudflare/unenv-preset@2.15.0(unenv@2.0.0-rc.24)(workerd@1.20260317.1)': dependencies: unenv: 2.0.0-rc.24 optionalDependencies: workerd: 1.20260317.1 - '@cloudflare/vite-plugin@1.29.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0)': + '@cloudflare/unenv-preset@2.15.0(unenv@2.0.0-rc.24)(workerd@1.20261104.1)': + dependencies: + unenv: 2.0.0-rc.24 + optionalDependencies: + workerd: 1.20261104.1 + + '@cloudflare/unenv-preset@2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261104.1)': + dependencies: + unenv: 2.0.0-rc.24 + optionalDependencies: + workerd: 1.20261104.1 + + '@cloudflare/vite-plugin@1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0)': dependencies: '@cloudflare/unenv-preset': 2.15.0(unenv@2.0.0-rc.24)(workerd@1.20260317.1) miniflare: 4.20260317.0 unenv: 2.0.0-rc.24 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + wrangler: 4.75.0 + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - workerd + + '@cloudflare/vite-plugin@1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0)': + dependencies: + '@cloudflare/unenv-preset': 2.15.0(unenv@2.0.0-rc.24)(workerd@1.20261104.1) + miniflare: 4.20260317.0 + unenv: 2.0.0-rc.24 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: 4.75.0 ws: 8.18.0 transitivePeerDependencies: @@ -32002,35 +30621,49 @@ snapshots: '@cloudflare/workerd-darwin-64@1.20260317.1': optional: true + '@cloudflare/workerd-darwin-64@1.20261104.1': + optional: true + '@cloudflare/workerd-darwin-arm64@1.20260317.1': optional: true + '@cloudflare/workerd-darwin-arm64@1.20261104.1': + optional: true + '@cloudflare/workerd-linux-64@1.20260317.1': optional: true + '@cloudflare/workerd-linux-64@1.20261104.1': + optional: true + '@cloudflare/workerd-linux-arm64@1.20260317.1': optional: true + '@cloudflare/workerd-linux-arm64@1.20261104.1': + optional: true + '@cloudflare/workerd-windows-64@1.20260317.1': optional: true - '@codspeed/core@5.5.0(debug@4.4.3)': + '@cloudflare/workerd-windows-64@1.20261104.1': + optional: true + + '@codspeed/core@6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - axios: 1.17.0(debug@4.4.3) - find-up: 6.3.0 - form-data: 4.0.5 + axios: 1.18.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) + form-data: 4.0.6 node-gyp-build: 4.8.4 stack-trace: 1.0.0-pre2 transitivePeerDependencies: - debug - supports-color - '@codspeed/vitest-plugin@5.5.0(debug@4.4.3)(tinybench@2.9.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4)': + '@codspeed/vitest-plugin@6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4)': dependencies: - '@codspeed/core': 5.5.0(debug@4.4.3) - tinybench: 2.9.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vitest: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + '@codspeed/core': 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) + tinybench: 6.2.2 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: - debug - supports-color @@ -32040,15 +30673,15 @@ snapshots: '@colors/colors@1.6.0': {} - '@convex-dev/better-auth@0.9.7(@standard-schema/spec@1.1.0)(better-auth@1.6.19(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.7.10)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2)': + '@convex-dev/better-auth@0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9))(hono@4.13.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - better-auth: 1.6.19(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2)) + better-auth: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) common-tags: 1.8.2 - convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) - convex-helpers: 0.1.104(@standard-schema/spec@1.1.0)(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.7.10)(react@19.2.3)(typescript@6.0.2)(zod@3.25.76) + convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9) + convex-helpers: 0.1.104(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9))(hono@4.13.9)(react@19.2.9)(zod@3.25.76) jose: 6.1.0 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) remeda: 2.32.0 semver: 7.7.3 type-fest: 4.41.0 @@ -32058,10 +30691,10 @@ snapshots: - hono - typescript - '@convex-dev/react-query@0.0.0-alpha.8(@tanstack/react-query@5.99.0(react@19.2.3))(convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3))': + '@convex-dev/react-query@0.0.0-alpha.8(@tanstack/react-query@5.102.0(react@19.2.9))(convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9))': dependencies: - '@tanstack/react-query': 5.99.0(react@19.2.3) - convex: 1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@tanstack/react-query': 5.102.0(react@19.2.9) + convex: 1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9) '@cspotcode/source-map-support@0.8.1': dependencies: @@ -32103,10 +30736,6 @@ snapshots: dependencies: '@csstools/css-tokenizer': 4.0.0 - '@csstools/css-syntax-patches-for-csstree@1.0.14(postcss@8.5.15)': - dependencies: - postcss: 8.5.15 - '@csstools/css-syntax-patches-for-csstree@1.1.5(css-tree@3.2.1)': optionalDependencies: css-tree: 3.2.1 @@ -32142,8 +30771,6 @@ snapshots: '@discoveryjs/json-ext@0.5.7': {} - '@discoveryjs/json-ext@0.6.3': {} - '@electric-sql/pglite-socket@0.0.6(@electric-sql/pglite@0.3.2)': dependencies: '@electric-sql/pglite': 0.3.2 @@ -32152,23 +30779,23 @@ snapshots: dependencies: '@electric-sql/pglite': 0.3.2 + '@electric-sql/pglite@0.3.16': {} + '@electric-sql/pglite@0.3.2': {} - '@emnapi/core@1.10.0': + '@emnapi/core@1.11.3': dependencies: - '@emnapi/wasi-threads': 1.2.1 + '@emnapi/wasi-threads': 1.2.3 tslib: 2.8.1 - optional: true '@emnapi/core@1.4.5': dependencies: '@emnapi/wasi-threads': 1.0.4 tslib: 2.8.1 - '@emnapi/runtime@1.10.0': + '@emnapi/runtime@1.11.3': dependencies: tslib: 2.8.1 - optional: true '@emnapi/runtime@1.4.5': dependencies: @@ -32178,14 +30805,13 @@ snapshots: dependencies: tslib: 2.8.1 - '@emnapi/wasi-threads@1.2.1': + '@emnapi/wasi-threads@1.2.3': dependencies: tslib: 2.8.1 - optional: true - '@emotion/babel-plugin@11.13.5': + '@emotion/babel-plugin@11.13.5(supports-color@10.2.2)': dependencies: - '@babel/helper-module-imports': 7.27.1 + '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) '@babel/runtime': 7.26.7 '@emotion/hash': 0.9.2 '@emotion/memoize': 0.9.0 @@ -32215,17 +30841,17 @@ snapshots: '@emotion/memoize@0.9.0': {} - '@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3)': + '@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2)': dependencies: '@babel/runtime': 7.26.7 - '@emotion/babel-plugin': 11.13.5 + '@emotion/babel-plugin': 11.13.5(supports-color@10.2.2) '@emotion/cache': 11.14.0 '@emotion/serialize': 1.3.3 - '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.3) + '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.9) '@emotion/utils': 1.4.2 '@emotion/weak-memoize': 0.4.0 hoist-non-react-statics: 3.3.2 - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 transitivePeerDependencies: @@ -32241,16 +30867,16 @@ snapshots: '@emotion/sheet@1.4.0': {} - '@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3)': + '@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2)': dependencies: '@babel/runtime': 7.26.7 - '@emotion/babel-plugin': 11.13.5 + '@emotion/babel-plugin': 11.13.5(supports-color@10.2.2) '@emotion/is-prop-valid': 1.3.1 - '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.3) + '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) '@emotion/serialize': 1.3.3 - '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.3) + '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.9) '@emotion/utils': 1.4.2 - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 transitivePeerDependencies: @@ -32258,9 +30884,9 @@ snapshots: '@emotion/unitless@0.10.0': {} - '@emotion/use-insertion-effect-with-fallbacks@1.2.0(react@19.2.3)': + '@emotion/use-insertion-effect-with-fallbacks@1.2.0(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 '@emotion/utils@1.4.2': {} @@ -32732,31 +31358,31 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@9.22.0(jiti@2.7.0))': + '@eslint-community/eslint-utils@4.4.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.0(eslint@9.22.0(jiti@2.7.0))': + '@eslint-community/eslint-utils@4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.1(eslint@9.22.0(jiti@2.7.0))': + '@eslint-community/eslint-utils@4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} '@eslint-community/regexpp@4.12.2': {} - '@eslint-react/ast@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@eslint-react/ast@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-react/eff': 1.26.2 - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/typescript-estree': 8.53.0(typescript@6.0.2) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 transitivePeerDependencies: @@ -32764,17 +31390,17 @@ snapshots: - supports-color - typescript - '@eslint-react/core@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@eslint-react/core@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) birecord: 0.1.1 ts-pattern: 5.6.2 transitivePeerDependencies: @@ -32784,59 +31410,59 @@ snapshots: '@eslint-react/eff@1.26.2': {} - '@eslint-react/eslint-plugin@1.26.2(eslint@9.22.0(jiti@2.7.0))(ts-api-utils@2.4.0(typescript@6.0.2))(typescript@6.0.2)': + '@eslint-react/eslint-plugin@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2))': dependencies: '@eslint-react/eff': 1.26.2 - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.23.0 - '@typescript-eslint/type-utils': 8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.23.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - eslint-plugin-react-debug: 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint-plugin-react-dom: 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint-plugin-react-hooks-extra: 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint-plugin-react-naming-convention: 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint-plugin-react-web-api: 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint-plugin-react-x: 1.26.2(eslint@9.22.0(jiti@2.7.0))(ts-api-utils@2.4.0(typescript@6.0.2))(typescript@6.0.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-react-debug: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-react-dom: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-react-hooks-extra: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-react-naming-convention: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-react-web-api: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-react-x: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - ts-api-utils - '@eslint-react/jsx@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@eslint-react/jsx@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) ts-pattern: 5.6.2 transitivePeerDependencies: - eslint - supports-color - typescript - '@eslint-react/shared@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@eslint-react/shared@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-react/eff': 1.26.2 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - picomatch: 4.0.4 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + picomatch: 4.0.7 ts-pattern: 5.6.2 transitivePeerDependencies: - eslint - supports-color - typescript - '@eslint-react/var@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@eslint-react/var@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 transitivePeerDependencies: @@ -32844,10 +31470,10 @@ snapshots: - supports-color - typescript - '@eslint/config-array@0.19.2': + '@eslint/config-array@0.19.2(supports-color@10.2.2)': dependencies: '@eslint/object-schema': 2.1.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -32858,10 +31484,10 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.0': + '@eslint/eslintrc@3.3.0(supports-color@10.2.2)': dependencies: ajv: 6.12.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -32872,9 +31498,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@10.0.1(eslint@9.22.0(jiti@2.7.0))': + '@eslint/js@10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': optionalDependencies: - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) '@eslint/js@9.22.0': {} @@ -32896,7 +31522,7 @@ snapshots: '@fastify/ajv-compiler@4.0.5': dependencies: ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) + ajv-formats: 3.0.1 fast-uri: 3.0.6 '@fastify/busboy@3.1.1': {} @@ -33245,20 +31871,16 @@ snapshots: '@floating-ui/core': 1.6.9 '@floating-ui/utils': 0.2.9 - '@floating-ui/react-dom@2.1.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@floating-ui/react-dom@2.1.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@floating-ui/dom': 1.6.13 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) '@floating-ui/utils@0.2.9': {} '@fontsource-variable/roboto@5.2.5': {} - '@foxt/js-srp@0.0.3-patch2': {} - - '@gar/promise-retry@1.0.3': {} - '@grpc/grpc-js@1.9.15': dependencies: '@grpc/proto-loader': 0.7.13 @@ -33271,29 +31893,15 @@ snapshots: protobufjs: 7.4.0 yargs: 17.7.2 - '@hapi/address@5.1.1': - dependencies: - '@hapi/hoek': 11.0.7 - - '@hapi/formula@3.0.2': {} - - '@hapi/hoek@11.0.7': {} - - '@hapi/pinpoint@2.0.1': {} - - '@hapi/tlds@1.1.7': {} - - '@hapi/topo@6.0.2': - dependencies: - '@hapi/hoek': 11.0.7 - - '@harperfast/extended-iterable@1.0.3': - optional: true - '@hono/node-server@1.14.2(hono@4.7.10)': dependencies: hono: 4.7.10 + '@hono/session@0.2.1(hono@4.13.9)': + dependencies: + hono: 4.13.9 + jose: 6.1.3 + '@humanfs/core@0.19.1': {} '@humanfs/node@0.16.6': @@ -33309,23 +31917,21 @@ snapshots: '@humanwhocodes/retry@0.4.2': {} - '@iarna/toml@2.2.5': {} - - '@img/colour@1.0.0': {} - - '@img/sharp-darwin-arm64@0.34.4': - optionalDependencies: - '@img/sharp-libvips-darwin-arm64': 1.2.3 - optional: true + '@img/colour@1.1.0': {} '@img/sharp-darwin-arm64@0.34.5': optionalDependencies: '@img/sharp-libvips-darwin-arm64': 1.2.4 optional: true - '@img/sharp-darwin-x64@0.34.4': + '@img/sharp-darwin-arm64@0.35.4': optionalDependencies: - '@img/sharp-libvips-darwin-x64': 1.2.3 + '@img/sharp-libvips-darwin-arm64': 1.3.3 + optional: true + + '@img/sharp-darwin-arm64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-darwin-arm64': 1.3.4 optional: true '@img/sharp-darwin-x64@0.34.5': @@ -33333,66 +31939,114 @@ snapshots: '@img/sharp-libvips-darwin-x64': 1.2.4 optional: true - '@img/sharp-libvips-darwin-arm64@1.2.3': + '@img/sharp-darwin-x64@0.35.4': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.3.3 + optional: true + + '@img/sharp-darwin-x64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.3.4 + optional: true + + '@img/sharp-freebsd-wasm32@0.35.4': + dependencies: + '@img/sharp-wasm32': 0.35.4 + optional: true + + '@img/sharp-freebsd-wasm32@0.35.5': + dependencies: + '@img/sharp-wasm32': 0.35.5 optional: true '@img/sharp-libvips-darwin-arm64@1.2.4': optional: true - '@img/sharp-libvips-darwin-x64@1.2.3': + '@img/sharp-libvips-darwin-arm64@1.3.3': + optional: true + + '@img/sharp-libvips-darwin-arm64@1.3.4': optional: true '@img/sharp-libvips-darwin-x64@1.2.4': optional: true - '@img/sharp-libvips-linux-arm64@1.2.3': + '@img/sharp-libvips-darwin-x64@1.3.3': + optional: true + + '@img/sharp-libvips-darwin-x64@1.3.4': optional: true '@img/sharp-libvips-linux-arm64@1.2.4': optional: true - '@img/sharp-libvips-linux-arm@1.2.3': + '@img/sharp-libvips-linux-arm64@1.3.3': + optional: true + + '@img/sharp-libvips-linux-arm64@1.3.4': optional: true '@img/sharp-libvips-linux-arm@1.2.4': optional: true - '@img/sharp-libvips-linux-ppc64@1.2.3': + '@img/sharp-libvips-linux-arm@1.3.3': + optional: true + + '@img/sharp-libvips-linux-arm@1.3.4': optional: true '@img/sharp-libvips-linux-ppc64@1.2.4': optional: true + '@img/sharp-libvips-linux-ppc64@1.3.3': + optional: true + + '@img/sharp-libvips-linux-ppc64@1.3.4': + optional: true + '@img/sharp-libvips-linux-riscv64@1.2.4': optional: true - '@img/sharp-libvips-linux-s390x@1.2.3': + '@img/sharp-libvips-linux-riscv64@1.3.3': + optional: true + + '@img/sharp-libvips-linux-riscv64@1.3.4': optional: true '@img/sharp-libvips-linux-s390x@1.2.4': optional: true - '@img/sharp-libvips-linux-x64@1.2.3': + '@img/sharp-libvips-linux-s390x@1.3.3': + optional: true + + '@img/sharp-libvips-linux-s390x@1.3.4': optional: true '@img/sharp-libvips-linux-x64@1.2.4': optional: true - '@img/sharp-libvips-linuxmusl-arm64@1.2.3': + '@img/sharp-libvips-linux-x64@1.3.3': + optional: true + + '@img/sharp-libvips-linux-x64@1.3.4': optional: true '@img/sharp-libvips-linuxmusl-arm64@1.2.4': optional: true - '@img/sharp-libvips-linuxmusl-x64@1.2.3': + '@img/sharp-libvips-linuxmusl-arm64@1.3.3': + optional: true + + '@img/sharp-libvips-linuxmusl-arm64@1.3.4': optional: true '@img/sharp-libvips-linuxmusl-x64@1.2.4': optional: true - '@img/sharp-linux-arm64@0.34.4': - optionalDependencies: - '@img/sharp-libvips-linux-arm64': 1.2.3 + '@img/sharp-libvips-linuxmusl-x64@1.3.3': + optional: true + + '@img/sharp-libvips-linuxmusl-x64@1.3.4': optional: true '@img/sharp-linux-arm64@0.34.5': @@ -33400,9 +32054,14 @@ snapshots: '@img/sharp-libvips-linux-arm64': 1.2.4 optional: true - '@img/sharp-linux-arm@0.34.4': + '@img/sharp-linux-arm64@0.35.4': optionalDependencies: - '@img/sharp-libvips-linux-arm': 1.2.3 + '@img/sharp-libvips-linux-arm64': 1.3.3 + optional: true + + '@img/sharp-linux-arm64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm64': 1.3.4 optional: true '@img/sharp-linux-arm@0.34.5': @@ -33410,9 +32069,14 @@ snapshots: '@img/sharp-libvips-linux-arm': 1.2.4 optional: true - '@img/sharp-linux-ppc64@0.34.4': + '@img/sharp-linux-arm@0.35.4': optionalDependencies: - '@img/sharp-libvips-linux-ppc64': 1.2.3 + '@img/sharp-libvips-linux-arm': 1.3.3 + optional: true + + '@img/sharp-linux-arm@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm': 1.3.4 optional: true '@img/sharp-linux-ppc64@0.34.5': @@ -33420,14 +32084,29 @@ snapshots: '@img/sharp-libvips-linux-ppc64': 1.2.4 optional: true + '@img/sharp-linux-ppc64@0.35.4': + optionalDependencies: + '@img/sharp-libvips-linux-ppc64': 1.3.3 + optional: true + + '@img/sharp-linux-ppc64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-ppc64': 1.3.4 + optional: true + '@img/sharp-linux-riscv64@0.34.5': optionalDependencies: '@img/sharp-libvips-linux-riscv64': 1.2.4 optional: true - '@img/sharp-linux-s390x@0.34.4': + '@img/sharp-linux-riscv64@0.35.4': optionalDependencies: - '@img/sharp-libvips-linux-s390x': 1.2.3 + '@img/sharp-libvips-linux-riscv64': 1.3.3 + optional: true + + '@img/sharp-linux-riscv64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-riscv64': 1.3.4 optional: true '@img/sharp-linux-s390x@0.34.5': @@ -33435,9 +32114,14 @@ snapshots: '@img/sharp-libvips-linux-s390x': 1.2.4 optional: true - '@img/sharp-linux-x64@0.34.4': + '@img/sharp-linux-s390x@0.35.4': optionalDependencies: - '@img/sharp-libvips-linux-x64': 1.2.3 + '@img/sharp-libvips-linux-s390x': 1.3.3 + optional: true + + '@img/sharp-linux-s390x@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-s390x': 1.3.4 optional: true '@img/sharp-linux-x64@0.34.5': @@ -33445,9 +32129,14 @@ snapshots: '@img/sharp-libvips-linux-x64': 1.2.4 optional: true - '@img/sharp-linuxmusl-arm64@0.34.4': + '@img/sharp-linux-x64@0.35.4': optionalDependencies: - '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 + '@img/sharp-libvips-linux-x64': 1.3.3 + optional: true + + '@img/sharp-linux-x64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linux-x64': 1.3.4 optional: true '@img/sharp-linuxmusl-arm64@0.34.5': @@ -33455,9 +32144,14 @@ snapshots: '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 optional: true - '@img/sharp-linuxmusl-x64@0.34.4': + '@img/sharp-linuxmusl-arm64@0.35.4': optionalDependencies: - '@img/sharp-libvips-linuxmusl-x64': 1.2.3 + '@img/sharp-libvips-linuxmusl-arm64': 1.3.3 + optional: true + + '@img/sharp-linuxmusl-arm64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-arm64': 1.3.4 optional: true '@img/sharp-linuxmusl-x64@0.34.5': @@ -33465,34 +32159,68 @@ snapshots: '@img/sharp-libvips-linuxmusl-x64': 1.2.4 optional: true - '@img/sharp-wasm32@0.34.4': - dependencies: - '@emnapi/runtime': 1.10.0 + '@img/sharp-linuxmusl-x64@0.35.4': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.3.3 + optional: true + + '@img/sharp-linuxmusl-x64@0.35.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.3.4 optional: true '@img/sharp-wasm32@0.34.5': dependencies: - '@emnapi/runtime': 1.10.0 + '@emnapi/runtime': 1.11.3 optional: true - '@img/sharp-win32-arm64@0.34.4': + '@img/sharp-wasm32@0.35.4': + dependencies: + '@emnapi/runtime': 1.11.3 + optional: true + + '@img/sharp-wasm32@0.35.5': + dependencies: + '@emnapi/runtime': 1.11.3 + optional: true + + '@img/sharp-webcontainers-wasm32@0.35.4': + dependencies: + '@img/sharp-wasm32': 0.35.4 + optional: true + + '@img/sharp-webcontainers-wasm32@0.35.5': + dependencies: + '@img/sharp-wasm32': 0.35.5 optional: true '@img/sharp-win32-arm64@0.34.5': optional: true - '@img/sharp-win32-ia32@0.34.4': + '@img/sharp-win32-arm64@0.35.4': + optional: true + + '@img/sharp-win32-arm64@0.35.5': optional: true '@img/sharp-win32-ia32@0.34.5': optional: true - '@img/sharp-win32-x64@0.34.4': + '@img/sharp-win32-ia32@0.35.4': + optional: true + + '@img/sharp-win32-ia32@0.35.5': optional: true '@img/sharp-win32-x64@0.34.5': optional: true + '@img/sharp-win32-x64@0.35.4': + optional: true + + '@img/sharp-win32-x64@0.35.5': + optional: true + '@import-maps/resolve@2.0.0': {} '@inlang/paraglide-js@2.4.0(babel-plugin-macros@3.1.0)': @@ -33521,25 +32249,43 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - '@inquirer/ansi@1.0.2': {} + '@inquirer/ansi@2.0.8': {} - '@inquirer/confirm@5.1.21(@types/node@25.0.9)': + '@inquirer/confirm@5.1.4(@types/node@25.0.9)': dependencies: - '@inquirer/core': 10.3.2(@types/node@25.0.9) - '@inquirer/type': 3.0.10(@types/node@25.0.9) + '@inquirer/core': 10.1.5(@types/node@25.0.9) + '@inquirer/type': 3.0.4(@types/node@25.0.9) + '@types/node': 25.0.9 + + '@inquirer/confirm@6.3.2(@types/node@25.0.9)': + dependencies: + '@inquirer/core': 12.0.3(@types/node@25.0.9) + '@inquirer/type': 4.1.1(@types/node@25.0.9) optionalDependencies: '@types/node': 25.0.9 - '@inquirer/core@10.3.2(@types/node@25.0.9)': + '@inquirer/core@10.1.5(@types/node@25.0.9)': dependencies: - '@inquirer/ansi': 1.0.2 - '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@25.0.9) + '@inquirer/figures': 1.0.10 + '@inquirer/type': 3.0.4(@types/node@25.0.9) + ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 signal-exit: 4.1.0 wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.3 + yoctocolors-cjs: 2.1.2 + transitivePeerDependencies: + - '@types/node' + + '@inquirer/core@12.0.3(@types/node@25.0.9)': + dependencies: + '@inquirer/ansi': 2.0.8 + '@inquirer/figures': 2.0.9 + '@inquirer/type': 4.1.1(@types/node@25.0.9) + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.0 + mute-stream: 3.0.0 + signal-exit: 4.1.0 optionalDependencies: '@types/node': 25.0.9 @@ -33550,81 +32296,20 @@ snapshots: optionalDependencies: '@types/node': 25.0.9 - '@inquirer/figures@1.0.15': {} + '@inquirer/figures@1.0.10': {} - '@inquirer/type@3.0.10(@types/node@25.0.9)': + '@inquirer/figures@2.0.9': {} + + '@inquirer/type@3.0.4(@types/node@25.0.9)': optionalDependencies: '@types/node': 25.0.9 - '@ionic/utils-array@2.1.6': - dependencies: - debug: 4.4.3 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color + '@inquirer/type@4.1.1(@types/node@25.0.9)': + optionalDependencies: + '@types/node': 25.0.9 - '@ionic/utils-fs@3.1.7': - dependencies: - '@types/fs-extra': 8.1.5 - debug: 4.4.3 - fs-extra: 9.1.0 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - - '@ionic/utils-object@2.1.6': - dependencies: - debug: 4.4.3 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - - '@ionic/utils-process@2.1.11': - dependencies: - '@ionic/utils-object': 2.1.6 - '@ionic/utils-terminal': 2.3.4 - debug: 4.4.3 - signal-exit: 3.0.7 - tree-kill: 1.2.2 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - - '@ionic/utils-stream@3.1.6': - dependencies: - debug: 4.4.3 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - - '@ionic/utils-subprocess@2.1.14': - dependencies: - '@ionic/utils-array': 2.1.6 - '@ionic/utils-fs': 3.1.7 - '@ionic/utils-process': 2.1.11 - '@ionic/utils-stream': 3.1.6 - '@ionic/utils-terminal': 2.3.4 - cross-spawn: 7.0.6 - debug: 4.4.3 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - - '@ionic/utils-terminal@2.3.4': - dependencies: - '@types/slice-ansi': 4.0.0 - debug: 4.4.3 - signal-exit: 3.0.7 - slice-ansi: 4.0.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - tslib: 2.8.1 - untildify: 4.0.0 - wrap-ansi: 7.0.0 - transitivePeerDependencies: - - supports-color - - '@ioredis/commands@1.5.0': {} + '@ioredis/commands@1.10.0': + optional: true '@isaacs/cliui@8.0.2': dependencies: @@ -33639,201 +32324,8 @@ snapshots: dependencies: minipass: 7.1.2 - '@isaacs/string-locale-compare@1.1.0': {} - - '@istanbuljs/schema@0.1.6': {} - '@jest/diff-sequences@30.0.1': {} - '@jimp/core@1.6.0': - dependencies: - '@jimp/file-ops': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - await-to-js: 3.0.0 - exif-parser: 0.1.12 - file-type: 16.5.4 - mime: 3.0.0 - - '@jimp/diff@1.6.0': - dependencies: - '@jimp/plugin-resize': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - pixelmatch: 5.3.0 - - '@jimp/file-ops@1.6.0': {} - - '@jimp/js-bmp@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - bmp-ts: 1.0.9 - - '@jimp/js-gif@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - gifwrap: 0.10.1 - omggif: 1.0.10 - - '@jimp/js-jpeg@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - jpeg-js: 0.4.4 - - '@jimp/js-png@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - pngjs: 7.0.0 - - '@jimp/js-tiff@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - utif2: 4.1.0 - - '@jimp/plugin-blit@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-blur@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/utils': 1.6.0 - - '@jimp/plugin-circle@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-color@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - tinycolor2: 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-contain@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/plugin-blit': 1.6.0 - '@jimp/plugin-resize': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-cover@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/plugin-crop': 1.6.0 - '@jimp/plugin-resize': 1.6.0 - '@jimp/types': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-crop@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-displace@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-dither@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - - '@jimp/plugin-fisheye@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-flip@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-hash@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/js-bmp': 1.6.0 - '@jimp/js-jpeg': 1.6.0 - '@jimp/js-png': 1.6.0 - '@jimp/js-tiff': 1.6.0 - '@jimp/plugin-color': 1.6.0 - '@jimp/plugin-resize': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - any-base: 1.1.0 - - '@jimp/plugin-mask@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-print@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/js-jpeg': 1.6.0 - '@jimp/js-png': 1.6.0 - '@jimp/plugin-blit': 1.6.0 - '@jimp/types': 1.6.0 - parse-bmfont-ascii: 1.0.6 - parse-bmfont-binary: 1.0.6 - parse-bmfont-xml: 1.1.6 - simple-xml-to-json: 1.2.7 - zod: 3.25.76 - - '@jimp/plugin-quantize@1.6.0': - dependencies: - image-q: 4.0.0 - zod: 3.25.76 - - '@jimp/plugin-resize@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/types': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-rotate@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/plugin-crop': 1.6.0 - '@jimp/plugin-resize': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/plugin-threshold@1.6.0': - dependencies: - '@jimp/core': 1.6.0 - '@jimp/plugin-color': 1.6.0 - '@jimp/plugin-hash': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - zod: 3.25.76 - - '@jimp/types@1.6.0': - dependencies: - zod: 3.25.76 - - '@jimp/utils@1.6.0': - dependencies: - '@jimp/types': 1.6.0 - tinycolor2: 1.6.0 - '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -33853,6 +32345,8 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.5': {} + '@jridgewell/sourcemap-codec@1.6.0': {} + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 @@ -33861,89 +32355,12 @@ snapshots: '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/sourcemap-codec': 1.6.0 '@jsonjoy.com/base64@1.1.2(tslib@2.8.1)': dependencies: tslib: 2.8.1 - '@jsonjoy.com/base64@17.67.0(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/buffers@1.2.1(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/buffers@17.67.0(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/codegen@1.0.0(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/codegen@17.67.0(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/fs-core@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - thingies: 2.6.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-fsa@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-core': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - thingies: 2.6.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-node-builtins@4.64.0(tslib@2.8.1)': - dependencies: - tslib: 2.8.1 - - '@jsonjoy.com/fs-node-to-fsa@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-fsa': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-node-utils@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - glob-to-regex.js: 1.2.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-node@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-core': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-print': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-snapshot': 4.64.0(tslib@2.8.1) - glob-to-regex.js: 1.2.0(tslib@2.8.1) - thingies: 2.6.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-print@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - tree-dump: 1.1.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/fs-snapshot@4.64.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/buffers': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/json-pack': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/util': 17.67.0(tslib@2.8.1) - tslib: 2.8.1 - '@jsonjoy.com/json-pack@1.1.1(tslib@2.8.1)': dependencies: '@jsonjoy.com/base64': 1.1.2(tslib@2.8.1) @@ -33952,65 +32369,10 @@ snapshots: thingies: 1.21.0(tslib@2.8.1) tslib: 2.8.1 - '@jsonjoy.com/json-pack@1.21.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/base64': 1.1.2(tslib@2.8.1) - '@jsonjoy.com/buffers': 1.2.1(tslib@2.8.1) - '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) - '@jsonjoy.com/json-pointer': 1.0.2(tslib@2.8.1) - '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) - hyperdyperid: 1.2.0 - thingies: 2.6.0(tslib@2.8.1) - tree-dump: 1.1.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/json-pack@17.67.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/base64': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/buffers': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/codegen': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/json-pointer': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/util': 17.67.0(tslib@2.8.1) - hyperdyperid: 1.2.0 - thingies: 2.6.0(tslib@2.8.1) - tree-dump: 1.1.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/json-pointer@1.0.2(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) - '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/json-pointer@17.67.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/util': 17.67.0(tslib@2.8.1) - tslib: 2.8.1 - '@jsonjoy.com/util@1.5.0(tslib@2.8.1)': dependencies: tslib: 2.8.1 - '@jsonjoy.com/util@1.9.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/buffers': 1.2.1(tslib@2.8.1) - '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) - tslib: 2.8.1 - - '@jsonjoy.com/util@17.67.0(tslib@2.8.1)': - dependencies: - '@jsonjoy.com/buffers': 17.67.0(tslib@2.8.1) - '@jsonjoy.com/codegen': 17.67.0(tslib@2.8.1) - tslib: 2.8.1 - - '@kwsites/file-exists@1.1.1': - dependencies: - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - '@kwsites/promise-deferred@1.1.1': {} - '@leichtgewicht/ip-codec@2.0.5': {} '@libsql/client@0.15.15': @@ -34137,27 +32499,6 @@ snapshots: '@lix-js/server-protocol-schema@0.1.1': {} - '@lmdb/lmdb-darwin-arm64@3.5.1': - optional: true - - '@lmdb/lmdb-darwin-x64@3.5.1': - optional: true - - '@lmdb/lmdb-linux-arm64@3.5.1': - optional: true - - '@lmdb/lmdb-linux-arm@3.5.1': - optional: true - - '@lmdb/lmdb-linux-x64@3.5.1': - optional: true - - '@lmdb/lmdb-win32-arm64@3.5.1': - optional: true - - '@lmdb/lmdb-win32-x64@3.5.1': - optional: true - '@loaderkit/resolve@1.0.4': dependencies: '@braidai/lang': 1.1.2 @@ -34178,14 +32519,14 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 - '@mapbox/node-pre-gyp@2.0.0': + '@mapbox/node-pre-gyp@2.0.0(supports-color@10.2.2)': dependencies: consola: 3.4.2 detect-libc: 2.1.2 - https-proxy-agent: 7.0.6 + https-proxy-agent: 7.0.6(supports-color@10.2.2) node-fetch: 2.7.0 nopt: 8.1.0 - semver: 7.8.2 + semver: 7.8.5 tar: 7.4.3 transitivePeerDependencies: - encoding @@ -34270,23 +32611,11 @@ snapshots: chevrotain: 10.5.0 lilconfig: 2.1.0 - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': - optional: true + '@msw/playwright@0.6.7(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))': + dependencies: + '@mswjs/interceptors': 0.41.9 + msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + outvariant: 1.4.3 '@mswjs/interceptors@0.37.6': dependencies: @@ -34297,39 +32626,48 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 + '@mswjs/interceptors@0.41.9': + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 + '@mui/core-downloads-tracker@6.4.7': {} - '@mui/material@6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@mui/material@6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 '@mui/core-downloads-tracker': 6.4.7 - '@mui/system': 6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3) + '@mui/system': 6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9) '@mui/types': 7.2.21(@types/react@19.2.9) - '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.3) + '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.9) '@popperjs/core': 2.11.8 '@types/react-transition-group': 4.4.12(@types/react@19.2.9) clsx: 2.1.1 csstype: 3.1.3 prop-types: 15.8.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) react-is: 19.0.0 - react-transition-group: 4.4.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + react-transition-group: 4.4.5(react-dom@19.2.9(react@19.2.9))(react@19.2.9) optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.3) - '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3) + '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) + '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) '@types/react': 19.2.9 - '@mui/private-theming@6.4.6(@types/react@19.2.9)(react@19.2.3)': + '@mui/private-theming@6.4.6(@types/react@19.2.9)(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 - '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.3) + '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.9) prop-types: 15.8.1 - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@mui/styled-engine@6.4.6(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(react@19.2.3)': + '@mui/styled-engine@6.4.6(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 '@emotion/cache': 11.14.0 @@ -34337,284 +32675,99 @@ snapshots: '@emotion/sheet': 1.4.0 csstype: 3.2.3 prop-types: 15.8.1 - react: 19.2.3 + react: 19.2.9 optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.3) - '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3) + '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) + '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) - '@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3)': + '@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 - '@mui/private-theming': 6.4.6(@types/react@19.2.9)(react@19.2.3) - '@mui/styled-engine': 6.4.6(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3))(react@19.2.3) + '@mui/private-theming': 6.4.6(@types/react@19.2.9)(react@19.2.9) + '@mui/styled-engine': 6.4.6(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(react@19.2.9) '@mui/types': 7.2.21(@types/react@19.2.9) - '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.3) + '@mui/utils': 6.4.6(@types/react@19.2.9)(react@19.2.9) clsx: 2.1.1 csstype: 3.2.3 prop-types: 15.8.1 - react: 19.2.3 + react: 19.2.9 optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.3) - '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.3))(@types/react@19.2.9)(react@19.2.3) + '@emotion/react': 11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) + '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2))(@types/react@19.2.9)(react@19.2.9)(supports-color@10.2.2) '@types/react': 19.2.9 '@mui/types@7.2.21(@types/react@19.2.9)': optionalDependencies: '@types/react': 19.2.9 - '@mui/utils@6.4.6(@types/react@19.2.9)(react@19.2.3)': + '@mui/utils@6.4.6(@types/react@19.2.9)(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 '@mui/types': 7.2.21(@types/react@19.2.9) '@types/prop-types': 15.7.14 clsx: 2.1.1 prop-types: 15.8.1 - react: 19.2.3 + react: 19.2.9 react-is: 19.0.0 optionalDependencies: '@types/react': 19.2.9 - '@napi-rs/nice-android-arm-eabi@1.1.1': - optional: true - - '@napi-rs/nice-android-arm64@1.1.1': - optional: true - - '@napi-rs/nice-darwin-arm64@1.1.1': - optional: true - - '@napi-rs/nice-darwin-x64@1.1.1': - optional: true - - '@napi-rs/nice-freebsd-x64@1.1.1': - optional: true - - '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': - optional: true - - '@napi-rs/nice-linux-arm64-gnu@1.1.1': - optional: true - - '@napi-rs/nice-linux-arm64-musl@1.1.1': - optional: true - - '@napi-rs/nice-linux-ppc64-gnu@1.1.1': - optional: true - - '@napi-rs/nice-linux-riscv64-gnu@1.1.1': - optional: true - - '@napi-rs/nice-linux-s390x-gnu@1.1.1': - optional: true - - '@napi-rs/nice-linux-x64-gnu@1.1.1': - optional: true - - '@napi-rs/nice-linux-x64-musl@1.1.1': - optional: true - - '@napi-rs/nice-openharmony-arm64@1.1.1': - optional: true - - '@napi-rs/nice-win32-arm64-msvc@1.1.1': - optional: true - - '@napi-rs/nice-win32-ia32-msvc@1.1.1': - optional: true - - '@napi-rs/nice-win32-x64-msvc@1.1.1': - optional: true - - '@napi-rs/nice@1.1.1': - optionalDependencies: - '@napi-rs/nice-android-arm-eabi': 1.1.1 - '@napi-rs/nice-android-arm64': 1.1.1 - '@napi-rs/nice-darwin-arm64': 1.1.1 - '@napi-rs/nice-darwin-x64': 1.1.1 - '@napi-rs/nice-freebsd-x64': 1.1.1 - '@napi-rs/nice-linux-arm-gnueabihf': 1.1.1 - '@napi-rs/nice-linux-arm64-gnu': 1.1.1 - '@napi-rs/nice-linux-arm64-musl': 1.1.1 - '@napi-rs/nice-linux-ppc64-gnu': 1.1.1 - '@napi-rs/nice-linux-riscv64-gnu': 1.1.1 - '@napi-rs/nice-linux-s390x-gnu': 1.1.1 - '@napi-rs/nice-linux-x64-gnu': 1.1.1 - '@napi-rs/nice-linux-x64-musl': 1.1.1 - '@napi-rs/nice-openharmony-arm64': 1.1.1 - '@napi-rs/nice-win32-arm64-msvc': 1.1.1 - '@napi-rs/nice-win32-ia32-msvc': 1.1.1 - '@napi-rs/nice-win32-x64-msvc': 1.1.1 + '@napi-rs/lzma-linux-x64-gnu@1.5.1': optional: true '@napi-rs/wasm-runtime@0.2.12': dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.2 + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@tybys/wasm-util': 0.10.3 optional: true '@napi-rs/wasm-runtime@0.2.4': dependencies: - '@emnapi/core': 1.4.5 - '@emnapi/runtime': 1.4.5 + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 '@tybys/wasm-util': 0.9.0 - '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)': dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.2 + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@tybys/wasm-util': 0.10.3 optional: true - '@nativescript-community/react@19.0.0(@nativescript/core@9.0.20)(dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2))(react@19.2.3)(undom-ng@1.1.2)': - dependencies: - '@nativescript/core': 9.0.20 - dominative: 0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2) - react: 19.2.3 - react-reconciler: 0.32.0(react@19.2.3) - undom-ng: 1.1.2 - - '@nativescript/android@9.0.5': {} - - '@nativescript/core@9.0.20': - dependencies: - '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) - '@csstools/css-color-parser': 3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) - '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) - '@csstools/css-tokenizer': 3.0.4 - '@nativescript/hook': 3.0.5 - acorn: 8.15.0 - css-tree: 3.2.1 - css-what: 7.0.0 - emoji-regex: 10.6.0 - source-map: 0.7.6 - source-map-js: 1.2.1 - tslib: 2.8.1 - - '@nativescript/doctor@2.0.17': - dependencies: - lodash: 4.17.21 - semver: 7.7.2 - shelljs: 0.10.0 - winreg: 1.2.5 - yauzl: 3.2.0 - - '@nativescript/hook@3.0.5': {} - - '@nativescript/ios@9.0.3': {} - - '@nativescript/types-android@9.0.0': {} - - '@nativescript/types-ios@9.0.0': {} - - '@nativescript/types@9.0.0': - dependencies: - '@nativescript/types-android': 9.0.0 - '@nativescript/types-ios': 9.0.0 - - '@nativescript/vite@2.0.3(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@testing-library/jest-dom@6.6.3)(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(postcss@8.5.12)(react@19.2.3)(rollup@4.56.0)(solid-js@1.9.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2))(yaml@2.9.0)': - dependencies: - '@analogjs/vite-plugin-angular': 2.6.3(@angular-devkit/build-angular@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(tailwindcss@4.2.2)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0))(@angular/build@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0))(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - '@angular-devkit/build-angular': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(chokidar@5.0.0)(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(jiti@2.7.0)(tailwindcss@4.2.2)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0) - '@angular/build': 21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(@angular/compiler@21.2.18)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@types/node@25.0.9)(chokidar@5.0.0)(jiti@2.7.0)(less@4.4.2)(postcss@8.5.12)(tailwindcss@4.2.2)(terser@5.46.0)(tslib@2.8.1)(tsx@4.20.3)(typescript@6.0.2)(vitest@4.1.4)(yaml@2.9.0) - '@babel/core': 7.29.0 - '@babel/generator': 7.29.1 - '@babel/parser': 7.29.2 - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) - '@rollup/plugin-alias': 6.0.0(rollup@4.56.0) - '@rollup/plugin-commonjs': 29.0.0(rollup@4.56.0) - '@rollup/plugin-replace': 6.0.3(rollup@4.56.0) - '@vitejs/plugin-vue': 6.0.5(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) - '@vitejs/plugin-vue-jsx': 5.1.5(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) - '@vue/compiler-sfc': 3.5.25 - esbuild: 0.25.10 - minimist: 1.2.8 - react-reconciler: 0.32.0(react@19.2.3) - sass: 1.97.2 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-solid: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - vite-plugin-static-copy: 3.4.0(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - vue-tsc: 3.3.7(typescript@6.0.2) - ws: 8.20.0 - transitivePeerDependencies: - - '@angular/compiler' - - '@angular/compiler-cli' - - '@angular/core' - - '@angular/localize' - - '@angular/platform-browser' - - '@angular/platform-server' - - '@angular/service-worker' - - '@angular/ssr' - - '@emnapi/core' - - '@emnapi/runtime' - - '@rspack/core' - - '@swc/core' - - '@testing-library/jest-dom' - - '@types/node' - - '@vitejs/devtools' - - '@web/test-runner' - - browser-sync - - bufferutil - - chokidar - - debug - - html-webpack-plugin - - jest - - jest-environment-jsdom - - jiti - - karma - - less - - lightningcss - - ng-packagr - - node-sass - - postcss - - protractor - - react - - rollup - - sass-embedded - - solid-js - - stylus - - sugarss - - supports-color - - tailwindcss - - terser - - tslib - - tsx - - typescript - - uglify-js - - utf-8-validate - - vitest - - vue - - webpack-cli - - yaml - '@neon-rs/load@0.0.4': {} - '@netlify/api@14.0.7': + '@netlify/ai@1.0.1': dependencies: - '@netlify/open-api': 2.40.0 + '@netlify/api': 15.1.2 + + '@netlify/api@15.1.2': + dependencies: + '@netlify/open-api': 2.57.1 node-fetch: 3.3.2 - p-wait-for: 5.0.2 picoquery: 2.5.0 '@netlify/binary-info@1.0.0': {} - '@netlify/blobs@10.1.0': + '@netlify/blobs@11.0.3(supports-color@10.2.2)': dependencies: - '@netlify/dev-utils': 4.3.0 - '@netlify/runtime-utils': 2.2.0 + '@netlify/dev-utils': 6.0.1 + '@netlify/otel': 7.0.2(supports-color@10.2.2) + '@netlify/runtime-utils': 3.0.0 + transitivePeerDependencies: + - supports-color - '@netlify/cache@3.3.0': + '@netlify/cache@4.0.0': dependencies: - '@netlify/runtime-utils': 2.2.0 + '@netlify/runtime-utils': 3.0.0 - '@netlify/config@23.2.0': + '@netlify/config@25.2.5': dependencies: - '@iarna/toml': 2.2.5 - '@netlify/api': 14.0.7 - '@netlify/headers-parser': 9.0.2 - '@netlify/redirect-parser': 15.0.3 - chalk: 5.6.2 - cron-parser: 4.9.0 + '@netlify/api': 15.1.2 + '@netlify/headers-parser': 10.1.1 + '@netlify/redirect-parser': 16.1.1 + chalk: 6.0.0 + cron-parser: 5.10.1 deepmerge: 4.3.1 dot-prop: 9.0.0 execa: 8.0.1 @@ -34625,45 +32778,50 @@ snapshots: indent-string: 5.0.0 is-plain-obj: 4.1.0 map-obj: 5.0.2 - omit.js: 2.0.2 p-locate: 6.0.0 path-type: 6.0.0 read-package-up: 11.0.0 + smol-toml: 1.6.1 tomlify-j0.4: 3.0.0 validate-npm-package-name: 5.0.1 yaml: 2.9.0 yargs: 17.7.2 + zod: 4.6.6 - '@netlify/dev-utils@4.3.0': + '@netlify/database-dev@1.0.1': dependencies: - '@whatwg-node/server': 0.10.13 - ansis: 4.1.0 - chokidar: 4.0.3 + '@electric-sql/pglite': 0.3.16 + pg-gateway: 0.3.0-beta.4 + + '@netlify/dev-utils@6.0.1': + dependencies: + '@whatwg-node/server': 0.11.0 + ansis: 4.3.1 + atomically: 2.1.1 + chokidar: 5.0.0 decache: 4.6.2 dettle: 1.0.5 dot-prop: 9.0.0 empathic: 2.0.0 env-paths: 3.0.0 - image-size: 2.0.2 - js-image-generator: 1.0.4 parse-gitignore: 2.0.0 - semver: 7.8.2 - tmp-promise: 3.0.3 - uuid: 11.1.0 - write-file-atomic: 5.0.1 + semver: 7.8.5 - '@netlify/dev@4.6.3(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0)': + '@netlify/dev@5.1.0(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)': dependencies: - '@netlify/blobs': 10.1.0 - '@netlify/config': 23.2.0 - '@netlify/dev-utils': 4.3.0 - '@netlify/edge-functions-dev': 1.0.0 - '@netlify/functions-dev': 1.0.0(rollup@4.56.0) - '@netlify/headers': 2.1.0 - '@netlify/images': 1.3.0(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2) - '@netlify/redirects': 3.1.0 - '@netlify/runtime': 4.1.1 - '@netlify/static': 3.1.0 + '@netlify/ai': 1.0.1 + '@netlify/blobs': 11.0.3(supports-color@10.2.2) + '@netlify/config': 25.2.5 + '@netlify/database-dev': 1.0.1 + '@netlify/dev-utils': 6.0.1 + '@netlify/edge-functions-dev': 2.0.1 + '@netlify/functions-dev': 2.0.5(rollup@4.63.1)(supports-color@10.2.2) + '@netlify/headers': 3.0.1 + '@netlify/images': 2.0.1(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(srvx@1.0.5) + '@netlify/redirects': 4.0.2 + '@netlify/runtime': 5.0.3(supports-color@10.2.2) + '@netlify/server-dev': 0.1.1 + '@netlify/static': 4.0.0 ulid: 3.0.1 transitivePeerDependencies: - '@azure/app-configuration' @@ -34674,6 +32832,7 @@ snapshots: - '@azure/storage-blob' - '@capacitor/preferences' - '@deno/kv' + - '@parcel/watcher' - '@planetscale/database' - '@upstash/redis' - '@vercel/blob' @@ -34687,62 +32846,60 @@ snapshots: - idb-keyval - ioredis - rollup + - srvx - supports-color - uploadthing - '@netlify/edge-bundler@14.7.0': + '@netlify/edge-bundler@16.0.4': dependencies: '@import-maps/resolve': 2.0.0 + '@sveltejs/acorn-typescript': 1.0.13(acorn@8.18.0) + acorn: 8.18.0 ajv: 8.18.0 ajv-errors: 3.0.0(ajv@8.18.0) better-ajv-errors: 1.2.0(ajv@8.18.0) common-path-prefix: 3.0.0 - env-paths: 3.0.0 - esbuild: 0.25.10 + esbuild: 0.28.1 execa: 8.0.1 find-up: 7.0.0 - get-port: 7.1.0 node-stream-zip: 1.15.0 p-retry: 6.2.1 - p-wait-for: 5.0.2 parse-imports: 2.2.1 - path-key: 4.0.0 - semver: 7.8.2 - tar: 7.4.3 + semver: 7.8.5 + tar: 7.5.22 tmp-promise: 3.0.3 urlpattern-polyfill: 8.0.2 - uuid: 11.1.0 '@netlify/edge-functions-bootstrap@2.16.0': {} - '@netlify/edge-functions-dev@1.0.0': + '@netlify/edge-functions-dev@2.0.1': dependencies: - '@netlify/dev-utils': 4.3.0 - '@netlify/edge-bundler': 14.7.0 - '@netlify/edge-functions': 3.0.0 + '@netlify/dev-utils': 6.0.1 + '@netlify/edge-bundler': 16.0.4 + '@netlify/edge-functions': 4.0.0 '@netlify/edge-functions-bootstrap': 2.16.0 - '@netlify/runtime-utils': 2.2.0 + '@netlify/runtime-utils': 3.0.0 get-port: 7.1.0 - '@netlify/edge-functions@3.0.0': + '@netlify/edge-functions@4.0.0': dependencies: - '@netlify/types': 2.1.0 + '@netlify/types': 3.0.0 - '@netlify/functions-dev@1.0.0(rollup@4.56.0)': + '@netlify/functions-dev@2.0.5(rollup@4.63.1)(supports-color@10.2.2)': dependencies: - '@netlify/blobs': 10.1.0 - '@netlify/dev-utils': 4.3.0 - '@netlify/functions': 5.0.0 - '@netlify/zip-it-and-ship-it': 14.1.11(rollup@4.56.0) - cron-parser: 4.9.0 + '@netlify/blobs': 11.0.3(supports-color@10.2.2) + '@netlify/dev-utils': 6.0.1 + '@netlify/functions': 6.0.0 + '@netlify/zip-it-and-ship-it': 15.5.1(rollup@4.63.1)(supports-color@10.2.2) + cron-parser: 5.10.1 decache: 4.6.2 - extract-zip: 2.0.1 is-stream: 4.0.1 jwt-decode: 4.0.0 lambda-local: 2.2.0 - read-package-up: 11.0.0 - semver: 7.8.2 + read-package-up: 12.0.0 + semver: 7.8.5 source-map-support: 0.5.21 + yauzl: 3.4.0 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -34750,26 +32907,22 @@ snapshots: - rollup - supports-color - '@netlify/functions@5.0.0': + '@netlify/functions@6.0.0': dependencies: - '@netlify/types': 2.1.0 + '@netlify/types': 3.0.0 - '@netlify/headers-parser@9.0.2': + '@netlify/headers-parser@10.1.1': dependencies: - '@iarna/toml': 2.2.5 escape-string-regexp: 5.0.0 - fast-safe-stringify: 2.1.1 - is-plain-obj: 4.1.0 - map-obj: 5.0.2 - path-exists: 5.0.0 + smol-toml: 1.6.1 - '@netlify/headers@2.1.0': + '@netlify/headers@3.0.1': dependencies: - '@netlify/headers-parser': 9.0.2 + '@netlify/headers-parser': 10.1.1 - '@netlify/images@1.3.0(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)': + '@netlify/images@2.0.1(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(srvx@1.0.5)': dependencies: - ipx: 3.1.1(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2) + ipx: 3.1.1(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(srvx@1.0.5) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -34780,6 +32933,7 @@ snapshots: - '@capacitor/preferences' - '@deno/kv' - '@netlify/blobs' + - '@parcel/watcher' - '@planetscale/database' - '@upstash/redis' - '@vercel/blob' @@ -34789,46 +32943,71 @@ snapshots: - db0 - idb-keyval - ioredis + - srvx - uploadthing - '@netlify/open-api@2.40.0': {} + '@netlify/open-api@2.57.1': {} - '@netlify/redirect-parser@15.0.3': + '@netlify/otel@7.0.2(supports-color@10.2.2)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/instrumentation': 0.221.0(@opentelemetry/api@1.9.1)(supports-color@10.2.2) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-node': 2.10.0(@opentelemetry/api@1.9.1) + transitivePeerDependencies: + - supports-color + + '@netlify/redirect-parser@16.1.1': dependencies: - '@iarna/toml': 2.2.5 fast-safe-stringify: 2.1.1 - is-plain-obj: 4.1.0 - path-exists: 5.0.0 + smol-toml: 1.6.1 - '@netlify/redirects@3.1.0': + '@netlify/redirects@4.0.2': dependencies: - '@netlify/dev-utils': 4.3.0 - '@netlify/redirect-parser': 15.0.3 - cookie: 1.0.2 - jsonwebtoken: 9.0.2 + '@netlify/dev-utils': 6.0.1 + '@netlify/redirect-parser': 16.1.1 + cookie: 2.0.1 + jsonwebtoken: 9.0.3 netlify-redirector: 0.5.0 - '@netlify/runtime-utils@2.2.0': {} + '@netlify/runtime-utils@3.0.0': {} - '@netlify/runtime@4.1.1': + '@netlify/runtime@5.0.3(supports-color@10.2.2)': dependencies: - '@netlify/blobs': 10.1.0 - '@netlify/cache': 3.3.0 - '@netlify/runtime-utils': 2.2.0 - '@netlify/types': 2.1.0 + '@netlify/blobs': 11.0.3(supports-color@10.2.2) + '@netlify/cache': 4.0.0 + '@netlify/runtime-utils': 3.0.0 + '@netlify/types': 3.0.0 + transitivePeerDependencies: + - supports-color - '@netlify/serverless-functions-api@2.7.1': {} + '@netlify/server-dev@0.1.1': + dependencies: + '@netlify/dev-utils': 6.0.1 + '@netlify/serverless-functions-api': 2.21.2 + get-port: 7.1.0 - '@netlify/static@3.1.0': + '@netlify/serverless-functions-api@2.18.0': + dependencies: + '@netlify/types': 2.8.0 + + '@netlify/serverless-functions-api@2.21.2': + dependencies: + '@netlify/types': 2.8.0 + + '@netlify/static@4.0.0': dependencies: mime-types: 3.0.2 - '@netlify/types@2.1.0': {} + '@netlify/types@2.8.0': {} - '@netlify/vite-plugin-tanstack-start@1.1.4(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@netlify/types@3.0.0': {} + + '@netlify/vite-plugin-tanstack-start@1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@netlify/vite-plugin': 2.7.4(babel-plugin-macros@3.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@netlify/vite-plugin': 3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optionalDependencies: '@tanstack/solid-start': link:packages/solid-start transitivePeerDependencies: @@ -34840,6 +33019,7 @@ snapshots: - '@azure/storage-blob' - '@capacitor/preferences' - '@deno/kv' + - '@parcel/watcher' - '@planetscale/database' - '@upstash/redis' - '@vercel/blob' @@ -34854,15 +33034,16 @@ snapshots: - idb-keyval - ioredis - rollup + - srvx - supports-color - uploadthing - '@netlify/vite-plugin@2.7.4(babel-plugin-macros@3.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@netlify/vite-plugin@3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@netlify/dev': 4.6.3(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(rollup@4.56.0) - '@netlify/dev-utils': 4.3.0 - dedent: 1.7.0(babel-plugin-macros@3.1.0) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@netlify/dev': 5.1.0(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2) + '@netlify/dev-utils': 6.0.1 + dedent: 1.7.2(babel-plugin-macros@3.1.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -34872,6 +33053,7 @@ snapshots: - '@azure/storage-blob' - '@capacitor/preferences' - '@deno/kv' + - '@parcel/watcher' - '@planetscale/database' - '@upstash/redis' - '@vercel/blob' @@ -34886,21 +33068,23 @@ snapshots: - idb-keyval - ioredis - rollup + - srvx - supports-color - uploadthing - '@netlify/zip-it-and-ship-it@14.1.11(rollup@4.56.0)': + '@netlify/zip-it-and-ship-it@15.5.1(rollup@4.63.1)(supports-color@10.2.2)': dependencies: - '@babel/parser': 7.29.2 - '@babel/types': 7.28.4 + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 '@netlify/binary-info': 1.0.0 - '@netlify/serverless-functions-api': 2.7.1 - '@vercel/nft': 0.29.4(rollup@4.56.0) - archiver: 7.0.1 + '@netlify/serverless-functions-api': 2.18.0 + '@opentelemetry/api': 1.8.0 + '@vercel/nft': 1.3.1(rollup@4.63.1)(supports-color@10.2.2) + archiver: 8.0.0 common-path-prefix: 3.0.0 copy-file: 11.1.0 es-module-lexer: 1.7.0 - esbuild: 0.25.10 + esbuild: 0.28.1 execa: 8.0.1 fast-glob: 3.3.3 filter-obj: 6.1.0 @@ -34909,20 +33093,20 @@ snapshots: junk: 4.0.1 locate-path: 7.2.0 merge-options: 3.0.4 - minimatch: 9.0.9 + minimatch: 10.2.5 normalize-path: 3.0.0 p-map: 7.0.3 path-exists: 5.0.0 - precinct: 12.2.0 + precinct: 12.2.0(supports-color@10.2.2) require-package-name: 2.0.1 resolve: 2.0.0-next.5 - semver: 7.8.2 + semver: 7.8.5 tmp-promise: 3.0.3 - toml: 3.0.0 + toml: 4.3.0 unixify: 1.0.0 urlpattern-polyfill: 8.0.2 yargs: 17.7.2 - zod: 3.25.76 + zod: 4.6.6 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -34930,11 +33114,31 @@ snapshots: - rollup - supports-color - '@ngtools/webpack@21.2.19(@angular/compiler-cli@21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2))(typescript@6.0.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1))': - dependencies: - '@angular/compiler-cli': 21.2.18(@angular/compiler@21.2.18)(typescript@6.0.2) - typescript: 6.0.2 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + '@next/env@16.3.4': {} + + '@next/swc-darwin-arm64@16.3.4': + optional: true + + '@next/swc-darwin-x64@16.3.4': + optional: true + + '@next/swc-linux-arm64-gnu@16.3.4': + optional: true + + '@next/swc-linux-arm64-musl@16.3.4': + optional: true + + '@next/swc-linux-x64-gnu@16.3.4': + optional: true + + '@next/swc-linux-x64-musl@16.3.4': + optional: true + + '@next/swc-win32-arm64-msvc@16.3.4': + optional: true + + '@next/swc-win32-x64-msvc@16.3.4': + optional: true '@noble/ciphers@2.2.0': {} @@ -34954,193 +33158,43 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.0 - '@npmcli/agent@4.0.2': + '@nx/devkit@24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)))': dependencies: - agent-base: 7.1.3 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 - lru-cache: 11.5.1 - socks-proxy-agent: 8.0.5 - transitivePeerDependencies: - - supports-color - - '@npmcli/arborist@9.1.8': - dependencies: - '@isaacs/string-locale-compare': 1.1.0 - '@npmcli/fs': 5.0.0 - '@npmcli/installed-package-contents': 4.0.0 - '@npmcli/map-workspaces': 5.0.3 - '@npmcli/metavuln-calculator': 9.0.3 - '@npmcli/name-from-folder': 4.0.0 - '@npmcli/node-gyp': 5.0.0 - '@npmcli/package-json': 7.0.5 - '@npmcli/query': 5.0.0 - '@npmcli/redact': 4.0.0 - '@npmcli/run-script': 10.0.4 - bin-links: 6.0.2 - cacache: 20.0.4 - common-ancestor-path: 1.0.1 - hosted-git-info: 9.0.3 - json-stringify-nice: 1.1.4 - lru-cache: 11.5.1 - minimatch: 10.2.5 - nopt: 9.0.0 - npm-install-checks: 8.0.0 - npm-package-arg: 13.0.2 - npm-pick-manifest: 11.0.3 - npm-registry-fetch: 19.1.1 - pacote: 21.0.4 - parse-conflict-json: 5.0.1 - proc-log: 6.1.0 - proggy: 4.0.0 - promise-all-reject-late: 1.0.1 - promise-call-limit: 3.0.2 - semver: 7.8.2 - ssri: 13.0.1 - treeverse: 3.0.0 - walk-up-path: 4.0.0 - transitivePeerDependencies: - - supports-color - - '@npmcli/fs@5.0.0': - dependencies: - semver: 7.8.2 - - '@npmcli/git@7.0.2': - dependencies: - '@gar/promise-retry': 1.0.3 - '@npmcli/promise-spawn': 9.0.1 - ini: 6.0.0 - lru-cache: 11.5.1 - npm-pick-manifest: 11.0.3 - proc-log: 6.1.0 - semver: 7.8.2 - which: 6.0.1 - - '@npmcli/installed-package-contents@4.0.0': - dependencies: - npm-bundled: 5.0.0 - npm-normalize-package-bin: 5.0.0 - - '@npmcli/map-workspaces@5.0.3': - dependencies: - '@npmcli/name-from-folder': 4.0.0 - '@npmcli/package-json': 7.0.5 - glob: 13.0.0 - minimatch: 10.2.5 - - '@npmcli/metavuln-calculator@9.0.3': - dependencies: - cacache: 20.0.4 - json-parse-even-better-errors: 5.0.0 - pacote: 21.0.4 - proc-log: 6.1.0 - semver: 7.8.2 - transitivePeerDependencies: - - supports-color - - '@npmcli/name-from-folder@4.0.0': {} - - '@npmcli/node-gyp@5.0.0': {} - - '@npmcli/package-json@7.0.5': - dependencies: - '@npmcli/git': 7.0.2 - glob: 13.0.0 - hosted-git-info: 9.0.3 - json-parse-even-better-errors: 5.0.0 - proc-log: 6.1.0 - semver: 7.8.2 - spdx-expression-parse: 4.0.0 - - '@npmcli/promise-spawn@9.0.1': - dependencies: - which: 6.0.1 - - '@npmcli/query@5.0.0': - dependencies: - postcss-selector-parser: 7.1.0 - - '@npmcli/redact@4.0.0': {} - - '@npmcli/run-script@10.0.4': - dependencies: - '@npmcli/node-gyp': 5.0.0 - '@npmcli/package-json': 7.0.5 - '@npmcli/promise-spawn': 9.0.1 - node-gyp: 12.4.0 - proc-log: 6.1.0 - - '@nstudio/trapezedev-project@7.2.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(typescript@5.7.3)': - dependencies: - '@ionic/utils-fs': 3.1.7 - '@ionic/utils-subprocess': 2.1.14 - '@prettier/plugin-xml': 2.2.0 - '@trapezedev/gradle-parse': 7.1.3 - '@xmldom/xmldom': 0.8.13 - cross-spawn: 7.0.6 - diff: 5.2.2 - env-paths: 3.0.0 - gradle-to-js: 2.0.1 - ini: 2.0.0 - kleur: 4.1.5 - lodash: 4.17.21 - plist: 3.1.0 - prettier: 2.8.8 - prompts: 2.4.2 - replace: 1.2.2 - tmp: 0.2.7 - ts-node: 10.9.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(typescript@5.7.3) - xcode: 3.0.1 - xml-js: 1.6.11 - xpath: 0.0.32 - yargs: 17.7.2 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - supports-color - - typescript - - '@nx/devkit@22.7.5(nx@22.7.5(@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))(debug@4.4.3))': - dependencies: - '@zkochan/js-yaml': 0.0.7 ejs: 5.0.1 - enquirer: 2.3.6 minimatch: 10.2.5 - nx: 22.7.5(@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))(debug@4.4.3) - semver: 7.8.2 + nx: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)) + semver: 7.8.5 tslib: 2.8.1 yargs-parser: 21.1.1 - '@nx/nx-darwin-arm64@22.7.5': + '@nx/nx-darwin-arm64@24.0.0': optional: true - '@nx/nx-darwin-x64@22.7.5': + '@nx/nx-darwin-x64@24.0.0': optional: true - '@nx/nx-freebsd-x64@22.7.5': + '@nx/nx-freebsd-x64@24.0.0': optional: true - '@nx/nx-linux-arm-gnueabihf@22.7.5': + '@nx/nx-linux-arm-gnueabihf@24.0.0': optional: true - '@nx/nx-linux-arm64-gnu@22.7.5': + '@nx/nx-linux-arm64-gnu@24.0.0': optional: true - '@nx/nx-linux-arm64-musl@22.7.5': + '@nx/nx-linux-arm64-musl@24.0.0': optional: true - '@nx/nx-linux-x64-gnu@22.7.5': + '@nx/nx-linux-x64-gnu@24.0.0': optional: true - '@nx/nx-linux-x64-musl@22.7.5': + '@nx/nx-linux-x64-musl@24.0.0': optional: true - '@nx/nx-win32-arm64-msvc@22.7.5': + '@nx/nx-win32-arm64-msvc@24.0.0': optional: true - '@nx/nx-win32-x64-msvc@22.7.5': + '@nx/nx-win32-x64-msvc@24.0.0': optional: true '@one-ini/wasm@0.1.1': {} @@ -35164,6 +33218,8 @@ snapshots: '@open-draft/deferred-promise@2.2.0': {} + '@open-draft/deferred-promise@3.0.0': {} + '@open-draft/logger@0.3.0': dependencies: is-node-process: 1.2.0 @@ -35171,145 +33227,63 @@ snapshots: '@open-draft/until@2.1.0': {} + '@opentelemetry/api-logs@0.221.0': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/api@1.8.0': {} + + '@opentelemetry/api@1.9.1': {} + + '@opentelemetry/context-async-hooks@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/core@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/instrumentation@0.221.0(@opentelemetry/api@1.9.1)(supports-color@10.2.2)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.221.0 + import-in-the-middle: 3.5.1 + require-in-the-middle: 8.0.1(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + + '@opentelemetry/resources@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-base@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-node@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/context-async-hooks': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/sdk-trace@2.10.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/semantic-conventions@1.41.1': {} - '@oxc-minify/binding-android-arm-eabi@0.110.0': - optional: true - - '@oxc-minify/binding-android-arm64@0.110.0': - optional: true - - '@oxc-minify/binding-darwin-arm64@0.110.0': - optional: true - - '@oxc-minify/binding-darwin-x64@0.110.0': - optional: true - - '@oxc-minify/binding-freebsd-x64@0.110.0': - optional: true - - '@oxc-minify/binding-linux-arm-gnueabihf@0.110.0': - optional: true - - '@oxc-minify/binding-linux-arm-musleabihf@0.110.0': - optional: true - - '@oxc-minify/binding-linux-arm64-gnu@0.110.0': - optional: true - - '@oxc-minify/binding-linux-arm64-musl@0.110.0': - optional: true - - '@oxc-minify/binding-linux-ppc64-gnu@0.110.0': - optional: true - - '@oxc-minify/binding-linux-riscv64-gnu@0.110.0': - optional: true - - '@oxc-minify/binding-linux-riscv64-musl@0.110.0': - optional: true - - '@oxc-minify/binding-linux-s390x-gnu@0.110.0': - optional: true - - '@oxc-minify/binding-linux-x64-gnu@0.110.0': - optional: true - - '@oxc-minify/binding-linux-x64-musl@0.110.0': - optional: true - - '@oxc-minify/binding-openharmony-arm64@0.110.0': - optional: true - - '@oxc-minify/binding-wasm32-wasi@0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - optional: true - - '@oxc-minify/binding-win32-arm64-msvc@0.110.0': - optional: true - - '@oxc-minify/binding-win32-ia32-msvc@0.110.0': - optional: true - - '@oxc-minify/binding-win32-x64-msvc@0.110.0': - optional: true - - '@oxc-parser/binding-android-arm-eabi@0.121.0': - optional: true - - '@oxc-parser/binding-android-arm64@0.121.0': - optional: true - - '@oxc-parser/binding-darwin-arm64@0.121.0': - optional: true - - '@oxc-parser/binding-darwin-x64@0.121.0': - optional: true - - '@oxc-parser/binding-freebsd-x64@0.121.0': - optional: true - - '@oxc-parser/binding-linux-arm-gnueabihf@0.121.0': - optional: true - - '@oxc-parser/binding-linux-arm-musleabihf@0.121.0': - optional: true - - '@oxc-parser/binding-linux-arm64-gnu@0.121.0': - optional: true - - '@oxc-parser/binding-linux-arm64-musl@0.121.0': - optional: true - - '@oxc-parser/binding-linux-ppc64-gnu@0.121.0': - optional: true - - '@oxc-parser/binding-linux-riscv64-gnu@0.121.0': - optional: true - - '@oxc-parser/binding-linux-riscv64-musl@0.121.0': - optional: true - - '@oxc-parser/binding-linux-s390x-gnu@0.121.0': - optional: true - - '@oxc-parser/binding-linux-x64-gnu@0.121.0': - optional: true - - '@oxc-parser/binding-linux-x64-musl@0.121.0': - optional: true - - '@oxc-parser/binding-openharmony-arm64@0.121.0': - optional: true - - '@oxc-parser/binding-wasm32-wasi@0.121.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - optional: true - - '@oxc-parser/binding-win32-arm64-msvc@0.121.0': - optional: true - - '@oxc-parser/binding-win32-ia32-msvc@0.121.0': - optional: true - - '@oxc-parser/binding-win32-x64-msvc@0.121.0': - optional: true - - '@oxc-project/types@0.113.0': {} - - '@oxc-project/types@0.115.0': {} - - '@oxc-project/types@0.121.0': {} - - '@oxc-project/types@0.132.0': {} + '@oxc-project/types@0.153.0': {} '@oxc-resolver/binding-android-arm-eabi@11.19.1': optional: true @@ -35359,9 +33333,9 @@ snapshots: '@oxc-resolver/binding-openharmony-arm64@11.19.1': optional: true - '@oxc-resolver/binding-wasm32-wasi@11.19.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + '@oxc-resolver/binding-wasm32-wasi@11.19.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)': dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -35376,71 +33350,6 @@ snapshots: '@oxc-resolver/binding-win32-x64-msvc@11.19.1': optional: true - '@oxc-transform/binding-android-arm-eabi@0.110.0': - optional: true - - '@oxc-transform/binding-android-arm64@0.110.0': - optional: true - - '@oxc-transform/binding-darwin-arm64@0.110.0': - optional: true - - '@oxc-transform/binding-darwin-x64@0.110.0': - optional: true - - '@oxc-transform/binding-freebsd-x64@0.110.0': - optional: true - - '@oxc-transform/binding-linux-arm-gnueabihf@0.110.0': - optional: true - - '@oxc-transform/binding-linux-arm-musleabihf@0.110.0': - optional: true - - '@oxc-transform/binding-linux-arm64-gnu@0.110.0': - optional: true - - '@oxc-transform/binding-linux-arm64-musl@0.110.0': - optional: true - - '@oxc-transform/binding-linux-ppc64-gnu@0.110.0': - optional: true - - '@oxc-transform/binding-linux-riscv64-gnu@0.110.0': - optional: true - - '@oxc-transform/binding-linux-riscv64-musl@0.110.0': - optional: true - - '@oxc-transform/binding-linux-s390x-gnu@0.110.0': - optional: true - - '@oxc-transform/binding-linux-x64-gnu@0.110.0': - optional: true - - '@oxc-transform/binding-linux-x64-musl@0.110.0': - optional: true - - '@oxc-transform/binding-openharmony-arm64@0.110.0': - optional: true - - '@oxc-transform/binding-wasm32-wasi@0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - optional: true - - '@oxc-transform/binding-win32-arm64-msvc@0.110.0': - optional: true - - '@oxc-transform/binding-win32-ia32-msvc@0.110.0': - optional: true - - '@oxc-transform/binding-win32-x64-msvc@0.110.0': - optional: true - '@panva/hkdf@1.2.1': {} '@parcel/watcher-android-arm64@2.5.1': @@ -35473,10 +33382,10 @@ snapshots: '@parcel/watcher-linux-x64-musl@2.5.1': optional: true - '@parcel/watcher-wasm@2.5.1': + '@parcel/watcher-wasm@2.6.0': dependencies: is-glob: 4.0.3 - micromatch: 4.0.8 + picomatch: 4.0.7 '@parcel/watcher-win32-arm64@2.5.1': optional: true @@ -35507,6 +33416,7 @@ snapshots: '@parcel/watcher-win32-arm64': 2.5.1 '@parcel/watcher-win32-ia32': 2.5.1 '@parcel/watcher-win32-x64': 2.5.1 + optional: true '@peculiar/asn1-cms@2.7.0': dependencies: @@ -35623,31 +33533,26 @@ snapshots: pprof-to-md: 0.2.0 react-pprof: 1.4.0 - '@playwright/test@1.61.1': + '@playwright/test@1.63.0': dependencies: - playwright: 1.61.1 + playwright: 1.63.0 '@polka/url@1.0.0-next.28': {} '@popperjs/core@2.11.8': {} - '@poppinss/colors@4.1.5': + '@poppinss/colors@4.1.6': dependencies: kleur: 4.1.5 '@poppinss/dumper@0.6.5': dependencies: - '@poppinss/colors': 4.1.5 + '@poppinss/colors': 4.1.6 '@sindresorhus/is': 7.1.0 supports-color: 10.2.2 '@poppinss/exception@1.2.2': {} - '@prettier/plugin-xml@2.2.0': - dependencies: - '@xml-tools/parser': 1.0.11 - prettier: 3.8.1 - '@prisma/adapter-libsql@7.0.0': dependencies: '@libsql/client': 0.8.1 @@ -35659,12 +33564,12 @@ snapshots: '@prisma/client-runtime-utils@7.0.0': {} - '@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2)': + '@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))': dependencies: '@prisma/client-runtime-utils': 7.0.0 optionalDependencies: - prisma: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) - typescript: 6.0.2 + prisma: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + typescript: '@typescript/typescript6@6.0.2' '@prisma/config@7.0.0': dependencies: @@ -35679,7 +33584,7 @@ snapshots: '@prisma/debug@7.0.0': {} - '@prisma/dev@0.13.0(typescript@6.0.2)': + '@prisma/dev@0.13.0(@typescript/typescript6@6.0.2)': dependencies: '@electric-sql/pglite': 0.3.2 '@electric-sql/pglite-socket': 0.0.6(@electric-sql/pglite@0.3.2) @@ -35696,7 +33601,7 @@ snapshots: proper-lockfile: 4.1.2 remeda: 2.21.3 std-env: 3.9.0 - valibot: 1.1.0(typescript@6.0.2) + valibot: 1.1.0(@typescript/typescript6@6.0.2) zeptomatch: 2.0.2 transitivePeerDependencies: - typescript @@ -35730,11 +33635,11 @@ snapshots: '@prisma/query-plan-executor@6.18.0': {} - '@prisma/studio-core-licensed@0.8.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@prisma/studio-core-licensed@0.8.0(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@types/react': 19.2.9 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) '@protobufjs/aspromise@1.1.2': {} @@ -35767,1334 +33672,1103 @@ snapshots: '@radix-ui/primitive@1.1.2': {} - '@radix-ui/react-accessible-icon@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-accessible-icon@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-accordion@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-accordion@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collapsible': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collapsible': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-alert-dialog@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-alert-dialog@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-arrow@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-arrow@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-aspect-ratio@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-aspect-ratio@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-avatar@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-avatar@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-checkbox@1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-checkbox@1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-collapsible@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-collapsible@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-collection@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-collection@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-compose-refs@1.1.2(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-compose-refs@1.1.2(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-context-menu@2.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-context-menu@2.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-context@1.1.2(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-context@1.1.2(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-dialog@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-dialog@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) aria-hidden: 1.2.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-direction@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-direction@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-dismissable-layer@1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-dismissable-layer@1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-escape-keydown': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-escape-keydown': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-dropdown-menu@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-dropdown-menu@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-focus-guards@1.1.2(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-focus-guards@1.1.2(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-focus-scope@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-focus-scope@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-form@0.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-form@0.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-label': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-label': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-hover-card@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-hover-card@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-id@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-id@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-label@2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-label@2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-menu@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-menu@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) aria-hidden: 1.2.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-menubar@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-menubar@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-navigation-menu@1.2.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-navigation-menu@1.2.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-popover@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-popover@1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) aria-hidden: 1.2.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-popper@1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-popper@1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@floating-ui/react-dom': 2.1.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-arrow': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-rect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) + '@floating-ui/react-dom': 2.1.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-arrow': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-rect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) '@radix-ui/rect': 1.1.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-portal@1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-portal@1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-presence@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-presence@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-primitive@2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-primitive@2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-progress@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-progress@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-radio-group@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-radio-group@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-roving-focus@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-roving-focus@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-scroll-area@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-scroll-area@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/number': 1.1.1 '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-select@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-select@2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/number': 1.1.1 '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) aria-hidden: 1.2.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + react-remove-scroll: 2.6.3(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-separator@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-separator@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-slider@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-slider@1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/number': 1.1.1 '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-slot@1.2.0(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-slot@1.2.0(@types/react@19.2.9)(react@19.2.9)': dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-switch@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-switch@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-tabs@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-tabs@1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-toast@1.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-toast@1.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-toggle-group@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-toggle-group@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toggle': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toggle': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-toggle@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-toggle@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-toolbar@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-toolbar@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-separator': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toggle-group': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-separator': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toggle-group': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-tooltip@1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-tooltip@1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-id': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@radix-ui/react-use-callback-ref@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-callback-ref@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-controllable-state@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-controllable-state@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-escape-keydown@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-escape-keydown@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-layout-effect@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-layout-effect@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-previous@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-previous@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-rect@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-rect@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: '@radix-ui/rect': 1.1.1 - react: 19.2.3 + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-use-size@1.1.1(@types/react@19.2.9)(react@19.2.3)': + '@radix-ui/react-use-size@1.1.1(@types/react@19.2.9)(react@19.2.9)': dependencies: - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - react: 19.2.3 + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + react: 19.2.9 optionalDependencies: '@types/react': 19.2.9 - '@radix-ui/react-visually-hidden@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/react-visually-hidden@1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) '@radix-ui/rect@1.1.1': {} - '@radix-ui/themes@3.3.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@radix-ui/themes@3.3.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@radix-ui/colors': 3.0.0 classnames: 2.5.1 - radix-ui: 1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - react-remove-scroll-bar: 2.3.8(@types/react@19.2.9)(react@19.2.3) + radix-ui: 1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + react-remove-scroll-bar: 2.3.8(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@rigor789/resolve-package-path@1.0.7': {} - - '@rolldown/binding-android-arm64@1.0.0-rc.4': + '@rolldown/binding-android-arm-eabi@1.2.13': optional: true - '@rolldown/binding-android-arm64@1.0.0-rc.9': + '@rolldown/binding-android-arm64@1.2.13': optional: true - '@rolldown/binding-android-arm64@1.0.2': + '@rolldown/binding-darwin-arm64@1.2.13': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-rc.4': + '@rolldown/binding-darwin-x64@1.2.13': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-rc.9': + '@rolldown/binding-freebsd-x64@1.2.13': optional: true - '@rolldown/binding-darwin-arm64@1.0.2': + '@rolldown/binding-linux-arm-gnueabihf@1.2.13': optional: true - '@rolldown/binding-darwin-x64@1.0.0-rc.4': + '@rolldown/binding-linux-arm64-gnu@1.2.13': optional: true - '@rolldown/binding-darwin-x64@1.0.0-rc.9': + '@rolldown/binding-linux-arm64-musl@1.2.13': optional: true - '@rolldown/binding-darwin-x64@1.0.2': + '@rolldown/binding-linux-ppc64-gnu@1.2.13': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-rc.4': + '@rolldown/binding-linux-s390x-gnu@1.2.13': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-rc.9': + '@rolldown/binding-linux-x64-gnu@1.2.13': optional: true - '@rolldown/binding-freebsd-x64@1.0.2': + '@rolldown/binding-linux-x64-musl@1.2.13': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.4': + '@rolldown/binding-openharmony-arm64@1.2.13': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.9': + '@rolldown/binding-win32-arm64-msvc@1.2.13': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.2': + '@rolldown/binding-win32-x64-msvc@1.2.13': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.4': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.2': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.4': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.2': - optional: true - - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-ppc64-gnu@1.0.2': - optional: true - - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-s390x-gnu@1.0.2': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.4': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.2': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.0-rc.4': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.0-rc.9': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.2': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.0-rc.4': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.0-rc.9': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.2': - optional: true - - '@rolldown/binding-wasm32-wasi@1.0.0-rc.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - optional: true + '@babel/core': 7.29.0(supports-color@10.2.2) + picomatch: 4.0.7 + rolldown: 1.2.13 + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - '@rolldown/binding-wasm32-wasi@1.0.0-rc.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' + '@babel/core': 7.29.7(supports-color@10.2.2) + picomatch: 4.0.7 + rolldown: 1.2.13 + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optional: true - '@rolldown/binding-wasm32-wasi@1.0.2': + '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + picomatch: 4.0.7 + rolldown: 1.2.13 + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.4': - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.9': - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.2': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.4': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.9': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.2': - optional: true - - '@rolldown/pluginutils@1.0.0': {} - - '@rolldown/pluginutils@1.0.0-beta.19': {} - - '@rolldown/pluginutils@1.0.0-beta.27': {} - '@rolldown/pluginutils@1.0.0-rc.2': {} - '@rolldown/pluginutils@1.0.0-rc.3': {} - - '@rolldown/pluginutils@1.0.0-rc.4': {} - '@rolldown/pluginutils@1.0.0-rc.7': {} '@rolldown/pluginutils@1.0.0-rc.9': {} '@rolldown/pluginutils@1.0.1': {} - '@rollup/plugin-alias@6.0.0(rollup@4.56.0)': - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-commonjs@29.0.0(rollup@4.56.0)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - commondir: 1.0.1 - estree-walker: 2.0.2 - fdir: 6.5.0(picomatch@4.0.4) - is-reference: 1.2.1 - magic-string: 0.30.21 - picomatch: 4.0.4 - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-inject@5.0.5(rollup@4.56.0)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - estree-walker: 2.0.2 - magic-string: 0.30.21 - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-json@6.1.0(rollup@4.56.0)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-node-resolve@16.0.3(rollup@4.56.0)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-module: 1.0.0 - resolve: 1.22.11 - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-replace@6.0.3(rollup@4.56.0)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - magic-string: 0.30.21 - optionalDependencies: - rollup: 4.56.0 - - '@rollup/plugin-terser@0.4.4(rollup@4.56.0)': - dependencies: - serialize-javascript: 6.0.2 - smob: 1.5.0 - terser: 5.37.0 - optionalDependencies: - rollup: 4.56.0 - - '@rollup/pluginutils@5.1.4(rollup@4.56.0)': + '@rollup/pluginutils@5.1.4(rollup@4.63.1)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 - picomatch: 4.0.4 + picomatch: 4.0.7 optionalDependencies: - rollup: 4.56.0 + rollup: 4.63.1 - '@rollup/rollup-android-arm-eabi@4.56.0': + '@rollup/rollup-android-arm-eabi@4.63.1': optional: true - '@rollup/rollup-android-arm64@4.56.0': + '@rollup/rollup-android-arm64@4.63.1': optional: true - '@rollup/rollup-darwin-arm64@4.56.0': + '@rollup/rollup-darwin-arm64@4.63.1': optional: true - '@rollup/rollup-darwin-x64@4.56.0': + '@rollup/rollup-darwin-x64@4.63.1': optional: true - '@rollup/rollup-freebsd-arm64@4.56.0': + '@rollup/rollup-freebsd-arm64@4.63.1': optional: true - '@rollup/rollup-freebsd-x64@4.56.0': + '@rollup/rollup-freebsd-x64@4.63.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.56.0': + '@rollup/rollup-linux-arm-gnueabihf@4.63.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.56.0': + '@rollup/rollup-linux-arm-musleabihf@4.63.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.56.0': + '@rollup/rollup-linux-arm64-gnu@4.63.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.56.0': + '@rollup/rollup-linux-arm64-musl@4.63.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.56.0': + '@rollup/rollup-linux-loong64-gnu@4.63.1': optional: true - '@rollup/rollup-linux-loong64-musl@4.56.0': + '@rollup/rollup-linux-loong64-musl@4.63.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.56.0': + '@rollup/rollup-linux-ppc64-gnu@4.63.1': optional: true - '@rollup/rollup-linux-ppc64-musl@4.56.0': + '@rollup/rollup-linux-ppc64-musl@4.63.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.56.0': + '@rollup/rollup-linux-riscv64-gnu@4.63.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.56.0': + '@rollup/rollup-linux-riscv64-musl@4.63.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.56.0': + '@rollup/rollup-linux-s390x-gnu@4.63.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.56.0': + '@rollup/rollup-linux-x64-gnu@4.63.1': optional: true - '@rollup/rollup-linux-x64-musl@4.56.0': + '@rollup/rollup-linux-x64-musl@4.63.1': optional: true - '@rollup/rollup-openbsd-x64@4.56.0': + '@rollup/rollup-openbsd-x64@4.63.1': optional: true - '@rollup/rollup-openharmony-arm64@4.56.0': + '@rollup/rollup-openharmony-arm64@4.63.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.56.0': + '@rollup/rollup-win32-arm64-msvc@4.63.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.56.0': + '@rollup/rollup-win32-ia32-msvc@4.63.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.56.0': + '@rollup/rollup-win32-x64-gnu@4.63.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.56.0': + '@rollup/rollup-win32-x64-msvc@4.63.1': optional: true - '@rsbuild/core@2.0.1': + '@rsbuild/core@2.3.1': dependencies: - '@rspack/core': 2.0.0(@swc/helpers@0.5.21) - '@swc/helpers': 0.5.21 - transitivePeerDependencies: - - '@module-federation/runtime-tools' - - '@rsbuild/core@2.0.14': - dependencies: - '@rspack/core': 2.0.8(@swc/helpers@0.5.23) + '@rspack/core': 2.3.1(@swc/helpers@0.5.23) '@swc/helpers': 0.5.23 transitivePeerDependencies: - '@module-federation/runtime-tools' - '@rsbuild/core@2.0.8': + '@rsbuild/plugin-babel@1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2)': dependencies: - '@rspack/core': 2.0.5(@swc/helpers@0.5.23) - '@swc/helpers': 0.5.23 - transitivePeerDependencies: - - '@module-federation/runtime-tools' - - '@rsbuild/plugin-babel@1.0.6(@rsbuild/core@2.0.14)': - dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-proposal-decorators': 7.28.0(@babel/core@7.28.5) - '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.28.5) - '@babel/preset-typescript': 7.28.5(@babel/core@7.28.5) - '@rsbuild/core': 2.0.14 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-proposal-decorators': 7.29.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/plugin-transform-class-properties': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@babel/preset-typescript': 7.28.5(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@types/babel__core': 7.20.5 + reduce-configs: 1.1.1 + optionalDependencies: + '@rsbuild/core': 2.3.1 + transitivePeerDependencies: + - supports-color + + '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))': + dependencies: + '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(react-refresh@0.18.0) + react-refresh: 0.18.0 + optionalDependencies: + '@rsbuild/core': 2.3.1 + transitivePeerDependencies: + - '@rspack/core' + + '@rsbuild/plugin-sass@2.0.1(@rsbuild/core@2.3.1)': + dependencies: deepmerge: 4.3.1 - reduce-configs: 1.1.1 - upath: 2.0.1 - transitivePeerDependencies: - - supports-color - - '@rsbuild/plugin-babel@1.1.2(@rsbuild/core@2.0.14)': - dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-proposal-decorators': 7.29.0(@babel/core@7.29.0) - '@babel/plugin-transform-class-properties': 7.28.6(@babel/core@7.29.0) - '@babel/preset-typescript': 7.28.5(@babel/core@7.29.0) - '@types/babel__core': 7.20.5 - reduce-configs: 1.1.1 + loader-utils: 2.0.4 + postcss: 8.5.29 + reduce-configs: 2.0.1 + sass-embedded: 1.105.1 optionalDependencies: - '@rsbuild/core': 2.0.14 - transitivePeerDependencies: - - supports-color + '@rsbuild/core': 2.3.1 - '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23))': + '@rsbuild/plugin-solid@1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2)': dependencies: - '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.0.8(@swc/helpers@0.5.23))(react-refresh@0.18.0) - react-refresh: 0.18.0 - optionalDependencies: - '@rsbuild/core': 2.0.14 - transitivePeerDependencies: - - '@rspack/core' - - '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.0.8)(@rspack/core@2.0.8(@swc/helpers@0.5.23))': - dependencies: - '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.0.8(@swc/helpers@0.5.23))(react-refresh@0.18.0) - react-refresh: 0.18.0 - optionalDependencies: - '@rsbuild/core': 2.0.8 - transitivePeerDependencies: - - '@rspack/core' - - '@rsbuild/plugin-solid@1.1.1(@babel/core@7.29.0)(@rsbuild/core@2.0.14)(solid-js@1.9.12)': - dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.0.14) - babel-preset-solid: 1.9.10(@babel/core@7.29.0)(solid-js@1.9.12) + '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) solid-refresh: 0.7.8(solid-js@1.9.12) optionalDependencies: - '@rsbuild/core': 2.0.14 + '@rsbuild/core': 2.3.1 transitivePeerDependencies: - '@babel/core' - solid-js - supports-color - '@rsbuild/plugin-solid@1.1.1(@babel/core@7.29.7)(@rsbuild/core@2.0.14)(solid-js@1.9.12)': + '@rsbuild/plugin-tailwindcss@2.0.3(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3)': dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.0.14) - babel-preset-solid: 1.9.10(@babel/core@7.29.7)(solid-js@1.9.12) - solid-refresh: 0.7.8(solid-js@1.9.12) + '@tailwindcss/webpack': 4.3.1(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3) optionalDependencies: - '@rsbuild/core': 2.0.14 + '@rsbuild/core': 2.3.1 transitivePeerDependencies: - - '@babel/core' - - solid-js - - supports-color + - '@rspack/core' + - webpack - '@rsbuild/plugin-vue-jsx@1.1.1(@babel/core@7.29.0)(@rsbuild/core@2.0.14)': + '@rsbuild/plugin-vue-jsx@2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2)': dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.0.14) - '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.0) - babel-plugin-vue-jsx-hmr: 1.0.0 + '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + babel-plugin-vue-jsx-hmr: 1.0.0(supports-color@10.2.2) optionalDependencies: - '@rsbuild/core': 2.0.14 + '@rsbuild/core': 2.3.1 transitivePeerDependencies: - '@babel/core' - supports-color - '@rsbuild/plugin-vue-jsx@2.0.0(@babel/core@7.29.0)(@rsbuild/core@2.0.14)': + '@rsbuild/plugin-vue@1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.0.14) - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.0) - babel-plugin-vue-jsx-hmr: 1.0.0 + rspack-vue-loader: 17.5.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) optionalDependencies: - '@rsbuild/core': 2.0.14 - transitivePeerDependencies: - - '@babel/core' - - supports-color - - '@rsbuild/plugin-vue-jsx@2.0.0(@babel/core@7.29.7)(@rsbuild/core@2.0.14)': - dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.0.14) - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7) - babel-plugin-vue-jsx-hmr: 1.0.0 - optionalDependencies: - '@rsbuild/core': 2.0.14 - transitivePeerDependencies: - - '@babel/core' - - supports-color - - '@rsbuild/plugin-vue@1.2.2(@rsbuild/core@2.0.14)(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(vue@3.5.25(typescript@6.0.2))': - dependencies: - '@rsbuild/core': 2.0.14 - rspack-vue-loader: 17.4.4(vue@3.5.25(typescript@6.0.2))(webpack@5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)) - webpack: 5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4) - transitivePeerDependencies: - - '@swc/core' - - '@vue/compiler-sfc' - - esbuild - - uglify-js - - vue - - webpack-cli - - '@rsbuild/plugin-vue@1.2.7(@rsbuild/core@2.0.14)(@rspack/core@2.0.8(@swc/helpers@0.5.23))(vue@3.5.25(typescript@6.0.2))': - dependencies: - rspack-vue-loader: 17.5.0(@rspack/core@2.0.8(@swc/helpers@0.5.23))(vue@3.5.25(typescript@6.0.2)) - optionalDependencies: - '@rsbuild/core': 2.0.14 + '@rsbuild/core': 2.3.1 transitivePeerDependencies: - '@rspack/core' - '@vue/compiler-sfc' - vue - '@rspack/binding-darwin-arm64@2.0.0': + '@rspack/binding-darwin-arm64@2.2.7': optional: true - '@rspack/binding-darwin-arm64@2.0.5': + '@rspack/binding-darwin-arm64@2.3.1': optional: true - '@rspack/binding-darwin-arm64@2.0.8': + '@rspack/binding-darwin-x64@2.2.7': optional: true - '@rspack/binding-darwin-x64@2.0.0': + '@rspack/binding-darwin-x64@2.3.1': optional: true - '@rspack/binding-darwin-x64@2.0.5': + '@rspack/binding-linux-arm64-gnu@2.2.7': optional: true - '@rspack/binding-darwin-x64@2.0.8': + '@rspack/binding-linux-arm64-gnu@2.3.1': optional: true - '@rspack/binding-linux-arm64-gnu@2.0.0': + '@rspack/binding-linux-arm64-musl@2.2.7': optional: true - '@rspack/binding-linux-arm64-gnu@2.0.5': + '@rspack/binding-linux-arm64-musl@2.3.1': optional: true - '@rspack/binding-linux-arm64-gnu@2.0.8': + '@rspack/binding-linux-ppc64-gnu@2.2.7': optional: true - '@rspack/binding-linux-arm64-musl@2.0.0': + '@rspack/binding-linux-ppc64-gnu@2.3.1': optional: true - '@rspack/binding-linux-arm64-musl@2.0.5': + '@rspack/binding-linux-riscv64-gnu@2.2.7': optional: true - '@rspack/binding-linux-arm64-musl@2.0.8': + '@rspack/binding-linux-riscv64-gnu@2.3.1': optional: true - '@rspack/binding-linux-x64-gnu@2.0.0': + '@rspack/binding-linux-riscv64-musl@2.2.7': optional: true - '@rspack/binding-linux-x64-gnu@2.0.5': + '@rspack/binding-linux-riscv64-musl@2.3.1': optional: true - '@rspack/binding-linux-x64-gnu@2.0.8': + '@rspack/binding-linux-s390x-gnu@2.2.7': optional: true - '@rspack/binding-linux-x64-musl@2.0.0': + '@rspack/binding-linux-s390x-gnu@2.3.1': optional: true - '@rspack/binding-linux-x64-musl@2.0.5': + '@rspack/binding-linux-x64-gnu@2.2.7': optional: true - '@rspack/binding-linux-x64-musl@2.0.8': + '@rspack/binding-linux-x64-gnu@2.3.1': optional: true - '@rspack/binding-wasm32-wasi@2.0.0': + '@rspack/binding-linux-x64-musl@2.2.7': + optional: true + + '@rspack/binding-linux-x64-musl@2.3.1': + optional: true + + '@rspack/binding-wasm32-wasi@2.2.7': dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) optional: true - '@rspack/binding-wasm32-wasi@2.0.5': + '@rspack/binding-wasm32-wasi@2.3.1': dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) optional: true - '@rspack/binding-wasm32-wasi@2.0.8': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@rspack/binding-win32-arm64-msvc@2.2.7': optional: true - '@rspack/binding-win32-arm64-msvc@2.0.0': + '@rspack/binding-win32-arm64-msvc@2.3.1': optional: true - '@rspack/binding-win32-arm64-msvc@2.0.5': + '@rspack/binding-win32-ia32-msvc@2.2.7': optional: true - '@rspack/binding-win32-arm64-msvc@2.0.8': + '@rspack/binding-win32-ia32-msvc@2.3.1': optional: true - '@rspack/binding-win32-ia32-msvc@2.0.0': + '@rspack/binding-win32-x64-msvc@2.2.7': optional: true - '@rspack/binding-win32-ia32-msvc@2.0.5': + '@rspack/binding-win32-x64-msvc@2.3.1': optional: true - '@rspack/binding-win32-ia32-msvc@2.0.8': - optional: true - - '@rspack/binding-win32-x64-msvc@2.0.0': - optional: true - - '@rspack/binding-win32-x64-msvc@2.0.5': - optional: true - - '@rspack/binding-win32-x64-msvc@2.0.8': - optional: true - - '@rspack/binding@2.0.0': + '@rspack/binding@2.2.7': optionalDependencies: - '@rspack/binding-darwin-arm64': 2.0.0 - '@rspack/binding-darwin-x64': 2.0.0 - '@rspack/binding-linux-arm64-gnu': 2.0.0 - '@rspack/binding-linux-arm64-musl': 2.0.0 - '@rspack/binding-linux-x64-gnu': 2.0.0 - '@rspack/binding-linux-x64-musl': 2.0.0 - '@rspack/binding-wasm32-wasi': 2.0.0 - '@rspack/binding-win32-arm64-msvc': 2.0.0 - '@rspack/binding-win32-ia32-msvc': 2.0.0 - '@rspack/binding-win32-x64-msvc': 2.0.0 + '@rspack/binding-darwin-arm64': 2.2.7 + '@rspack/binding-darwin-x64': 2.2.7 + '@rspack/binding-linux-arm64-gnu': 2.2.7 + '@rspack/binding-linux-arm64-musl': 2.2.7 + '@rspack/binding-linux-ppc64-gnu': 2.2.7 + '@rspack/binding-linux-riscv64-gnu': 2.2.7 + '@rspack/binding-linux-riscv64-musl': 2.2.7 + '@rspack/binding-linux-s390x-gnu': 2.2.7 + '@rspack/binding-linux-x64-gnu': 2.2.7 + '@rspack/binding-linux-x64-musl': 2.2.7 + '@rspack/binding-wasm32-wasi': 2.2.7 + '@rspack/binding-win32-arm64-msvc': 2.2.7 + '@rspack/binding-win32-ia32-msvc': 2.2.7 + '@rspack/binding-win32-x64-msvc': 2.2.7 - '@rspack/binding@2.0.5': + '@rspack/binding@2.3.1': optionalDependencies: - '@rspack/binding-darwin-arm64': 2.0.5 - '@rspack/binding-darwin-x64': 2.0.5 - '@rspack/binding-linux-arm64-gnu': 2.0.5 - '@rspack/binding-linux-arm64-musl': 2.0.5 - '@rspack/binding-linux-x64-gnu': 2.0.5 - '@rspack/binding-linux-x64-musl': 2.0.5 - '@rspack/binding-wasm32-wasi': 2.0.5 - '@rspack/binding-win32-arm64-msvc': 2.0.5 - '@rspack/binding-win32-ia32-msvc': 2.0.5 - '@rspack/binding-win32-x64-msvc': 2.0.5 + '@rspack/binding-darwin-arm64': 2.3.1 + '@rspack/binding-darwin-x64': 2.3.1 + '@rspack/binding-linux-arm64-gnu': 2.3.1 + '@rspack/binding-linux-arm64-musl': 2.3.1 + '@rspack/binding-linux-ppc64-gnu': 2.3.1 + '@rspack/binding-linux-riscv64-gnu': 2.3.1 + '@rspack/binding-linux-riscv64-musl': 2.3.1 + '@rspack/binding-linux-s390x-gnu': 2.3.1 + '@rspack/binding-linux-x64-gnu': 2.3.1 + '@rspack/binding-linux-x64-musl': 2.3.1 + '@rspack/binding-wasm32-wasi': 2.3.1 + '@rspack/binding-win32-arm64-msvc': 2.3.1 + '@rspack/binding-win32-ia32-msvc': 2.3.1 + '@rspack/binding-win32-x64-msvc': 2.3.1 - '@rspack/binding@2.0.8': - optionalDependencies: - '@rspack/binding-darwin-arm64': 2.0.8 - '@rspack/binding-darwin-x64': 2.0.8 - '@rspack/binding-linux-arm64-gnu': 2.0.8 - '@rspack/binding-linux-arm64-musl': 2.0.8 - '@rspack/binding-linux-x64-gnu': 2.0.8 - '@rspack/binding-linux-x64-musl': 2.0.8 - '@rspack/binding-wasm32-wasi': 2.0.8 - '@rspack/binding-win32-arm64-msvc': 2.0.8 - '@rspack/binding-win32-ia32-msvc': 2.0.8 - '@rspack/binding-win32-x64-msvc': 2.0.8 - - '@rspack/core@2.0.0(@swc/helpers@0.5.21)': + '@rspack/core@2.2.7(@swc/helpers@0.5.23)': dependencies: - '@rspack/binding': 2.0.0 - optionalDependencies: - '@swc/helpers': 0.5.21 - - '@rspack/core@2.0.0(@swc/helpers@0.5.23)': - dependencies: - '@rspack/binding': 2.0.0 + '@rspack/binding': 2.2.7 optionalDependencies: '@swc/helpers': 0.5.23 - '@rspack/core@2.0.5(@swc/helpers@0.5.23)': + '@rspack/core@2.3.1(@swc/helpers@0.5.23)': dependencies: - '@rspack/binding': 2.0.5 - optionalDependencies: - '@swc/helpers': 0.5.23 - - '@rspack/core@2.0.8(@swc/helpers@0.5.23)': - dependencies: - '@rspack/binding': 2.0.8 + '@rspack/binding': 2.3.1 optionalDependencies: '@swc/helpers': 0.5.23 '@rspack/lite-tapable@1.1.0': {} - '@rspack/plugin-react-refresh@2.0.0(@rspack/core@2.0.8(@swc/helpers@0.5.23))(react-refresh@0.18.0)': + '@rspack/plugin-react-refresh@2.0.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(react-refresh@0.18.0)': dependencies: react-refresh: 0.18.0 optionalDependencies: - '@rspack/core': 2.0.8(@swc/helpers@0.5.23) + '@rspack/core': 2.3.1(@swc/helpers@0.5.23) '@rushstack/node-core-library@5.7.0(@types/node@25.0.9)': dependencies: ajv: 8.13.0 ajv-draft-04: 1.0.0(ajv@8.13.0) - ajv-formats: 3.0.1(ajv@8.13.0) + ajv-formats: 3.0.1 fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 @@ -37158,11 +34832,11 @@ snapshots: '@sentry-internal/replay-canvas': 10.32.0 '@sentry/core': 10.32.0 - '@sentry/bundler-plugin-core@4.6.1': + '@sentry/bundler-plugin-core@4.6.1(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) '@sentry/babel-plugin-component-annotate': 4.6.1 - '@sentry/cli': 2.58.4 + '@sentry/cli': 2.58.4(supports-color@10.2.2) dotenv: 16.6.1 find-up: 5.0.0 glob: 10.5.0 @@ -37196,9 +34870,9 @@ snapshots: '@sentry/cli-win32-x64@2.58.4': optional: true - '@sentry/cli@2.58.4': + '@sentry/cli@2.58.4(supports-color@10.2.2)': dependencies: - https-proxy-agent: 5.0.1 + https-proxy-agent: 5.0.1(supports-color@10.2.2) node-fetch: 2.7.0 progress: 2.0.3 proxy-from-env: 1.1.0 @@ -37223,12 +34897,12 @@ snapshots: '@sentry/types': 7.120.4 '@sentry/utils': 7.120.4 - '@sentry/react@10.32.0(react@19.2.3)': + '@sentry/react@10.32.0(react@19.2.9)': dependencies: '@sentry/browser': 10.32.0 '@sentry/core': 10.32.0 hoist-non-react-statics: 3.3.2 - react: 19.2.3 + react: 19.2.9 '@sentry/solid@10.32.0(@tanstack/solid-router@packages+solid-router)(solid-js@1.9.12)': dependencies: @@ -37248,9 +34922,9 @@ snapshots: dependencies: '@sentry/types': 7.120.4 - '@sentry/vite-plugin@4.6.1': + '@sentry/vite-plugin@4.6.1(supports-color@10.2.2)': dependencies: - '@sentry/bundler-plugin-core': 4.6.1 + '@sentry/bundler-plugin-core': 4.6.1(supports-color@10.2.2) unplugin: 1.0.1 transitivePeerDependencies: - encoding @@ -37264,52 +34938,12 @@ snapshots: optionalDependencies: '@tanstack/vue-router': link:packages/vue-router - '@sigstore/bundle@4.0.0': - dependencies: - '@sigstore/protobuf-specs': 0.5.1 - - '@sigstore/core@3.2.1': {} - - '@sigstore/protobuf-specs@0.5.1': {} - - '@sigstore/sign@4.1.1': - dependencies: - '@gar/promise-retry': 1.0.3 - '@sigstore/bundle': 4.0.0 - '@sigstore/core': 3.2.1 - '@sigstore/protobuf-specs': 0.5.1 - make-fetch-happen: 15.0.6 - proc-log: 6.1.0 - transitivePeerDependencies: - - supports-color - - '@sigstore/tuf@4.0.2': - dependencies: - '@sigstore/protobuf-specs': 0.5.1 - tuf-js: 4.1.0 - transitivePeerDependencies: - - supports-color - - '@sigstore/verify@3.1.1': - dependencies: - '@sigstore/bundle': 4.0.0 - '@sigstore/core': 3.2.1 - '@sigstore/protobuf-specs': 0.5.1 - - '@simple-git/args-pathspec@1.0.3': {} - - '@simple-git/argv-parser@1.1.1': - dependencies: - '@simple-git/args-pathspec': 1.0.3 - '@sinclair/typebox@0.31.28': {} '@sindresorhus/is@4.6.0': {} '@sindresorhus/is@7.1.0': {} - '@sindresorhus/merge-streams@4.0.0': {} - '@so-ric/colorspace@1.1.6': dependencies: color: 5.0.2 @@ -37407,25 +35041,25 @@ snapshots: '@standard-schema/spec@1.1.0': {} - '@stylistic/eslint-plugin@5.10.0(eslint@9.22.0(jiti@2.7.0))': + '@stylistic/eslint-plugin@5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/types': 8.57.1 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 - picomatch: 4.0.4 + picomatch: 4.0.7 - '@stylistic/eslint-plugin@5.4.0(eslint@9.22.0(jiti@2.7.0))': + '@stylistic/eslint-plugin@5.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/types': 8.53.0 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 - picomatch: 4.0.4 + picomatch: 4.0.7 '@supabase/auth-js@2.67.3': dependencies: @@ -37475,22 +35109,26 @@ snapshots: - bufferutil - utf-8-validate + '@sveltejs/acorn-typescript@1.0.13(acorn@8.18.0)': + dependencies: + acorn: 8.18.0 + '@swc-node/core@1.14.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)': dependencies: '@swc/core': 1.15.33(@swc/helpers@0.5.23) '@swc/types': 0.1.26 - '@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2)': + '@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: '@swc-node/core': 1.14.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26) '@swc-node/sourcemap-support': 0.6.1 '@swc/core': 1.15.33(@swc/helpers@0.5.23) colorette: 2.0.20 - debug: 4.4.3 - oxc-resolver: 11.19.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + debug: 4.4.3(supports-color@10.2.2) + oxc-resolver: 11.19.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) pirates: 4.0.7 tslib: 2.8.1 - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -37563,10 +35201,6 @@ snapshots: dependencies: tslib: 2.8.1 - '@swc/helpers@0.5.21': - dependencies: - tslib: 2.8.1 - '@swc/helpers@0.5.23': dependencies: tslib: 2.8.1 @@ -37578,49 +35212,95 @@ snapshots: '@tailwindcss/node@4.2.2': dependencies: '@jridgewell/remapping': 2.3.5 - enhanced-resolve: 5.20.1 - jiti: 2.6.1 + enhanced-resolve: 5.21.6 + jiti: 2.7.0 lightningcss: 1.32.0 magic-string: 0.30.21 source-map-js: 1.2.1 tailwindcss: 4.2.2 + '@tailwindcss/node@4.3.1': + dependencies: + '@jridgewell/remapping': 2.3.5 + enhanced-resolve: 5.21.6 + jiti: 2.7.0 + lightningcss: 1.32.0 + magic-string: 0.30.21 + source-map-js: 1.2.1 + tailwindcss: 4.3.1 + '@tailwindcss/oxide-android-arm64@4.2.2': optional: true + '@tailwindcss/oxide-android-arm64@4.3.1': + optional: true + '@tailwindcss/oxide-darwin-arm64@4.2.2': optional: true + '@tailwindcss/oxide-darwin-arm64@4.3.1': + optional: true + '@tailwindcss/oxide-darwin-x64@4.2.2': optional: true + '@tailwindcss/oxide-darwin-x64@4.3.1': + optional: true + '@tailwindcss/oxide-freebsd-x64@4.2.2': optional: true + '@tailwindcss/oxide-freebsd-x64@4.3.1': + optional: true + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.2': optional: true + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.1': + optional: true + '@tailwindcss/oxide-linux-arm64-gnu@4.2.2': optional: true + '@tailwindcss/oxide-linux-arm64-gnu@4.3.1': + optional: true + '@tailwindcss/oxide-linux-arm64-musl@4.2.2': optional: true + '@tailwindcss/oxide-linux-arm64-musl@4.3.1': + optional: true + '@tailwindcss/oxide-linux-x64-gnu@4.2.2': optional: true + '@tailwindcss/oxide-linux-x64-gnu@4.3.1': + optional: true + '@tailwindcss/oxide-linux-x64-musl@4.2.2': optional: true + '@tailwindcss/oxide-linux-x64-musl@4.3.1': + optional: true + '@tailwindcss/oxide-wasm32-wasi@4.2.2': optional: true + '@tailwindcss/oxide-wasm32-wasi@4.3.1': + optional: true + '@tailwindcss/oxide-win32-arm64-msvc@4.2.2': optional: true + '@tailwindcss/oxide-win32-arm64-msvc@4.3.1': + optional: true + '@tailwindcss/oxide-win32-x64-msvc@4.2.2': optional: true + '@tailwindcss/oxide-win32-x64-msvc@4.3.1': + optional: true + '@tailwindcss/oxide@4.2.2': optionalDependencies: '@tailwindcss/oxide-android-arm64': 4.2.2 @@ -37636,6 +35316,21 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.2.2 '@tailwindcss/oxide-win32-x64-msvc': 4.2.2 + '@tailwindcss/oxide@4.3.1': + optionalDependencies: + '@tailwindcss/oxide-android-arm64': 4.3.1 + '@tailwindcss/oxide-darwin-arm64': 4.3.1 + '@tailwindcss/oxide-darwin-x64': 4.3.1 + '@tailwindcss/oxide-freebsd-x64': 4.3.1 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.1 + '@tailwindcss/oxide-linux-arm64-gnu': 4.3.1 + '@tailwindcss/oxide-linux-arm64-musl': 4.3.1 + '@tailwindcss/oxide-linux-x64-gnu': 4.3.1 + '@tailwindcss/oxide-linux-x64-musl': 4.3.1 + '@tailwindcss/oxide-wasm32-wasi': 4.3.1 + '@tailwindcss/oxide-win32-arm64-msvc': 4.3.1 + '@tailwindcss/oxide-win32-x64-msvc': 4.3.1 + '@tailwindcss/postcss@4.2.2': dependencies: '@alloc/quick-lru': 5.2.0 @@ -37644,12 +35339,29 @@ snapshots: postcss: 8.5.8 tailwindcss: 4.2.2 - '@tailwindcss/vite@4.2.2(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@tailwindcss/vite@4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@tailwindcss/node': 4.2.2 '@tailwindcss/oxide': 4.2.2 tailwindcss: 4.2.2 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@tailwindcss/vite@4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@tailwindcss/node': 4.2.2 + '@tailwindcss/oxide': 4.2.2 + tailwindcss: 4.2.2 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@tailwindcss/webpack@4.3.1(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3)': + dependencies: + '@alloc/quick-lru': 5.2.0 + '@tailwindcss/node': 4.3.1 + '@tailwindcss/oxide': 4.3.1 + tailwindcss: 4.3.1 + optionalDependencies: + '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) '@tanstack/devtools-client@0.0.4': dependencies: @@ -37716,15 +35428,15 @@ snapshots: - csstype - utf-8-validate - '@tanstack/eslint-config@0.3.2(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@tanstack/eslint-config@0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint/js': 9.36.0 - '@stylistic/eslint-plugin': 5.4.0(eslint@9.22.0(jiti@2.7.0)) - eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0)) - eslint-plugin-n: 17.23.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@stylistic/eslint-plugin': 5.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint-plugin-import-x: 4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-n: 17.23.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) globals: 16.4.0 - typescript-eslint: 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - vue-eslint-parser: 10.2.0(eslint@9.22.0(jiti@2.7.0)) + typescript-eslint: 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + vue-eslint-parser: 10.2.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - '@typescript-eslint/utils' - eslint @@ -37732,16 +35444,16 @@ snapshots: - supports-color - typescript - '@tanstack/eslint-config@0.4.0(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@tanstack/eslint-config@0.4.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint/js': 10.0.1(eslint@9.22.0(jiti@2.7.0)) - '@stylistic/eslint-plugin': 5.10.0(eslint@9.22.0(jiti@2.7.0)) - eslint: 9.22.0(jiti@2.7.0) - eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0)) - eslint-plugin-n: 17.24.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint/js': 10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + '@stylistic/eslint-plugin': 5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-import-x: 4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-n: 17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) globals: 17.4.0 - typescript-eslint: 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - vue-eslint-parser: 10.4.0(eslint@9.22.0(jiti@2.7.0)) + typescript-eslint: 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + vue-eslint-parser: 10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - '@typescript-eslint/utils' - eslint-import-resolver-node @@ -37752,7 +35464,7 @@ snapshots: dependencies: remove-accents: 0.5.0 - '@tanstack/query-core@5.99.0': {} + '@tanstack/query-core@5.102.0': {} '@tanstack/query-devtools@5.67.2': {} @@ -37760,48 +35472,48 @@ snapshots: '@tanstack/query-devtools@5.91.1': {} - '@tanstack/react-devtools@0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)': + '@tanstack/react-devtools@0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)': dependencies: '@tanstack/devtools': 0.6.14(csstype@3.2.3)(solid-js@1.9.12) '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) transitivePeerDependencies: - bufferutil - csstype - solid-js - utf-8-validate - '@tanstack/react-query-devtools@5.67.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3)': + '@tanstack/react-query-devtools@5.67.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9)': dependencies: '@tanstack/query-devtools': 5.67.2 - '@tanstack/react-query': 5.99.0(react@19.2.3) - react: 19.2.3 + '@tanstack/react-query': 5.102.0(react@19.2.9) + react: 19.2.9 - '@tanstack/react-query-devtools@5.90.2(@tanstack/react-query@5.99.0(react@19.2.3))(react@19.2.3)': + '@tanstack/react-query-devtools@5.90.2(@tanstack/react-query@5.102.0(react@19.2.9))(react@19.2.9)': dependencies: '@tanstack/query-devtools': 5.90.1 - '@tanstack/react-query': 5.99.0(react@19.2.3) - react: 19.2.3 + '@tanstack/react-query': 5.102.0(react@19.2.9) + react: 19.2.9 - '@tanstack/react-query@5.99.0(react@19.2.3)': + '@tanstack/react-query@5.102.0(react@19.2.9)': dependencies: - '@tanstack/query-core': 5.99.0 - react: 19.2.3 + '@tanstack/query-core': 5.102.0 + react: 19.2.9 - '@tanstack/react-store@0.9.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@tanstack/react-store@0.11.2(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@tanstack/store': 0.9.3 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - use-sync-external-store: 1.6.0(react@19.2.3) + '@tanstack/store': 0.11.2 + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + use-sync-external-store: 1.6.0(react@19.2.9) - '@tanstack/react-virtual@3.13.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@tanstack/react-virtual@3.13.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@tanstack/virtual-core': 3.13.0 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) '@tanstack/solid-devtools@0.7.14(csstype@3.2.3)(solid-js@1.9.12)': dependencies: @@ -37812,15 +35524,15 @@ snapshots: - csstype - utf-8-validate - '@tanstack/solid-query-devtools@5.90.4(@tanstack/solid-query@5.99.0(solid-js@1.9.12))(solid-js@1.9.12)': + '@tanstack/solid-query-devtools@5.90.4(@tanstack/solid-query@5.102.0(solid-js@1.9.12))(solid-js@1.9.12)': dependencies: '@tanstack/query-devtools': 5.90.1 - '@tanstack/solid-query': 5.99.0(solid-js@1.9.12) + '@tanstack/solid-query': 5.102.0(solid-js@1.9.12) solid-js: 1.9.12 - '@tanstack/solid-query@5.99.0(solid-js@1.9.12)': + '@tanstack/solid-query@5.102.0(solid-js@1.9.12)': dependencies: - '@tanstack/query-core': 5.99.0 + '@tanstack/query-core': 5.102.0 solid-js: 1.9.12 '@tanstack/solid-virtual@3.13.12(solid-js@1.9.12)': @@ -37828,7 +35540,7 @@ snapshots: '@tanstack/virtual-core': 3.13.12 solid-js: 1.9.12 - '@tanstack/store@0.9.3': {} + '@tanstack/store@0.11.2': {} '@tanstack/virtual-core@3.13.0': {} @@ -37836,57 +35548,107 @@ snapshots: '@tanstack/virtual-core@3.13.13': {} - '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-dts: 4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - vite-plugin-externalize-deps: 0.10.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - vite-tsconfig-paths: 6.1.1(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: - '@types/node' - rollup - supports-color - typescript - '@tanstack/vue-query-devtools@5.91.0(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2))': + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + - typescript + + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + - typescript + + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + - typescript + + '@tanstack/vue-query-devtools@5.91.0(@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@tanstack/query-devtools': 5.90.1 - '@tanstack/vue-query': 5.99.0(vue@3.5.25(typescript@6.0.2)) - vue: 3.5.25(typescript@6.0.2) + '@tanstack/vue-query': 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) + vue: 3.5.25(@typescript/typescript6@6.0.2) - '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3))': + '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@tanstack/query-devtools': 5.91.1 - '@tanstack/vue-query': 5.99.0(vue@3.5.25(typescript@5.8.3)) + '@tanstack/vue-query': 5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2)) + vue: 3.5.25(@typescript/typescript6@6.0.2) + + '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3)))(vue@3.5.25(typescript@5.8.3))': + dependencies: + '@tanstack/query-devtools': 5.91.1 + '@tanstack/vue-query': 5.102.0(vue@3.5.25(typescript@5.8.3)) vue: 3.5.25(typescript@5.8.3) - '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2))': + '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2))': dependencies: '@tanstack/query-devtools': 5.91.1 - '@tanstack/vue-query': 5.99.0(vue@3.5.25(typescript@6.0.2)) + '@tanstack/vue-query': 5.102.0(vue@3.5.25(typescript@6.0.2)) vue: 3.5.25(typescript@6.0.2) - '@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@5.8.3))': + '@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@tanstack/match-sorter-utils': 8.19.4 - '@tanstack/query-core': 5.99.0 + '@tanstack/query-core': 5.102.0 + '@vue/devtools-api': 6.6.4 + vue: 3.5.25(@typescript/typescript6@6.0.2) + vue-demi: 0.14.10(vue@3.5.25(@typescript/typescript6@6.0.2)) + + '@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@5.8.3))': + dependencies: + '@tanstack/match-sorter-utils': 8.19.4 + '@tanstack/query-core': 5.102.0 '@vue/devtools-api': 6.6.4 vue: 3.5.25(typescript@5.8.3) vue-demi: 0.14.10(vue@3.5.25(typescript@5.8.3)) - '@tanstack/vue-query@5.99.0(vue@3.5.25(typescript@6.0.2))': + '@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2))': dependencies: '@tanstack/match-sorter-utils': 8.19.4 - '@tanstack/query-core': 5.99.0 + '@tanstack/query-core': 5.102.0 '@vue/devtools-api': 6.6.4 vue: 3.5.25(typescript@6.0.2) vue-demi: 0.14.10(vue@3.5.25(typescript@6.0.2)) - '@tanstack/vue-store@0.9.3(vue@3.5.25(typescript@6.0.2))': + '@tanstack/vue-store@0.11.2(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: - '@tanstack/store': 0.9.3 - vue: 3.5.25(typescript@6.0.2) - vue-demi: 0.14.10(vue@3.5.25(typescript@6.0.2)) + '@tanstack/store': 0.11.2 + vue: 3.5.25(@typescript/typescript6@6.0.2) + vue-demi: 0.14.10(vue@3.5.25(@typescript/typescript6@6.0.2)) '@tanstack/vue-virtual@3.13.13(vue@3.5.25(typescript@5.9.3))': dependencies: @@ -37895,8 +35657,8 @@ snapshots: '@testing-library/dom@10.4.1': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/runtime': 7.29.2 + '@babel/code-frame': 7.29.7 + '@babel/runtime': 7.26.7 '@types/aria-query': 5.0.4 aria-query: 5.3.0 dom-accessibility-api: 0.5.16 @@ -37906,7 +35668,7 @@ snapshots: '@testing-library/dom@9.3.4': dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 '@babel/runtime': 7.26.7 '@types/aria-query': 5.0.4 aria-query: 5.1.3 @@ -37922,89 +35684,70 @@ snapshots: chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.6.3 - lodash: 4.18.1 + lodash: 4.17.21 redent: 3.0.0 + optional: true - '@testing-library/react@16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4)': + dependencies: + '@adobe/css-tools': 4.4.1 + '@testing-library/dom': 10.4.1 + aria-query: 5.3.2 + css.escape: 1.5.1 + dom-accessibility-api: 0.6.3 + picocolors: 1.1.1 + redent: 3.0.0 + optionalDependencies: + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + '@testing-library/react@16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 '@testing-library/dom': 10.4.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@testing-library/react@16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@testing-library/react@16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@babel/runtime': 7.26.7 '@testing-library/dom': 10.4.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) - '@testing-library/vue@8.1.0(@vue/compiler-sfc@3.5.25)(vue@3.5.25(typescript@6.0.2))': + '@testing-library/vue@8.1.0(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@babel/runtime': 7.26.7 '@testing-library/dom': 9.3.4 '@vue/test-utils': 2.4.6 - vue: 3.5.25(typescript@6.0.2) + vue: 3.5.25(@typescript/typescript6@6.0.2) optionalDependencies: '@vue/compiler-sfc': 3.5.25 - '@tokenizer/token@0.3.0': {} - - '@trapezedev/gradle-parse@7.1.3': {} - - '@trpc/client@11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2)': + '@trpc/client@11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2)': dependencies: - '@trpc/server': 11.4.3(typescript@6.0.2) - typescript: 6.0.2 + '@trpc/server': 11.4.3(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' - '@trpc/server@11.4.3(typescript@6.0.2)': + '@trpc/server@11.4.3(@typescript/typescript6@6.0.2)': dependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' - '@trpc/tanstack-react-query@11.4.3(@tanstack/react-query@5.99.0(react@19.2.3))(@trpc/client@11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2))(@trpc/server@11.4.3(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2)': + '@trpc/tanstack-react-query@11.4.3(@tanstack/react-query@5.102.0(react@19.2.9))(@trpc/client@11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2))(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: - '@tanstack/react-query': 5.99.0(react@19.2.3) - '@trpc/client': 11.4.3(@trpc/server@11.4.3(typescript@6.0.2))(typescript@6.0.2) - '@trpc/server': 11.4.3(typescript@6.0.2) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - typescript: 6.0.2 + '@tanstack/react-query': 5.102.0(react@19.2.9) + '@trpc/client': 11.4.3(@trpc/server@11.4.3(@typescript/typescript6@6.0.2))(@typescript/typescript6@6.0.2) + '@trpc/server': 11.4.3(@typescript/typescript6@6.0.2) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + typescript: '@typescript/typescript6@6.0.2' - '@ts-morph/common@0.22.0': - dependencies: - fast-glob: 3.3.3 - minimatch: 9.0.9 - mkdirp: 3.0.1 - path-browserify: 1.0.1 - - '@ts-morph/common@0.26.1': - dependencies: - fast-glob: 3.3.3 - minimatch: 9.0.9 - path-browserify: 1.0.1 - - '@tsconfig/node10@1.0.12': {} - - '@tsconfig/node12@1.0.11': {} - - '@tsconfig/node14@1.0.3': {} - - '@tsconfig/node16@1.0.4': {} - - '@tufjs/canonical-json@2.0.0': {} - - '@tufjs/models@4.1.0': - dependencies: - '@tufjs/canonical-json': 2.0.0 - minimatch: 10.2.5 - - '@tybys/wasm-util@0.10.2': + '@tybys/wasm-util@0.10.3': dependencies: tslib: 2.8.1 optional: true @@ -38022,23 +35765,23 @@ snapshots: '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.28.5 - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.28.0 '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 '@types/babel__template@7.4.4': dependencies: '@babel/parser': 7.28.5 - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.8 '@types/body-parser@1.19.5': dependencies: @@ -38079,13 +35822,15 @@ snapshots: '@types/eslint@9.6.1': dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 '@types/estree@1.0.7': {} '@types/estree@1.0.8': {} + '@types/estree@1.0.9': {} + '@types/express-serve-static-core@4.19.6': dependencies: '@types/node': 25.0.9 @@ -38113,10 +35858,6 @@ snapshots: '@types/express-serve-static-core': 5.0.6 '@types/serve-static': 2.2.0 - '@types/fs-extra@8.1.5': - dependencies: - '@types/node': 25.0.9 - '@types/html-minifier-terser@6.1.0': {} '@types/http-errors@2.0.4': {} @@ -38172,8 +35913,6 @@ snapshots: dependencies: csstype: 3.2.3 - '@types/resolve@1.20.2': {} - '@types/retry@0.12.2': {} '@types/send@0.17.4': @@ -38196,7 +35935,9 @@ snapshots: '@types/http-errors': 2.0.4 '@types/node': 25.0.9 - '@types/slice-ansi@4.0.0': {} + '@types/set-cookie-parser@2.4.10': + dependencies: + '@types/node': 25.0.9 '@types/sockjs@0.3.36': dependencies: @@ -38204,6 +35945,8 @@ snapshots: '@types/statuses@2.0.5': {} + '@types/statuses@2.0.6': {} + '@types/tough-cookie@4.0.5': {} '@types/triple-beam@1.3.5': {} @@ -38212,26 +35955,32 @@ snapshots: dependencies: '@types/node': 25.0.9 - '@types/yargs-parser@21.0.3': {} - - '@types/yargs@17.0.33': - dependencies: - '@types/yargs-parser': 21.0.3 - - '@types/yauzl@2.10.3': - dependencies: - '@types/node': 25.0.9 - optional: true - - '@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + '@typescript-eslint/parser': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/scope-manager': 8.44.1 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) + '@typescript-eslint/type-utils': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.44.1 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + graphemer: 1.4.0 + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.1.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3))(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.44.1 + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 @@ -38240,168 +35989,142 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.44.1 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/visitor-keys': 8.44.1 - eslint: 9.22.0(jiti@2.7.0) - graphemer: 1.4.0 - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/scope-manager': 8.57.1 - '@typescript-eslint/type-utils': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/utils': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.57.1 - eslint: 9.22.0(jiti@2.7.0) - ignore: 7.0.5 + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + ignore: 7.0.12 natural-compare: 1.4.0 - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3)': + '@typescript-eslint/parser@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/scope-manager': 8.44.1 '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.44.1 + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2)': + '@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2)': dependencies: '@typescript-eslint/scope-manager': 8.44.1 '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.44.1(supports-color@10.2.2)(typescript@5.9.2) '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@typescript-eslint/scope-manager': 8.44.1 - '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@6.0.2) - '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2)': + '@typescript-eslint/parser@8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2)': dependencies: '@typescript-eslint/scope-manager': 8.53.0 '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/typescript-estree': 8.53.0(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.53.0(supports-color@10.2.2)(typescript@5.9.2) '@typescript-eslint/visitor-keys': 8.53.0 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/scope-manager': 8.57.1 '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/typescript-estree': 8.57.1(typescript@6.0.2) + '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.57.1 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.44.1(typescript@5.8.3)': + '@typescript-eslint/project-service@8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.53.0(@typescript/typescript6@6.0.2) + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.44.1(supports-color@10.2.2)(typescript@5.8.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.8.3) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.44.1(typescript@5.9.2)': + '@typescript-eslint/project-service@8.44.1(supports-color@10.2.2)(typescript@5.9.2)': dependencies: '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.9.2) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.44.1(typescript@6.0.2)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/project-service@8.53.0(typescript@5.9.2)': + '@typescript-eslint/project-service@8.53.0(supports-color@10.2.2)(typescript@5.9.2)': dependencies: '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.9.2) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.53.0(typescript@5.9.3)': + '@typescript-eslint/project-service@8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.9.3) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 + '@typescript-eslint/tsconfig-utils': 8.57.1(@typescript/typescript6@6.0.2) + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.57.1(supports-color@10.2.2)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.57.1(typescript@5.9.3) + '@typescript-eslint/types': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.53.0(typescript@6.0.2)': + '@typescript-eslint/rule-tester@8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - debug: 4.4.3 - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/project-service@8.57.1(typescript@6.0.2)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.57.1(typescript@6.0.2) - '@typescript-eslint/types': 8.57.1 - debug: 4.4.3 - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/rule-tester@8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@typescript-eslint/typescript-estree': 8.23.0(typescript@6.0.2) - '@typescript-eslint/utils': 8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@typescript-eslint/typescript-estree': 8.23.0(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) ajv: 6.12.6 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) json-stable-stringify-without-jsonify: 1.0.1 lodash.merge: 4.6.2 semver: 7.7.2 @@ -38409,13 +36132,13 @@ snapshots: - supports-color - typescript - '@typescript-eslint/rule-tester@8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2)': + '@typescript-eslint/rule-tester@8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2)': dependencies: - '@typescript-eslint/parser': 8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) - '@typescript-eslint/typescript-estree': 8.53.0(typescript@5.9.2) - '@typescript-eslint/utils': 8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2) + '@typescript-eslint/parser': 8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.53.0(supports-color@10.2.2)(typescript@5.9.2) + '@typescript-eslint/utils': 8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) ajv: 6.12.6 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) json-stable-stringify-without-jsonify: 1.0.1 lodash.merge: 4.6.2 semver: 7.7.3 @@ -38443,6 +36166,10 @@ snapshots: '@typescript-eslint/types': 8.57.1 '@typescript-eslint/visitor-keys': 8.57.1 + '@typescript-eslint/tsconfig-utils@8.44.1(@typescript/typescript6@6.0.2)': + dependencies: + typescript: '@typescript/typescript6@6.0.2' + '@typescript-eslint/tsconfig-utils@8.44.1(typescript@5.8.3)': dependencies: typescript: 5.8.3 @@ -38451,9 +36178,9 @@ snapshots: dependencies: typescript: 5.9.2 - '@typescript-eslint/tsconfig-utils@8.44.1(typescript@6.0.2)': + '@typescript-eslint/tsconfig-utils@8.53.0(@typescript/typescript6@6.0.2)': dependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' '@typescript-eslint/tsconfig-utils@8.53.0(typescript@5.8.3)': dependencies: @@ -38463,62 +36190,47 @@ snapshots: dependencies: typescript: 5.9.2 - '@typescript-eslint/tsconfig-utils@8.53.0(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.57.1(@typescript/typescript6@6.0.2)': + dependencies: + typescript: '@typescript/typescript6@6.0.2' + + '@typescript-eslint/tsconfig-utils@8.57.1(typescript@5.9.3)': dependencies: typescript: 5.9.3 - '@typescript-eslint/tsconfig-utils@8.53.0(typescript@6.0.2)': + '@typescript-eslint/type-utils@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - typescript: 6.0.2 - - '@typescript-eslint/tsconfig-utils@8.57.1(typescript@6.0.2)': - dependencies: - typescript: 6.0.2 - - '@typescript-eslint/type-utils@8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@typescript-eslint/typescript-estree': 8.23.0(typescript@6.0.2) - '@typescript-eslint/utils': 8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + ts-api-utils: 2.1.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': dependencies: '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3) - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.44.1(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@6.0.2) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) - ts-api-utils: 2.1.0(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/type-utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@typescript-eslint/type-utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/typescript-estree': 8.57.1(typescript@6.0.2) - '@typescript-eslint/utils': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 + '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -38530,191 +36242,176 @@ snapshots: '@typescript-eslint/types@8.57.1': {} - '@typescript-eslint/typescript-estree@8.23.0(typescript@6.0.2)': + '@typescript-eslint/typescript-estree@8.23.0(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: '@typescript-eslint/types': 8.23.0 '@typescript-eslint/visitor-keys': 8.23.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.9 - semver: 7.8.2 - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 + semver: 7.8.5 + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.44.1(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/project-service': 8.44.1(typescript@5.8.3) - '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.8.3) + '@typescript-eslint/project-service': 8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/tsconfig-utils': 8.44.1(@typescript/typescript6@6.0.2) '@typescript-eslint/types': 8.44.1 '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.9 - semver: 7.8.2 + semver: 7.8.5 + ts-api-utils: 2.1.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/typescript-estree@8.44.1(supports-color@10.2.2)(typescript@5.8.3)': + dependencies: + '@typescript-eslint/project-service': 8.44.1(supports-color@10.2.2)(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.8.3) + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/visitor-keys': 8.44.1 + debug: 4.4.3(supports-color@10.2.2) + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.9 + semver: 7.8.5 ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.44.1(typescript@5.9.2)': + '@typescript-eslint/typescript-estree@8.44.1(supports-color@10.2.2)(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.44.1(typescript@5.9.2) + '@typescript-eslint/project-service': 8.44.1(supports-color@10.2.2)(typescript@5.9.2) '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.9.2) '@typescript-eslint/types': 8.44.1 '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.9 - semver: 7.8.2 + semver: 7.8.5 ts-api-utils: 2.1.0(typescript@5.9.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.44.1(typescript@6.0.2)': + '@typescript-eslint/typescript-estree@8.53.0(supports-color@10.2.2)(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.44.1(typescript@6.0.2) - '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@6.0.2) - '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/visitor-keys': 8.44.1 - debug: 4.4.3 - fast-glob: 3.3.3 - is-glob: 4.0.3 - minimatch: 9.0.9 - semver: 7.8.2 - ts-api-utils: 2.1.0(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/typescript-estree@8.53.0(typescript@5.9.2)': - dependencies: - '@typescript-eslint/project-service': 8.53.0(typescript@5.9.2) + '@typescript-eslint/project-service': 8.53.0(supports-color@10.2.2)(typescript@5.9.2) '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.9.2) '@typescript-eslint/types': 8.53.0 '@typescript-eslint/visitor-keys': 8.53.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 9.0.9 - semver: 7.8.2 - tinyglobby: 0.2.16 + semver: 7.8.5 + tinyglobby: 0.2.17 ts-api-utils: 2.4.0(typescript@5.9.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.53.0(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/project-service': 8.53.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@5.9.3) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/visitor-keys': 8.53.0 - debug: 4.4.3 - minimatch: 9.0.9 - semver: 7.8.2 - tinyglobby: 0.2.16 + '@typescript-eslint/project-service': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/tsconfig-utils': 8.57.1(@typescript/typescript6@6.0.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/visitor-keys': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) + minimatch: 10.2.5 + semver: 7.8.5 + tinyglobby: 0.2.17 + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/typescript-estree@8.57.1(supports-color@10.2.2)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/project-service': 8.57.1(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.57.1(typescript@5.9.3) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/visitor-keys': 8.57.1 + debug: 4.4.3(supports-color@10.2.2) + minimatch: 10.2.5 + semver: 7.8.5 + tinyglobby: 0.2.17 ts-api-utils: 2.4.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.53.0(typescript@6.0.2)': + '@typescript-eslint/utils@8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@typescript-eslint/project-service': 8.53.0(typescript@6.0.2) - '@typescript-eslint/tsconfig-utils': 8.53.0(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/visitor-keys': 8.53.0 - debug: 4.4.3 - minimatch: 9.0.9 - semver: 7.8.2 - tinyglobby: 0.2.16 - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/typescript-estree@8.57.1(typescript@6.0.2)': - dependencies: - '@typescript-eslint/project-service': 8.57.1(typescript@6.0.2) - '@typescript-eslint/tsconfig-utils': 8.57.1(typescript@6.0.2) - '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/visitor-keys': 8.57.1 - debug: 4.4.3 - minimatch: 10.2.5 - semver: 7.8.2 - tinyglobby: 0.2.16 - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.23.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.4.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.23.0 '@typescript-eslint/types': 8.23.0 - '@typescript-eslint/typescript-estree': 8.23.0(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 + '@typescript-eslint/typescript-estree': 8.23.0(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.8.3)': + '@typescript-eslint/utils@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.44.1 '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) - eslint: 9.22.0(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': + dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(supports-color@10.2.2)(typescript@5.8.3) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2)': + '@typescript-eslint/utils@8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2)': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.44.1 '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2) - eslint: 9.22.0(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.44.1(supports-color@10.2.2)(typescript@5.9.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@typescript-eslint/utils@8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2)': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) - '@typescript-eslint/scope-manager': 8.44.1 - '@typescript-eslint/types': 8.44.1 - '@typescript-eslint/typescript-estree': 8.44.1(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.53.0(eslint@9.22.0(jiti@2.7.0))(typescript@5.9.2)': - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.53.0 '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/typescript-estree': 8.53.0(typescript@5.9.2) - eslint: 9.22.0(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.53.0(supports-color@10.2.2)(typescript@5.9.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2)': + '@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.57.1 '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/typescript-estree': 8.57.1(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 + '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -38738,6 +36435,70 @@ snapshots: '@typescript-eslint/types': 8.57.1 eslint-visitor-keys: 5.0.1 + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + + '@typescript/typescript6@6.0.2': + dependencies: + '@typescript/old': typescript@6.0.2 + '@unrs/resolver-binding-android-arm-eabi@1.11.1': optional: true @@ -38797,275 +36558,236 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true - '@vercel/nft@0.29.4(rollup@4.56.0)': + '@vercel/nft@1.3.1(rollup@4.63.1)(supports-color@10.2.2)': dependencies: - '@mapbox/node-pre-gyp': 2.0.0 - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - acorn: 8.15.0 - acorn-import-attributes: 1.9.5(acorn@8.15.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 10.5.0 - graceful-fs: 4.2.11 - node-gyp-build: 4.8.4 - picomatch: 4.0.4 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - rollup - - supports-color - - '@vercel/nft@1.3.0(rollup@4.56.0)': - dependencies: - '@mapbox/node-pre-gyp': 2.0.0 - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - acorn: 8.15.0 - acorn-import-attributes: 1.9.5(acorn@8.15.0) + '@mapbox/node-pre-gyp': 2.0.0(supports-color@10.2.2) + '@rollup/pluginutils': 5.1.4(rollup@4.63.1) + acorn: 8.18.0 + acorn-import-attributes: 1.9.5(acorn@8.18.0) async-sema: 3.1.1 bindings: 1.5.0 estree-walker: 2.0.2 glob: 13.0.0 graceful-fs: 4.2.11 node-gyp-build: 4.8.4 - picomatch: 4.0.4 + picomatch: 4.0.7 resolve-from: 5.0.0 transitivePeerDependencies: - encoding - rollup - supports-color - '@vitejs/plugin-basic-ssl@2.1.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - - '@vitejs/plugin-react@4.3.4(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.28.5) - '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.28.5) - '@types/babel__core': 7.20.5 - react-refresh: 0.14.2 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - supports-color - - '@vitejs/plugin-react@4.6.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.5) - '@rolldown/pluginutils': 1.0.0-beta.19 - '@types/babel__core': 7.20.5 - react-refresh: 0.17.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - supports-color - - '@vitejs/plugin-react@4.7.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.29.0) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.29.0) - '@rolldown/pluginutils': 1.0.0-beta.27 - '@types/babel__core': 7.20.5 - react-refresh: 0.17.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - supports-color - - '@vitejs/plugin-react@5.2.0(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.29.0) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.29.0) - '@rolldown/pluginutils': 1.0.0-rc.3 - '@types/babel__core': 7.20.5 - react-refresh: 0.18.0 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - supports-color - - '@vitejs/plugin-react@6.0.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.7 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + optionalDependencies: + '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + babel-plugin-react-compiler: 1.0.0 - '@vitejs/plugin-rsc@0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@rolldown/pluginutils': 1.0.0-rc.4 - es-module-lexer: 2.0.0 + '@rolldown/pluginutils': 1.0.0-rc.7 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + optionalDependencies: + '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + babel-plugin-react-compiler: 1.0.0 + + '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@rolldown/pluginutils': 1.0.0-rc.7 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + optionalDependencies: + '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + babel-plugin-react-compiler: 1.0.0 + + '@vitejs/plugin-rsc@0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + es-module-lexer: 3.0.4 estree-walker: 3.0.3 - magic-string: 0.30.21 - periscopic: 4.0.2 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - srvx: 0.11.15 - strip-literal: 3.1.0 - turbo-stream: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + magic-string: 1.4.5 + obug: 3.0.0 + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + srvx: 1.0.8 + strip-literal: 4.0.0 + turbo-stream: 3.2.1 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - '@vitejs/plugin-rsc@0.5.20(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-rsc@0.5.39(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@rolldown/pluginutils': 1.0.0-rc.4 - es-module-lexer: 2.0.0 + '@rolldown/pluginutils': 1.0.1 + es-module-lexer: 3.0.4 estree-walker: 3.0.3 - magic-string: 0.30.21 - periscopic: 4.0.2 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - srvx: 0.11.15 - strip-literal: 3.1.0 - turbo-stream: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) + magic-string: 1.4.5 + obug: 3.0.0 + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + srvx: 1.0.8 + strip-literal: 4.0.0 + turbo-stream: 3.2.1 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - '@vitejs/plugin-vue-jsx@4.2.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': + '@vitejs/plugin-vue-jsx@4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-transform-typescript': 7.28.5(@babel/core@7.28.5) - '@rolldown/pluginutils': 1.0.0 - '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.28.5) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vue: 3.5.25(typescript@6.0.2) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + '@rolldown/pluginutils': 1.0.1 + '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.0) - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - vue: 3.5.25(typescript@6.0.2) + '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.0) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.8.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.0) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.9.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': dependencies: - '@babel/core': 7.29.0 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 - '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.0) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@6.0.5(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - vue: 3.5.25(typescript@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vue: 3.5.25(@typescript/typescript6@6.0.2) - '@vitejs/plugin-vue@6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.8.3) - '@vitejs/plugin-vue@6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.9.3) - '@vitejs/plugin-vue@6.0.5(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@6.0.2) - '@vitest/browser@4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(vitest@4.1.4)': - dependencies: - '@blazediff/core': 1.9.1 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - '@vitest/utils': 4.1.4 - magic-string: 0.30.21 - pngjs: 7.0.0 - sirv: 3.0.2 - tinyrainbow: 3.1.0 - vitest: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@25.0.1)(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - ws: 8.20.0 - transitivePeerDependencies: - - bufferutil - - msw - - utf-8-validate - - vite - '@vitest/expect@4.1.4': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.2 '@vitest/spy': 4.1.4 '@vitest/utils': 4.1.4 - chai: 6.2.2 - tinyrainbow: 3.1.0 - - '@vitest/mocker@4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@vitest/spy': 4.1.4 - estree-walker: 3.0.3 - magic-string: 0.30.21 - optionalDependencies: - msw: 2.7.0(@types/node@25.0.9)(typescript@5.9.2) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - - '@vitest/mocker@4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@vitest/spy': 4.1.4 - estree-walker: 3.0.3 - magic-string: 0.30.21 - optionalDependencies: - msw: 2.7.0(@types/node@25.0.9)(typescript@6.0.2) - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) + chai: 6.3.0 + tinyrainbow: 3.2.0 optional: true - '@vitest/mocker@4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))': + '@vitest/mocker@4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - msw: 2.7.0(@types/node@25.0.9)(typescript@6.0.2) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + optional: true + + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.4 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.4 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.4 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.4 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + msw: 2.15.0(@types/node@25.0.9)(typescript@5.9.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) '@vitest/pretty-format@4.1.4': dependencies: - tinyrainbow: 3.1.0 + tinyrainbow: 3.2.0 + optional: true + + '@vitest/pretty-format@5.0.4': + dependencies: + tinyrainbow: 3.2.0 '@vitest/runner@4.1.4': dependencies: '@vitest/utils': 4.1.4 pathe: 2.0.3 + optional: true '@vitest/snapshot@4.1.4': dependencies: @@ -39073,29 +36795,47 @@ snapshots: '@vitest/utils': 4.1.4 magic-string: 0.30.21 pathe: 2.0.3 + optional: true - '@vitest/spy@4.1.4': {} + '@vitest/spy@4.1.4': + optional: true + + '@vitest/spy@5.0.4': {} '@vitest/ui@4.1.4(vitest@4.1.4)': dependencies: '@vitest/utils': 4.1.4 - fflate: 0.8.2 - flatted: 3.4.2 + fflate: 0.8.3 + flatted: 3.4.4 pathe: 2.0.3 sirv: 3.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vitest: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@25.0.1)(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + tinyglobby: 0.2.17 + tinyrainbow: 3.2.0 + vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + optional: true + + '@vitest/ui@5.0.4(vitest@5.0.4)': + dependencies: + '@vitest/utils': 5.0.4 + fflate: 0.8.3 + flatted: 3.4.4 + pathe: 2.0.3 + sirv: 3.0.2 + tinyrainbow: 3.2.0 + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitest/utils@4.1.4': dependencies: '@vitest/pretty-format': 4.1.4 convert-source-map: 2.0.0 - tinyrainbow: 3.1.0 + tinyrainbow: 3.2.0 + optional: true - '@volar/language-core@2.4.23': + '@vitest/utils@5.0.4': dependencies: - '@volar/source-map': 2.4.23 + '@vitest/pretty-format': 5.0.4 + convert-source-map: 2.0.0 + tinyrainbow: 3.2.0 '@volar/language-core@2.4.26': dependencies: @@ -39105,149 +36845,115 @@ snapshots: dependencies: '@volar/source-map': 2.4.28 - '@volar/source-map@2.4.23': {} - '@volar/source-map@2.4.26': {} '@volar/source-map@2.4.28': {} - '@volar/typescript@2.4.23': - dependencies: - '@volar/language-core': 2.4.23 - path-browserify: 1.0.1 - vscode-uri: 3.0.8 - - '@volar/typescript@2.4.26': + '@volar/typescript@2.4.26(@typescript/typescript6@6.0.2)': dependencies: '@volar/language-core': 2.4.26 path-browserify: 1.0.1 vscode-uri: 3.0.8 + optionalDependencies: + typescript: '@typescript/typescript6@6.0.2' - '@volar/typescript@2.4.28': + '@volar/typescript@2.4.26(typescript@5.9.2)': + dependencies: + '@volar/language-core': 2.4.26 + path-browserify: 1.0.1 + vscode-uri: 3.0.8 + optionalDependencies: + typescript: 5.9.2 + + '@volar/typescript@2.4.28(@typescript/typescript6@6.0.2)': dependencies: '@volar/language-core': 2.4.28 path-browserify: 1.0.1 vscode-uri: 3.0.8 + optionalDependencies: + typescript: '@typescript/typescript6@6.0.2' + + '@volar/typescript@2.4.28(typescript@5.8.3)': + dependencies: + '@volar/language-core': 2.4.28 + path-browserify: 1.0.1 + vscode-uri: 3.0.8 + optionalDependencies: + typescript: 5.8.3 + + '@volar/typescript@2.4.28(typescript@5.9.3)': + dependencies: + '@volar/language-core': 2.4.28 + path-browserify: 1.0.1 + vscode-uri: 3.0.8 + optionalDependencies: + typescript: 5.9.3 '@vue/babel-helper-vue-transform-on@1.5.0': {} '@vue/babel-helper-vue-transform-on@2.0.1': {} - '@vue/babel-plugin-jsx@1.5.0(@babel/core@7.28.5)': + '@vue/babel-plugin-jsx@1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5) - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 + '@babel/helper-module-imports': 7.29.7(supports-color@10.2.2) + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 '@vue/babel-helper-vue-transform-on': 1.5.0 - '@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.28.5) + '@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@vue/shared': 3.5.25 optionalDependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@vue/babel-plugin-jsx@1.5.0(@babel/core@7.29.0)': + '@vue/babel-plugin-jsx@2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/helper-module-imports': 7.27.1 + '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.0) - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 - '@vue/babel-helper-vue-transform-on': 1.5.0 - '@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.29.0) - '@vue/shared': 3.5.25 - optionalDependencies: - '@babel/core': 7.29.0 - transitivePeerDependencies: - - supports-color - - '@vue/babel-plugin-jsx@2.0.1(@babel/core@7.29.0)': - dependencies: - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.0) - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 '@vue/babel-helper-vue-transform-on': 2.0.1 - '@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.29.0) + '@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@vue/shared': 3.5.25 optionalDependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@vue/babel-plugin-jsx@2.0.1(@babel/core@7.29.7)': + '@vue/babel-plugin-resolve-type@1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7) - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 - '@vue/babel-helper-vue-transform-on': 2.0.1 - '@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.29.7) - '@vue/shared': 3.5.25 - optionalDependencies: - '@babel/core': 7.29.7 - transitivePeerDependencies: - - supports-color - - '@vue/babel-plugin-resolve-type@1.5.0(@babel/core@7.28.5)': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 + '@babel/code-frame': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-module-imports': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/parser': 7.29.2 + '@babel/parser': 7.29.8 '@vue/compiler-sfc': 3.5.25 transitivePeerDependencies: - supports-color - '@vue/babel-plugin-resolve-type@1.5.0(@babel/core@7.29.0)': + '@vue/babel-plugin-resolve-type@2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/helper-module-imports': 7.27.1 + '@babel/code-frame': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.28.6 - '@babel/parser': 7.29.2 - '@vue/compiler-sfc': 3.5.25 - transitivePeerDependencies: - - supports-color - - '@vue/babel-plugin-resolve-type@2.0.1(@babel/core@7.29.0)': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/parser': 7.29.2 - '@vue/compiler-sfc': 3.5.25 - transitivePeerDependencies: - - supports-color - - '@vue/babel-plugin-resolve-type@2.0.1(@babel/core@7.29.7)': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/parser': 7.29.2 + '@babel/parser': 7.29.8 '@vue/compiler-sfc': 3.5.25 transitivePeerDependencies: - supports-color '@vue/compiler-core@3.5.25': dependencies: - '@babel/parser': 7.29.7 + '@babel/parser': 7.29.8 '@vue/shared': 3.5.25 entities: 4.5.0 estree-walker: 2.0.2 - source-map-js: 1.2.1 + source-map-js: 1.2.2 '@vue/compiler-dom@3.5.25': dependencies: @@ -39256,15 +36962,15 @@ snapshots: '@vue/compiler-sfc@3.5.25': dependencies: - '@babel/parser': 7.29.7 + '@babel/parser': 7.29.8 '@vue/compiler-core': 3.5.25 '@vue/compiler-dom': 3.5.25 '@vue/compiler-ssr': 3.5.25 '@vue/shared': 3.5.25 estree-walker: 2.0.2 magic-string: 0.30.21 - postcss: 8.5.15 - source-map-js: 1.2.1 + postcss: 8.5.29 + source-map-js: 1.2.2 '@vue/compiler-ssr@3.5.25': dependencies: @@ -39278,7 +36984,7 @@ snapshots: '@vue/devtools-api@6.6.4': {} - '@vue/language-core@2.1.6(typescript@6.0.2)': + '@vue/language-core@2.1.6(@typescript/typescript6@6.0.2)': dependencies: '@volar/language-core': 2.4.26 '@vue/compiler-dom': 3.5.25 @@ -39289,57 +36995,22 @@ snapshots: muggle-string: 0.4.1 path-browserify: 1.0.1 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' - '@vue/language-core@3.1.5(typescript@5.8.3)': - dependencies: - '@volar/language-core': 2.4.23 - '@vue/compiler-dom': 3.5.25 - '@vue/shared': 3.5.25 - alien-signals: 3.1.1 - muggle-string: 0.4.1 - path-browserify: 1.0.1 - picomatch: 4.0.4 - optionalDependencies: - typescript: 5.8.3 - - '@vue/language-core@3.1.5(typescript@5.9.3)': - dependencies: - '@volar/language-core': 2.4.23 - '@vue/compiler-dom': 3.5.25 - '@vue/shared': 3.5.25 - alien-signals: 3.1.1 - muggle-string: 0.4.1 - path-browserify: 1.0.1 - picomatch: 4.0.4 - optionalDependencies: - typescript: 5.9.3 - - '@vue/language-core@3.1.5(typescript@6.0.2)': - dependencies: - '@volar/language-core': 2.4.23 - '@vue/compiler-dom': 3.5.25 - '@vue/shared': 3.5.25 - alien-signals: 3.1.1 - muggle-string: 0.4.1 - path-browserify: 1.0.1 - picomatch: 4.0.4 - optionalDependencies: - typescript: 6.0.2 - - '@vue/language-core@3.1.8(typescript@6.0.2)': + '@vue/language-core@2.1.6(typescript@5.9.2)': dependencies: '@volar/language-core': 2.4.26 '@vue/compiler-dom': 3.5.25 + '@vue/compiler-vue2': 2.7.16 '@vue/shared': 3.5.25 - alien-signals: 3.1.1 + computeds: 0.0.1 + minimatch: 9.0.9 muggle-string: 0.4.1 path-browserify: 1.0.1 - picomatch: 4.0.4 optionalDependencies: - typescript: 6.0.2 + typescript: 5.9.2 - '@vue/language-core@3.3.7': + '@vue/language-core@3.3.8': dependencies: '@volar/language-core': 2.4.28 '@vue/compiler-dom': 3.5.25 @@ -39347,7 +37018,7 @@ snapshots: alien-signals: 3.2.1 muggle-string: 0.4.1 path-browserify: 1.0.1 - picomatch: 4.0.4 + picomatch: 4.0.7 '@vue/reactivity@3.5.25': dependencies: @@ -39365,6 +37036,12 @@ snapshots: '@vue/shared': 3.5.25 csstype: 3.1.3 + '@vue/server-renderer@3.5.25(vue@3.5.25(@typescript/typescript6@6.0.2))': + dependencies: + '@vue/compiler-ssr': 3.5.25 + '@vue/shared': 3.5.25 + vue: 3.5.25(@typescript/typescript6@6.0.2) + '@vue/server-renderer@3.5.25(vue@3.5.25(typescript@5.8.3))': dependencies: '@vue/compiler-ssr': 3.5.25 @@ -39466,34 +37143,54 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.110.3)': + dependencies: + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) + optional: true + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)': dependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.110.3)': + dependencies: + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) + optional: true + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)': dependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.4)(webpack@5.110.3)': + dependencies: + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) + optionalDependencies: + webpack-dev-server: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) + optional: true + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.4)(webpack@5.97.1)': dependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) optionalDependencies: - webpack-dev-server: 5.2.4(webpack-cli@5.1.4)(webpack@5.97.1) + webpack-dev-server: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) '@whatwg-node/disposablestack@0.0.6': dependencies: '@whatwg-node/promise-helpers': 1.3.2 tslib: 2.8.1 - '@whatwg-node/fetch@0.10.11': + '@whatwg-node/fetch@0.10.13': dependencies: - '@whatwg-node/node-fetch': 0.8.1 + '@whatwg-node/node-fetch': 0.8.6 urlpattern-polyfill: 10.1.0 - '@whatwg-node/node-fetch@0.8.1': + '@whatwg-node/node-fetch@0.8.6': dependencies: '@fastify/busboy': 3.1.1 '@whatwg-node/disposablestack': 0.0.6 @@ -39504,11 +37201,11 @@ snapshots: dependencies: tslib: 2.8.1 - '@whatwg-node/server@0.10.13': + '@whatwg-node/server@0.11.0': dependencies: '@envelop/instrumentation': 1.0.0 '@whatwg-node/disposablestack': 0.0.6 - '@whatwg-node/fetch': 0.10.11 + '@whatwg-node/fetch': 0.10.13 '@whatwg-node/promise-helpers': 1.3.2 tslib: 2.8.1 @@ -39523,19 +37220,13 @@ snapshots: iron-webcrypto: 2.0.0 jose: 6.1.3 - '@workos/authkit-tanstack-react-start@0.5.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@workos/authkit-tanstack-react-start@0.5.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)': dependencies: '@tanstack/react-router': link:packages/react-router '@tanstack/react-start': link:packages/react-start '@workos/authkit-session': 0.3.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - - '@xml-tools/parser@1.0.11': - dependencies: - chevrotain: 7.1.1 - - '@xmldom/xmldom@0.8.13': {} + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) '@xtuc/ieee754@1.2.0': {} @@ -39551,8 +37242,6 @@ snapshots: abbrev@3.0.0: {} - abbrev@4.0.0: {} - abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -39569,34 +37258,23 @@ snapshots: mime-types: 3.0.1 negotiator: 1.0.0 - acorn-import-attributes@1.9.5(acorn@8.15.0): + acorn-import-attributes@1.9.5(acorn@8.18.0): dependencies: - acorn: 8.15.0 - - acorn-import-phases@1.0.4(acorn@8.15.0): - dependencies: - acorn: 8.15.0 + acorn: 8.18.0 acorn-jsx@5.3.2(acorn@8.15.0): dependencies: acorn: 8.15.0 - acorn-walk@8.3.5: - dependencies: - acorn: 8.15.0 - acorn@8.14.1: {} acorn@8.15.0: {} - adjust-sourcemap-loader@4.0.0: - dependencies: - loader-utils: 2.0.4 - regex-parser: 2.3.1 + acorn@8.18.0: {} - agent-base@6.0.2: + agent-base@6.0.2(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -39610,29 +37288,21 @@ snapshots: dependencies: ajv: 8.18.0 - ajv-formats@2.1.1(ajv@8.17.1): - optionalDependencies: - ajv: 8.17.1 - - ajv-formats@3.0.1(ajv@8.13.0): - optionalDependencies: - ajv: 8.13.0 - - ajv-formats@3.0.1(ajv@8.17.1): - optionalDependencies: - ajv: 8.17.1 - - ajv-formats@3.0.1(ajv@8.18.0): - optionalDependencies: + ajv-formats@2.1.1: + dependencies: ajv: 8.18.0 + ajv-formats@3.0.1: + dependencies: + ajv: 8.17.1 + ajv-keywords@3.5.2(ajv@6.12.6): dependencies: ajv: 6.12.6 - ajv-keywords@5.1.0(ajv@8.17.1): + ajv-keywords@5.1.0(ajv@8.18.0): dependencies: - ajv: 8.17.1 + ajv: 8.18.0 fast-deep-equal: 3.1.3 ajv@6.12.6: @@ -39670,12 +37340,14 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - alien-signals@3.1.1: {} - alien-signals@3.2.1: {} ansi-colors@4.1.3: {} + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + ansi-escapes@7.0.0: dependencies: environment: 1.1.0 @@ -39686,10 +37358,6 @@ snapshots: ansi-regex@6.2.2: {} - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -39698,9 +37366,7 @@ snapshots: ansi-styles@6.2.3: {} - ansis@4.1.0: {} - - any-base@1.1.0: {} + ansis@4.3.1: {} any-promise@1.3.0: {} @@ -39709,31 +37375,21 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 - archiver-utils@5.0.2: + archiver@8.0.0: dependencies: - glob: 10.5.0 - graceful-fs: 4.2.11 - is-stream: 2.0.1 - lazystream: 1.0.1 - lodash: 4.17.21 - normalize-path: 3.0.0 - readable-stream: 4.7.0 - - archiver@7.0.1: - dependencies: - archiver-utils: 5.0.2 async: 3.2.6 buffer-crc32: 1.0.0 + is-stream: 4.0.1 + lazystream: 1.0.1 + normalize-path: 3.0.0 readable-stream: 4.7.0 - readdir-glob: 1.1.3 + readdir-glob: 3.0.0 tar-stream: 3.2.0 - zip-stream: 6.0.1 + zip-stream: 7.0.5 transitivePeerDependencies: - bare-abort-controller - bare-buffer - arg@4.1.3: {} - argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -39778,8 +37434,6 @@ snapshots: ast-module-types@6.0.1: {} - astral-regex@2.0.0: {} - async-mutex@0.5.0: dependencies: tslib: 2.8.1 @@ -39790,10 +37444,13 @@ snapshots: asynckit@0.4.0: {} - at-least-node@1.0.0: {} - atomic-sleep@1.0.0: {} + atomically@2.1.1: + dependencies: + stubborn-fs: 2.0.0 + when-exit: 2.1.5 + autocannon@8.0.0: dependencies: '@minimistjs/subarg': 1.0.0 @@ -39820,15 +37477,6 @@ snapshots: semver: 7.7.3 timestring: 6.0.0 - autoprefixer@10.4.27(postcss@8.5.12): - dependencies: - browserslist: 4.28.1 - caniuse-lite: 1.0.30001806 - fraction.js: 5.3.4 - picocolors: 1.1.1 - postcss: 8.5.12 - postcss-value-parser: 4.2.0 - available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 @@ -39838,33 +37486,13 @@ snapshots: '@fastify/error': 4.2.0 fastq: 1.19.0 - await-to-js@3.0.0: {} - aws-ssl-profiles@1.1.2: {} - axios@1.16.0(debug@4.4.3): + axios@1.18.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - follow-redirects: 1.16.0(debug@4.4.3) - form-data: 4.0.5 - proxy-from-env: 2.1.0 - transitivePeerDependencies: - - debug - - axios@1.17.0(debug@4.4.3): - dependencies: - follow-redirects: 1.16.0(debug@4.4.3) - form-data: 4.0.5 - https-proxy-agent: 5.0.1 - proxy-from-env: 2.1.0 - transitivePeerDependencies: - - debug - - supports-color - - axios@1.18.1(debug@4.4.3): - dependencies: - follow-redirects: 1.16.0(debug@4.4.3) - form-data: 4.0.5 - https-proxy-agent: 5.0.1 + follow-redirects: 1.16.0(debug@4.4.3(supports-color@10.2.2)) + form-data: 4.0.6 + https-proxy-agent: 5.0.1(supports-color@10.2.2) proxy-from-env: 2.1.0 transitivePeerDependencies: - debug @@ -39872,117 +37500,67 @@ snapshots: b4a@1.6.7: {} - babel-dead-code-elimination@1.0.12: + babel-dead-code-elimination@1.0.12(supports-color@10.2.2): dependencies: - '@babel/core': 7.28.5 - '@babel/parser': 7.28.5 - '@babel/traverse': 7.28.5 - '@babel/types': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/parser': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) + '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - babel-loader@10.0.0(@babel/core@7.28.5)(webpack@5.97.1): + babel-loader@10.0.0(@babel/core@7.28.5(supports-color@10.2.2))(webpack@5.97.1): dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) find-up: 5.0.0 webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) - babel-loader@10.0.0(@babel/core@7.29.7)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): + babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.28.5(supports-color@10.2.2)): dependencies: - '@babel/core': 7.29.7 - find-up: 5.0.0 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - - babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.28.5): - dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.28.5(supports-color@10.2.2) '@babel/helper-module-imports': 7.18.6 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5) - '@babel/types': 7.29.0 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5(supports-color@10.2.2)) + '@babel/types': 7.29.8 html-entities: 2.3.3 parse5: 7.3.0 - babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.29.0): + babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.29.7(supports-color@10.2.2)): dependencies: - '@babel/core': 7.29.0 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-module-imports': 7.18.6 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.0) - '@babel/types': 7.29.0 - html-entities: 2.3.3 - parse5: 7.3.0 - - babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.29.7): - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-module-imports': 7.18.6 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7) - '@babel/types': 7.29.0 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@babel/types': 7.29.8 html-entities: 2.3.3 parse5: 7.3.0 babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.29.2 + '@babel/runtime': 7.26.7 cosmiconfig: 7.1.0 resolve: 1.22.11 - babel-plugin-polyfill-corejs2@0.4.17(@babel/core@7.29.7): + babel-plugin-react-compiler@1.0.0: dependencies: - '@babel/compat-data': 7.29.0 - '@babel/core': 7.29.7 - '@babel/helper-define-polyfill-provider': 0.6.8(@babel/core@7.29.7) - semver: 6.3.1 + '@babel/types': 7.29.8 + + babel-plugin-vue-jsx-hmr@1.0.0(supports-color@10.2.2): + dependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) + '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs3@0.13.0(@babel/core@7.29.7): + babel-preset-solid@1.9.10(@babel/core@7.28.5(supports-color@10.2.2))(solid-js@1.9.12): dependencies: - '@babel/core': 7.29.7 - '@babel/helper-define-polyfill-provider': 0.6.8(@babel/core@7.29.7) - core-js-compat: 3.49.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-corejs3@0.14.2(@babel/core@7.29.7): - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-define-polyfill-provider': 0.6.8(@babel/core@7.29.7) - core-js-compat: 3.49.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-regenerator@0.6.8(@babel/core@7.29.7): - dependencies: - '@babel/core': 7.29.7 - '@babel/helper-define-polyfill-provider': 0.6.8(@babel/core@7.29.7) - transitivePeerDependencies: - - supports-color - - babel-plugin-vue-jsx-hmr@1.0.0: - dependencies: - '@babel/core': 7.29.0 - '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.0) - transitivePeerDependencies: - - supports-color - - babel-preset-solid@1.9.10(@babel/core@7.28.5)(solid-js@1.9.12): - dependencies: - '@babel/core': 7.28.5 - babel-plugin-jsx-dom-expressions: 0.40.3(@babel/core@7.28.5) + '@babel/core': 7.28.5(supports-color@10.2.2) + babel-plugin-jsx-dom-expressions: 0.40.3(@babel/core@7.28.5(supports-color@10.2.2)) optionalDependencies: solid-js: 1.9.12 - babel-preset-solid@1.9.10(@babel/core@7.29.0)(solid-js@1.9.12): + babel-preset-solid@1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12): dependencies: - '@babel/core': 7.29.0 - babel-plugin-jsx-dom-expressions: 0.40.3(@babel/core@7.29.0) - optionalDependencies: - solid-js: 1.9.12 - - babel-preset-solid@1.9.10(@babel/core@7.29.7)(solid-js@1.9.12): - dependencies: - '@babel/core': 7.29.7 - babel-plugin-jsx-dom-expressions: 0.40.3(@babel/core@7.29.7) + '@babel/core': 7.29.7(supports-color@10.2.2) + babel-plugin-jsx-dom-expressions: 0.40.3(@babel/core@7.29.7(supports-color@10.2.2)) optionalDependencies: solid-js: 1.9.12 @@ -39990,8 +37568,7 @@ snapshots: balanced-match@4.0.3: {} - bare-events@2.5.4: - optional: true + balanced-match@4.0.4: {} bare-events@2.9.1: {} @@ -40024,72 +37601,61 @@ snapshots: base64-js@1.5.1: {} - baseline-browser-mapping@2.9.8: {} + baseline-browser-mapping@2.11.23: {} batch@0.6.1: {} - beasties@0.4.1: - dependencies: - css-select: 6.0.0 - css-what: 7.0.0 - dom-serializer: 2.0.0 - domhandler: 5.0.3 - htmlparser2: 10.1.0 - picocolors: 1.1.1 - postcss: 8.5.15 - postcss-media-query-parser: 0.2.3 - postcss-safe-parser: 7.0.1(postcss@8.5.15) - better-ajv-errors@1.2.0(ajv@8.18.0): dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 '@humanwhocodes/momoa': 2.0.4 ajv: 8.18.0 chalk: 4.1.2 jsonpointer: 5.0.1 leven: 3.1.0 - better-auth@1.6.19(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(typescript@6.0.2)): + better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)): dependencies: - '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) - '@better-auth/drizzle-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) - '@better-auth/kysely-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(kysely@0.29.2) - '@better-auth/memory-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) - '@better-auth/mongo-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) - '@better-auth/prisma-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@prisma/client@7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2))(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2)) - '@better-auth/telemetry': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.6(zod@4.4.3))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1) + '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) + '@better-auth/drizzle-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) + '@better-auth/kysely-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(kysely@0.29.2) + '@better-auth/memory-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) + '@better-auth/mongo-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) + '@better-auth/prisma-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) + '@better-auth/telemetry': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1) '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 '@noble/ciphers': 2.2.0 '@noble/hashes': 2.0.1 - better-call: 1.3.6(zod@4.4.3) + better-call: 1.3.6(zod@4.5.4) defu: 6.1.4 jose: 6.1.3 kysely: 0.29.2 nanostores: 1.3.0 - zod: 4.4.3 + zod: 4.5.4 optionalDependencies: - '@prisma/client': 7.0.0(prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2))(typescript@6.0.2) + '@prisma/client': 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)) '@tanstack/solid-start': link:packages/solid-start mysql2: 3.15.3 - prisma: 7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + next: 16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1) + prisma: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) solid-js: 1.9.12 - vitest: 4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - vue: 3.5.25(typescript@6.0.2) + vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - '@cloudflare/workers-types' - '@opentelemetry/api' - better-call@1.3.6(zod@4.4.3): + better-call@1.3.6(zod@4.5.4): dependencies: '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 rou3: 0.7.12 set-cookie-parser: 3.1.0 optionalDependencies: - zod: 4.4.3 + zod: 4.5.4 better-path-resolve@1.0.0: dependencies: @@ -40099,18 +37665,8 @@ snapshots: dependencies: require-from-string: 2.0.2 - big-integer@1.6.52: {} - big.js@5.2.2: {} - bin-links@6.0.2: - dependencies: - cmd-shim: 8.0.0 - npm-normalize-package-bin: 5.0.0 - proc-log: 6.1.0 - read-cmd-shim: 6.0.0 - write-file-atomic: 7.0.1 - binary-extensions@2.3.0: {} bindings@1.5.0: @@ -40127,13 +37683,11 @@ snapshots: blake3-wasm@2.1.5: {} - bmp-ts@1.0.9: {} - - body-parser@1.20.5: + body-parser@1.20.5(supports-color@10.2.2): dependencies: bytes: 3.1.2 content-type: 1.0.5 - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) depd: 2.0.0 destroy: 1.2.0 http-errors: 2.0.1 @@ -40146,11 +37700,11 @@ snapshots: transitivePeerDependencies: - supports-color - body-parser@2.2.2: + body-parser@2.2.2(supports-color@10.2.2): dependencies: bytes: 3.1.2 content-type: 1.0.5 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) http-errors: 2.0.0 iconv-lite: 0.7.0 on-finished: 2.4.1 @@ -40167,22 +37721,6 @@ snapshots: boolbase@1.0.0: {} - bplist-creator@0.1.0: - dependencies: - stream-buffers: 2.2.0 - - bplist-creator@0.1.1: - dependencies: - stream-buffers: 2.2.0 - - bplist-parser@0.3.1: - dependencies: - big-integer: 1.6.52 - - bplist-parser@0.3.2: - dependencies: - big-integer: 1.6.52 - brace-expansion@1.1.15: dependencies: balanced-match: 1.0.2 @@ -40192,9 +37730,13 @@ snapshots: dependencies: balanced-match: 1.0.2 - brace-expansion@5.0.6: + brace-expansion@5.0.12: dependencies: - balanced-match: 4.0.3 + balanced-match: 4.0.4 + + brace-expansion@5.0.9: + dependencies: + balanced-match: 4.0.4 braces@3.0.3: dependencies: @@ -40209,14 +37751,12 @@ snapshots: browserslist@4.28.1: dependencies: - baseline-browser-mapping: 2.9.8 - caniuse-lite: 1.0.30001806 + baseline-browser-mapping: 2.11.23 + caniuse-lite: 1.0.30001760 electron-to-chromium: 1.5.267 node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) - buffer-crc32@0.2.13: {} - buffer-crc32@1.0.0: {} buffer-equal-constant-time@1.0.1: {} @@ -40233,8 +37773,6 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - bufferpack@0.0.6: {} - bun-types@1.2.22(@types/react@19.2.9): dependencies: '@types/node': 25.0.9 @@ -40242,9 +37780,7 @@ snapshots: bundle-name@4.1.0: dependencies: - run-applescript: 7.0.0 - - byline@5.0.0: {} + run-applescript: 7.1.0 bytes@3.1.2: {} @@ -40256,44 +37792,16 @@ snapshots: confbox: 0.2.2 defu: 6.1.4 dotenv: 16.6.1 - exsolve: 1.0.8 + exsolve: 1.1.1 giget: 2.0.0 - jiti: 2.6.1 + jiti: 2.7.0 ohash: 2.0.11 pathe: 2.0.3 perfect-debounce: 1.0.0 pkg-types: 2.3.0 rc9: 2.1.2 - c12@3.3.3(magicast@0.5.1): - dependencies: - chokidar: 5.0.0 - confbox: 0.2.2 - defu: 6.1.4 - dotenv: 17.4.2 - exsolve: 1.0.8 - giget: 2.0.0 - jiti: 2.6.1 - ohash: 2.0.11 - pathe: 2.0.3 - perfect-debounce: 2.0.0 - pkg-types: 2.3.0 - rc9: 2.1.2 - optionalDependencies: - magicast: 0.5.1 - - cacache@20.0.4: - dependencies: - '@npmcli/fs': 5.0.0 - fs-minipass: 3.0.3 - glob: 13.0.0 - lru-cache: 11.5.1 - minipass: 7.1.2 - minipass-collect: 2.0.1 - minipass-flush: 1.0.7 - minipass-pipeline: 1.2.4 - p-map: 7.0.3 - ssri: 13.0.1 + cac@7.1.0: {} call-bind-apply-helpers@1.0.2: dependencies: @@ -40321,24 +37829,29 @@ snapshots: pascal-case: 3.1.2 tslib: 2.8.1 - camelcase@5.3.1: {} - caniuse-lite@1.0.30001696: {} - caniuse-lite@1.0.30001806: {} + caniuse-lite@1.0.30001760: {} - chai@6.2.2: {} - - chalk@2.4.2: + cf@1.0.0-beta.28(@types/node@25.0.9): dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 + '@cloudflare/build-output-utils': 0.9.10 + '@cloudflare/config': 0.30.2 + '@cloudflare/runtime-types': 0.1.23(@types/node@25.0.9) + blake3-wasm: 2.1.5 + miniflare: 5.20261104.0-beta(@types/node@25.0.9) + transitivePeerDependencies: + - '@types/node' + - bufferutil + - utf-8-validate + + chai@6.3.0: {} chalk@3.0.0: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + optional: true chalk@4.1.2: dependencies: @@ -40347,6 +37860,8 @@ snapshots: chalk@5.6.2: {} + chalk@6.0.0: {} + char-regex@1.0.2: {} char-spinner@1.0.1: {} @@ -40373,7 +37888,7 @@ snapshots: parse5: 7.3.0 parse5-htmlparser2-tree-adapter: 7.1.0 parse5-parser-stream: 7.1.2 - undici: 6.27.0 + undici: 6.21.2 whatwg-mimetype: 4.0.0 chevrotain@10.5.0: @@ -40385,10 +37900,6 @@ snapshots: lodash: 4.17.21 regexp-to-ast: 0.5.0 - chevrotain@7.1.1: - dependencies: - regexp-to-ast: 0.5.0 - chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -40417,8 +37928,12 @@ snapshots: dependencies: consola: 3.4.2 + citty@0.2.2: {} + cjs-module-lexer@1.4.3: {} + cjs-module-lexer@2.2.1: {} + classnames@2.5.1: {} clean-css@5.3.3: @@ -40429,10 +37944,6 @@ snapshots: dependencies: restore-cursor: 3.1.0 - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 - cli-highlight@2.1.11: dependencies: chalk: 4.1.2 @@ -40444,7 +37955,7 @@ snapshots: cli-spinners@2.6.1: {} - cli-spinners@3.4.0: {} + cli-spinners@2.9.2: {} cli-table3@0.6.5: dependencies: @@ -40452,24 +37963,9 @@ snapshots: optionalDependencies: '@colors/colors': 1.5.0 - cli-truncate@5.2.0: - dependencies: - slice-ansi: 8.0.0 - string-width: 8.2.2 - cli-width@4.1.0: {} - clipboardy@4.0.0: - dependencies: - execa: 8.0.1 - is-wsl: 3.1.1 - is64bit: 2.0.0 - - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 + client-only@0.0.1: {} cliui@7.0.4: dependencies: @@ -40483,12 +37979,6 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - cliui@9.0.1: - dependencies: - string-width: 7.2.0 - strip-ansi: 7.2.0 - wrap-ansi: 9.0.2 - clone-deep@4.0.1: dependencies: is-plain-object: 2.0.4 @@ -40499,17 +37989,8 @@ snapshots: clsx@2.1.1: {} - cluster-key-slot@1.1.2: {} - - cmd-shim@8.0.0: {} - - code-block-writer@12.0.0: {} - - code-block-writer@13.0.3: {} - - color-convert@1.9.3: - dependencies: - color-name: 1.1.3 + cluster-key-slot@1.1.1: + optional: true color-convert@2.0.1: dependencies: @@ -40519,28 +38000,16 @@ snapshots: dependencies: color-name: 2.1.0 - color-name@1.1.3: {} - color-name@1.1.4: {} color-name@2.1.0: {} - color-string@1.9.1: - dependencies: - color-name: 1.1.4 - simple-swizzle: 0.2.4 - color-string@2.1.2: dependencies: color-name: 2.1.0 color-support@1.1.3: {} - color@4.2.3: - dependencies: - color-convert: 2.0.1 - color-string: 1.9.1 - color@5.0.2: dependencies: color-convert: 3.1.3 @@ -40548,6 +38017,8 @@ snapshots: colorette@2.0.20: {} + colorjs.io@0.7.1: {} + combinate@1.1.11: {} combined-stream@1.0.8: @@ -40574,23 +38045,17 @@ snapshots: comment-parser@1.4.1: {} - common-ancestor-path@1.0.1: {} - common-path-prefix@3.0.0: {} common-tags@1.8.2: {} - commondir@1.0.1: {} - compare-versions@6.1.1: {} - compatx@0.2.0: {} - - compress-commons@6.0.2: + compress-commons@7.0.1: dependencies: crc-32: 1.2.2 - crc32-stream: 6.0.0 - is-stream: 2.0.1 + crc32-stream: 7.0.1 + is-stream: 4.0.1 normalize-path: 3.0.0 readable-stream: 4.7.0 @@ -40598,11 +38063,11 @@ snapshots: dependencies: mime-db: 1.54.0 - compression@1.8.0: + compression@1.8.0(supports-color@10.2.2): dependencies: bytes: 3.1.2 compressible: 2.0.18 - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) negotiator: 0.6.4 on-headers: 1.0.2 safe-buffer: 5.2.1 @@ -40610,11 +38075,11 @@ snapshots: transitivePeerDependencies: - supports-color - compression@1.8.1: + compression@1.8.1(supports-color@10.2.2): dependencies: bytes: 3.1.2 compressible: 2.0.18 - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) negotiator: 0.6.4 on-headers: 1.1.0 safe-buffer: 5.2.1 @@ -40676,47 +38141,45 @@ snapshots: convert-source-map@2.0.0: {} - convex-helpers@0.1.104(@standard-schema/spec@1.1.0)(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.7.10)(react@19.2.3)(typescript@6.0.2)(zod@3.25.76): + convex-helpers@0.1.104(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9))(hono@4.13.9)(react@19.2.9)(zod@3.25.76): dependencies: - convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) + convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9) optionalDependencies: '@standard-schema/spec': 1.1.0 - hono: 4.7.10 - react: 19.2.3 - typescript: 6.0.2 + hono: 4.13.9 + react: 19.2.9 + typescript: '@typescript/typescript6@6.0.2' zod: 3.25.76 - convex-solidjs@0.0.3(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)(solid-js@1.9.12): + convex-solidjs@0.0.3(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9)(solid-js@1.9.12): dependencies: '@solid-primitives/context': 0.3.2(solid-js@1.9.12) - convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) + convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9) solid-js: 1.9.12 transitivePeerDependencies: - '@auth0/auth0-react' - '@clerk/clerk-react' - react - convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + convex@1.19.0(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: esbuild: 0.23.0 jwt-decode: 3.1.2 prettier: 3.4.2 optionalDependencies: - '@clerk/clerk-react': 5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@clerk/clerk-react': 5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) - convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3): + convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9))(react@19.2.9): dependencies: esbuild: 0.25.4 - prettier: 3.6.2 + prettier: 3.8.1 optionalDependencies: - '@clerk/clerk-react': 5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 + '@clerk/clerk-react': 5.59.3(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 - cookie-es@1.2.2: {} - - cookie-es@2.0.0: {} + cookie-es@1.2.3: {} cookie-es@3.1.1: {} @@ -40728,28 +38191,15 @@ snapshots: cookie@1.0.2: {} - copy-anything@2.0.6: - dependencies: - is-what: 3.14.1 + cookie@1.1.1: {} + + cookie@2.0.1: {} copy-file@11.1.0: dependencies: graceful-fs: 4.2.11 p-event: 6.0.1 - copy-webpack-plugin@14.0.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - glob-parent: 6.0.2 - normalize-path: 3.0.0 - schema-utils: 4.3.3 - serialize-javascript: 7.0.7 - tinyglobby: 0.2.16 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - - core-js-compat@3.49.0: - dependencies: - browserslist: 4.28.1 - core-util-is@1.0.3: {} cosmiconfig@7.1.0: @@ -40760,30 +38210,26 @@ snapshots: path-type: 4.0.0 yaml: 1.10.3 - cosmiconfig@9.0.0(typescript@6.0.2): + cosmiconfig@9.0.0(@typescript/typescript6@6.0.2): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' crc-32@1.2.2: {} - crc32-stream@6.0.0: + crc32-stream@7.0.1: dependencies: crc-32: 1.2.2 readable-stream: 4.7.0 - create-require@1.1.1: {} - - cron-parser@4.9.0: + cron-parser@5.10.1: dependencies: luxon: 3.7.2 - croner@9.1.0: {} - cross-argv@2.0.0: {} cross-env@10.0.0: @@ -40791,19 +38237,6 @@ snapshots: '@epic-web/invariant': 1.0.0 cross-spawn: 7.0.6 - cross-env@10.1.0: - dependencies: - '@epic-web/invariant': 1.0.0 - cross-spawn: 7.0.6 - - cross-spawn@6.0.6: - dependencies: - nice-try: 1.0.5 - path-key: 2.0.1 - semver: 5.7.2 - shebang-command: 1.2.0 - which: 1.3.1 - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -40814,18 +38247,9 @@ snapshots: dependencies: uncrypto: 0.1.3 - crossws@0.4.3(srvx@0.10.1): + crossws@0.4.12(srvx@1.0.5): optionalDependencies: - srvx: 0.10.1 - - crossws@0.4.4(srvx@0.11.15): - optionalDependencies: - srvx: 0.11.15 - - crossws@0.4.5(srvx@0.11.15): - optionalDependencies: - srvx: 0.11.15 - optional: true + srvx: 1.0.5 css-loader@7.1.2(webpack@5.97.1): dependencies: @@ -40840,19 +38264,6 @@ snapshots: optionalDependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) - css-loader@7.1.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - icss-utils: 5.1.0(postcss@8.5.15) - postcss: 8.5.15 - postcss-modules-extract-imports: 3.1.0(postcss@8.5.15) - postcss-modules-local-by-default: 4.2.0(postcss@8.5.15) - postcss-modules-scope: 3.2.1(postcss@8.5.15) - postcss-modules-values: 4.0.0(postcss@8.5.15) - postcss-value-parser: 4.2.0 - semver: 7.8.2 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - css-select@4.3.0: dependencies: boolbase: 1.0.0 @@ -40869,18 +38280,10 @@ snapshots: domutils: 3.2.2 nth-check: 2.1.1 - css-select@6.0.0: - dependencies: - boolbase: 1.0.0 - css-what: 7.0.0 - domhandler: 5.0.3 - domutils: 3.2.2 - nth-check: 2.1.1 - css-tree@2.2.1: dependencies: mdn-data: 2.0.28 - source-map-js: 1.2.1 + source-map-js: 1.2.2 css-tree@3.2.1: dependencies: @@ -40889,8 +38292,6 @@ snapshots: css-what@6.1.0: {} - css-what@7.0.0: {} - css.escape@1.5.1: {} cssesc@3.0.0: {} @@ -40906,13 +38307,11 @@ snapshots: '@asamuzakjp/css-color': 2.8.3 rrweb-cssom: 0.8.0 - cssstyle@5.3.1(postcss@8.5.15): + cssstyle@5.3.1: dependencies: '@asamuzakjp/css-color': 4.0.5 - '@csstools/css-syntax-patches-for-csstree': 1.0.14(postcss@8.5.15) + '@csstools/css-syntax-patches-for-csstree': 1.1.5(css-tree@3.2.1) css-tree: 3.2.1 - transitivePeerDependencies: - - postcss csstype@3.1.3: {} @@ -40943,39 +38342,33 @@ snapshots: dependencies: '@babel/runtime': 7.26.7 - date-format@4.0.14: {} - - db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3): - optionalDependencies: - '@electric-sql/pglite': 0.3.2 - '@libsql/client': 0.15.15 - mysql2: 3.15.3 + db0@0.4.1: {} de-indent@1.0.2: {} - debug@2.6.9: + debug@2.6.9(supports-color@10.2.2): dependencies: ms: 2.0.0 + optionalDependencies: + supports-color: 10.2.2 - debug@4.4.3: + debug@4.4.3(supports-color@10.2.2): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 10.2.2 decache@4.6.2: dependencies: callsite: 1.0.0 - decamelize@1.2.0: {} - - decimal.js@10.5.0: {} - decimal.js@10.6.0: {} dedent@1.5.1(babel-plugin-macros@3.1.0): optionalDependencies: babel-plugin-macros: 3.1.0 - dedent@1.7.0(babel-plugin-macros@3.1.0): + dedent@1.7.2(babel-plugin-macros@3.1.0): optionalDependencies: babel-plugin-macros: 3.1.0 @@ -41006,17 +38399,12 @@ snapshots: deepmerge@4.3.1: {} - default-browser-id@5.0.0: {} + default-browser-id@5.0.1: {} default-browser@5.2.1: dependencies: bundle-name: 4.1.0 - default-browser-id: 5.0.0 - - default-browser@5.5.0: - dependencies: - bundle-name: 4.1.0 - default-browser-id: 5.0.0 + default-browser-id: 5.0.1 defaults@1.0.4: dependencies: @@ -41028,8 +38416,6 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - define-lazy-prop@2.0.0: {} - define-lazy-prop@3.0.0: {} define-properties@1.2.1: @@ -41040,6 +38426,8 @@ snapshots: defu@6.1.4: {} + defu@6.1.7: {} + delay@5.0.0: {} delayed-stream@1.0.0: {} @@ -41058,14 +38446,13 @@ snapshots: detect-indent@6.1.0: {} - detect-libc@1.0.3: {} + detect-libc@1.0.3: + optional: true detect-libc@2.0.2: {} detect-libc@2.1.2: {} - detect-newline@3.1.0: {} - detect-node-es@1.1.0: {} detect-node@2.1.0: {} @@ -41086,11 +38473,11 @@ snapshots: dependencies: node-source-walk: 7.0.1 - detective-postcss@7.0.1(postcss@8.5.15): + detective-postcss@7.0.1(postcss@8.5.29): dependencies: is-url: 1.2.4 - postcss: 8.5.15 - postcss-values-parser: 6.0.2(postcss@8.5.15) + postcss: 8.5.29 + postcss-values-parser: 6.0.2(postcss@8.5.29) detective-sass@6.0.1: dependencies: @@ -41104,16 +38491,16 @@ snapshots: detective-stylus@5.0.1: {} - detective-typescript@14.0.0(typescript@5.9.3): + detective-typescript@14.0.0(supports-color@10.2.2)(typescript@5.9.3): dependencies: - '@typescript-eslint/typescript-estree': 8.53.0(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.57.1(supports-color@10.2.2)(typescript@5.9.3) ast-module-types: 6.0.1 node-source-walk: 7.0.1 typescript: 5.9.3 transitivePeerDependencies: - supports-color - detective-vue2@2.2.0(typescript@5.9.3): + detective-vue2@2.2.0(supports-color@10.2.2)(typescript@5.9.3): dependencies: '@dependents/detective-less': 5.0.1 '@vue/compiler-sfc': 3.5.25 @@ -41121,7 +38508,7 @@ snapshots: detective-sass: 6.0.1 detective-scss: 5.0.1 detective-stylus: 5.0.1 - detective-typescript: 14.0.0(typescript@5.9.3) + detective-typescript: 14.0.0(supports-color@10.2.2)(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -41130,11 +38517,7 @@ snapshots: dexie@4.2.1: {} - diff@4.0.4: {} - - diff@5.2.2: {} - - diff@8.0.2: {} + diff@9.0.0: {} dir-glob@3.0.1: dependencies: @@ -41179,11 +38562,6 @@ snapshots: dependencies: domelementtype: 2.3.0 - dominative@0.1.3(@nativescript/core@9.0.20)(undom-ng@1.1.2): - dependencies: - '@nativescript/core': 9.0.20 - undom-ng: 1.1.2 - domutils@2.8.0: dependencies: dom-serializer: 1.4.1 @@ -41201,17 +38579,13 @@ snapshots: no-case: 3.0.4 tslib: 2.8.1 - dot-prop@10.1.0: - dependencies: - type-fest: 5.4.1 - dot-prop@9.0.0: dependencies: type-fest: 4.41.0 dotenv-expand@12.0.3: dependencies: - dotenv: 16.4.7 + dotenv: 16.6.1 dotenv@16.4.7: {} @@ -41219,8 +38593,6 @@ snapshots: dotenv@17.2.3: {} - dotenv@17.4.2: {} - dotenv@8.6.0: {} dunder-proto@1.0.1: @@ -41229,8 +38601,6 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - duplexer@0.1.2: {} - eastasianwidth@0.2.0: {} ecdsa-sig-formatter@1.0.11: @@ -41242,7 +38612,7 @@ snapshots: '@one-ini/wasm': 0.1.1 commander: 10.0.1 minimatch: 9.0.1 - semver: 7.8.2 + semver: 7.8.5 ee-first@1.1.1: {} @@ -41257,10 +38627,6 @@ snapshots: electron-to-chromium@1.5.90: {} - email-validator@2.0.4: {} - - emoji-regex@10.6.0: {} - emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -41289,21 +38655,22 @@ snapshots: enhanced-resolve@5.18.1: dependencies: graceful-fs: 4.2.11 - tapable: 2.2.1 + tapable: 2.3.3 enhanced-resolve@5.18.3: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.0 + tapable: 2.3.3 - enhanced-resolve@5.20.1: + enhanced-resolve@5.21.6: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.0 + tapable: 2.3.3 - enquirer@2.3.6: + enhanced-resolve@5.24.5: dependencies: - ansi-colors: 4.1.3 + graceful-fs: 4.2.11 + tapable: 2.3.3 enquirer@2.4.1: dependencies: @@ -41316,33 +38683,23 @@ snapshots: entities@6.0.0: {} - entities@7.0.1: {} - entities@8.0.0: {} env-paths@2.2.1: {} env-paths@3.0.0: {} - env-runner@0.1.6(miniflare@4.20260317.0): + env-runner@0.2.3: dependencies: - crossws: 0.4.4(srvx@0.11.15) - httpxy: 0.3.1 - srvx: 0.11.15 - optionalDependencies: - miniflare: 4.20260317.0 + crossws: 0.4.12(srvx@1.0.5) + exsolve: 1.1.1 + httpxy: 0.5.5 + srvx: 1.0.5 envinfo@7.14.0: {} environment@1.1.0: {} - err-code@2.0.3: {} - - errno@0.1.8: - dependencies: - prr: 1.0.1 - optional: true - error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -41369,11 +38726,11 @@ snapshots: es-module-lexer@1.7.0: {} - es-module-lexer@2.0.0: {} + es-module-lexer@2.3.2: {} - es-object-atoms@1.1.1: - dependencies: - es-errors: 1.3.0 + es-module-lexer@3.0.3: {} + + es-module-lexer@3.0.4: {} es-object-atoms@1.1.2: dependencies: @@ -41384,28 +38741,26 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 - hasown: 2.0.2 + hasown: 2.0.4 - esbuild-plugin-solid@0.6.0(esbuild@0.27.4)(solid-js@1.9.12): + esbuild-plugin-solid@0.6.0(esbuild@0.27.4)(solid-js@1.9.12)(supports-color@10.2.2): dependencies: - '@babel/core': 7.28.5 - '@babel/preset-typescript': 7.27.1(@babel/core@7.28.5) - babel-preset-solid: 1.9.10(@babel/core@7.28.5)(solid-js@1.9.12) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/preset-typescript': 7.27.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) esbuild: 0.27.4 solid-js: 1.9.12 transitivePeerDependencies: - supports-color - esbuild-plugin-vue3@0.5.1(cheerio@1.0.0)(sass@1.97.2)(vue@3.5.25(typescript@6.0.2)): + esbuild-plugin-vue3@0.5.1(cheerio@1.0.0)(sass@1.97.2)(vue@3.5.25(@typescript/typescript6@6.0.2)): dependencies: typescript: 4.9.5 - vue: 3.5.25(typescript@6.0.2) + vue: 3.5.25(@typescript/typescript6@6.0.2) optionalDependencies: cheerio: 1.0.0 sass: 1.97.2 - esbuild-wasm@0.28.1: {} - esbuild@0.23.0: optionalDependencies: '@esbuild/aix-ppc64': 0.23.0 @@ -41595,10 +38950,10 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-compat-utils@0.5.1(eslint@9.22.0(jiti@2.7.0)): + eslint-compat-utils@0.5.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 9.22.0(jiti@2.7.0) - semver: 7.8.2 + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + semver: 7.8.5 eslint-import-context@0.1.9(unrs-resolver@1.11.1): dependencies: @@ -41607,214 +38962,210 @@ snapshots: optionalDependencies: unrs-resolver: 1.11.1 - eslint-plugin-es-x@7.8.0(eslint@9.22.0(jiti@2.7.0)): + eslint-plugin-es-x@7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@eslint-community/regexpp': 4.12.1 - eslint: 9.22.0(jiti@2.7.0) - eslint-compat-utils: 0.5.1(eslint@9.22.0(jiti@2.7.0)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-compat-utils: 0.5.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) - eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0)): + eslint-plugin-import-x@4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@typescript-eslint/types': 8.53.0 comment-parser: 1.4.1 - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-import-context: 0.1.9(unrs-resolver@1.11.1) is-glob: 4.0.3 minimatch: 10.2.5 - semver: 7.8.2 + semver: 7.8.5 stable-hash-x: 0.2.0 unrs-resolver: 1.11.1 - optionalDependencies: - '@typescript-eslint/utils': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) transitivePeerDependencies: - supports-color - eslint-plugin-n@17.23.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-n@17.23.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) - enhanced-resolve: 5.18.3 - eslint: 9.22.0(jiti@2.7.0) - eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + enhanced-resolve: 5.21.6 + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) get-tsconfig: 4.10.1 globals: 15.14.0 globrex: 0.1.2 ignore: 5.3.2 - semver: 7.8.2 - ts-declaration-location: 1.0.7(typescript@6.0.2) + semver: 7.8.5 + ts-declaration-location: 1.0.7(@typescript/typescript6@6.0.2) transitivePeerDependencies: - typescript - eslint-plugin-n@17.24.0(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-n@17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) enhanced-resolve: 5.18.3 - eslint: 9.22.0(jiti@2.7.0) - eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) get-tsconfig: 4.10.1 globals: 15.14.0 globrex: 0.1.2 ignore: 5.3.2 - semver: 7.8.2 - ts-declaration-location: 1.0.7(typescript@6.0.2) + semver: 7.8.5 + ts-declaration-location: 1.0.7(@typescript/typescript6@6.0.2) transitivePeerDependencies: - typescript - eslint-plugin-react-debug@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-react-debug@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-react-dom@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-react-dom@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) compare-versions: 6.1.1 - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-react-hooks-extra@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-react-hooks-extra@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-react-hooks@5.1.0(eslint@9.22.0(jiti@2.7.0)): + eslint-plugin-react-hooks@5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 9.22.0(jiti@2.7.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) - eslint-plugin-react-naming-convention@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-react-naming-convention@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-react-web-api@1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-react-web-api@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-react-x@1.26.2(eslint@9.22.0(jiti@2.7.0))(ts-api-utils@2.4.0(typescript@6.0.2))(typescript@6.0.2): + eslint-plugin-react-x@1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)): dependencies: - '@eslint-react/ast': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/core': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/ast': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/core': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@eslint-react/eff': 1.26.2 - '@eslint-react/jsx': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/shared': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@eslint-react/var': 1.26.2(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/scope-manager': 8.53.0 - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/types': 8.53.0 - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + '@eslint-react/jsx': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/shared': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@eslint-react/var': 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.57.1 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.57.1 + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) compare-versions: 6.1.1 - eslint: 9.22.0(jiti@2.7.0) - is-immutable-type: 5.0.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + is-immutable-type: 5.0.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) string-ts: 2.2.1 ts-pattern: 5.6.2 optionalDependencies: - ts-api-utils: 2.4.0(typescript@6.0.2) - typescript: 6.0.2 + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-solid@0.14.5(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + eslint-plugin-solid@0.14.5(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) + '@typescript-eslint/utils': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) estraverse: 5.3.0 is-html: 2.0.0 kebab-case: 1.0.2 known-css-properties: 0.30.0 style-to-object: 1.0.8 - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0)): + eslint-plugin-unused-imports@4.1.4(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 9.22.0(jiti@2.7.0) - optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) - eslint-plugin-vue@9.33.0(eslint@9.22.0(jiti@2.7.0)): + eslint-plugin-vue@9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) - eslint: 9.22.0(jiti@2.7.0) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) globals: 13.24.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.1.2 semver: 7.7.3 - vue-eslint-parser: 9.4.3(eslint@9.22.0(jiti@2.7.0)) + vue-eslint-parser: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -41840,14 +39191,14 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@9.22.0(jiti@2.7.0): + eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.19.2 + '@eslint/config-array': 0.19.2(supports-color@10.2.2) '@eslint/config-helpers': 0.1.0 '@eslint/core': 0.12.0 - '@eslint/eslintrc': 3.3.0 + '@eslint/eslintrc': 3.3.0(supports-color@10.2.2) '@eslint/js': 9.22.0 '@eslint/plugin-kit': 0.2.7 '@humanfs/node': 0.16.6 @@ -41858,7 +39209,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) escape-string-regexp: 4.0.0 eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.1 @@ -41912,7 +39263,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 esutils@2.0.3: {} @@ -41922,8 +39273,6 @@ snapshots: eventemitter3@4.0.7: {} - eventemitter3@5.0.4: {} - events-universal@1.0.1: dependencies: bare-events: 2.9.1 @@ -41932,28 +39281,6 @@ snapshots: events@3.3.0: {} - execa@1.0.0: - dependencies: - cross-spawn: 6.0.6 - get-stream: 4.1.0 - is-stream: 1.1.0 - npm-run-path: 2.0.2 - p-finally: 1.0.0 - signal-exit: 3.0.7 - strip-eof: 1.0.0 - - execa@5.1.1: - dependencies: - cross-spawn: 7.0.6 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - execa@8.0.1: dependencies: cross-spawn: 7.0.6 @@ -41966,29 +39293,25 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 - exif-parser@0.1.12: {} + expect-type@1.4.0: {} - expect-type@1.3.0: {} - - exponential-backoff@3.1.3: {} - - express@4.22.2: + express@4.22.2(supports-color@10.2.2): dependencies: accepts: 1.3.8 array-flatten: 1.1.1 - body-parser: 1.20.5 + body-parser: 1.20.5(supports-color@10.2.2) content-disposition: 0.5.4 content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.0.6 - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) depd: 2.0.0 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 - finalhandler: 1.3.1 + finalhandler: 1.3.1(supports-color@10.2.2) fresh: 0.5.2 - http-errors: 2.0.0 + http-errors: 2.0.1 merge-descriptors: 1.0.3 methods: 1.1.2 on-finished: 2.4.1 @@ -41998,30 +39321,30 @@ snapshots: qs: 6.15.2 range-parser: 1.2.1 safe-buffer: 5.2.1 - send: 0.19.0 - serve-static: 1.16.2 + send: 0.19.0(supports-color@10.2.2) + serve-static: 1.16.2(supports-color@10.2.2) setprototypeof: 1.2.0 - statuses: 2.0.1 + statuses: 2.0.2 type-is: 1.6.18 utils-merge: 1.0.1 vary: 1.1.2 transitivePeerDependencies: - supports-color - express@5.2.1: + express@5.2.1(supports-color@10.2.2): dependencies: accepts: 2.0.0 - body-parser: 2.2.2 + body-parser: 2.2.2(supports-color@10.2.2) content-disposition: 1.0.0 content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) depd: 2.0.0 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 - finalhandler: 2.1.0 + finalhandler: 2.1.0(supports-color@10.2.2) fresh: 2.0.0 http-errors: 2.0.0 merge-descriptors: 2.0.0 @@ -42032,31 +39355,21 @@ snapshots: proxy-addr: 2.0.7 qs: 6.14.0 range-parser: 1.2.1 - router: 2.2.0 - send: 1.2.0 - serve-static: 2.2.1 + router: 2.2.0(supports-color@10.2.2) + send: 1.2.0(supports-color@10.2.2) + serve-static: 2.2.1(supports-color@10.2.2) statuses: 2.0.1 type-is: 2.0.1 vary: 1.1.2 transitivePeerDependencies: - supports-color - exsolve@1.0.7: {} + exsolve@1.1.1: {} - exsolve@1.0.8: {} + exsolve@1.2.0: {} extendable-error@0.1.7: {} - extract-zip@2.0.1: - dependencies: - debug: 4.4.3 - get-stream: 5.2.0 - yauzl: 2.10.0 - optionalDependencies: - '@types/yauzl': 2.10.3 - transitivePeerDependencies: - - supports-color - fast-check@3.23.2: dependencies: pure-rand: 6.1.0 @@ -42081,7 +39394,7 @@ snapshots: dependencies: '@fastify/merge-json-schemas': 0.2.1 ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) + ajv-formats: 3.0.1 fast-uri: 3.0.6 json-schema-ref-resolver: 3.0.0 rfdc: 1.4.1 @@ -42096,8 +39409,18 @@ snapshots: fast-sha256@1.3.0: {} + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + fast-uri@3.0.6: {} + fast-wrap-ansi@0.2.0: + dependencies: + fast-string-width: 3.0.2 + fastest-levenshtein@1.0.16: {} fastify@5.7.1: @@ -42115,7 +39438,7 @@ snapshots: process-warning: 5.0.0 rfdc: 1.4.1 secure-json-parse: 4.1.0 - semver: 7.8.2 + semver: 7.8.5 toad-cache: 3.7.0 fastq@1.19.0: @@ -42126,17 +39449,13 @@ snapshots: dependencies: websocket-driver: 0.7.4 - fd-slicer@1.1.0: - dependencies: - pend: 1.2.0 - fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 - fdir@6.5.0(picomatch@4.0.4): + fdir@6.5.0(picomatch@4.0.7): optionalDependencies: - picomatch: 4.0.4 + picomatch: 4.0.7 fecha@4.2.3: {} @@ -42145,9 +39464,7 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 - fetchdts@0.1.7: {} - - fflate@0.8.2: {} + fetchdts@0.2.0: {} fflate@0.8.3: {} @@ -42163,12 +39480,6 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-type@16.5.4: - dependencies: - readable-web-to-node-stream: 3.0.4 - strtok3: 6.3.0 - token-types: 4.2.1 - file-uri-to-path@1.0.0: {} fill-range@7.1.1: @@ -42177,9 +39488,9 @@ snapshots: filter-obj@6.1.0: {} - finalhandler@1.3.1: + finalhandler@1.3.1(supports-color@10.2.2): dependencies: - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -42189,9 +39500,9 @@ snapshots: transitivePeerDependencies: - supports-color - finalhandler@2.1.0: + finalhandler@2.1.0(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -42220,11 +39531,6 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - find-up@6.3.0: - dependencies: - locate-path: 7.2.0 - path-exists: 5.0.0 - find-up@7.0.0: dependencies: locate-path: 7.2.0 @@ -42273,16 +39579,13 @@ snapshots: flatted@3.4.2: {} + flatted@3.4.4: {} + fn.name@1.1.0: {} - follow-redirects@1.16.0(debug@4.4.3): + follow-redirects@1.16.0(debug@4.4.3(supports-color@10.2.2)): optionalDependencies: - debug: 4.4.3 - - font-finder@1.1.0: - dependencies: - get-system-fonts: 2.0.2 - promise-stream-reader: 1.0.1 + debug: 4.4.3(supports-color@10.2.2) for-each@0.3.5: dependencies: @@ -42293,12 +39596,6 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.1: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - form-data@4.0.5: dependencies: asynckit: 0.4.0 @@ -42307,23 +39604,29 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + form-data@4.0.6: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.4 + mime-types: 2.1.35 + formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 forwarded@0.2.0: {} - fraction.js@5.3.4: {} - - framer-motion@11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + framer-motion@11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: motion-dom: 11.18.1 motion-utils: 11.18.1 tslib: 2.8.1 optionalDependencies: '@emotion/is-prop-valid': 1.3.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) fresh@0.5.2: {} @@ -42343,20 +39646,6 @@ snapshots: jsonfile: 4.0.0 universalify: 0.1.2 - fs-extra@9.1.0: - dependencies: - at-least-node: 1.0.0 - graceful-fs: 4.2.11 - jsonfile: 6.2.1 - universalify: 2.0.1 - - fs-minipass@3.0.3: - dependencies: - minipass: 7.1.2 - - fsevents@2.3.2: - optional: true - fsevents@2.3.3: optional: true @@ -42377,19 +39666,17 @@ snapshots: get-caller-file@2.0.5: {} - get-east-asian-width@1.6.0: {} - get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 function-bind: 1.1.2 get-proto: 1.0.1 gopd: 1.2.0 has-symbols: 1.1.0 - hasown: 2.0.2 + hasown: 2.0.4 math-intrinsics: 1.1.0 get-nonce@1.0.1: {} @@ -42403,31 +39690,14 @@ snapshots: get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 - es-object-atoms: 1.1.1 - - get-stream@4.1.0: - dependencies: - pump: 3.0.3 - - get-stream@5.2.0: - dependencies: - pump: 3.0.3 - - get-stream@6.0.1: {} + es-object-atoms: 1.1.2 get-stream@8.0.1: {} - get-system-fonts@2.0.2: {} - get-tsconfig@4.10.1: dependencies: resolve-pkg-maps: 1.0.0 - gifwrap@0.10.1: - dependencies: - image-q: 4.0.0 - omggif: 1.0.10 - giget@2.0.0: dependencies: citty: 0.1.6 @@ -42447,10 +39717,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob-to-regex.js@1.2.0(tslib@2.8.1): - dependencies: - tslib: 2.8.1 - glob-to-regexp@0.4.1: {} glob@10.5.0: @@ -42489,15 +39755,6 @@ snapshots: merge2: 1.4.1 slash: 3.0.0 - globby@16.1.0: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - fast-glob: 3.3.3 - ignore: 7.0.5 - is-path-inside: 4.0.0 - slash: 5.1.0 - unicorn-magic: 0.4.0 - globrex@0.1.2: {} gonzales-pe@4.3.0: @@ -42516,52 +39773,33 @@ snapshots: graceful-fs@4.2.11: {} - gradle-to-js@2.0.1: - dependencies: - lodash.merge: 4.6.2 - grammex@3.1.11: {} graphemer@1.4.0: {} graphql@16.10.0: {} - gzip-size@7.0.0: - dependencies: - duplexer: 0.1.2 + graphql@16.14.2: {} - h3@1.15.5: + h3@1.15.11: dependencies: - cookie-es: 1.2.2 + cookie-es: 1.2.3 crossws: 0.3.5 - defu: 6.1.4 + defu: 6.1.7 destr: 2.0.5 iron-webcrypto: 1.2.1 node-mock-http: 1.0.4 radix3: 1.1.2 - ufo: 1.6.3 + ufo: 1.6.4 uncrypto: 0.1.3 - h3@2.0.1-rc.14(crossws@0.4.3(srvx@0.10.1)): + h3@2.0.1-rc.32(crossws@0.4.12(srvx@1.0.5))(ocache@0.3.0): dependencies: - rou3: 0.7.12 - srvx: 0.11.15 + rou3: 0.9.2 + srvx: 1.0.5 optionalDependencies: - crossws: 0.4.3(srvx@0.10.1) - - h3@2.0.1-rc.16(crossws@0.4.4(srvx@0.11.15)): - dependencies: - rou3: 0.8.1 - srvx: 0.11.15 - optionalDependencies: - crossws: 0.4.4(srvx@0.11.15) - - h3@2.0.1-rc.20(crossws@0.4.5(srvx@0.11.15)): - dependencies: - rou3: 0.8.1 - srvx: 0.11.15 - optionalDependencies: - crossws: 0.4.5(srvx@0.11.15) + crossws: 0.4.12(srvx@1.0.5) + ocache: 0.3.0 handle-thing@2.0.1: {} @@ -42569,8 +39807,6 @@ snapshots: has-bigints@1.1.0: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} has-own-prop@2.0.0: {} @@ -42605,6 +39841,11 @@ snapshots: headers-polyfill@4.0.3: {} + headers-polyfill@5.0.1: + dependencies: + '@types/set-cookie-parser': 2.4.10 + set-cookie-parser: 3.1.0 + hey-listen@1.0.8: {} highlight.js@10.7.3: {} @@ -42613,11 +39854,17 @@ snapshots: dependencies: react-is: 16.13.1 + hono-sessions@0.8.1(hono@4.13.9): + dependencies: + hono: 4.13.9 + iron-webcrypto: 1.2.1 + ohash: 2.0.11 + + hono@4.13.9: {} + hono@4.7.10: {} - hookable@5.5.3: {} - - hookable@6.1.0: {} + hookable@6.1.2: {} hosted-git-info@7.0.2: dependencies: @@ -42658,21 +39905,10 @@ snapshots: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.37.0 + terser: 5.51.2 html-tags@3.3.1: {} - html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - '@types/html-minifier-terser': 6.1.0 - html-minifier-terser: 6.1.0 - lodash: 4.17.21 - pretty-error: 4.0.0 - tapable: 2.2.1 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - optional: true - html-webpack-plugin@5.6.3(webpack@5.97.1): dependencies: '@types/html-minifier-terser': 6.1.0 @@ -42683,13 +39919,6 @@ snapshots: optionalDependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) - htmlparser2@10.1.0: - dependencies: - domelementtype: 2.3.0 - domhandler: 5.0.3 - domutils: 3.2.2 - entities: 7.0.1 - htmlparser2@6.1.0: dependencies: domelementtype: 2.3.0 @@ -42704,8 +39933,6 @@ snapshots: domutils: 3.2.2 entities: 4.5.0 - http-cache-semantics@4.2.0: {} - http-deceiver@1.2.7: {} http-errors@1.6.3: @@ -42733,17 +39960,17 @@ snapshots: http-parser-js@0.5.9: {} - http-proxy-agent@7.0.2: + http-proxy-agent@7.0.2(supports-color@10.2.2): dependencies: agent-base: 7.1.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.9(@types/express@4.17.25): + http-proxy-middleware@2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)): dependencies: '@types/http-proxy': 1.17.15 - http-proxy: 1.18.1(debug@4.4.3) + http-proxy: 1.18.1(debug@4.4.3(supports-color@10.2.2)) is-glob: 4.0.3 is-plain-obj: 3.0.0 micromatch: 4.0.8 @@ -42752,32 +39979,21 @@ snapshots: transitivePeerDependencies: - debug - http-proxy-middleware@3.0.5: + http-proxy-middleware@3.0.5(supports-color@10.2.2): dependencies: '@types/http-proxy': 1.17.15 - debug: 4.4.3 - http-proxy: 1.18.1(debug@4.4.3) + debug: 4.4.3(supports-color@10.2.2) + http-proxy: 1.18.1(debug@4.4.3(supports-color@10.2.2)) is-glob: 4.0.3 is-plain-object: 5.0.0 micromatch: 4.0.8 transitivePeerDependencies: - supports-color - http-proxy-middleware@3.0.7: - dependencies: - '@types/http-proxy': 1.17.15 - debug: 4.4.3 - http-proxy: 1.18.1(debug@4.4.3) - is-glob: 4.0.3 - is-plain-object: 5.0.0 - micromatch: 4.0.8 - transitivePeerDependencies: - - supports-color - - http-proxy@1.18.1(debug@4.4.3): + http-proxy@1.18.1(debug@4.4.3(supports-color@10.2.2)): dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.16.0(debug@4.4.3) + follow-redirects: 1.16.0(debug@4.4.3(supports-color@10.2.2)) requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -42786,28 +40002,24 @@ snapshots: http-status-codes@2.3.0: {} - https-proxy-agent@5.0.1: + https-proxy-agent@5.0.1(supports-color@10.2.2): dependencies: - agent-base: 6.0.2 - debug: 4.4.3 + agent-base: 6.0.2(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.6: + https-proxy-agent@7.0.6(supports-color@10.2.2): dependencies: agent-base: 7.1.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - httpxy@0.1.7: {} - - httpxy@0.3.1: {} + httpxy@0.5.5: {} human-id@4.1.1: {} - human-signals@2.1.0: {} - human-signals@5.0.0: {} hyperdyperid@1.2.0: {} @@ -42830,14 +40042,6 @@ snapshots: dependencies: safer-buffer: 2.1.2 - iconv-lite@0.7.3: - dependencies: - safer-buffer: 2.1.2 - - icss-utils@5.1.0(postcss@8.5.15): - dependencies: - postcss: 8.5.15 - icss-utils@5.1.0(postcss@8.5.6): dependencies: postcss: 8.5.6 @@ -42846,34 +40050,31 @@ snapshots: ieee754@1.2.1: {} - ignore-walk@8.0.0: - dependencies: - minimatch: 10.2.5 - ignore@5.3.2: {} + ignore@7.0.12: {} + ignore@7.0.5: {} image-meta@0.2.2: {} - image-q@4.0.0: - dependencies: - '@types/node': 25.0.9 - - image-size@0.5.5: - optional: true - - image-size@2.0.2: {} - immer@10.1.1: {} immutable@5.1.4: {} + immutable@5.1.9: {} + import-fresh@3.3.0: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 + import-in-the-middle@3.5.1: + dependencies: + cjs-module-lexer: 2.2.1 + es-module-lexer: 3.0.3 + module-details-from-path: 1.0.4 + import-lazy@4.0.0: {} import-local@3.2.0: @@ -42895,10 +40096,6 @@ snapshots: ini@1.3.8: {} - ini@2.0.0: {} - - ini@6.0.0: {} - inline-style-parser@0.2.4: {} internal-slot@1.1.0: @@ -42907,66 +40104,42 @@ snapshots: hasown: 2.0.4 side-channel: 1.1.0 - interpret@1.4.0: {} - interpret@3.1.1: {} - ioredis@5.9.2: + ioredis@5.11.1(supports-color@10.2.2): dependencies: - '@ioredis/commands': 1.5.0 - cluster-key-slot: 1.1.2 - debug: 4.4.3 + '@ioredis/commands': 1.10.0 + cluster-key-slot: 1.1.1 + debug: 4.4.3(supports-color@10.2.2) denque: 2.1.0 - lodash.defaults: 4.2.0 - lodash.isarguments: 3.1.0 redis-errors: 1.2.0 redis-parser: 3.0.0 standard-as-callback: 2.1.0 transitivePeerDependencies: - supports-color - - ios-device-lib@0.9.4: - dependencies: - bufferpack: 0.0.6 - uuid: 8.3.2 - - ios-mobileprovision-finder@1.2.1: - dependencies: - chalk: 5.6.2 - plist: 3.1.0 - yargs: 17.7.2 - - ios-sim-portable@4.5.1: - dependencies: - bplist-parser: 0.3.2 - lodash: 4.17.21 - plist: 3.0.6 - shelljs: 0.9.2 - yargs: 17.7.1 - - ip-address@10.2.0: {} + optional: true ipaddr.js@1.9.1: {} ipaddr.js@2.2.0: {} - ipx@3.1.1(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2): + ipx@3.1.1(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(srvx@1.0.5): dependencies: '@fastify/accept-negotiator': 2.0.1 citty: 0.1.6 consola: 3.4.2 - defu: 6.1.4 + defu: 6.1.7 destr: 2.0.5 etag: 1.8.1 - h3: 1.15.5 + h3: 1.15.11 image-meta: 0.2.2 - listhen: 1.9.0 + listhen: 1.10.1(srvx@1.0.5) ofetch: 1.5.1 pathe: 2.0.3 - sharp: 0.34.4 + sharp: 0.34.5 svgo: 4.0.0 - ufo: 1.6.3 - unstorage: 1.17.4(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2) + ufo: 1.6.4 + unstorage: 1.17.5(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2)) xss: 1.0.15 transitivePeerDependencies: - '@azure/app-configuration' @@ -42978,6 +40151,7 @@ snapshots: - '@capacitor/preferences' - '@deno/kv' - '@netlify/blobs' + - '@parcel/watcher' - '@planetscale/database' - '@upstash/redis' - '@vercel/blob' @@ -42987,8 +40161,14 @@ snapshots: - db0 - idb-keyval - ioredis + - srvx - uploadthing + iron-session@9.0.1: + dependencies: + cookie: 2.0.1 + iron-webcrypto: 2.0.0 + iron-webcrypto@1.2.1: {} iron-webcrypto@2.0.0: @@ -43008,8 +40188,6 @@ snapshots: is-arrayish@0.2.1: {} - is-arrayish@0.3.4: {} - is-bigint@1.1.0: dependencies: has-bigints: 1.1.0 @@ -43034,18 +40212,12 @@ snapshots: call-bound: 1.0.4 has-tostringtag: 1.0.2 - is-docker@2.2.1: {} - is-docker@3.0.0: {} is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@5.1.0: - dependencies: - get-east-asian-width: 1.6.0 - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -43054,30 +40226,24 @@ snapshots: dependencies: html-tags: 3.3.1 - is-immutable-type@5.0.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + is-immutable-type@5.0.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/type-utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - ts-api-utils: 2.4.0(typescript@6.0.2) - ts-declaration-location: 1.0.5(typescript@6.0.2) - typescript: 6.0.2 + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) + ts-declaration-location: 1.0.7(@typescript/typescript6@6.0.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - is-in-ssh@1.0.0: {} - is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 is-interactive@1.0.0: {} - is-interactive@2.0.0: {} - is-map@2.0.3: {} - is-module@1.0.0: {} - is-network-error@1.1.0: {} is-node-process@1.2.0: {} @@ -43109,14 +40275,6 @@ snapshots: is-property@1.0.2: {} - is-reference@1.2.1: - dependencies: - '@types/estree': 1.0.8 - - is-reference@3.0.3: - dependencies: - '@types/estree': 1.0.8 - is-regex@1.2.1: dependencies: call-bound: 1.0.4 @@ -43130,8 +40288,6 @@ snapshots: dependencies: call-bound: 1.0.4 - is-stream@1.1.0: {} - is-stream@2.0.1: {} is-stream@3.0.0: {} @@ -43168,24 +40324,14 @@ snapshots: call-bound: 1.0.4 get-intrinsic: 1.3.0 - is-what@3.14.1: {} - is-what@4.1.16: {} is-windows@1.0.2: {} - is-wsl@2.2.0: - dependencies: - is-docker: 2.2.1 - - is-wsl@3.1.1: + is-wsl@3.1.0: dependencies: is-inside-container: 1.0.0 - is64bit@2.0.0: - dependencies: - system-architecture: 0.1.0 - isarray@1.0.0: {} isarray@2.0.5: {} @@ -43194,22 +40340,8 @@ snapshots: isexe@2.0.0: {} - isexe@4.0.0: {} - isobject@3.0.1: {} - istanbul-lib-coverage@3.2.2: {} - - istanbul-lib-instrument@6.0.3: - dependencies: - '@babel/core': 7.29.0 - '@babel/parser': 7.29.2 - '@istanbuljs/schema': 0.1.6 - istanbul-lib-coverage: 3.2.2 - semver: 7.8.2 - transitivePeerDependencies: - - supports-color - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -43222,58 +40354,16 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jimp@1.6.0: - dependencies: - '@jimp/core': 1.6.0 - '@jimp/diff': 1.6.0 - '@jimp/js-bmp': 1.6.0 - '@jimp/js-gif': 1.6.0 - '@jimp/js-jpeg': 1.6.0 - '@jimp/js-png': 1.6.0 - '@jimp/js-tiff': 1.6.0 - '@jimp/plugin-blit': 1.6.0 - '@jimp/plugin-blur': 1.6.0 - '@jimp/plugin-circle': 1.6.0 - '@jimp/plugin-color': 1.6.0 - '@jimp/plugin-contain': 1.6.0 - '@jimp/plugin-cover': 1.6.0 - '@jimp/plugin-crop': 1.6.0 - '@jimp/plugin-displace': 1.6.0 - '@jimp/plugin-dither': 1.6.0 - '@jimp/plugin-fisheye': 1.6.0 - '@jimp/plugin-flip': 1.6.0 - '@jimp/plugin-hash': 1.6.0 - '@jimp/plugin-mask': 1.6.0 - '@jimp/plugin-print': 1.6.0 - '@jimp/plugin-quantize': 1.6.0 - '@jimp/plugin-resize': 1.6.0 - '@jimp/plugin-rotate': 1.6.0 - '@jimp/plugin-threshold': 1.6.0 - '@jimp/types': 1.6.0 - '@jimp/utils': 1.6.0 - jiti@2.6.1: {} jiti@2.7.0: {} jju@1.4.0: {} - joi@18.2.3: - dependencies: - '@hapi/address': 5.1.1 - '@hapi/formula': 3.0.2 - '@hapi/hoek': 11.0.7 - '@hapi/pinpoint': 2.0.1 - '@hapi/tlds': 1.1.7 - '@hapi/topo': 6.0.2 - '@standard-schema/spec': 1.1.0 - jose@6.1.0: {} jose@6.1.3: {} - jpeg-js@0.4.4: {} - js-base64@3.7.8: {} js-beautify@1.15.4: @@ -43286,15 +40376,11 @@ snapshots: js-cookie@3.0.5: {} - js-image-generator@1.0.4: - dependencies: - jpeg-js: 0.4.4 - js-sha256@0.11.1: {} - js-tokens@4.0.0: {} + js-tokens@10.0.0: {} - js-tokens@9.0.1: {} + js-tokens@4.0.0: {} js-yaml@3.14.1: dependencies: @@ -43309,15 +40395,15 @@ snapshots: dependencies: argparse: 2.0.1 - jsdom@25.0.1: + jsdom@25.0.1(supports-color@10.2.2): dependencies: cssstyle: 4.2.1 data-urls: 5.0.0 - decimal.js: 10.5.0 - form-data: 4.0.1 + decimal.js: 10.6.0 + form-data: 4.0.5 html-encoding-sniffer: 4.0.0 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 + http-proxy-agent: 7.0.2(supports-color@10.2.2) + https-proxy-agent: 7.0.6(supports-color@10.2.2) is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.16 parse5: 7.3.0 @@ -43330,38 +40416,37 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.1.0 - ws: 8.18.0 + ws: 8.20.0 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - jsdom@27.0.0(postcss@8.5.15): + jsdom@27.0.0(supports-color@10.2.2): dependencies: '@asamuzakjp/dom-selector': 6.5.6 - cssstyle: 5.3.1(postcss@8.5.15) + cssstyle: 5.3.1 data-urls: 6.0.0 - decimal.js: 10.5.0 + decimal.js: 10.6.0 html-encoding-sniffer: 4.0.0 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 + http-proxy-agent: 7.0.2(supports-color@10.2.2) + https-proxy-agent: 7.0.6(supports-color@10.2.2) is-potential-custom-element-name: 1.0.1 parse5: 7.3.0 rrweb-cssom: 0.8.0 saxes: 6.0.0 symbol-tree: 3.2.4 - tough-cookie: 6.0.0 + tough-cookie: 6.0.1 w3c-xmlserializer: 5.0.0 - webidl-conversions: 8.0.0 + webidl-conversions: 8.0.1 whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 15.1.0 - ws: 8.18.3 + ws: 8.20.0 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil - - postcss - supports-color - utf-8-validate @@ -43382,7 +40467,7 @@ snapshots: saxes: 6.0.0 symbol-tree: 3.2.4 tough-cookie: 6.0.1 - undici: 7.28.0 + undici: 7.27.2 w3c-xmlserializer: 5.0.0 webidl-conversions: 8.0.1 whatwg-mimetype: 5.0.0 @@ -43397,8 +40482,6 @@ snapshots: json-parse-even-better-errors@2.3.1: {} - json-parse-even-better-errors@5.0.0: {} - json-schema-ref-resolver@3.0.0: dependencies: dequal: 2.0.3 @@ -43409,31 +40492,19 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} - json-stringify-nice@1.1.4: {} - json5@2.2.3: {} - jsonc-parser@3.2.0: {} - jsonc-parser@3.3.1: {} jsonfile@4.0.0: optionalDependencies: graceful-fs: 4.2.11 - jsonfile@6.2.1: - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - - jsonparse@1.3.1: {} - jsonpointer@5.0.1: {} - jsonwebtoken@9.0.2: + jsonwebtoken@9.0.3: dependencies: - jws: 3.2.2 + jws: 4.0.1 lodash.includes: 4.3.0 lodash.isboolean: 3.0.3 lodash.isinteger: 4.0.4 @@ -43442,33 +40513,25 @@ snapshots: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.8.2 + semver: 7.8.5 junk@4.0.1: {} - just-diff-apply@5.5.0: {} - - just-diff@6.0.2: {} - - jwa@1.4.2: + jwa@2.0.1: dependencies: buffer-equal-constant-time: 1.0.1 ecdsa-sig-formatter: 1.0.11 safe-buffer: 5.2.1 - jws@3.2.2: + jws@4.0.1: dependencies: - jwa: 1.4.2 + jwa: 2.0.1 safe-buffer: 5.2.1 jwt-decode@3.1.2: {} jwt-decode@4.0.0: {} - karma-source-map-support@1.4.0: - dependencies: - source-map-support: 0.5.21 - kebab-case@1.0.2: {} keyv@4.5.4: @@ -43477,14 +40540,8 @@ snapshots: kind-of@6.0.3: {} - kleur@3.0.3: {} - kleur@4.1.5: {} - klona@2.0.6: {} - - knitwork@1.3.0: {} - known-css-properties@0.30.0: {} kolorist@1.8.0: {} @@ -43512,26 +40569,6 @@ snapshots: dependencies: readable-stream: 2.3.8 - less-loader@12.3.1(less@4.4.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - less: 4.4.2 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - - less@4.4.2: - dependencies: - copy-anything: 2.0.6 - parse-node-version: 1.0.1 - tslib: 2.8.1 - optionalDependencies: - errno: 0.1.8 - graceful-fs: 4.2.11 - image-size: 0.5.5 - make-dir: 2.1.0 - mime: 1.6.0 - needle: 3.5.0 - source-map: 0.6.1 - leven@3.1.0: {} levn@0.4.1: @@ -43567,51 +40604,78 @@ snapshots: '@libsql/linux-x64-musl': 0.5.22 '@libsql/win32-x64-msvc': 0.5.22 - license-webpack-plugin@4.0.2(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - webpack-sources: 3.3.3 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - light-my-request@6.6.0: dependencies: - cookie: 1.0.2 + cookie: 1.1.1 process-warning: 4.0.1 set-cookie-parser: 2.7.2 lightningcss-android-arm64@1.32.0: optional: true + lightningcss-android-arm64@1.33.0: + optional: true + lightningcss-darwin-arm64@1.32.0: optional: true + lightningcss-darwin-arm64@1.33.0: + optional: true + lightningcss-darwin-x64@1.32.0: optional: true + lightningcss-darwin-x64@1.33.0: + optional: true + lightningcss-freebsd-x64@1.32.0: optional: true + lightningcss-freebsd-x64@1.33.0: + optional: true + lightningcss-linux-arm-gnueabihf@1.32.0: optional: true + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + lightningcss-linux-arm64-gnu@1.32.0: optional: true + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + lightningcss-linux-arm64-musl@1.32.0: optional: true + lightningcss-linux-arm64-musl@1.33.0: + optional: true + lightningcss-linux-x64-gnu@1.32.0: optional: true + lightningcss-linux-x64-gnu@1.33.0: + optional: true + lightningcss-linux-x64-musl@1.32.0: optional: true + lightningcss-linux-x64-musl@1.33.0: + optional: true + lightningcss-win32-arm64-msvc@1.32.0: optional: true + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + lightningcss-win32-x64-msvc@1.32.0: optional: true + lightningcss-win32-x64-msvc@1.33.0: + optional: true + lightningcss@1.32.0: dependencies: detect-libc: 2.1.2 @@ -43628,83 +40692,62 @@ snapshots: lightningcss-win32-arm64-msvc: 1.32.0 lightningcss-win32-x64-msvc: 1.32.0 + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + lilconfig@2.1.0: {} lines-and-columns@1.2.4: {} lines-and-columns@2.0.3: {} - listhen@1.9.0: + listhen@1.10.1(srvx@1.0.5): dependencies: - '@parcel/watcher': 2.5.1 - '@parcel/watcher-wasm': 2.5.1 - citty: 0.1.6 - clipboardy: 4.0.0 + '@parcel/watcher-wasm': 2.6.0 + citty: 0.2.2 consola: 3.4.2 - crossws: 0.3.5 - defu: 6.1.4 + crossws: 0.4.12(srvx@1.0.5) + defu: 6.1.7 get-port-please: 3.2.0 - h3: 1.15.5 + h3: 1.15.11 http-shutdown: 1.2.2 - jiti: 2.6.1 - mlly: 1.8.0 - node-forge: 1.3.1 - pathe: 1.1.2 - std-env: 3.10.0 - ufo: 1.6.3 - untun: 0.1.3 - uqr: 0.1.2 - - listr2@9.0.5: - dependencies: - cli-truncate: 5.2.0 - colorette: 2.0.20 - eventemitter3: 5.0.4 - log-update: 6.1.0 - rfdc: 1.4.1 - wrap-ansi: 9.0.2 - - lmdb@3.5.1: - dependencies: - '@harperfast/extended-iterable': 1.0.3 - msgpackr: 1.12.1 - node-addon-api: 6.1.0 - node-gyp-build-optional-packages: 5.2.2 - ordered-binary: 1.6.1 - weak-lru-cache: 1.2.2 - optionalDependencies: - '@lmdb/lmdb-darwin-arm64': 3.5.1 - '@lmdb/lmdb-darwin-x64': 3.5.1 - '@lmdb/lmdb-linux-arm': 3.5.1 - '@lmdb/lmdb-linux-arm64': 3.5.1 - '@lmdb/lmdb-linux-x64': 3.5.1 - '@lmdb/lmdb-win32-arm64': 3.5.1 - '@lmdb/lmdb-win32-x64': 3.5.1 - optional: true + jiti: 2.7.0 + node-forge: 1.4.0 + pathe: 2.0.3 + std-env: 4.2.0 + tinyclip: 0.1.15 + ufo: 1.6.4 + untun: 0.2.2 + uqr: 0.1.3 + transitivePeerDependencies: + - srvx loader-runner@4.3.0: {} - loader-runner@4.3.1: {} - loader-utils@2.0.4: dependencies: big.js: 5.2.2 emojis-list: 3.0.0 json5: 2.2.3 - loader-utils@3.3.1: {} - local-pkg@0.5.1: dependencies: mlly: 1.8.0 pkg-types: 1.3.1 - local-pkg@1.1.2: - dependencies: - mlly: 1.8.0 - pkg-types: 2.3.0 - quansync: 0.2.11 - locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -43723,16 +40766,10 @@ snapshots: lodash.clonedeep@4.5.0: {} - lodash.debounce@4.0.8: {} - - lodash.defaults@4.2.0: {} - lodash.flatten@4.4.0: {} lodash.includes@4.3.0: {} - lodash.isarguments@3.1.0: {} - lodash.isboolean@3.0.3: {} lodash.isinteger@4.0.4: {} @@ -43751,38 +40788,11 @@ snapshots: lodash@4.17.21: {} - lodash@4.17.23: {} - - lodash@4.18.1: {} - log-symbols@4.1.0: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 - log-symbols@7.0.1: - dependencies: - is-unicode-supported: 2.1.0 - yoctocolors: 2.1.2 - - log-update@6.1.0: - dependencies: - ansi-escapes: 7.0.0 - cli-cursor: 5.0.0 - slice-ansi: 7.1.2 - strip-ansi: 7.2.0 - wrap-ansi: 9.0.2 - - log4js@6.9.1: - dependencies: - date-format: 4.0.14 - debug: 4.4.3 - flatted: 3.4.2 - rfdc: 1.4.1 - streamroller: 3.1.5 - transitivePeerDependencies: - - supports-color - logform@2.7.0: dependencies: '@colors/colors': 1.6.0 @@ -43804,8 +40814,6 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.2.2: {} - lru-cache@11.5.1: {} lru-cache@5.1.1: @@ -43830,38 +40838,15 @@ snapshots: magic-string@0.30.8: dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/sourcemap-codec': 1.6.0 - magicast@0.5.1: + magic-string@1.4.3: dependencies: - '@babel/parser': 7.29.2 - '@babel/types': 7.29.0 - source-map-js: 1.2.1 + '@jridgewell/sourcemap-codec': 1.6.0 - make-dir@2.1.0: + magic-string@1.4.5: dependencies: - pify: 4.0.1 - semver: 5.7.2 - optional: true - - make-error@1.3.6: {} - - make-fetch-happen@15.0.6: - dependencies: - '@gar/promise-retry': 1.0.3 - '@npmcli/agent': 4.0.2 - '@npmcli/redact': 4.0.0 - cacache: 20.0.4 - http-cache-semantics: 4.2.0 - minipass: 7.1.2 - minipass-fetch: 5.0.2 - minipass-flush: 1.0.7 - minipass-pipeline: 1.2.4 - negotiator: 1.0.0 - proc-log: 6.1.0 - ssri: 13.0.1 - transitivePeerDependencies: - - supports-color + '@jridgewell/sourcemap-codec': 1.6.0 manage-path@2.0.0: {} @@ -43872,17 +40857,6 @@ snapshots: html-link-extractor: 1.0.5 marked: 17.0.1 - marked-terminal@7.3.0(marked@15.0.12): - dependencies: - ansi-escapes: 7.0.0 - ansi-regex: 6.2.2 - chalk: 5.6.2 - cli-highlight: 2.1.11 - cli-table3: 0.6.5 - marked: 15.0.12 - node-emoji: 2.2.0 - supports-hyperlinks: 3.1.0 - marked-terminal@7.3.0(marked@9.1.6): dependencies: ansi-escapes: 7.0.0 @@ -43894,8 +40868,6 @@ snapshots: node-emoji: 2.2.0 supports-hyperlinks: 3.1.0 - marked@15.0.12: {} - marked@17.0.1: {} marked@9.1.6: {} @@ -43917,23 +40889,6 @@ snapshots: tree-dump: 1.0.2(tslib@2.8.1) tslib: 2.8.1 - memfs@4.64.0(tslib@2.8.1): - dependencies: - '@jsonjoy.com/fs-core': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-fsa': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-builtins': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-to-fsa': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-node-utils': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-print': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/fs-snapshot': 4.64.0(tslib@2.8.1) - '@jsonjoy.com/json-pack': 1.21.0(tslib@2.8.1) - '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) - glob-to-regex.js: 1.2.0(tslib@2.8.1) - thingies: 2.6.0(tslib@2.8.1) - tree-dump: 1.1.0(tslib@2.8.1) - tslib: 2.8.1 - merge-anything@5.1.7: dependencies: is-what: 4.1.16 @@ -43975,24 +40930,12 @@ snapshots: mime@1.6.0: {} - mime@3.0.0: {} - - mime@4.1.0: {} - mimic-fn@2.1.0: {} mimic-fn@4.0.0: {} - mimic-function@5.0.1: {} - min-indent@1.0.1: {} - mini-css-extract-plugin@2.10.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - schema-utils: 4.3.3 - tapable: 2.3.0 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - miniflare@4.20260317.0: dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -44005,19 +40948,24 @@ snapshots: - bufferutil - utf-8-validate - minimalistic-assert@1.0.1: {} - - minimatch@10.2.4: + miniflare@5.20261104.0-beta(@types/node@25.0.9): dependencies: - brace-expansion: 5.0.6 + '@cspotcode/source-map-support': 0.8.1 + sharp: 0.35.5(@types/node@25.0.9) + undici: 7.30.1 + workerd: 1.20261104.1 + ws: 8.21.0 + youch: 4.1.0-beta.10 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - utf-8-validate + + minimalistic-assert@1.0.1: {} minimatch@10.2.5: dependencies: - brace-expansion: 5.0.6 - - minimatch@3.0.5: - dependencies: - brace-expansion: 1.1.15 + brace-expansion: 5.0.9 minimatch@3.0.8: dependencies: @@ -44027,10 +40975,6 @@ snapshots: dependencies: brace-expansion: 1.1.15 - minimatch@5.1.9: - dependencies: - brace-expansion: 2.1.1 - minimatch@9.0.1: dependencies: brace-expansion: 2.1.1 @@ -44041,33 +40985,23 @@ snapshots: minimist@1.2.8: {} - minipass-collect@2.0.1: + minimizer-webpack-plugin@5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3): dependencies: - minipass: 7.1.2 - - minipass-fetch@5.0.2: - dependencies: - minipass: 7.1.2 - minipass-sized: 2.0.0 - minizlib: 3.0.1 + '@jridgewell/trace-mapping': 0.3.31 + jest-worker: 27.5.1 + schema-utils: 4.3.3 + terser: 5.51.2 + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) optionalDependencies: - iconv-lite: 0.7.3 - - minipass-flush@1.0.7: - dependencies: - minipass: 3.3.6 - - minipass-pipeline@1.2.4: - dependencies: - minipass: 3.3.6 - - minipass-sized@2.0.0: - dependencies: - minipass: 7.1.2 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 + '@swc/core': 1.15.33(@swc/helpers@0.5.23) + clean-css: 5.3.3 + csso: 5.0.5 + esbuild: 0.28.1 + html-minifier-terser: 6.1.0 + lightningcss: 1.33.0 + postcss: 8.5.29 + sharp: 0.35.5(@types/node@25.0.9) + svgo: 4.0.0 minipass@7.1.2: {} @@ -44087,13 +41021,15 @@ snapshots: acorn: 8.15.0 pathe: 2.0.3 pkg-types: 1.3.1 - ufo: 1.6.3 + ufo: 1.6.4 module-definition@6.0.1: dependencies: ast-module-types: 6.0.1 node-source-walk: 7.0.1 + module-details-from-path@1.0.4: {} + motion-dom@11.18.1: dependencies: motion-utils: 11.18.1 @@ -44104,48 +41040,54 @@ snapshots: mrmime@2.0.0: {} - mrmime@2.0.1: {} - ms@2.0.0: {} ms@2.1.3: {} - msgpackr-extract@3.0.4: + msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2): dependencies: - node-gyp-build-optional-packages: 5.2.2 - optionalDependencies: - '@msgpackr-extract/msgpackr-extract-darwin-arm64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-darwin-x64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-arm': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-arm64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-x64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.4 - optional: true - - msgpackr@1.12.1: - optionalDependencies: - msgpackr-extract: 3.0.4 - optional: true - - msw@2.7.0(@types/node@25.0.9)(typescript@5.9.2): - dependencies: - '@bundled-es-modules/cookie': 2.0.1 - '@bundled-es-modules/statuses': 1.0.1 - '@bundled-es-modules/tough-cookie': 0.1.6 - '@inquirer/confirm': 5.1.21(@types/node@25.0.9) - '@mswjs/interceptors': 0.37.6 - '@open-draft/deferred-promise': 2.2.0 - '@open-draft/until': 2.1.0 - '@types/cookie': 0.6.0 - '@types/statuses': 2.0.5 - graphql: 16.10.0 - headers-polyfill: 4.0.3 + '@inquirer/confirm': 6.3.2(@types/node@25.0.9) + '@mswjs/interceptors': 0.41.9 + '@open-draft/deferred-promise': 3.0.0 + '@types/statuses': 2.0.6 + cookie: 1.1.1 + graphql: 16.14.2 + headers-polyfill: 5.0.1 is-node-process: 1.2.0 outvariant: 1.4.3 path-to-regexp: 6.3.0 picocolors: 1.1.1 + rettime: 0.11.11 + statuses: 2.0.2 strict-event-emitter: 0.5.1 - type-fest: 4.41.0 + tough-cookie: 6.0.1 + type-fest: 5.9.0 + until-async: 3.0.2 + yargs: 17.7.2 + optionalDependencies: + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - '@types/node' + + msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2): + dependencies: + '@inquirer/confirm': 6.3.2(@types/node@25.0.9) + '@mswjs/interceptors': 0.41.9 + '@open-draft/deferred-promise': 3.0.0 + '@types/statuses': 2.0.6 + cookie: 1.1.1 + graphql: 16.14.2 + headers-polyfill: 5.0.1 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + rettime: 0.11.11 + statuses: 2.0.2 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.1 + type-fest: 5.9.0 + until-async: 3.0.2 yargs: 17.7.2 optionalDependencies: typescript: 5.9.2 @@ -44153,12 +41095,12 @@ snapshots: - '@types/node' optional: true - msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2): + msw@2.7.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2): dependencies: '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 '@bundled-es-modules/tough-cookie': 0.1.6 - '@inquirer/confirm': 5.1.21(@types/node@25.0.9) + '@inquirer/confirm': 5.1.4(@types/node@25.0.9) '@mswjs/interceptors': 0.37.6 '@open-draft/deferred-promise': 2.2.0 '@open-draft/until': 2.1.0 @@ -44174,7 +41116,7 @@ snapshots: type-fest: 4.41.0 yargs: 17.7.2 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - '@types/node' @@ -44187,12 +41129,14 @@ snapshots: mute-stream@2.0.0: {} + mute-stream@3.0.0: {} + mysql2@3.15.3: dependencies: aws-ssl-profiles: 1.1.2 denque: 2.1.0 generate-function: 2.3.1 - iconv-lite: 0.7.3 + iconv-lite: 0.7.0 long: 5.3.1 lru.min: 1.1.3 named-placeholders: 1.1.3 @@ -44211,94 +41155,16 @@ snapshots: nanoid@3.3.11: {} - nanoid@3.3.12: {} + nanoid@3.3.18: {} + + nanoid@3.3.19: {} nanostores@1.3.0: {} napi-postinstall@0.3.3: {} - nativescript-dev-xcode@0.8.1: - dependencies: - simple-plist: 1.3.1 - uuid: 9.0.1 - - nativescript@9.0.6(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(debug@4.4.3): - dependencies: - '@foxt/js-srp': 0.0.3-patch2 - '@nativescript/doctor': 2.0.17 - '@nativescript/hook': 3.0.5 - '@npmcli/arborist': 9.1.8 - '@nstudio/trapezedev-project': 7.2.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(typescript@5.7.3) - '@rigor789/resolve-package-path': 1.0.7 - axios: 1.18.1(debug@4.4.3) - byline: 5.0.0 - chokidar: 3.6.0 - cli-table3: 0.6.5 - color: 4.2.3 - convert-source-map: 2.0.0 - detect-newline: 3.1.0 - email-validator: 2.0.4 - esprima: 4.0.1 - font-finder: 1.1.0 - ios-device-lib: 0.9.4 - ios-mobileprovision-finder: 1.2.1 - ios-sim-portable: 4.5.1 - jimp: 1.6.0 - lodash: 4.17.23 - log4js: 6.9.1 - marked: 15.0.12 - marked-terminal: 7.3.0(marked@15.0.12) - minimatch: 10.2.4 - mkdirp: 3.0.1 - mute-stream: 2.0.0 - nativescript-dev-xcode: 0.8.1 - open: 8.4.2 - ora: 5.4.1 - pacote: 21.0.4 - pbxproj-dom: 1.2.0 - plist: 3.1.0 - plist-merge-patch: 0.2.0 - prettier: 3.7.3 - prompts: 2.4.2 - proper-lockfile: 4.1.2 - proxy-lib: 0.4.1 - qr-image: 3.2.0 - qrcode-terminal: 0.12.0 - semver: 7.7.3 - shelljs: 0.10.0 - simple-git: 3.36.0 - simple-plist: 1.4.0 - source-map: 0.7.6 - tar: 7.5.9 - ts-morph: 25.0.1 - tunnel: 0.0.6 - typescript: 5.7.3 - universal-analytics: 0.5.3 - uuid: 11.1.0 - winreg: 1.2.5 - ws: 8.18.3 - xml2js: 0.6.2 - yargs: 17.7.2 - yazl: 3.3.1 - optionalDependencies: - fsevents: 2.3.3 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - bufferutil - - debug - - supports-color - - utf-8-validate - natural-compare@1.4.0: {} - needle@3.5.0: - dependencies: - iconv-lite: 0.6.3 - sax: 1.4.1 - optional: true - negotiator@0.6.3: {} negotiator@0.6.4: {} @@ -44309,286 +41175,91 @@ snapshots: netlify-redirector@0.5.0: {} - nf3@0.3.11: {} + next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.105.1): + dependencies: + '@next/env': 16.3.4 + '@swc/helpers': 0.5.23 + baseline-browser-mapping: 2.11.23 + caniuse-lite: 1.0.30001760 + postcss: 8.5.23 + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-macros@3.1.0)(react@19.2.9) + optionalDependencies: + '@next/swc-darwin-arm64': 16.3.4 + '@next/swc-darwin-x64': 16.3.4 + '@next/swc-linux-arm64-gnu': 16.3.4 + '@next/swc-linux-arm64-musl': 16.3.4 + '@next/swc-linux-x64-gnu': 16.3.4 + '@next/swc-linux-x64-musl': 16.3.4 + '@next/swc-win32-arm64-msvc': 16.3.4 + '@next/swc-win32-x64-msvc': 16.3.4 + '@opentelemetry/api': 1.9.1 + '@playwright/test': 1.63.0 + babel-plugin-react-compiler: 1.0.0 + sass: 1.105.1 + sharp: 0.35.4(@types/node@25.0.9) + transitivePeerDependencies: + - '@babel/core' + - '@types/node' + - babel-plugin-macros + optional: true - nf3@0.3.6: {} + next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.9(react@19.2.9))(react@19.2.9)(sass@1.97.2): + dependencies: + '@next/env': 16.3.4 + '@swc/helpers': 0.5.23 + baseline-browser-mapping: 2.11.23 + caniuse-lite: 1.0.30001760 + postcss: 8.5.23 + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-macros@3.1.0)(react@19.2.9) + optionalDependencies: + '@next/swc-darwin-arm64': 16.3.4 + '@next/swc-darwin-x64': 16.3.4 + '@next/swc-linux-arm64-gnu': 16.3.4 + '@next/swc-linux-arm64-musl': 16.3.4 + '@next/swc-linux-x64-gnu': 16.3.4 + '@next/swc-linux-x64-musl': 16.3.4 + '@next/swc-win32-arm64-msvc': 16.3.4 + '@next/swc-win32-x64-msvc': 16.3.4 + '@opentelemetry/api': 1.9.1 + '@playwright/test': 1.63.0 + babel-plugin-react-compiler: 1.0.0 + sass: 1.97.2 + sharp: 0.35.4(@types/node@25.0.9) + transitivePeerDependencies: + - '@babel/core' + - '@types/node' + - babel-plugin-macros - nice-try@1.0.5: {} + nf3@0.3.24: {} - nitro@3.0.1-alpha.2(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(ioredis@5.9.2)(lru-cache@11.5.1)(mysql2@3.15.3)(rolldown@1.0.2)(rollup@4.56.0)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2): + nitro@3.0.260903-beta: dependencies: consola: 3.4.2 - crossws: 0.4.3(srvx@0.10.1) - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - h3: 2.0.1-rc.14(crossws@0.4.3(srvx@0.10.1)) - jiti: 2.6.1 - nf3: 0.3.6 - ofetch: 2.0.0-alpha.3 - ohash: 2.0.11 - oxc-minify: 0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - oxc-transform: 0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - srvx: 0.10.1 - undici: 7.24.4 + crossws: 0.4.12(srvx@1.0.5) + db0: 0.4.1 + env-runner: 0.2.3 + h3: 2.0.1-rc.32(crossws@0.4.12(srvx@1.0.5))(ocache@0.3.0) + hookable: 6.1.2 + nf3: 0.3.24 + ocache: 0.3.0 + rolldown: 1.2.13 + rou3: 0.9.2 + srvx: 1.0.5 unenv: 2.0.0-rc.24 - unstorage: 2.0.0-alpha.5(@netlify/blobs@10.1.0)(chokidar@5.0.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(lru-cache@11.5.1)(ofetch@2.0.0-alpha.3) - optionalDependencies: - rolldown: 1.0.2 - rollup: 4.56.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - xml2js: 0.6.2 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@deno/kv' - - '@electric-sql/pglite' - - '@emnapi/core' - - '@emnapi/runtime' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/functions' - - '@vercel/kv' - - aws4fetch - - better-sqlite3 - - chokidar - - drizzle-orm - - idb-keyval - - ioredis - - lru-cache - - mongodb - - mysql2 - - sqlite3 - - uploadthing - - nitro@3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2): - dependencies: - consola: 3.4.2 - crossws: 0.4.4(srvx@0.11.15) - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - env-runner: 0.1.6(miniflare@4.20260317.0) - h3: 2.0.1-rc.16(crossws@0.4.4(srvx@0.11.15)) - hookable: 6.1.0 - nf3: 0.3.11 - ocache: 0.1.2 - ofetch: 2.0.0-alpha.3 - ohash: 2.0.11 - rolldown: 1.0.0-rc.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - srvx: 0.11.15 - unenv: 2.0.0-rc.24 - unstorage: 2.0.0-alpha.6(@netlify/blobs@10.1.0)(chokidar@5.0.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(lru-cache@11.5.1)(ofetch@2.0.0-alpha.3) - optionalDependencies: - dotenv: 17.4.2 - giget: 2.0.0 - jiti: 2.7.0 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - xml2js: 0.6.2 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@deno/kv' - - '@electric-sql/pglite' - - '@emnapi/core' - - '@emnapi/runtime' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/functions' - - '@vercel/kv' - - aws4fetch - - better-sqlite3 - - chokidar - - drizzle-orm - - idb-keyval - - ioredis - - lru-cache - - miniflare - - mongodb - - mysql2 - - sqlite3 - - uploadthing - - nitro@3.0.260311-beta(@electric-sql/pglite@0.3.2)(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(chokidar@5.0.0)(dotenv@17.4.2)(giget@2.0.0)(jiti@2.7.0)(lru-cache@11.5.1)(miniflare@4.20260317.0)(mysql2@3.15.3)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0))(xml2js@0.6.2): - dependencies: - consola: 3.4.2 - crossws: 0.4.4(srvx@0.11.15) - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - env-runner: 0.1.6(miniflare@4.20260317.0) - h3: 2.0.1-rc.16(crossws@0.4.4(srvx@0.11.15)) - hookable: 6.1.0 - nf3: 0.3.11 - ocache: 0.1.2 - ofetch: 2.0.0-alpha.3 - ohash: 2.0.11 - rolldown: 1.0.0-rc.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - srvx: 0.11.15 - unenv: 2.0.0-rc.24 - unstorage: 2.0.0-alpha.6(@netlify/blobs@10.1.0)(chokidar@5.0.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(lru-cache@11.5.1)(ofetch@2.0.0-alpha.3) - optionalDependencies: - dotenv: 17.4.2 - giget: 2.0.0 - jiti: 2.7.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - xml2js: 0.6.2 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@deno/kv' - - '@electric-sql/pglite' - - '@emnapi/core' - - '@emnapi/runtime' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/functions' - - '@vercel/kv' - - aws4fetch - - better-sqlite3 - - chokidar - - drizzle-orm - - idb-keyval - - ioredis - - lru-cache - - miniflare - - mongodb - - mysql2 - - sqlite3 - - uploadthing - - nitropack@2.13.1(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(@netlify/blobs@10.1.0)(mysql2@3.15.3)(rolldown@1.0.2)(xml2js@0.6.2): - dependencies: - '@cloudflare/kv-asset-handler': 0.4.2 - '@rollup/plugin-alias': 6.0.0(rollup@4.56.0) - '@rollup/plugin-commonjs': 29.0.0(rollup@4.56.0) - '@rollup/plugin-inject': 5.0.5(rollup@4.56.0) - '@rollup/plugin-json': 6.1.0(rollup@4.56.0) - '@rollup/plugin-node-resolve': 16.0.3(rollup@4.56.0) - '@rollup/plugin-replace': 6.0.3(rollup@4.56.0) - '@rollup/plugin-terser': 0.4.4(rollup@4.56.0) - '@vercel/nft': 1.3.0(rollup@4.56.0) - archiver: 7.0.1 - c12: 3.3.3(magicast@0.5.1) - chokidar: 5.0.0 - citty: 0.1.6 - compatx: 0.2.0 - confbox: 0.2.2 - consola: 3.4.2 - cookie-es: 2.0.0 - croner: 9.1.0 - crossws: 0.3.5 - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - defu: 6.1.4 - destr: 2.0.5 - dot-prop: 10.1.0 - esbuild: 0.27.4 - escape-string-regexp: 5.0.0 - etag: 1.8.1 - exsolve: 1.0.8 - globby: 16.1.0 - gzip-size: 7.0.0 - h3: 1.15.5 - hookable: 5.5.3 - httpxy: 0.1.7 - ioredis: 5.9.2 - jiti: 2.6.1 - klona: 2.0.6 - knitwork: 1.3.0 - listhen: 1.9.0 - magic-string: 0.30.21 - magicast: 0.5.1 - mime: 4.1.0 - mlly: 1.8.0 - node-fetch-native: 1.6.7 - node-mock-http: 1.0.4 - ofetch: 1.5.1 - ohash: 2.0.11 - pathe: 2.0.3 - perfect-debounce: 2.0.0 - pkg-types: 2.3.0 - pretty-bytes: 7.1.0 - radix3: 1.1.2 - rollup: 4.56.0 - rollup-plugin-visualizer: 6.0.5(rolldown@1.0.2)(rollup@4.56.0) - scule: 1.3.0 - semver: 7.7.3 - serve-placeholder: 2.0.2 - serve-static: 2.2.1 - source-map: 0.7.6 - std-env: 3.10.0 - ufo: 1.6.3 - ultrahtml: 1.6.0 - uncrypto: 0.1.3 - unctx: 2.5.0 - unenv: 2.0.0-rc.24 - unimport: 5.6.0 - unplugin-utils: 0.3.1 - unstorage: 1.17.4(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2) - untyped: 2.0.0 - unwasm: 0.5.3 - youch: 4.1.0-beta.13 - youch-core: 0.3.3 - optionalDependencies: - xml2js: 0.6.2 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@deno/kv' - - '@electric-sql/pglite' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/functions' - - '@vercel/kv' - - aws4fetch - - bare-abort-controller - - bare-buffer - - better-sqlite3 - - drizzle-orm - - encoding - - idb-keyval - - mysql2 - - rolldown - - sqlite3 - - supports-color - - uploadthing + unstorage: 2.0.0-alpha.10 no-case@3.0.4: dependencies: lower-case: 2.0.2 tslib: 2.8.1 - node-addon-api@6.1.0: + node-addon-api@7.1.1: optional: true - node-addon-api@7.1.1: {} - node-domexception@1.0.0: {} node-emoji@2.2.0: @@ -44612,28 +41283,12 @@ snapshots: node-forge@1.3.1: {} - node-gyp-build-optional-packages@5.2.2: - dependencies: - detect-libc: 2.1.2 - optional: true + node-forge@1.4.0: {} node-gyp-build@3.9.0: {} node-gyp-build@4.8.4: {} - node-gyp@12.4.0: - dependencies: - env-paths: 2.2.1 - exponential-backoff: 3.1.3 - graceful-fs: 4.2.11 - nopt: 9.0.0 - proc-log: 6.1.0 - semver: 7.8.2 - tar: 7.5.9 - tinyglobby: 0.2.16 - undici: 6.27.0 - which: 6.0.1 - node-mock-http@1.0.4: {} node-releases@2.0.19: {} @@ -44642,7 +41297,7 @@ snapshots: node-source-walk@7.0.1: dependencies: - '@babel/parser': 7.29.2 + '@babel/parser': 7.29.8 node-stream-zip@1.15.0: {} @@ -44654,14 +41309,16 @@ snapshots: dependencies: abbrev: 3.0.0 - nopt@9.0.0: - dependencies: - abbrev: 4.0.0 - normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 - semver: 7.8.2 + semver: 7.8.5 + validate-npm-package-license: 3.0.4 + + normalize-package-data@8.0.0: + dependencies: + hosted-git-info: 9.0.3 + semver: 7.8.5 validate-npm-package-license: 3.0.4 normalize-path@2.1.1: @@ -44670,52 +41327,6 @@ snapshots: normalize-path@3.0.0: {} - npm-bundled@5.0.0: - dependencies: - npm-normalize-package-bin: 5.0.0 - - npm-install-checks@8.0.0: - dependencies: - semver: 7.8.2 - - npm-normalize-package-bin@5.0.0: {} - - npm-package-arg@13.0.2: - dependencies: - hosted-git-info: 9.0.3 - proc-log: 6.1.0 - semver: 7.8.2 - validate-npm-package-name: 7.0.2 - - npm-packlist@10.0.4: - dependencies: - ignore-walk: 8.0.0 - proc-log: 6.1.0 - - npm-pick-manifest@11.0.3: - dependencies: - npm-install-checks: 8.0.0 - npm-normalize-package-bin: 5.0.0 - npm-package-arg: 13.0.2 - semver: 7.8.2 - - npm-registry-fetch@19.1.1: - dependencies: - '@npmcli/redact': 4.0.0 - jsonparse: 1.3.1 - make-fetch-happen: 15.0.6 - minipass: 7.1.2 - minipass-fetch: 5.0.2 - minizlib: 3.0.1 - npm-package-arg: 13.0.2 - proc-log: 6.1.0 - transitivePeerDependencies: - - supports-color - - npm-run-path@2.0.2: - dependencies: - path-key: 2.0.1 - npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -44730,8 +41341,10 @@ snapshots: nwsapi@2.2.16: {} - nx@22.7.5(@swc-node/register@1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))(debug@4.4.3): + nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)): dependencies: + '@clack/core': 1.4.3 + '@clack/prompts': 1.7.0 '@emnapi/core': 1.4.5 '@emnapi/runtime': 1.4.5 '@emnapi/wasi-threads': 1.0.4 @@ -44740,18 +41353,14 @@ snapshots: '@tybys/wasm-util': 0.9.0 '@yarnpkg/lockfile': 1.1.0 '@zkochan/js-yaml': 0.0.7 - ansi-colors: 4.1.3 ansi-regex: 5.0.1 ansi-styles: 4.3.0 argparse: 2.0.1 - asynckit: 0.4.0 - axios: 1.16.0(debug@4.4.3) balanced-match: 4.0.3 base64-js: 1.5.1 bl: 4.1.0 - brace-expansion: 5.0.6 + brace-expansion: 5.0.12 buffer: 5.7.1 - call-bind-apply-helpers: 1.0.2 chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 @@ -44759,83 +41368,63 @@ snapshots: clone: 1.0.4 color-convert: 2.0.1 color-name: 1.1.4 - combined-stream: 1.0.8 defaults: 1.0.4 - define-lazy-prop: 2.0.0 - delayed-stream: 1.0.0 dotenv: 16.4.7 dotenv-expand: 12.0.3 - dunder-proto: 1.0.1 ejs: 5.0.1 emoji-regex: 8.0.0 end-of-stream: 1.4.5 - enquirer: 2.3.6 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.1 - es-set-tostringtag: 2.1.0 escalade: 3.2.0 escape-string-regexp: 1.0.5 + fast-string-truncated-width: 3.0.3 + fast-string-width: 3.0.2 + fast-wrap-ansi: 0.2.0 figures: 3.2.0 - flat: 5.0.2 - follow-redirects: 1.16.0(debug@4.4.3) - form-data: 4.0.5 fs-constants: 1.0.0 - function-bind: 1.1.2 get-caller-file: 2.0.5 - get-intrinsic: 1.3.0 - get-proto: 1.0.1 - gopd: 1.2.0 has-flag: 4.0.0 - has-symbols: 1.1.0 - has-tostringtag: 1.0.2 - hasown: 2.0.2 ieee754: 1.2.1 - ignore: 7.0.5 + ignore: 7.0.12 inherits: 2.0.4 - is-docker: 2.2.1 is-fullwidth-code-point: 3.0.0 is-interactive: 1.0.0 is-unicode-supported: 0.1.0 - is-wsl: 2.2.0 + isexe: 2.0.0 json5: 2.2.3 - jsonc-parser: 3.2.0 + jsonc-parser: 3.3.1 lines-and-columns: 2.0.3 log-symbols: 4.1.0 - math-intrinsics: 1.1.0 - mime-db: 1.52.0 - mime-types: 2.1.35 mimic-fn: 2.1.0 minimatch: 10.2.5 minimist: 1.2.8 npm-run-path: 4.0.1 once: 1.4.0 onetime: 5.1.2 - open: 8.4.2 - ora: 5.3.0 + ora: 5.4.1 path-key: 3.1.1 picocolors: 1.1.1 - proxy-from-env: 2.1.0 readable-stream: 3.6.2 require-directory: 2.1.1 resolve.exports: 2.0.3 restore-cursor: 3.1.0 safe-buffer: 5.2.1 - semver: 7.7.4 + semver: 7.8.5 signal-exit: 3.0.7 - smol-toml: 1.6.1 + sisteransi: 1.0.5 + smol-toml: 1.9.0 string-width: 4.2.3 string_decoder: 1.3.0 strip-ansi: 6.0.1 strip-bom: 3.0.0 supports-color: 7.2.0 tar-stream: 2.2.0 - tmp: 0.2.6 - tree-kill: 1.2.2 + tmp: 0.2.7 tsconfig-paths: 4.2.0 tslib: 2.8.1 + undici: 7.29.0 util-deprecate: 1.0.2 wcwidth: 1.0.1 + which: 3.0.1 wrap-ansi: 7.0.0 wrappy: 1.0.2 y18n: 5.0.8 @@ -44843,20 +41432,18 @@ snapshots: yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@nx/nx-darwin-arm64': 22.7.5 - '@nx/nx-darwin-x64': 22.7.5 - '@nx/nx-freebsd-x64': 22.7.5 - '@nx/nx-linux-arm-gnueabihf': 22.7.5 - '@nx/nx-linux-arm64-gnu': 22.7.5 - '@nx/nx-linux-arm64-musl': 22.7.5 - '@nx/nx-linux-x64-gnu': 22.7.5 - '@nx/nx-linux-x64-musl': 22.7.5 - '@nx/nx-win32-arm64-msvc': 22.7.5 - '@nx/nx-win32-x64-msvc': 22.7.5 - '@swc-node/register': 1.11.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(typescript@6.0.2) + '@nx/nx-darwin-arm64': 24.0.0 + '@nx/nx-darwin-x64': 24.0.0 + '@nx/nx-freebsd-x64': 24.0.0 + '@nx/nx-linux-arm-gnueabihf': 24.0.0 + '@nx/nx-linux-arm64-gnu': 24.0.0 + '@nx/nx-linux-arm64-musl': 24.0.0 + '@nx/nx-linux-x64-gnu': 24.0.0 + '@nx/nx-linux-x64-musl': 24.0.0 + '@nx/nx-win32-arm64-msvc': 24.0.0 + '@nx/nx-win32-x64-msvc': 24.0.0 + '@swc-node/register': 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@swc/core': 1.15.33(@swc/helpers@0.5.23) - transitivePeerDependencies: - - debug nypm@0.6.0: dependencies: @@ -44890,26 +41477,21 @@ snapshots: obuf@1.1.2: {} - obug@2.1.1: {} + obug@2.1.1: + optional: true - ocache@0.1.2: - dependencies: - ohash: 2.0.11 + obug@3.0.0: {} + + ocache@0.3.0: {} ofetch@1.5.1: dependencies: destr: 2.0.5 node-fetch-native: 1.6.7 - ufo: 1.6.3 - - ofetch@2.0.0-alpha.3: {} + ufo: 1.6.4 ohash@2.0.11: {} - omggif@1.0.10: {} - - omit.js@2.0.2: {} - on-exit-leak-free@2.1.2: {} on-finished@2.4.1: @@ -44938,31 +41520,12 @@ snapshots: dependencies: mimic-fn: 4.0.0 - onetime@7.0.0: - dependencies: - mimic-function: 5.0.1 - open@10.1.0: dependencies: default-browser: 5.2.1 define-lazy-prop: 3.0.0 is-inside-container: 1.0.0 - is-wsl: 3.1.1 - - open@11.0.0: - dependencies: - default-browser: 5.5.0 - define-lazy-prop: 3.0.0 - is-in-ssh: 1.0.0 - is-inside-container: 1.0.0 - powershell-utils: 0.1.0 - wsl-utils: 0.3.1 - - open@8.4.2: - dependencies: - define-lazy-prop: 2.0.0 - is-docker: 2.2.1 - is-wsl: 2.2.0 + is-wsl: 3.1.0 optionator@0.9.4: dependencies: @@ -44973,102 +41536,23 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - ora@5.3.0: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.6.1 - is-interactive: 1.0.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - ora@5.4.1: dependencies: bl: 4.1.0 chalk: 4.1.2 cli-cursor: 3.1.0 - cli-spinners: 2.6.1 + cli-spinners: 2.9.2 is-interactive: 1.0.0 is-unicode-supported: 0.1.0 log-symbols: 4.1.0 strip-ansi: 6.0.1 wcwidth: 1.0.1 - ora@9.3.0: - dependencies: - chalk: 5.6.2 - cli-cursor: 5.0.0 - cli-spinners: 3.4.0 - is-interactive: 2.0.0 - is-unicode-supported: 2.1.0 - log-symbols: 7.0.1 - stdin-discarder: 0.3.2 - string-width: 8.2.2 - - ordered-binary@1.6.1: - optional: true - outdent@0.5.0: {} outvariant@1.4.3: {} - oxc-minify@0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - optionalDependencies: - '@oxc-minify/binding-android-arm-eabi': 0.110.0 - '@oxc-minify/binding-android-arm64': 0.110.0 - '@oxc-minify/binding-darwin-arm64': 0.110.0 - '@oxc-minify/binding-darwin-x64': 0.110.0 - '@oxc-minify/binding-freebsd-x64': 0.110.0 - '@oxc-minify/binding-linux-arm-gnueabihf': 0.110.0 - '@oxc-minify/binding-linux-arm-musleabihf': 0.110.0 - '@oxc-minify/binding-linux-arm64-gnu': 0.110.0 - '@oxc-minify/binding-linux-arm64-musl': 0.110.0 - '@oxc-minify/binding-linux-ppc64-gnu': 0.110.0 - '@oxc-minify/binding-linux-riscv64-gnu': 0.110.0 - '@oxc-minify/binding-linux-riscv64-musl': 0.110.0 - '@oxc-minify/binding-linux-s390x-gnu': 0.110.0 - '@oxc-minify/binding-linux-x64-gnu': 0.110.0 - '@oxc-minify/binding-linux-x64-musl': 0.110.0 - '@oxc-minify/binding-openharmony-arm64': 0.110.0 - '@oxc-minify/binding-wasm32-wasi': 0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@oxc-minify/binding-win32-arm64-msvc': 0.110.0 - '@oxc-minify/binding-win32-ia32-msvc': 0.110.0 - '@oxc-minify/binding-win32-x64-msvc': 0.110.0 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - oxc-parser@0.121.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - dependencies: - '@oxc-project/types': 0.121.0 - optionalDependencies: - '@oxc-parser/binding-android-arm-eabi': 0.121.0 - '@oxc-parser/binding-android-arm64': 0.121.0 - '@oxc-parser/binding-darwin-arm64': 0.121.0 - '@oxc-parser/binding-darwin-x64': 0.121.0 - '@oxc-parser/binding-freebsd-x64': 0.121.0 - '@oxc-parser/binding-linux-arm-gnueabihf': 0.121.0 - '@oxc-parser/binding-linux-arm-musleabihf': 0.121.0 - '@oxc-parser/binding-linux-arm64-gnu': 0.121.0 - '@oxc-parser/binding-linux-arm64-musl': 0.121.0 - '@oxc-parser/binding-linux-ppc64-gnu': 0.121.0 - '@oxc-parser/binding-linux-riscv64-gnu': 0.121.0 - '@oxc-parser/binding-linux-riscv64-musl': 0.121.0 - '@oxc-parser/binding-linux-s390x-gnu': 0.121.0 - '@oxc-parser/binding-linux-x64-gnu': 0.121.0 - '@oxc-parser/binding-linux-x64-musl': 0.121.0 - '@oxc-parser/binding-openharmony-arm64': 0.121.0 - '@oxc-parser/binding-wasm32-wasi': 0.121.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@oxc-parser/binding-win32-arm64-msvc': 0.121.0 - '@oxc-parser/binding-win32-ia32-msvc': 0.121.0 - '@oxc-parser/binding-win32-x64-msvc': 0.121.0 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - oxc-resolver@11.19.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): + oxc-resolver@11.19.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3): optionalDependencies: '@oxc-resolver/binding-android-arm-eabi': 11.19.1 '@oxc-resolver/binding-android-arm64': 11.19.1 @@ -45086,7 +41570,7 @@ snapshots: '@oxc-resolver/binding-linux-x64-gnu': 11.19.1 '@oxc-resolver/binding-linux-x64-musl': 11.19.1 '@oxc-resolver/binding-openharmony-arm64': 11.19.1 - '@oxc-resolver/binding-wasm32-wasi': 11.19.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@oxc-resolver/binding-wasm32-wasi': 11.19.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) '@oxc-resolver/binding-win32-arm64-msvc': 11.19.1 '@oxc-resolver/binding-win32-ia32-msvc': 11.19.1 '@oxc-resolver/binding-win32-x64-msvc': 11.19.1 @@ -45094,32 +41578,6 @@ snapshots: - '@emnapi/core' - '@emnapi/runtime' - oxc-transform@0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - optionalDependencies: - '@oxc-transform/binding-android-arm-eabi': 0.110.0 - '@oxc-transform/binding-android-arm64': 0.110.0 - '@oxc-transform/binding-darwin-arm64': 0.110.0 - '@oxc-transform/binding-darwin-x64': 0.110.0 - '@oxc-transform/binding-freebsd-x64': 0.110.0 - '@oxc-transform/binding-linux-arm-gnueabihf': 0.110.0 - '@oxc-transform/binding-linux-arm-musleabihf': 0.110.0 - '@oxc-transform/binding-linux-arm64-gnu': 0.110.0 - '@oxc-transform/binding-linux-arm64-musl': 0.110.0 - '@oxc-transform/binding-linux-ppc64-gnu': 0.110.0 - '@oxc-transform/binding-linux-riscv64-gnu': 0.110.0 - '@oxc-transform/binding-linux-riscv64-musl': 0.110.0 - '@oxc-transform/binding-linux-s390x-gnu': 0.110.0 - '@oxc-transform/binding-linux-x64-gnu': 0.110.0 - '@oxc-transform/binding-linux-x64-musl': 0.110.0 - '@oxc-transform/binding-openharmony-arm64': 0.110.0 - '@oxc-transform/binding-wasm32-wasi': 0.110.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@oxc-transform/binding-win32-arm64-msvc': 0.110.0 - '@oxc-transform/binding-win32-ia32-msvc': 0.110.0 - '@oxc-transform/binding-win32-x64-msvc': 0.110.0 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - p-event@6.0.1: dependencies: p-timeout: 6.1.4 @@ -45128,8 +41586,6 @@ snapshots: dependencies: p-map: 2.1.0 - p-finally@1.0.0: {} - p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -45158,8 +41614,6 @@ snapshots: p-map@7.0.3: {} - p-map@7.0.6: {} - p-retry@6.2.1: dependencies: '@types/retry': 0.12.2 @@ -45170,10 +41624,6 @@ snapshots: p-try@2.2.0: {} - p-wait-for@5.0.2: - dependencies: - p-timeout: 6.1.4 - package-json-from-dist@1.0.1: {} package-manager-detector@0.2.11: @@ -45182,28 +41632,6 @@ snapshots: package-manager-detector@1.6.0: {} - pacote@21.0.4: - dependencies: - '@npmcli/git': 7.0.2 - '@npmcli/installed-package-contents': 4.0.0 - '@npmcli/package-json': 7.0.5 - '@npmcli/promise-spawn': 9.0.1 - '@npmcli/run-script': 10.0.4 - cacache: 20.0.4 - fs-minipass: 3.0.3 - minipass: 7.1.2 - npm-package-arg: 13.0.2 - npm-packlist: 10.0.4 - npm-pick-manifest: 11.0.3 - npm-registry-fetch: 19.1.1 - proc-log: 6.1.0 - promise-retry: 2.0.1 - sigstore: 4.1.1 - ssri: 13.0.1 - tar: 7.4.3 - transitivePeerDependencies: - - supports-color - pako@1.0.11: {} param-case@3.0.4: @@ -45215,21 +41643,6 @@ snapshots: dependencies: callsites: 3.1.0 - parse-bmfont-ascii@1.0.6: {} - - parse-bmfont-binary@1.0.6: {} - - parse-bmfont-xml@1.1.6: - dependencies: - xml-parse-from-string: 1.0.1 - xml2js: 0.5.0 - - parse-conflict-json@5.0.1: - dependencies: - json-parse-even-better-errors: 5.0.0 - just-diff: 6.0.2 - just-diff-apply: 5.5.0 - parse-gitignore@2.0.0: {} parse-imports@2.2.1: @@ -45239,25 +41652,17 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 parse-json@8.3.0: dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 index-to-position: 1.2.0 type-fest: 4.41.0 - parse-node-version@1.0.1: {} - - parse5-html-rewriting-stream@8.0.0: - dependencies: - entities: 6.0.0 - parse5: 8.0.1 - parse5-sax-parser: 8.0.0 - parse5-htmlparser2-tree-adapter@6.0.1: dependencies: parse5: 6.0.1 @@ -45271,10 +41676,6 @@ snapshots: dependencies: parse5: 7.3.0 - parse5-sax-parser@8.0.0: - dependencies: - parse5: 8.0.1 - parse5@5.1.1: {} parse5@6.0.1: {} @@ -45300,8 +41701,6 @@ snapshots: path-exists@5.0.0: {} - path-key@2.0.1: {} - path-key@3.1.1: {} path-key@4.0.0: {} @@ -45315,7 +41714,7 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.2.2 + lru-cache: 11.5.1 minipass: 7.1.2 path-to-regexp@0.1.12: {} @@ -45328,25 +41727,13 @@ snapshots: path-type@6.0.0: {} - pathe@1.1.2: {} - pathe@2.0.3: {} - pbxproj-dom@1.2.0: {} - - peek-readable@4.1.0: {} - pend@1.2.0: {} perfect-debounce@1.0.0: {} - perfect-debounce@2.0.0: {} - - periscopic@4.0.2: - dependencies: - '@types/estree': 1.0.8 - is-reference: 3.0.3 - zimmerframe: 1.1.4 + pg-gateway@0.3.0-beta.4: {} picocolors@1.1.1: {} @@ -45354,7 +41741,7 @@ snapshots: picomatch@4.0.3: {} - picomatch@4.0.4: {} + picomatch@4.0.7: {} picoquery@2.5.0: {} @@ -45382,14 +41769,6 @@ snapshots: pirates@4.0.7: {} - piscina@5.2.0: - optionalDependencies: - '@napi-rs/nice': 1.1.1 - - pixelmatch@5.3.0: - dependencies: - pngjs: 6.0.0 - pkg-dir@4.2.0: dependencies: find-up: 4.1.0 @@ -45403,7 +41782,7 @@ snapshots: pkg-types@2.3.0: dependencies: confbox: 0.2.2 - exsolve: 1.0.8 + exsolve: 1.1.1 pathe: 2.0.3 pkijs@3.4.0: @@ -45415,50 +41794,17 @@ snapshots: pvutils: 1.1.3 tslib: 2.8.1 - playwright-core@1.61.1: {} + playwright-core@1.63.0: {} - playwright@1.61.1: + playwright@1.63.0: dependencies: - playwright-core: 1.61.1 - optionalDependencies: - fsevents: 2.3.2 - - plist-merge-patch@0.2.0: - dependencies: - lodash: 4.17.21 - plist: 3.0.6 - - plist@3.0.6: - dependencies: - base64-js: 1.5.1 - xmlbuilder: 15.1.1 - - plist@3.1.0: - dependencies: - '@xmldom/xmldom': 0.8.13 - base64-js: 1.5.1 - xmlbuilder: 15.1.1 - - pngjs@6.0.0: {} - - pngjs@7.0.0: {} + playwright-core: 1.63.0 possible-typed-array-names@1.1.0: {} - postcss-loader@8.2.0(postcss@8.5.12)(typescript@6.0.2)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): + postcss-loader@8.2.0(@typescript/typescript6@6.0.2)(postcss@8.5.6)(webpack@5.97.1): dependencies: - cosmiconfig: 9.0.0(typescript@6.0.2) - jiti: 2.6.1 - postcss: 8.5.12 - semver: 7.7.3 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - transitivePeerDependencies: - - typescript - - postcss-loader@8.2.0(postcss@8.5.6)(typescript@6.0.2)(webpack@5.97.1): - dependencies: - cosmiconfig: 9.0.0(typescript@6.0.2) + cosmiconfig: 9.0.0(@typescript/typescript6@6.0.2) jiti: 2.6.1 postcss: 8.5.6 semver: 7.7.3 @@ -45467,23 +41813,10 @@ snapshots: transitivePeerDependencies: - typescript - postcss-media-query-parser@0.2.3: {} - - postcss-modules-extract-imports@3.1.0(postcss@8.5.15): - dependencies: - postcss: 8.5.15 - postcss-modules-extract-imports@3.1.0(postcss@8.5.6): dependencies: postcss: 8.5.6 - postcss-modules-local-by-default@4.2.0(postcss@8.5.15): - dependencies: - icss-utils: 5.1.0(postcss@8.5.15) - postcss: 8.5.15 - postcss-selector-parser: 7.1.0 - postcss-value-parser: 4.2.0 - postcss-modules-local-by-default@4.2.0(postcss@8.5.6): dependencies: icss-utils: 5.1.0(postcss@8.5.6) @@ -45491,30 +41824,16 @@ snapshots: postcss-selector-parser: 7.1.0 postcss-value-parser: 4.2.0 - postcss-modules-scope@3.2.1(postcss@8.5.15): - dependencies: - postcss: 8.5.15 - postcss-selector-parser: 7.1.0 - postcss-modules-scope@3.2.1(postcss@8.5.6): dependencies: postcss: 8.5.6 postcss-selector-parser: 7.1.0 - postcss-modules-values@4.0.0(postcss@8.5.15): - dependencies: - icss-utils: 5.1.0(postcss@8.5.15) - postcss: 8.5.15 - postcss-modules-values@4.0.0(postcss@8.5.6): dependencies: icss-utils: 5.1.0(postcss@8.5.6) postcss: 8.5.6 - postcss-safe-parser@7.0.1(postcss@8.5.15): - dependencies: - postcss: 8.5.15 - postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 @@ -45527,24 +41846,24 @@ snapshots: postcss-value-parser@4.2.0: {} - postcss-values-parser@6.0.2(postcss@8.5.15): + postcss-values-parser@6.0.2(postcss@8.5.29): dependencies: color-name: 1.1.4 is-url-superb: 4.0.0 - postcss: 8.5.15 + postcss: 8.5.29 quote-unquote: 1.0.0 - postcss@8.5.12: + postcss@8.5.23: dependencies: - nanoid: 3.3.12 + nanoid: 3.3.18 picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.15: + postcss@8.5.29: dependencies: - nanoid: 3.3.12 + nanoid: 3.3.19 picocolors: 1.1.1 - source-map-js: 1.2.1 + source-map-js: 1.2.2 postcss@8.5.3: dependencies: @@ -45566,8 +41885,6 @@ snapshots: postgres@3.4.7: {} - powershell-utils@0.1.0: {} - pprof-format@2.2.1: {} pprof-to-md@0.1.0: @@ -45584,22 +41901,22 @@ snapshots: preact@10.24.3: {} - precinct@12.2.0: + precinct@12.2.0(supports-color@10.2.2): dependencies: '@dependents/detective-less': 5.0.1 commander: 12.1.0 detective-amd: 6.0.1 detective-cjs: 6.0.1 detective-es6: 5.0.1 - detective-postcss: 7.0.1(postcss@8.5.15) + detective-postcss: 7.0.1(postcss@8.5.29) detective-sass: 6.0.1 detective-scss: 5.0.1 detective-stylus: 5.0.1 - detective-typescript: 14.0.0(typescript@5.9.3) - detective-vue2: 2.2.0(typescript@5.9.3) + detective-typescript: 14.0.0(supports-color@10.2.2)(typescript@5.9.3) + detective-vue2: 2.2.0(supports-color@10.2.2)(typescript@5.9.3) module-definition: 6.0.1 node-source-walk: 7.0.1 - postcss: 8.5.15 + postcss: 8.5.29 typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -45610,17 +41927,13 @@ snapshots: prettier@3.4.2: {} - prettier@3.5.0: {} - prettier@3.6.2: {} - prettier@3.7.3: {} - prettier@3.8.1: {} - pretty-bytes@5.6.0: {} + prettier@3.9.6: {} - pretty-bytes@7.1.0: {} + pretty-bytes@5.6.0: {} pretty-error@4.0.0: dependencies: @@ -45633,24 +41946,22 @@ snapshots: ansi-styles: 5.2.0 react-is: 17.0.2 - prisma@7.0.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(typescript@6.0.2): + prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: '@prisma/config': 7.0.0 - '@prisma/dev': 0.13.0(typescript@6.0.2) + '@prisma/dev': 0.13.0(@typescript/typescript6@6.0.2) '@prisma/engines': 7.0.0 - '@prisma/studio-core-licensed': 0.8.0(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@prisma/studio-core-licensed': 0.8.0(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) mysql2: 3.15.3 postgres: 3.4.7 optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - '@types/react' - magicast - react - react-dom - proc-log@6.1.0: {} - process-nextick-args@2.0.1: {} process-warning@4.0.1: {} @@ -45659,28 +41970,10 @@ snapshots: process@0.11.10: {} - proggy@4.0.0: {} - progress@2.0.3: {} - promise-all-reject-late@1.0.1: {} - - promise-call-limit@3.0.2: {} - promise-limit@2.7.0: {} - promise-retry@2.0.1: - dependencies: - err-code: 2.0.3 - retry: 0.12.0 - - promise-stream-reader@1.0.1: {} - - prompts@2.4.2: - dependencies: - kleur: 3.0.3 - sisteransi: 1.0.5 - prop-types@15.8.1: dependencies: loose-envify: 1.4.0 @@ -45734,11 +42027,6 @@ snapshots: proxy-from-env@2.1.0: {} - proxy-lib@0.4.1: {} - - prr@1.0.1: - optional: true - psl@1.15.0: dependencies: punycode: 2.3.1 @@ -45750,11 +42038,6 @@ snapshots: picocolors: 1.1.1 sade: 1.8.1 - pump@3.0.3: - dependencies: - end-of-stream: 1.4.5 - once: 1.4.0 - punycode@2.3.1: {} pure-rand@6.1.0: {} @@ -45765,10 +42048,6 @@ snapshots: pvutils@1.1.3: {} - qr-image@3.2.0: {} - - qrcode-terminal@0.12.0: {} - qs@6.14.0: dependencies: side-channel: 1.1.0 @@ -45787,60 +42066,60 @@ snapshots: quote-unquote@1.0.0: {} - radix-ui@1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + radix-ui@1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-accessible-icon': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-accordion': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-alert-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-aspect-ratio': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-avatar': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-checkbox': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-collapsible': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-context-menu': 2.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-dropdown-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-form': 0.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-hover-card': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-label': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-menubar': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-navigation-menu': 1.2.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-popover': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-progress': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-radio-group': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-scroll-area': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-select': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-separator': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slider': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-switch': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-tabs': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toast': 1.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toggle': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toggle-group': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-toolbar': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-tooltip': 1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-escape-keydown': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.3) - '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@radix-ui/react-accessible-icon': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-accordion': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-alert-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-aspect-ratio': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-avatar': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-checkbox': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-collapsible': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-collection': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-context-menu': 2.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-dialog': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-direction': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-dismissable-layer': 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-dropdown-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-focus-scope': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-form': 0.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-hover-card': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-label': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-menu': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-menubar': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-navigation-menu': 1.2.6(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-popover': 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-popper': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-portal': 1.1.5(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-presence': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-primitive': 2.0.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-progress': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-radio-group': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-roving-focus': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-scroll-area': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-select': 2.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-separator': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slider': 1.2.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-slot': 1.2.0(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-switch': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-tabs': 1.1.4(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toast': 1.2.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toggle': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toggle-group': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-toolbar': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-tooltip': 1.2.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-controllable-state': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-escape-keydown': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.2.9)(react@19.2.9) + '@radix-ui/react-visually-hidden': 1.1.3(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.9(react@19.2.9))(react@19.2.9) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 '@types/react-dom': 19.2.3(@types/react@19.2.9) @@ -45872,17 +42151,17 @@ snapshots: defu: 6.1.4 destr: 2.0.5 - react-dom@19.2.3(react@19.2.3): + react-dom@19.2.9(react@19.2.9): dependencies: - react: 19.2.3 + react: 19.2.9 scheduler: 0.27.0 - react-hot-toast@2.5.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + react-hot-toast@2.5.1(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: csstype: 3.1.3 goober: 2.1.16(csstype@3.1.3) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) react-is@16.13.1: {} @@ -45895,73 +42174,62 @@ snapshots: gl-matrix: 3.4.4 pprof-format: 2.2.1 protobufjs: 7.5.4 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - - react-reconciler@0.32.0(react@19.2.3): - dependencies: - react: 19.2.3 - scheduler: 0.26.0 - - react-refresh@0.14.2: {} - - react-refresh@0.17.0: {} + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) react-refresh@0.18.0: {} - react-remove-scroll-bar@2.3.8(@types/react@19.2.9)(react@19.2.3): + react-remove-scroll-bar@2.3.8(@types/react@19.2.9)(react@19.2.9): dependencies: - react: 19.2.3 - react-style-singleton: 2.2.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-style-singleton: 2.2.3(@types/react@19.2.9)(react@19.2.9) tslib: 2.8.1 optionalDependencies: '@types/react': 19.2.9 - react-remove-scroll@2.6.3(@types/react@19.2.9)(react@19.2.3): + react-remove-scroll@2.6.3(@types/react@19.2.9)(react@19.2.9): dependencies: - react: 19.2.3 - react-remove-scroll-bar: 2.3.8(@types/react@19.2.9)(react@19.2.3) - react-style-singleton: 2.2.3(@types/react@19.2.9)(react@19.2.3) + react: 19.2.9 + react-remove-scroll-bar: 2.3.8(@types/react@19.2.9)(react@19.2.9) + react-style-singleton: 2.2.3(@types/react@19.2.9)(react@19.2.9) tslib: 2.8.1 - use-callback-ref: 1.3.3(@types/react@19.2.9)(react@19.2.3) - use-sidecar: 1.1.3(@types/react@19.2.9)(react@19.2.3) + use-callback-ref: 1.3.3(@types/react@19.2.9)(react@19.2.9) + use-sidecar: 1.1.3(@types/react@19.2.9)(react@19.2.9) optionalDependencies: '@types/react': 19.2.9 - react-server-dom-rspack@0.0.2(@rspack/core@2.0.0(@swc/helpers@0.5.23))(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + react-server-dom-rspack@0.1.1(@rspack/core@2.2.7(@swc/helpers@0.5.23))(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: - '@rspack/core': 2.0.0(@swc/helpers@0.5.23) - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) - react-style-singleton@2.2.3(@types/react@19.2.9)(react@19.2.3): + react-style-singleton@2.2.3(@types/react@19.2.9)(react@19.2.9): dependencies: get-nonce: 1.0.1 - react: 19.2.3 + react: 19.2.9 tslib: 2.8.1 optionalDependencies: '@types/react': 19.2.9 - react-transition-group@4.4.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + react-transition-group@4.4.5(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: '@babel/runtime': 7.26.7 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) - react-tweet@3.3.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + react-tweet@3.3.0(react-dom@19.2.9(react@19.2.9))(react@19.2.9): dependencies: '@swc/helpers': 0.5.15 clsx: 2.1.1 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - swr: 2.3.4(react@19.2.3) + react: 19.2.9 + react-dom: 19.2.9(react@19.2.9) + swr: 2.3.4(react@19.2.9) - react@19.2.3: {} - - read-cmd-shim@6.0.0: {} + react@19.2.9: {} read-package-up@11.0.0: dependencies: @@ -45969,6 +42237,20 @@ snapshots: read-pkg: 9.0.1 type-fest: 4.41.0 + read-package-up@12.0.0: + dependencies: + find-up-simple: 1.0.1 + read-pkg: 10.1.0 + type-fest: 5.9.0 + + read-pkg@10.1.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 8.0.0 + parse-json: 8.3.0 + type-fest: 5.9.0 + unicorn-magic: 0.4.0 + read-pkg@9.0.1: dependencies: '@types/normalize-package-data': 2.4.4 @@ -46008,13 +42290,9 @@ snapshots: process: 0.11.10 string_decoder: 1.3.0 - readable-web-to-node-stream@3.0.4: + readdir-glob@3.0.0: dependencies: - readable-stream: 4.7.0 - - readdir-glob@1.1.3: - dependencies: - minimatch: 5.1.9 + minimatch: 10.2.5 readdirp@3.6.0: dependencies: @@ -46026,13 +42304,9 @@ snapshots: real-require@0.2.0: {} - rechoir@0.6.2: - dependencies: - resolve: 1.22.11 - rechoir@0.8.0: dependencies: - resolve: 1.22.10 + resolve: 1.22.11 redaxios@0.5.1: {} @@ -46041,26 +42315,22 @@ snapshots: indent-string: 4.0.0 strip-indent: 3.0.0 - redis-errors@1.2.0: {} + redis-errors@1.2.0: + optional: true redis-parser@3.0.0: dependencies: redis-errors: 1.2.0 + optional: true reduce-configs@1.1.1: {} + reduce-configs@2.0.1: {} + reflect-metadata@0.2.2: {} - regenerate-unicode-properties@10.2.2: - dependencies: - regenerate: 1.4.2 - - regenerate@1.4.2: {} - regenerator-runtime@0.14.1: {} - regex-parser@2.3.1: {} - regexp-to-ast@0.5.0: {} regexp.prototype.flags@1.5.4: @@ -46072,21 +42342,6 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 - regexpu-core@6.4.0: - dependencies: - regenerate: 1.4.2 - regenerate-unicode-properties: 10.2.2 - regjsgen: 0.8.0 - regjsparser: 0.13.2 - unicode-match-property-ecmascript: 2.0.0 - unicode-match-property-value-ecmascript: 2.2.1 - - regjsgen@0.8.0: {} - - regjsparser@0.13.2: - dependencies: - jsesc: 3.1.0 - reinterval@1.1.0: {} relateurl@0.2.7: {} @@ -46113,17 +42368,16 @@ snapshots: repeat-string@1.6.1: {} - replace@1.2.2: - dependencies: - chalk: 2.4.2 - minimatch: 3.0.5 - yargs: 15.4.1 - require-directory@2.1.1: {} require-from-string@2.0.2: {} - require-main-filename@2.0.0: {} + require-in-the-middle@8.0.1(supports-color@10.2.2): + dependencies: + debug: 4.4.3(supports-color@10.2.2) + module-details-from-path: 1.0.4 + transitivePeerDependencies: + - supports-color require-package-name@2.0.1: {} @@ -46139,22 +42393,8 @@ snapshots: resolve-pkg-maps@1.0.0: {} - resolve-url-loader@5.0.0: - dependencies: - adjust-sourcemap-loader: 4.0.0 - convert-source-map: 1.9.0 - loader-utils: 2.0.4 - postcss: 8.5.15 - source-map: 0.6.1 - resolve.exports@2.0.3: {} - resolve@1.22.10: - dependencies: - is-core-module: 2.16.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - resolve@1.22.11: dependencies: is-core-module: 2.16.1 @@ -46172,11 +42412,6 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - ret@0.5.0: {} retimer@3.0.0: {} @@ -46185,6 +42420,8 @@ snapshots: retry@0.13.1: {} + rettime@0.11.11: {} + reusify@1.0.4: {} rfdc@1.4.1: {} @@ -46198,121 +42435,67 @@ snapshots: glob: 13.0.0 package-json-from-dist: 1.0.1 - rolldown@1.0.0-rc.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): + rolldown@1.2.13: dependencies: - '@oxc-project/types': 0.113.0 - '@rolldown/pluginutils': 1.0.0-rc.4 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.4 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.4 - '@rolldown/binding-darwin-x64': 1.0.0-rc.4 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.4 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.4 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.4 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.4 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.4 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.4 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.4 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.4 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.4 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - rolldown@1.0.0-rc.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - dependencies: - '@oxc-project/types': 0.115.0 - '@rolldown/pluginutils': 1.0.0-rc.9 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.9 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.9 - '@rolldown/binding-darwin-x64': 1.0.0-rc.9 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.9 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.9 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.9 - '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.9 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.9 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.9 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.9 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - rolldown@1.0.2: - dependencies: - '@oxc-project/types': 0.132.0 + '@oxc-project/types': 0.153.0 '@rolldown/pluginutils': 1.0.1 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.2 - '@rolldown/binding-darwin-arm64': 1.0.2 - '@rolldown/binding-darwin-x64': 1.0.2 - '@rolldown/binding-freebsd-x64': 1.0.2 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.2 - '@rolldown/binding-linux-arm64-gnu': 1.0.2 - '@rolldown/binding-linux-arm64-musl': 1.0.2 - '@rolldown/binding-linux-ppc64-gnu': 1.0.2 - '@rolldown/binding-linux-s390x-gnu': 1.0.2 - '@rolldown/binding-linux-x64-gnu': 1.0.2 - '@rolldown/binding-linux-x64-musl': 1.0.2 - '@rolldown/binding-openharmony-arm64': 1.0.2 - '@rolldown/binding-wasm32-wasi': 1.0.2 - '@rolldown/binding-win32-arm64-msvc': 1.0.2 - '@rolldown/binding-win32-x64-msvc': 1.0.2 + '@rolldown/binding-android-arm-eabi': 1.2.13 + '@rolldown/binding-android-arm64': 1.2.13 + '@rolldown/binding-darwin-arm64': 1.2.13 + '@rolldown/binding-darwin-x64': 1.2.13 + '@rolldown/binding-freebsd-x64': 1.2.13 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.13 + '@rolldown/binding-linux-arm64-gnu': 1.2.13 + '@rolldown/binding-linux-arm64-musl': 1.2.13 + '@rolldown/binding-linux-ppc64-gnu': 1.2.13 + '@rolldown/binding-linux-s390x-gnu': 1.2.13 + '@rolldown/binding-linux-x64-gnu': 1.2.13 + '@rolldown/binding-linux-x64-musl': 1.2.13 + '@rolldown/binding-openharmony-arm64': 1.2.13 + '@rolldown/binding-win32-arm64-msvc': 1.2.13 + '@rolldown/binding-win32-x64-msvc': 1.2.13 - rollup-plugin-visualizer@6.0.5(rolldown@1.0.2)(rollup@4.56.0): + rollup@4.63.1: dependencies: - open: 8.4.2 - picomatch: 4.0.4 - source-map: 0.7.6 - yargs: 17.7.2 + '@types/estree': 1.0.9 optionalDependencies: - rolldown: 1.0.2 - rollup: 4.56.0 - - rollup@4.56.0: - dependencies: - '@types/estree': 1.0.8 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.56.0 - '@rollup/rollup-android-arm64': 4.56.0 - '@rollup/rollup-darwin-arm64': 4.56.0 - '@rollup/rollup-darwin-x64': 4.56.0 - '@rollup/rollup-freebsd-arm64': 4.56.0 - '@rollup/rollup-freebsd-x64': 4.56.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.56.0 - '@rollup/rollup-linux-arm-musleabihf': 4.56.0 - '@rollup/rollup-linux-arm64-gnu': 4.56.0 - '@rollup/rollup-linux-arm64-musl': 4.56.0 - '@rollup/rollup-linux-loong64-gnu': 4.56.0 - '@rollup/rollup-linux-loong64-musl': 4.56.0 - '@rollup/rollup-linux-ppc64-gnu': 4.56.0 - '@rollup/rollup-linux-ppc64-musl': 4.56.0 - '@rollup/rollup-linux-riscv64-gnu': 4.56.0 - '@rollup/rollup-linux-riscv64-musl': 4.56.0 - '@rollup/rollup-linux-s390x-gnu': 4.56.0 - '@rollup/rollup-linux-x64-gnu': 4.56.0 - '@rollup/rollup-linux-x64-musl': 4.56.0 - '@rollup/rollup-openbsd-x64': 4.56.0 - '@rollup/rollup-openharmony-arm64': 4.56.0 - '@rollup/rollup-win32-arm64-msvc': 4.56.0 - '@rollup/rollup-win32-ia32-msvc': 4.56.0 - '@rollup/rollup-win32-x64-gnu': 4.56.0 - '@rollup/rollup-win32-x64-msvc': 4.56.0 + '@napi-rs/lzma-linux-x64-gnu': 1.5.1 + '@rollup/rollup-android-arm-eabi': 4.63.1 + '@rollup/rollup-android-arm64': 4.63.1 + '@rollup/rollup-darwin-arm64': 4.63.1 + '@rollup/rollup-darwin-x64': 4.63.1 + '@rollup/rollup-freebsd-arm64': 4.63.1 + '@rollup/rollup-freebsd-x64': 4.63.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.63.1 + '@rollup/rollup-linux-arm-musleabihf': 4.63.1 + '@rollup/rollup-linux-arm64-gnu': 4.63.1 + '@rollup/rollup-linux-arm64-musl': 4.63.1 + '@rollup/rollup-linux-loong64-gnu': 4.63.1 + '@rollup/rollup-linux-loong64-musl': 4.63.1 + '@rollup/rollup-linux-ppc64-gnu': 4.63.1 + '@rollup/rollup-linux-ppc64-musl': 4.63.1 + '@rollup/rollup-linux-riscv64-gnu': 4.63.1 + '@rollup/rollup-linux-riscv64-musl': 4.63.1 + '@rollup/rollup-linux-s390x-gnu': 4.63.1 + '@rollup/rollup-linux-x64-gnu': 4.63.1 + '@rollup/rollup-linux-x64-musl': 4.63.1 + '@rollup/rollup-openbsd-x64': 4.63.1 + '@rollup/rollup-openharmony-arm64': 4.63.1 + '@rollup/rollup-win32-arm64-msvc': 4.63.1 + '@rollup/rollup-win32-ia32-msvc': 4.63.1 + '@rollup/rollup-win32-x64-gnu': 4.63.1 + '@rollup/rollup-win32-x64-msvc': 4.63.1 fsevents: 2.3.3 + optional: true rou3@0.7.12: {} - rou3@0.8.1: {} + rou3@0.9.2: {} - router@2.2.0: + router@2.2.0(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 @@ -46324,23 +42507,32 @@ snapshots: rrweb-cssom@0.8.0: {} - rspack-vue-loader@17.4.4(vue@3.5.25(typescript@6.0.2))(webpack@5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)): + rsbuild-plugin-cloudflare@0.0.4(@rsbuild/core@2.3.1)(@types/node@25.0.9)(workerd@1.20261104.1): dependencies: - chalk: 4.1.2 - watchpack: 2.4.2 - webpack: 5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4) - optionalDependencies: - vue: 3.5.25(typescript@6.0.2) + '@cloudflare/build-output-utils': 0.9.10 + '@cloudflare/config': 0.30.2 + '@cloudflare/runtime-types': 0.1.23(@types/node@25.0.9) + '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261104.1) + '@rsbuild/core': 2.3.1 + miniflare: 5.20261104.0-beta(@types/node@25.0.9) + unenv: 2.0.0-rc.24 + ws: 8.21.0 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - utf-8-validate + - workerd - rspack-vue-loader@17.5.0(@rspack/core@2.0.8(@swc/helpers@0.5.23))(vue@3.5.25(typescript@6.0.2)): + rspack-vue-loader@17.5.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)): dependencies: '@rspack/lite-tapable': 1.1.0 chalk: 4.1.2 optionalDependencies: - '@rspack/core': 2.0.8(@swc/helpers@0.5.23) - vue: 3.5.25(typescript@6.0.2) + '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + '@vue/compiler-sfc': 3.5.25 + vue: 3.5.25(@typescript/typescript6@6.0.2) - run-applescript@7.0.0: {} + run-applescript@7.1.0: {} run-parallel@1.2.0: dependencies: @@ -46376,26 +42568,107 @@ snapshots: safer-buffer@2.1.2: {} - sass-loader@16.0.7(sass@1.97.3)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): + sass-embedded-all-unknown@1.105.1: dependencies: - neo-async: 2.6.2 + sass: 1.105.1 + optional: true + + sass-embedded-android-arm64@1.105.1: + optional: true + + sass-embedded-android-arm@1.105.1: + optional: true + + sass-embedded-android-riscv64@1.105.1: + optional: true + + sass-embedded-android-x64@1.105.1: + optional: true + + sass-embedded-darwin-arm64@1.105.1: + optional: true + + sass-embedded-darwin-x64@1.105.1: + optional: true + + sass-embedded-linux-arm64@1.105.1: + optional: true + + sass-embedded-linux-arm@1.105.1: + optional: true + + sass-embedded-linux-musl-arm64@1.105.1: + optional: true + + sass-embedded-linux-musl-arm@1.105.1: + optional: true + + sass-embedded-linux-musl-riscv64@1.105.1: + optional: true + + sass-embedded-linux-musl-x64@1.105.1: + optional: true + + sass-embedded-linux-riscv64@1.105.1: + optional: true + + sass-embedded-linux-x64@1.105.1: + optional: true + + sass-embedded-unknown-all@1.105.1: + dependencies: + sass: 1.105.1 + optional: true + + sass-embedded-win32-arm64@1.105.1: + optional: true + + sass-embedded-win32-x64@1.105.1: + optional: true + + sass-embedded@1.105.1: + dependencies: + '@bufbuild/protobuf': 2.16.0 + colorjs.io: 0.7.1 + immutable: 5.1.9 + rxjs: 7.8.2 + supports-color: 8.1.1 + sync-child-process: 1.0.2 + varint: 6.0.0 optionalDependencies: - sass: 1.97.3 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + sass-embedded-all-unknown: 1.105.1 + sass-embedded-android-arm: 1.105.1 + sass-embedded-android-arm64: 1.105.1 + sass-embedded-android-riscv64: 1.105.1 + sass-embedded-android-x64: 1.105.1 + sass-embedded-darwin-arm64: 1.105.1 + sass-embedded-darwin-x64: 1.105.1 + sass-embedded-linux-arm: 1.105.1 + sass-embedded-linux-arm64: 1.105.1 + sass-embedded-linux-musl-arm: 1.105.1 + sass-embedded-linux-musl-arm64: 1.105.1 + sass-embedded-linux-musl-riscv64: 1.105.1 + sass-embedded-linux-musl-x64: 1.105.1 + sass-embedded-linux-riscv64: 1.105.1 + sass-embedded-linux-x64: 1.105.1 + sass-embedded-unknown-all: 1.105.1 + sass-embedded-win32-arm64: 1.105.1 + sass-embedded-win32-x64: 1.105.1 + + sass@1.105.1: + dependencies: + chokidar: 5.0.0 + immutable: 5.1.9 + source-map-js: 1.2.2 + optionalDependencies: + '@parcel/watcher': 2.5.1 + optional: true sass@1.97.2: dependencies: chokidar: 4.0.3 immutable: 5.1.4 - source-map-js: 1.2.1 - optionalDependencies: - '@parcel/watcher': 2.5.1 - - sass@1.97.3: - dependencies: - chokidar: 4.0.3 - immutable: 5.1.4 - source-map-js: 1.2.1 + source-map-js: 1.2.2 optionalDependencies: '@parcel/watcher': 2.5.1 @@ -46405,8 +42678,6 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.26.0: {} - scheduler@0.27.0: {} schema-utils@3.3.0: @@ -46415,21 +42686,12 @@ snapshots: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) - schema-utils@4.3.0: - dependencies: - '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) - schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) - - scule@1.3.0: {} + ajv: 8.18.0 + ajv-formats: 2.1.1 + ajv-keywords: 5.1.0(ajv@8.18.0) secure-json-parse@4.1.0: {} @@ -46440,8 +42702,6 @@ snapshots: '@peculiar/x509': 1.14.3 pkijs: 3.4.0 - semver@5.7.2: {} - semver@6.3.1: {} semver@7.5.4: @@ -46452,13 +42712,13 @@ snapshots: semver@7.7.3: {} - semver@7.7.4: {} - semver@7.8.2: {} - send@0.19.0: + semver@7.8.5: {} + + send@0.19.0(supports-color@10.2.2): dependencies: - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) depd: 2.0.0 destroy: 1.2.0 encodeurl: 1.0.2 @@ -46474,9 +42734,9 @@ snapshots: transitivePeerDependencies: - supports-color - send@1.2.0: + send@1.2.0(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -46496,19 +42756,23 @@ snapshots: dependencies: randombytes: 2.1.0 - serialize-javascript@7.0.7: {} - seroval-plugins@1.5.4(seroval@1.5.4): dependencies: seroval: 1.5.4 + seroval-plugins@1.6.7(seroval@1.6.7): + dependencies: + seroval: 1.6.7 + seroval@1.5.4: {} - serve-index@1.9.1: + seroval@1.6.7: {} + + serve-index@1.9.1(supports-color@10.2.2): dependencies: accepts: 1.3.8 batch: 0.6.1 - debug: 2.6.9 + debug: 2.6.9(supports-color@10.2.2) escape-html: 1.0.3 http-errors: 1.6.3 mime-types: 2.1.35 @@ -46516,30 +42780,24 @@ snapshots: transitivePeerDependencies: - supports-color - serve-placeholder@2.0.2: - dependencies: - defu: 6.1.4 - - serve-static@1.16.2: + serve-static@1.16.2(supports-color@10.2.2): dependencies: encodeurl: 2.0.0 escape-html: 1.0.3 parseurl: 1.3.3 - send: 0.19.0 + send: 0.19.0(supports-color@10.2.2) transitivePeerDependencies: - supports-color - serve-static@2.2.1: + serve-static@2.2.1(supports-color@10.2.2): dependencies: encodeurl: 2.0.0 escape-html: 1.0.3 parseurl: 1.3.3 - send: 1.2.0 + send: 1.2.0(supports-color@10.2.2) transitivePeerDependencies: - supports-color - set-blocking@2.0.0: {} - set-cookie-parser@2.7.2: {} set-cookie-parser@3.1.0: {} @@ -46568,40 +42826,11 @@ snapshots: dependencies: kind-of: 6.0.3 - sharp@0.34.4: - dependencies: - '@img/colour': 1.0.0 - detect-libc: 2.1.2 - semver: 7.8.2 - optionalDependencies: - '@img/sharp-darwin-arm64': 0.34.4 - '@img/sharp-darwin-x64': 0.34.4 - '@img/sharp-libvips-darwin-arm64': 1.2.3 - '@img/sharp-libvips-darwin-x64': 1.2.3 - '@img/sharp-libvips-linux-arm': 1.2.3 - '@img/sharp-libvips-linux-arm64': 1.2.3 - '@img/sharp-libvips-linux-ppc64': 1.2.3 - '@img/sharp-libvips-linux-s390x': 1.2.3 - '@img/sharp-libvips-linux-x64': 1.2.3 - '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 - '@img/sharp-libvips-linuxmusl-x64': 1.2.3 - '@img/sharp-linux-arm': 0.34.4 - '@img/sharp-linux-arm64': 0.34.4 - '@img/sharp-linux-ppc64': 0.34.4 - '@img/sharp-linux-s390x': 0.34.4 - '@img/sharp-linux-x64': 0.34.4 - '@img/sharp-linuxmusl-arm64': 0.34.4 - '@img/sharp-linuxmusl-x64': 0.34.4 - '@img/sharp-wasm32': 0.34.4 - '@img/sharp-win32-arm64': 0.34.4 - '@img/sharp-win32-ia32': 0.34.4 - '@img/sharp-win32-x64': 0.34.4 - sharp@0.34.5: dependencies: - '@img/colour': 1.0.0 + '@img/colour': 1.1.0 detect-libc: 2.1.2 - semver: 7.8.2 + semver: 7.8.5 optionalDependencies: '@img/sharp-darwin-arm64': 0.34.5 '@img/sharp-darwin-x64': 0.34.5 @@ -46628,34 +42857,83 @@ snapshots: '@img/sharp-win32-ia32': 0.34.5 '@img/sharp-win32-x64': 0.34.5 - shebang-command@1.2.0: + sharp@0.35.4(@types/node@25.0.9): dependencies: - shebang-regex: 1.0.0 + '@img/colour': 1.1.0 + detect-libc: 2.1.2 + semver: 7.8.5 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.35.4 + '@img/sharp-darwin-x64': 0.35.4 + '@img/sharp-freebsd-wasm32': 0.35.4 + '@img/sharp-libvips-darwin-arm64': 1.3.3 + '@img/sharp-libvips-darwin-x64': 1.3.3 + '@img/sharp-libvips-linux-arm': 1.3.3 + '@img/sharp-libvips-linux-arm64': 1.3.3 + '@img/sharp-libvips-linux-ppc64': 1.3.3 + '@img/sharp-libvips-linux-riscv64': 1.3.3 + '@img/sharp-libvips-linux-s390x': 1.3.3 + '@img/sharp-libvips-linux-x64': 1.3.3 + '@img/sharp-libvips-linuxmusl-arm64': 1.3.3 + '@img/sharp-libvips-linuxmusl-x64': 1.3.3 + '@img/sharp-linux-arm': 0.35.4 + '@img/sharp-linux-arm64': 0.35.4 + '@img/sharp-linux-ppc64': 0.35.4 + '@img/sharp-linux-riscv64': 0.35.4 + '@img/sharp-linux-s390x': 0.35.4 + '@img/sharp-linux-x64': 0.35.4 + '@img/sharp-linuxmusl-arm64': 0.35.4 + '@img/sharp-linuxmusl-x64': 0.35.4 + '@img/sharp-webcontainers-wasm32': 0.35.4 + '@img/sharp-win32-arm64': 0.35.4 + '@img/sharp-win32-ia32': 0.35.4 + '@img/sharp-win32-x64': 0.35.4 + '@types/node': 25.0.9 + optional: true + + sharp@0.35.5(@types/node@25.0.9): + dependencies: + '@img/colour': 1.1.0 + detect-libc: 2.1.2 + semver: 7.8.5 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.35.5 + '@img/sharp-darwin-x64': 0.35.5 + '@img/sharp-freebsd-wasm32': 0.35.5 + '@img/sharp-libvips-darwin-arm64': 1.3.4 + '@img/sharp-libvips-darwin-x64': 1.3.4 + '@img/sharp-libvips-linux-arm': 1.3.4 + '@img/sharp-libvips-linux-arm64': 1.3.4 + '@img/sharp-libvips-linux-ppc64': 1.3.4 + '@img/sharp-libvips-linux-riscv64': 1.3.4 + '@img/sharp-libvips-linux-s390x': 1.3.4 + '@img/sharp-libvips-linux-x64': 1.3.4 + '@img/sharp-libvips-linuxmusl-arm64': 1.3.4 + '@img/sharp-libvips-linuxmusl-x64': 1.3.4 + '@img/sharp-linux-arm': 0.35.5 + '@img/sharp-linux-arm64': 0.35.5 + '@img/sharp-linux-ppc64': 0.35.5 + '@img/sharp-linux-riscv64': 0.35.5 + '@img/sharp-linux-s390x': 0.35.5 + '@img/sharp-linux-x64': 0.35.5 + '@img/sharp-linuxmusl-arm64': 0.35.5 + '@img/sharp-linuxmusl-x64': 0.35.5 + '@img/sharp-webcontainers-wasm32': 0.35.5 + '@img/sharp-win32-arm64': 0.35.5 + '@img/sharp-win32-ia32': 0.35.5 + '@img/sharp-win32-x64': 0.35.5 + '@types/node': 25.0.9 shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - shebang-regex@1.0.0: {} - shebang-regex@3.0.0: {} shell-quote@1.8.2: {} shell-quote@1.8.3: {} - shelljs@0.10.0: - dependencies: - execa: 5.1.1 - fast-glob: 3.3.3 - - shelljs@0.9.2: - dependencies: - execa: 1.0.0 - fast-glob: 3.3.3 - interpret: 1.4.0 - rechoir: 0.6.2 - side-channel-list@1.0.0: dependencies: es-errors: 1.3.0 @@ -46684,53 +42962,15 @@ snapshots: side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 - siginfo@2.0.0: {} + siginfo@2.0.0: + optional: true signal-exit@3.0.7: {} signal-exit@4.1.0: {} - sigstore@4.1.1: - dependencies: - '@sigstore/bundle': 4.0.0 - '@sigstore/core': 3.2.1 - '@sigstore/protobuf-specs': 0.5.1 - '@sigstore/sign': 4.1.1 - '@sigstore/tuf': 4.0.2 - '@sigstore/verify': 3.1.1 - transitivePeerDependencies: - - supports-color - - simple-git@3.36.0: - dependencies: - '@kwsites/file-exists': 1.1.1 - '@kwsites/promise-deferred': 1.1.1 - '@simple-git/args-pathspec': 1.0.3 - '@simple-git/argv-parser': 1.1.1 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - simple-icons@14.9.0: {} - simple-plist@1.3.1: - dependencies: - bplist-creator: 0.1.0 - bplist-parser: 0.3.1 - plist: 3.1.0 - - simple-plist@1.4.0: - dependencies: - bplist-creator: 0.1.1 - bplist-parser: 0.3.2 - plist: 3.1.0 - - simple-swizzle@0.2.4: - dependencies: - is-arrayish: 0.3.4 - - simple-xml-to-json@1.2.7: {} - sirv@3.0.2: dependencies: '@polka/url': 1.0.0-next.28 @@ -46745,51 +42985,18 @@ snapshots: slash@3.0.0: {} - slash@5.1.0: {} - slashes@3.0.12: {} - slice-ansi@4.0.0: - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - - slice-ansi@7.1.2: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - - slice-ansi@8.0.0: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - - smart-buffer@4.2.0: {} - - smob@1.5.0: {} - smol-toml@1.6.1: {} + smol-toml@1.9.0: {} + sockjs@0.3.24: dependencies: faye-websocket: 0.11.4 uuid: 8.3.2 websocket-driver: 0.7.4 - socks-proxy-agent@8.0.5: - dependencies: - agent-base: 7.1.3 - debug: 4.4.3 - socks: 2.8.9 - transitivePeerDependencies: - - supports-color - - socks@2.8.9: - dependencies: - ip-address: 10.2.0 - smart-buffer: 4.2.0 - solid-js@1.9.12: dependencies: csstype: 3.2.3 @@ -46806,19 +43013,19 @@ snapshots: csstype: 3.1.3 solid-js: 1.9.12 - solid-refresh@0.6.3(solid-js@1.9.12): + solid-refresh@0.6.3(solid-js@1.9.12)(supports-color@10.2.2): dependencies: - '@babel/generator': 7.29.1 - '@babel/helper-module-imports': 7.27.1 - '@babel/types': 7.29.0 + '@babel/generator': 7.29.8 + '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) + '@babel/types': 7.29.8 solid-js: 1.9.12 transitivePeerDependencies: - supports-color solid-refresh@0.7.8(solid-js@1.9.12): dependencies: - '@babel/generator': 7.29.1 - '@babel/types': 7.29.0 + '@babel/generator': 7.29.8 + '@babel/types': 7.29.8 solid-js: 1.9.12 sonic-boom@4.2.0: @@ -46827,11 +43034,7 @@ snapshots: source-map-js@1.2.1: {} - source-map-loader@5.0.0(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - iconv-lite: 0.6.3 - source-map-js: 1.2.1 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + source-map-js@1.2.2: {} source-map-support@0.5.21: dependencies: @@ -46863,16 +43066,11 @@ snapshots: spdx-exceptions: 2.5.0 spdx-license-ids: 3.0.22 - spdx-expression-parse@4.0.0: - dependencies: - spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.22 - spdx-license-ids@3.0.22: {} - spdy-transport@3.0.0: + spdy-transport@3.0.0(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -46881,13 +43079,13 @@ snapshots: transitivePeerDependencies: - supports-color - spdy@4.0.2: + spdy@4.0.2(supports-color@10.2.2): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 - spdy-transport: 3.0.0 + spdy-transport: 3.0.0(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -46902,17 +43100,9 @@ snapshots: sqlstring@2.3.3: {} - srvx@0.10.0: {} + srvx@1.0.5: {} - srvx@0.10.1: {} - - srvx@0.11.12: {} - - srvx@0.11.15: {} - - ssri@13.0.1: - dependencies: - minipass: 7.1.2 + srvx@1.0.8: {} stable-hash-x@0.2.0: {} @@ -46920,9 +43110,11 @@ snapshots: stack-trace@1.0.0-pre2: {} - stackback@0.0.2: {} + stackback@0.0.2: + optional: true - standard-as-callback@2.1.0: {} + standard-as-callback@2.1.0: + optional: true standardwebhooks@1.0.0: dependencies: @@ -46944,32 +43136,15 @@ snapshots: std-env@3.9.0: {} - std-env@4.1.0: {} + std-env@4.2.0: {} - stdin-discarder@0.3.2: {} + std-env@4.3.0: {} stop-iteration-iterator@1.1.0: dependencies: es-errors: 1.3.0 internal-slot: 1.1.0 - stream-buffers@2.2.0: {} - - streamroller@3.1.5: - dependencies: - date-format: 4.0.14 - debug: 4.4.3 - fs-extra: 8.1.0 - transitivePeerDependencies: - - supports-color - - streamx@2.22.0: - dependencies: - fast-fifo: 1.3.2 - text-decoder: 1.2.3 - optionalDependencies: - bare-events: 2.5.4 - streamx@2.27.0: dependencies: events-universal: 1.0.1 @@ -46996,17 +43171,6 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.2.0 - string-width@7.2.0: - dependencies: - emoji-regex: 10.6.0 - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - - string-width@8.2.2: - dependencies: - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 @@ -47025,10 +43189,6 @@ snapshots: strip-bom@3.0.0: {} - strip-eof@1.0.0: {} - - strip-final-newline@2.0.0: {} - strip-final-newline@3.0.0: {} strip-indent@3.0.0: @@ -47037,14 +43197,15 @@ snapshots: strip-json-comments@3.1.1: {} - strip-literal@3.1.0: + strip-literal@4.0.0: dependencies: - js-tokens: 9.0.1 + js-tokens: 10.0.0 - strtok3@6.3.0: + stubborn-fs@2.0.0: dependencies: - '@tokenizer/token': 0.3.0 - peek-readable: 4.1.0 + stubborn-utils: 1.0.2 + + stubborn-utils@1.0.2: {} style-loader@4.0.0(webpack@5.97.1): dependencies: @@ -47054,14 +43215,18 @@ snapshots: dependencies: inline-style-parser: 0.2.4 + styled-jsx@5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-macros@3.1.0)(react@19.2.9): + dependencies: + client-only: 0.0.1 + react: 19.2.9 + optionalDependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) + babel-plugin-macros: 3.1.0 + stylis@4.2.0: {} supports-color@10.2.2: {} - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -47093,15 +43258,19 @@ snapshots: '@swc/counter': 0.1.3 webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) - swr@2.3.4(react@19.2.3): + swr@2.3.4(react@19.2.9): dependencies: dequal: 2.0.3 - react: 19.2.3 - use-sync-external-store: 1.6.0(react@19.2.3) + react: 19.2.9 + use-sync-external-store: 1.6.0(react@19.2.9) symbol-tree@3.2.4: {} - system-architecture@0.1.0: {} + sync-child-process@1.0.2: + dependencies: + sync-message-port: 1.2.0 + + sync-message-port@1.2.0: {} tagged-tag@1.0.0: {} @@ -47111,9 +43280,11 @@ snapshots: tailwindcss@4.2.2: {} + tailwindcss@4.3.1: {} + tapable@2.2.1: {} - tapable@2.3.0: {} + tapable@2.3.3: {} tar-stream@2.2.0: dependencies: @@ -47128,7 +43299,7 @@ snapshots: b4a: 1.6.7 bare-fs: 4.7.2 fast-fifo: 1.3.2 - streamx: 2.22.0 + streamx: 2.27.0 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -47142,7 +43313,7 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - tar@7.5.9: + tar@7.5.22: dependencies: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0 @@ -47162,7 +43333,7 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 - schema-utils: 4.3.0 + schema-utils: 4.3.3 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) @@ -47170,23 +43341,11 @@ snapshots: '@swc/core': 1.15.33(@swc/helpers@0.5.23) esbuild: 0.27.4 - terser-webpack-plugin@5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - '@jridgewell/trace-mapping': 0.3.31 - jest-worker: 27.5.1 - schema-utils: 4.3.0 - serialize-javascript: 6.0.2 - terser: 5.37.0 - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - optionalDependencies: - '@swc/core': 1.15.33(@swc/helpers@0.5.23) - esbuild: 0.28.1 - terser-webpack-plugin@5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.97.1): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 - schema-utils: 4.3.0 + schema-utils: 4.3.3 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) @@ -47194,30 +43353,6 @@ snapshots: '@swc/core': 1.15.33(@swc/helpers@0.5.23) esbuild: 0.28.1 - terser-webpack-plugin@5.3.16(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack@5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)): - dependencies: - '@jridgewell/trace-mapping': 0.3.31 - jest-worker: 27.5.1 - schema-utils: 4.3.3 - serialize-javascript: 6.0.2 - terser: 5.37.0 - webpack: 5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4) - optionalDependencies: - '@swc/core': 1.15.33(@swc/helpers@0.5.23) - esbuild: 0.27.4 - - terser-webpack-plugin@5.3.16(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - '@jridgewell/trace-mapping': 0.3.31 - jest-worker: 27.5.1 - schema-utils: 4.3.3 - serialize-javascript: 6.0.2 - terser: 5.37.0 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - optionalDependencies: - '@swc/core': 1.15.33(@swc/helpers@0.5.23) - esbuild: 0.28.1 - terser@5.37.0: dependencies: '@jridgewell/source-map': 0.3.6 @@ -47225,17 +43360,13 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 - terser@5.46.0: + terser@5.51.2: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.15.0 + acorn: 8.18.0 commander: 2.20.3 source-map-support: 0.5.21 - text-decoder@1.2.3: - dependencies: - b4a: 1.6.7 - text-decoder@1.2.7: dependencies: b4a: 1.6.7 @@ -47254,10 +43385,6 @@ snapshots: dependencies: tslib: 2.8.1 - thingies@2.6.0(tslib@2.8.1): - dependencies: - tslib: 2.8.1 - thread-stream@4.0.0: dependencies: real-require: 0.2.0 @@ -47266,25 +43393,28 @@ snapshots: timestring@6.0.0: {} - tinybench@2.9.0: {} + tinybench@2.9.0: + optional: true - tinycolor2@1.6.0: {} + tinybench@6.2.2: {} + + tinyclip@0.1.15: {} tinyexec@0.3.2: {} - tinyexec@1.0.2: {} + tinyexec@1.3.1: {} tinyglobby@0.2.15: dependencies: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 - tinyglobby@0.2.16: + tinyglobby@0.2.17: dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 - tinyrainbow@3.1.0: {} + tinyrainbow@3.2.0: {} tldts-core@6.1.76: {} @@ -47302,8 +43432,6 @@ snapshots: dependencies: tmp: 0.2.7 - tmp@0.2.6: {} - tmp@0.2.7: {} to-regex-range@5.0.1: @@ -47314,12 +43442,7 @@ snapshots: toidentifier@1.0.1: {} - token-types@4.2.1: - dependencies: - '@tokenizer/token': 0.3.0 - ieee754: 1.2.1 - - toml@3.0.0: {} + toml@4.3.0: {} tomlify-j0.4@3.0.0: {} @@ -47336,10 +43459,6 @@ snapshots: dependencies: tldts: 6.1.76 - tough-cookie@6.0.0: - dependencies: - tldts: 7.0.16 - tough-cookie@6.0.1: dependencies: tldts: 7.0.16 @@ -47358,16 +43477,14 @@ snapshots: dependencies: tslib: 2.8.1 - tree-dump@1.1.0(tslib@2.8.1): - dependencies: - tslib: 2.8.1 - tree-kill@1.2.2: {} - treeverse@3.0.0: {} - triple-beam@1.4.1: {} + ts-api-utils@2.1.0(@typescript/typescript6@6.0.2): + dependencies: + typescript: '@typescript/typescript6@6.0.2' + ts-api-utils@2.1.0(typescript@5.8.3): dependencies: typescript: 5.8.3 @@ -47376,9 +43493,9 @@ snapshots: dependencies: typescript: 5.9.2 - ts-api-utils@2.1.0(typescript@6.0.2): + ts-api-utils@2.4.0(@typescript/typescript6@6.0.2): dependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' ts-api-utils@2.4.0(typescript@5.9.2): dependencies: @@ -47388,55 +43505,20 @@ snapshots: dependencies: typescript: 5.9.3 - ts-api-utils@2.4.0(typescript@6.0.2): + ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2): dependencies: - typescript: 6.0.2 - - ts-declaration-location@1.0.5(typescript@6.0.2): - dependencies: - minimatch: 10.2.5 - typescript: 6.0.2 - - ts-declaration-location@1.0.7(typescript@6.0.2): - dependencies: - picomatch: 4.0.4 - typescript: 6.0.2 - - ts-morph@21.0.1: - dependencies: - '@ts-morph/common': 0.22.0 - code-block-writer: 12.0.0 - - ts-morph@25.0.1: - dependencies: - '@ts-morph/common': 0.26.1 - code-block-writer: 13.0.3 - - ts-node@10.9.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(@types/node@25.0.9)(typescript@5.7.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.12 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 25.0.9 - acorn: 8.15.0 - acorn-walk: 8.3.5 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.4 - make-error: 1.3.6 - typescript: 5.7.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - optionalDependencies: - '@swc/core': 1.15.33(@swc/helpers@0.5.23) + picomatch: 4.0.7 + typescript: '@typescript/typescript6@6.0.2' ts-pattern@5.6.2: {} - tsconfck@3.1.4(typescript@6.0.2): + tsconfck@3.1.4(@typescript/typescript6@6.0.2): optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' + + tsconfck@3.1.4(typescript@5.9.2): + optionalDependencies: + typescript: 5.9.2 tsconfig-paths@4.2.0: dependencies: @@ -47459,17 +43541,7 @@ snapshots: dependencies: tslib: 1.14.1 - tuf-js@4.1.0: - dependencies: - '@tufjs/models': 4.1.0 - debug: 4.4.3 - make-fetch-happen: 15.0.6 - transitivePeerDependencies: - - supports-color - - tunnel@0.0.6: {} - - turbo-stream@3.1.0: {} + turbo-stream@3.2.1: {} type-check@0.4.0: dependencies: @@ -47477,9 +43549,11 @@ snapshots: type-fest@0.20.2: {} + type-fest@0.21.3: {} + type-fest@4.41.0: {} - type-fest@5.4.1: + type-fest@5.9.0: dependencies: tagged-tag: 1.0.0 @@ -47494,27 +43568,25 @@ snapshots: media-typer: 1.1.0 mime-types: 3.0.1 - typed-assert@1.0.9: {} - - typescript-eslint@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + typescript-eslint@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/parser': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/typescript-estree': 8.44.1(typescript@6.0.2) - '@typescript-eslint/utils': 8.44.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 + '@typescript-eslint/eslint-plugin': 8.44.1(@typescript-eslint/parser@8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.44.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - typescript-eslint@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2): + typescript-eslint@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2))(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/parser': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - '@typescript-eslint/typescript-estree': 8.57.1(typescript@6.0.2) - '@typescript-eslint/utils': 8.57.1(eslint@9.22.0(jiti@2.7.0))(typescript@6.0.2) - eslint: 9.22.0(jiti@2.7.0) - typescript: 6.0.2 + '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -47522,8 +43594,6 @@ snapshots: typescript@5.4.2: {} - typescript@5.5.4: {} - typescript@5.6.1-rc: {} typescript@5.6.3: {} @@ -47538,118 +43608,99 @@ snapshots: typescript@6.0.2: {} - ufo@1.6.1: {} + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 - ufo@1.6.3: {} + ufo@1.6.4: {} uint8array-extras@1.5.0: {} ulid@3.0.1: {} - ultrahtml@1.6.0: {} - uncrypto@0.1.3: {} - unctx@2.5.0: - dependencies: - acorn: 8.15.0 - estree-walker: 3.0.3 - magic-string: 0.30.21 - unplugin: 2.3.11 - undici-types@7.16.0: {} undici-types@7.24.4: {} - undici@6.27.0: {} + undici@6.21.2: {} undici@7.24.4: {} - undici@7.28.0: {} + undici@7.27.2: {} - undom-ng@1.1.2: {} + undici@7.29.0: {} + + undici@7.30.1: {} unenv@2.0.0-rc.24: dependencies: pathe: 2.0.3 - unicode-canonical-property-names-ecmascript@2.0.1: {} - unicode-emoji-modifier-base@1.0.0: {} - unicode-match-property-ecmascript@2.0.0: - dependencies: - unicode-canonical-property-names-ecmascript: 2.0.1 - unicode-property-aliases-ecmascript: 2.2.0 - - unicode-match-property-value-ecmascript@2.2.1: {} - - unicode-property-aliases-ecmascript@2.2.0: {} - unicorn-magic@0.1.0: {} unicorn-magic@0.4.0: {} - unimport@5.6.0: - dependencies: - acorn: 8.15.0 - escape-string-regexp: 5.0.0 - estree-walker: 3.0.3 - local-pkg: 1.1.2 - magic-string: 0.30.21 - mlly: 1.8.0 - pathe: 2.0.3 - picomatch: 4.0.4 - pkg-types: 2.3.0 - scule: 1.3.0 - strip-literal: 3.1.0 - tinyglobby: 0.2.16 - unplugin: 2.3.11 - unplugin-utils: 0.3.1 - - universal-analytics@0.5.3: - dependencies: - debug: 4.4.3 - uuid: 8.3.2 - transitivePeerDependencies: - - supports-color - universalify@0.1.2: {} universalify@0.2.0: {} - universalify@2.0.1: {} - unixify@1.0.0: dependencies: normalize-path: 2.1.1 unpipe@1.0.0: {} - unplugin-utils@0.3.1: - dependencies: - pathe: 2.0.3 - picomatch: 4.0.4 - unplugin@1.0.1: dependencies: acorn: 8.15.0 chokidar: 3.6.0 - webpack-sources: 3.2.3 + webpack-sources: 3.3.3 webpack-virtual-modules: 0.5.0 unplugin@2.3.11: dependencies: '@jridgewell/remapping': 2.3.5 acorn: 8.15.0 - picomatch: 4.0.4 + picomatch: 4.0.7 webpack-virtual-modules: 0.6.2 - unplugin@3.0.0: + unplugin@3.7.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(esbuild@0.28.1)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3): dependencies: '@jridgewell/remapping': 2.3.5 - picomatch: 4.0.3 + '@rolldown/pluginutils': 1.0.1 + picomatch: 4.0.7 webpack-virtual-modules: 0.6.2 + optionalDependencies: + '@rsbuild/core': 2.3.1 + '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + esbuild: 0.28.1 + rolldown: 1.2.13 + rollup: 4.63.1 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) unrs-resolver@1.11.1: dependencies: @@ -47675,64 +43726,26 @@ snapshots: '@unrs/resolver-binding-win32-ia32-msvc': 1.11.1 '@unrs/resolver-binding-win32-x64-msvc': 1.11.1 - unstorage@1.17.4(@netlify/blobs@10.1.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2): + unstorage@1.17.5(@netlify/blobs@11.0.3(supports-color@10.2.2))(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2)): dependencies: anymatch: 3.1.3 chokidar: 5.0.0 destr: 2.0.5 - h3: 1.15.5 - lru-cache: 11.2.2 + h3: 1.15.11 + lru-cache: 11.5.1 node-fetch-native: 1.6.7 ofetch: 1.5.1 - ufo: 1.6.3 + ufo: 1.6.4 optionalDependencies: - '@netlify/blobs': 10.1.0 - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - ioredis: 5.9.2 + '@netlify/blobs': 11.0.3(supports-color@10.2.2) + db0: 0.4.1 + ioredis: 5.11.1(supports-color@10.2.2) - unstorage@2.0.0-alpha.5(@netlify/blobs@10.1.0)(chokidar@5.0.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(ioredis@5.9.2)(lru-cache@11.5.1)(ofetch@2.0.0-alpha.3): - optionalDependencies: - '@netlify/blobs': 10.1.0 - chokidar: 5.0.0 - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - ioredis: 5.9.2 - lru-cache: 11.5.1 - ofetch: 2.0.0-alpha.3 + unstorage@2.0.0-alpha.10: {} - unstorage@2.0.0-alpha.6(@netlify/blobs@10.1.0)(chokidar@5.0.0)(db0@0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3))(lru-cache@11.5.1)(ofetch@2.0.0-alpha.3): - optionalDependencies: - '@netlify/blobs': 10.1.0 - chokidar: 5.0.0 - db0: 0.3.4(@electric-sql/pglite@0.3.2)(@libsql/client@0.15.15)(mysql2@3.15.3) - lru-cache: 11.5.1 - ofetch: 2.0.0-alpha.3 + until-async@3.0.2: {} - untildify@4.0.0: {} - - untun@0.1.3: - dependencies: - citty: 0.1.6 - consola: 3.4.2 - pathe: 1.1.2 - - untyped@2.0.0: - dependencies: - citty: 0.1.6 - defu: 6.1.4 - jiti: 2.6.1 - knitwork: 1.3.0 - scule: 1.3.0 - - unwasm@0.5.3: - dependencies: - exsolve: 1.0.8 - knitwork: 1.3.0 - magic-string: 0.30.21 - mlly: 1.8.0 - pathe: 2.0.3 - pkg-types: 2.3.0 - - upath@2.0.1: {} + untun@0.2.2: {} update-browserslist-db@1.1.2(browserslist@4.24.4): dependencies: @@ -47746,7 +43759,7 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - uqr@0.1.2: {} + uqr@0.1.3: {} uri-js@4.4.1: dependencies: @@ -47761,28 +43774,24 @@ snapshots: urlpattern-polyfill@8.0.2: {} - use-callback-ref@1.3.3(@types/react@19.2.9)(react@19.2.3): + use-callback-ref@1.3.3(@types/react@19.2.9)(react@19.2.9): dependencies: - react: 19.2.3 + react: 19.2.9 tslib: 2.8.1 optionalDependencies: '@types/react': 19.2.9 - use-sidecar@1.1.3(@types/react@19.2.9)(react@19.2.3): + use-sidecar@1.1.3(@types/react@19.2.9)(react@19.2.9): dependencies: detect-node-es: 1.1.0 - react: 19.2.3 + react: 19.2.9 tslib: 2.8.1 optionalDependencies: '@types/react': 19.2.9 - use-sync-external-store@1.6.0(react@19.2.3): + use-sync-external-store@1.6.0(react@19.2.9): dependencies: - react: 19.2.3 - - utif2@4.1.0: - dependencies: - pako: 1.0.11 + react: 19.2.9 util-deprecate@1.0.2: {} @@ -47794,23 +43803,15 @@ snapshots: uuid@10.0.0: {} - uuid@11.1.0: {} - - uuid@7.0.3: {} - uuid@8.3.2: {} - uuid@9.0.1: {} - - v8-compile-cache-lib@3.0.1: {} - - valibot@1.0.0-beta.15(typescript@6.0.2): + valibot@1.0.0-beta.15(@typescript/typescript6@6.0.2): optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' - valibot@1.1.0(typescript@6.0.2): + valibot@1.1.0(@typescript/typescript6@6.0.2): optionalDependencies: - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' validate-npm-package-license@3.0.4: dependencies: @@ -47819,273 +43820,307 @@ snapshots: validate-npm-package-name@5.0.1: {} - validate-npm-package-name@7.0.2: {} + varint@6.0.0: {} vary@1.1.2: {} - vite-plugin-dts@4.2.3(@types/node@25.0.9)(rollup@4.56.0)(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) - '@rollup/pluginutils': 5.1.4(rollup@4.56.0) - '@volar/typescript': 2.4.26 - '@vue/language-core': 2.1.6(typescript@6.0.2) + '@rollup/pluginutils': 5.1.4(rollup@4.63.1) + '@volar/typescript': 2.4.26(@typescript/typescript6@6.0.2) + '@vue/language-core': 2.1.6(@typescript/typescript6@6.0.2) compare-versions: 6.1.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) kolorist: 1.8.0 local-pkg: 0.5.1 magic-string: 0.30.21 - typescript: 6.0.2 + typescript: '@typescript/typescript6@6.0.2' optionalDependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - '@types/node' - rollup - supports-color - vite-plugin-externalize-deps@0.10.0(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) + '@rollup/pluginutils': 5.1.4(rollup@4.63.1) + '@volar/typescript': 2.4.26(@typescript/typescript6@6.0.2) + '@vue/language-core': 2.1.6(@typescript/typescript6@6.0.2) + compare-versions: 6.1.1 + debug: 4.4.3(supports-color@10.2.2) + kolorist: 1.8.0 + local-pkg: 0.5.1 + magic-string: 0.30.21 + typescript: '@typescript/typescript6@6.0.2' + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color - vite-plugin-solid@2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - '@babel/core': 7.28.5 + '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) + '@rollup/pluginutils': 5.1.4(rollup@4.63.1) + '@volar/typescript': 2.4.26(@typescript/typescript6@6.0.2) + '@vue/language-core': 2.1.6(@typescript/typescript6@6.0.2) + compare-versions: 6.1.1 + debug: 4.4.3(supports-color@10.2.2) + kolorist: 1.8.0 + local-pkg: 0.5.1 + magic-string: 0.30.21 + typescript: '@typescript/typescript6@6.0.2' + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + + vite-plugin-dts@4.2.3(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) + '@rollup/pluginutils': 5.1.4(rollup@4.63.1) + '@volar/typescript': 2.4.26(typescript@5.9.2) + '@vue/language-core': 2.1.6(typescript@5.9.2) + compare-versions: 6.1.1 + debug: 4.4.3(supports-color@10.2.2) + kolorist: 1.8.0 + local-pkg: 0.5.1 + magic-string: 0.30.21 + typescript: 5.9.2 + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + + vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vite-plugin-solid@2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 - babel-preset-solid: 1.9.10(@babel/core@7.28.5)(solid-js@1.9.12) + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) merge-anything: 5.1.7 solid-js: 1.9.12 - solid-refresh: 0.6.3(solid-js@1.9.12) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 6.6.3 transitivePeerDependencies: - supports-color - vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 - babel-preset-solid: 1.9.10(@babel/core@7.28.5)(solid-js@1.9.12) + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) merge-anything: 5.1.7 solid-js: 1.9.12 - solid-refresh: 0.6.3(solid-js@1.9.12) - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + optionalDependencies: + '@testing-library/jest-dom': 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) + transitivePeerDependencies: + - supports-color + + vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) + '@types/babel__core': 7.20.5 + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) + merge-anything: 5.1.7 + solid-js: 1.9.12 + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 6.6.3 transitivePeerDependencies: - supports-color - vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 - babel-preset-solid: 1.9.10(@babel/core@7.28.5)(solid-js@1.9.12) + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) merge-anything: 5.1.7 solid-js: 1.9.12 - solid-refresh: 0.6.3(solid-js@1.9.12) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 6.6.3 transitivePeerDependencies: - supports-color - vite-plugin-static-copy@3.4.0(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - chokidar: 3.6.0 - p-map: 7.0.6 - picocolors: 1.1.1 - tinyglobby: 0.2.16 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@types/babel__core': 7.20.5 + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) + merge-anything: 5.1.7 + solid-js: 1.9.12 + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + optionalDependencies: + '@testing-library/jest-dom': 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) + transitivePeerDependencies: + - supports-color - vite-tsconfig-paths@6.1.1(typescript@6.0.2)(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) globrex: 0.1.2 - tsconfck: 3.1.4(typescript@6.0.2) - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) + tsconfck: 3.1.4(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - supports-color - typescript - vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0): + vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - esbuild: 0.27.4 - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 - postcss: 8.5.15 - rollup: 4.56.0 - tinyglobby: 0.2.16 - optionalDependencies: - '@types/node': 25.0.9 - fsevents: 2.3.3 - jiti: 2.7.0 - less: 4.4.2 - lightningcss: 1.32.0 - sass: 1.97.2 - terser: 5.46.0 - tsx: 4.20.3 - yaml: 2.9.0 + debug: 4.4.3(supports-color@10.2.2) + globrex: 0.1.2 + tsconfck: 3.1.4(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - supports-color + - typescript - vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0): + vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - lightningcss: 1.32.0 - picomatch: 4.0.4 - postcss: 8.5.15 - rolldown: 1.0.2 - tinyglobby: 0.2.16 + debug: 4.4.3(supports-color@10.2.2) + globrex: 0.1.2 + tsconfck: 3.1.4(@typescript/typescript6@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - supports-color + - typescript + + vite-tsconfig-paths@6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + debug: 4.4.3(supports-color@10.2.2) + globrex: 0.1.2 + tsconfck: 3.1.4(typescript@5.9.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + transitivePeerDependencies: + - supports-color + - typescript + + vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.29 + rolldown: 1.2.13 + tinyglobby: 0.2.17 optionalDependencies: '@types/node': 25.0.9 esbuild: 0.27.4 fsevents: 2.3.3 jiti: 2.7.0 - less: 4.4.2 sass: 1.97.2 - terser: 5.37.0 + sass-embedded: 1.105.1 + terser: 5.51.2 tsx: 4.20.3 yaml: 2.9.0 - vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0): + vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): dependencies: - lightningcss: 1.32.0 - picomatch: 4.0.4 - postcss: 8.5.15 - rolldown: 1.0.2 - tinyglobby: 0.2.16 + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.29 + rolldown: 1.2.13 + tinyglobby: 0.2.17 optionalDependencies: '@types/node': 25.0.9 esbuild: 0.28.1 fsevents: 2.3.3 jiti: 2.7.0 - less: 4.4.2 - sass: 1.97.3 - terser: 5.46.0 + sass: 1.105.1 + sass-embedded: 1.105.1 + terser: 5.51.2 tsx: 4.20.3 yaml: 2.9.0 - vitefu@1.1.1(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): - optionalDependencies: - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - - vitefu@1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): - optionalDependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - - vitefu@1.1.1(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): - optionalDependencies: - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - - vitest@4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@25.0.1)(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): dependencies: - '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - '@vitest/pretty-format': 4.1.4 - '@vitest/runner': 4.1.4 - '@vitest/snapshot': 4.1.4 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 - expect-type: 1.3.0 - magic-string: 0.30.21 - obug: 2.1.1 - pathe: 2.0.3 - picomatch: 4.0.3 - std-env: 4.1.0 - tinybench: 2.9.0 - tinyexec: 1.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - why-is-node-running: 2.3.0 + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.29 + rolldown: 1.2.13 + tinyglobby: 0.2.17 optionalDependencies: '@types/node': 25.0.9 - '@vitest/ui': 4.1.4(vitest@4.1.4) - jsdom: 25.0.1 - transitivePeerDependencies: - - msw + esbuild: 0.28.1 + fsevents: 2.3.3 + jiti: 2.7.0 + sass: 1.97.2 + sass-embedded: 1.105.1 + terser: 5.51.2 + tsx: 4.20.3 + yaml: 2.9.0 - vitest@4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@27.0.0(postcss@8.5.15))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vitefu@1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vitefu@1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vitefu@1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vitefu@1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + optionalDependencies: + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + vitest@4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.4 '@vitest/runner': 4.1.4 '@vitest/snapshot': 4.1.4 '@vitest/spy': 4.1.4 '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 - expect-type: 1.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 magic-string: 0.30.21 obug: 2.1.1 pathe: 2.0.3 - picomatch: 4.0.3 - std-env: 4.1.0 + picomatch: 4.0.7 + std-env: 4.3.0 tinybench: 2.9.0 - tinyexec: 1.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 25.0.9 - '@vitest/ui': 4.1.4(vitest@4.1.4) - jsdom: 27.0.0(postcss@8.5.15) - transitivePeerDependencies: - - msw - - vitest@4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - '@vitest/pretty-format': 4.1.4 - '@vitest/runner': 4.1.4 - '@vitest/snapshot': 4.1.4 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 - expect-type: 1.3.0 - magic-string: 0.30.21 - obug: 2.1.1 - pathe: 2.0.3 - picomatch: 4.0.3 - std-env: 4.1.0 - tinybench: 2.9.0 - tinyexec: 1.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(less@4.4.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 25.0.9 - '@vitest/ui': 4.1.4(vitest@4.1.4) - jsdom: 29.1.1(@noble/hashes@2.0.1) - transitivePeerDependencies: - - msw - - vitest@4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0)) - '@vitest/pretty-format': 4.1.4 - '@vitest/runner': 4.1.4 - '@vitest/snapshot': 4.1.4 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 - expect-type: 1.3.0 - magic-string: 0.30.21 - obug: 2.1.1 - pathe: 2.0.3 - picomatch: 4.0.3 - std-env: 4.1.0 - tinybench: 2.9.0 - tinyexec: 1.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vite: 7.3.6(@types/node@25.0.9)(jiti@2.7.0)(less@4.4.2)(lightningcss@1.32.0)(sass@1.97.2)(terser@5.46.0)(tsx@4.20.3)(yaml@2.9.0) + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + tinyrainbow: 3.2.0 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: + '@opentelemetry/api': 1.9.1 '@types/node': 25.0.9 '@vitest/ui': 4.1.4(vitest@4.1.4) jsdom: 29.1.1(@noble/hashes@2.0.1) @@ -48093,31 +44128,146 @@ snapshots: - msw optional: true - vitest@4.1.4(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)): + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.7.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0)) - '@vitest/pretty-format': 4.1.4 - '@vitest/runner': 4.1.4 - '@vitest/snapshot': 4.1.4 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 - expect-type: 1.3.0 - magic-string: 0.30.21 - obug: 2.1.1 - pathe: 2.0.3 - picomatch: 4.0.3 - std-env: 4.1.0 - tinybench: 2.9.0 - tinyexec: 1.0.2 - tinyglobby: 0.2.15 - tinyrainbow: 3.1.0 - vite: 8.0.14(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(less@4.4.2)(sass@1.97.2)(terser@5.37.0)(tsx@4.20.3)(yaml@2.9.0) - why-is-node-running: 2.3.0 + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 optionalDependencies: + '@opentelemetry/api': 1.9.1 '@types/node': 25.0.9 - '@vitest/ui': 4.1.4(vitest@4.1.4) + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 25.0.1(supports-color@10.2.2) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 25.0.1(supports-color@10.2.2) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 25.0.1(supports-color@10.2.2) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 27.0.0(supports-color@10.2.2) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 29.1.1(@noble/hashes@2.0.1) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) jsdom: 29.1.1(@noble/hashes@2.0.1) transitivePeerDependencies: - msw @@ -48126,6 +44276,10 @@ snapshots: vue-component-type-helpers@2.2.12: {} + vue-demi@0.14.10(vue@3.5.25(@typescript/typescript6@6.0.2)): + dependencies: + vue: 3.5.25(@typescript/typescript6@6.0.2) + vue-demi@0.14.10(vue@3.5.25(typescript@5.8.3)): dependencies: vue: 3.5.25(typescript@5.8.3) @@ -48134,34 +44288,34 @@ snapshots: dependencies: vue: 3.5.25(typescript@6.0.2) - vue-eslint-parser@10.2.0(eslint@9.22.0(jiti@2.7.0)): + vue-eslint-parser@10.2.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.1 espree: 10.4.0 esquery: 1.6.0 - semver: 7.8.2 + semver: 7.8.5 transitivePeerDependencies: - supports-color - vue-eslint-parser@10.4.0(eslint@9.22.0(jiti@2.7.0)): + vue-eslint-parser@10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.1 espree: 10.4.0 esquery: 1.6.0 - semver: 7.8.2 + semver: 7.8.5 transitivePeerDependencies: - supports-color - vue-eslint-parser@9.4.3(eslint@9.22.0(jiti@2.7.0)): + vue-eslint-parser@9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - debug: 4.4.3 - eslint: 9.22.0(jiti@2.7.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 @@ -48171,35 +44325,33 @@ snapshots: transitivePeerDependencies: - supports-color - vue-tsc@3.1.5(typescript@5.8.3): + vue-tsc@3.3.8(@typescript/typescript6@6.0.2): dependencies: - '@volar/typescript': 2.4.23 - '@vue/language-core': 3.1.5(typescript@5.8.3) + '@volar/typescript': 2.4.28(@typescript/typescript6@6.0.2) + '@vue/language-core': 3.3.8 + typescript: '@typescript/typescript6@6.0.2' + + vue-tsc@3.3.8(typescript@5.8.3): + dependencies: + '@volar/typescript': 2.4.28(typescript@5.8.3) + '@vue/language-core': 3.3.8 typescript: 5.8.3 - vue-tsc@3.1.5(typescript@5.9.3): + vue-tsc@3.3.8(typescript@5.9.3): dependencies: - '@volar/typescript': 2.4.23 - '@vue/language-core': 3.1.5(typescript@5.9.3) + '@volar/typescript': 2.4.28(typescript@5.9.3) + '@vue/language-core': 3.3.8 typescript: 5.9.3 - vue-tsc@3.1.5(typescript@6.0.2): + vue@3.5.25(@typescript/typescript6@6.0.2): dependencies: - '@volar/typescript': 2.4.23 - '@vue/language-core': 3.1.5(typescript@6.0.2) - typescript: 6.0.2 - - vue-tsc@3.1.8(typescript@6.0.2): - dependencies: - '@volar/typescript': 2.4.26 - '@vue/language-core': 3.1.8(typescript@6.0.2) - typescript: 6.0.2 - - vue-tsc@3.3.7(typescript@6.0.2): - dependencies: - '@volar/typescript': 2.4.28 - '@vue/language-core': 3.3.7 - typescript: 6.0.2 + '@vue/compiler-dom': 3.5.25 + '@vue/compiler-sfc': 3.5.25 + '@vue/runtime-dom': 3.5.25 + '@vue/server-renderer': 3.5.25(vue@3.5.25(@typescript/typescript6@6.0.2)) + '@vue/shared': 3.5.25 + optionalDependencies: + typescript: '@typescript/typescript6@6.0.2' vue@3.5.25(typescript@5.8.3): dependencies: @@ -48235,34 +44387,11 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - wait-on@9.0.10: - dependencies: - axios: 1.18.1(debug@4.4.3) - joi: 18.2.3 - lodash: 4.18.1 - minimist: 1.2.8 - rxjs: 7.8.2 - transitivePeerDependencies: - - debug - - supports-color - - walk-up-path@4.0.0: {} - watchpack@2.4.2: dependencies: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - watchpack@2.4.4: - dependencies: - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - - watchpack@2.5.1: - dependencies: - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - watchpack@2.5.2: dependencies: graceful-fs: 4.2.11 @@ -48275,9 +44404,6 @@ snapshots: dependencies: defaults: 1.0.4 - weak-lru-cache@1.2.2: - optional: true - web-streams-polyfill@3.3.3: {} web-vitals@4.2.4: {} @@ -48288,10 +44414,28 @@ snapshots: webidl-conversions@7.0.0: {} - webidl-conversions@8.0.0: {} - webidl-conversions@8.0.1: {} + webpack-cli@5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3): + dependencies: + '@discoveryjs/json-ext': 0.5.7 + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.110.3) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.110.3) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.4)(webpack@5.110.3) + colorette: 2.0.20 + commander: 10.0.1 + cross-spawn: 7.0.6 + envinfo: 7.14.0 + fastest-levenshtein: 1.0.16 + import-local: 3.2.0 + interpret: 3.1.1 + rechoir: 0.8.0 + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack-merge: 5.10.0 + optionalDependencies: + webpack-dev-server: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) + optional: true + webpack-cli@5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1): dependencies: '@discoveryjs/json-ext': 0.5.7 @@ -48309,9 +44453,9 @@ snapshots: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) webpack-merge: 5.10.0 optionalDependencies: - webpack-dev-server: 5.2.4(webpack-cli@5.1.4)(webpack@5.97.1) + webpack-dev-server: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) - webpack-dev-middleware@7.4.2(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): + webpack-dev-middleware@7.4.2(webpack@5.110.3): dependencies: colorette: 2.0.20 memfs: 4.17.0 @@ -48320,7 +44464,8 @@ snapshots: range-parser: 1.2.1 schema-utils: 4.3.3 optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + optional: true webpack-dev-middleware@7.4.2(webpack@5.97.1): dependencies: @@ -48333,20 +44478,7 @@ snapshots: optionalDependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) - webpack-dev-middleware@7.4.5(tslib@2.8.1)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - colorette: 2.0.20 - memfs: 4.64.0(tslib@2.8.1) - mime-types: 3.0.2 - on-finished: 2.4.1 - range-parser: 1.2.1 - schema-utils: 4.3.3 - optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - transitivePeerDependencies: - - tslib - - webpack-dev-server@5.2.4(webpack-cli@5.1.4)(webpack@5.97.1): + webpack-dev-server@5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -48360,24 +44492,64 @@ snapshots: bonjour-service: 1.3.0 chokidar: 3.6.0 colorette: 2.0.20 - compression: 1.8.1 + compression: 1.8.1(supports-color@10.2.2) connect-history-api-fallback: 2.0.0 - express: 4.22.2 + express: 4.22.2(supports-color@10.2.2) graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.9(@types/express@4.17.25) + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) ipaddr.js: 2.2.0 launch-editor: 2.9.1 open: 10.1.0 p-retry: 6.2.1 schema-utils: 4.3.3 selfsigned: 5.5.0 - serve-index: 1.9.1 + serve-index: 1.9.1(supports-color@10.2.2) sockjs: 0.3.24 - spdy: 4.0.2 + spdy: 4.0.2(supports-color@10.2.2) + webpack-dev-middleware: 7.4.2(webpack@5.110.3) + ws: 8.20.0 + optionalDependencies: + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + optional: true + + webpack-dev-server@5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1): + dependencies: + '@types/bonjour': 3.5.13 + '@types/connect-history-api-fallback': 1.5.4 + '@types/express': 4.17.25 + '@types/express-serve-static-core': 4.19.6 + '@types/serve-index': 1.9.4 + '@types/serve-static': 1.15.7 + '@types/sockjs': 0.3.36 + '@types/ws': 8.5.14 + ansi-html-community: 0.0.8 + bonjour-service: 1.3.0 + chokidar: 3.6.0 + colorette: 2.0.20 + compression: 1.8.1(supports-color@10.2.2) + connect-history-api-fallback: 2.0.0 + express: 4.22.2(supports-color@10.2.2) + graceful-fs: 4.2.11 + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) + ipaddr.js: 2.2.0 + launch-editor: 2.9.1 + open: 10.1.0 + p-retry: 6.2.1 + schema-utils: 4.3.3 + selfsigned: 5.5.0 + serve-index: 1.9.1(supports-color@10.2.2) + sockjs: 0.3.24 + spdy: 4.0.2(supports-color@10.2.2) webpack-dev-middleware: 7.4.2(webpack@5.97.1) ws: 8.20.0 optionalDependencies: - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) transitivePeerDependencies: - bufferutil @@ -48385,7 +44557,7 @@ snapshots: - supports-color - utf-8-validate - webpack-dev-server@5.2.5(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): + webpack-dev-server@5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -48399,24 +44571,25 @@ snapshots: bonjour-service: 1.3.0 chokidar: 3.6.0 colorette: 2.0.20 - compression: 1.8.1 + compression: 1.8.1(supports-color@10.2.2) connect-history-api-fallback: 2.0.0 - express: 4.22.2 + express: 4.22.2(supports-color@10.2.2) graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.9(@types/express@4.17.25) + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) ipaddr.js: 2.2.0 launch-editor: 2.9.1 open: 10.1.0 p-retry: 6.2.1 schema-utils: 4.3.3 selfsigned: 5.5.0 - serve-index: 1.9.1 + serve-index: 1.9.1(supports-color@10.2.2) sockjs: 0.3.24 - spdy: 4.0.2 - webpack-dev-middleware: 7.4.2(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) + spdy: 4.0.2(supports-color@10.2.2) + webpack-dev-middleware: 7.4.2(webpack@5.97.1) ws: 8.20.0 optionalDependencies: - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) transitivePeerDependencies: - bufferutil - debug @@ -48429,89 +44602,55 @@ snapshots: flat: 5.0.2 wildcard: 2.0.1 - webpack-merge@6.0.1: - dependencies: - clone-deep: 4.0.1 - flat: 5.0.2 - wildcard: 2.0.1 - webpack-sources@3.2.3: {} webpack-sources@3.3.3: {} - webpack-subresource-integrity@5.1.0(html-webpack-plugin@5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)))(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)): - dependencies: - typed-assert: 1.0.9 - webpack: 5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1) - optionalDependencies: - html-webpack-plugin: 5.6.3(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) + webpack-sources@3.5.1: {} webpack-virtual-modules@0.5.0: {} webpack-virtual-modules@0.6.2: {} - webpack@5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4): + webpack@5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4): dependencies: - '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.15.0 - acorn-import-phases: 1.0.4(acorn@8.15.0) + acorn: 8.18.0 browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.18.3 - es-module-lexer: 2.0.0 - eslint-scope: 5.1.1 + enhanced-resolve: 5.24.5 + es-module-lexer: 2.3.2 events: 3.3.0 - glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.1 - mime-types: 2.1.35 + mime-db: 1.54.0 + minimizer-webpack-plugin: 5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3) neo-async: 2.6.2 schema-utils: 4.3.3 - tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack@5.104.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)) - watchpack: 2.4.4 - webpack-sources: 3.3.3 - transitivePeerDependencies: - - '@swc/core' - - esbuild - - uglify-js - - webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1): - dependencies: - '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.8 - '@types/json-schema': 7.0.15 - '@webassemblyjs/ast': 1.14.1 - '@webassemblyjs/wasm-edit': 1.14.1 - '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.15.0 - acorn-import-phases: 1.0.4(acorn@8.15.0) - browserslist: 4.28.1 - chrome-trace-event: 1.0.4 - enhanced-resolve: 5.20.1 - es-module-lexer: 2.0.0 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.1 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 4.3.3 - tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.105.2(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) + tapable: 2.3.3 watchpack: 2.5.2 - webpack-sources: 3.3.3 + webpack-sources: 3.5.1 + optionalDependencies: + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) transitivePeerDependencies: + - '@minify-html/node' + - '@napi-rs/image' - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso - esbuild + - html-minifier-terser + - imagemin + - lightningcss + - postcss + - sharp + - svgo - uglify-js webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4): @@ -48546,36 +44685,6 @@ snapshots: - esbuild - uglify-js - webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1): - dependencies: - '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.7 - '@webassemblyjs/ast': 1.14.1 - '@webassemblyjs/wasm-edit': 1.14.1 - '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.14.1 - browserslist: 4.24.4 - chrome-trace-event: 1.0.4 - enhanced-resolve: 5.18.1 - es-module-lexer: 1.6.0 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 3.3.0 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)) - watchpack: 2.4.2 - webpack-sources: 3.2.3 - transitivePeerDependencies: - - '@swc/core' - - esbuild - - uglify-js - webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 @@ -48632,7 +44741,7 @@ snapshots: whatwg-url@15.1.0: dependencies: tr46: 6.0.0 - webidl-conversions: 8.0.0 + webidl-conversions: 8.0.1 whatwg-url@16.0.1(@noble/hashes@2.0.1): dependencies: @@ -48647,6 +44756,8 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 + when-exit@2.1.5: {} + which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 @@ -48662,8 +44773,6 @@ snapshots: is-weakmap: 2.0.2 is-weakset: 2.0.4 - which-module@2.0.1: {} - which-typed-array@1.1.19: dependencies: available-typed-arrays: 1.0.7 @@ -48674,27 +44783,24 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 - which@1.3.1: - dependencies: - isexe: 2.0.0 - which@2.0.2: dependencies: isexe: 2.0.0 - which@6.0.1: + which@3.0.1: dependencies: - isexe: 4.0.0 + isexe: 2.0.0 why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 + optional: true + + why-is-node-running@3.2.1: {} wildcard@2.0.1: {} - winreg@1.2.5: {} - winston-transport@4.9.0: dependencies: logform: 2.7.0 @@ -48725,6 +44831,14 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20260317.1 '@cloudflare/workerd-windows-64': 1.20260317.1 + workerd@1.20261104.1: + optionalDependencies: + '@cloudflare/workerd-darwin-64': 1.20261104.1 + '@cloudflare/workerd-darwin-arm64': 1.20261104.1 + '@cloudflare/workerd-linux-64': 1.20261104.1 + '@cloudflare/workerd-linux-arm64': 1.20261104.1 + '@cloudflare/workerd-windows-64': 1.20261104.1 + wrangler@4.75.0: dependencies: '@cloudflare/kv-asset-handler': 0.4.2 @@ -48759,59 +44873,18 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.2.0 - wrap-ansi@9.0.2: - dependencies: - ansi-styles: 6.2.3 - string-width: 7.2.0 - strip-ansi: 7.2.0 - wrappy@1.0.2: {} - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - write-file-atomic@7.0.1: - dependencies: - signal-exit: 4.1.0 - ws@8.18.0: {} - ws@8.18.3: {} - ws@8.20.0: {} - wsl-utils@0.3.1: - dependencies: - is-wsl: 3.1.1 - powershell-utils: 0.1.0 - - xcode@3.0.1: - dependencies: - simple-plist: 1.4.0 - uuid: 7.0.3 - - xml-js@1.6.11: - dependencies: - sax: 1.4.1 + ws@8.21.0: {} xml-name-validator@4.0.0: {} xml-name-validator@5.0.0: {} - xml-parse-from-string@1.0.1: {} - - xml2js@0.5.0: - dependencies: - sax: 1.4.1 - xmlbuilder: 11.0.1 - - xml2js@0.6.2: - dependencies: - sax: 1.4.1 - xmlbuilder: 11.0.1 - xmlbuilder2@4.0.3: dependencies: '@oozcitak/dom': 2.0.2 @@ -48819,21 +44892,13 @@ snapshots: '@oozcitak/util': 10.0.0 js-yaml: 4.1.1 - xmlbuilder@11.0.1: {} - - xmlbuilder@15.1.1: {} - xmlchars@2.2.0: {} - xpath@0.0.32: {} - xss@1.0.15: dependencies: commander: 2.20.3 cssfilter: 0.0.10 - y18n@4.0.3: {} - y18n@5.0.8: {} yallist@3.1.1: {} @@ -48846,31 +44911,10 @@ snapshots: yaml@2.9.0: {} - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - yargs-parser@20.2.9: {} yargs-parser@21.1.1: {} - yargs-parser@22.0.0: {} - - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - yargs@16.2.0: dependencies: cliui: 7.0.4 @@ -48881,16 +44925,6 @@ snapshots: y18n: 5.0.8 yargs-parser: 20.2.9 - yargs@17.7.1: - dependencies: - cliui: 8.0.1 - escalade: 3.2.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - yargs@17.7.2: dependencies: cliui: 8.0.1 @@ -48901,38 +44935,15 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 - yargs@18.0.0: + yauzl@3.4.0: dependencies: - cliui: 9.0.1 - escalade: 3.2.0 - get-caller-file: 2.0.5 - string-width: 7.2.0 - y18n: 5.0.8 - yargs-parser: 22.0.0 - - yauzl@2.10.0: - dependencies: - buffer-crc32: 0.2.13 - fd-slicer: 1.1.0 - - yauzl@3.2.0: - dependencies: - buffer-crc32: 0.2.13 pend: 1.2.0 - yazl@3.3.1: - dependencies: - buffer-crc32: 1.0.0 - - yn@3.1.1: {} - yocto-queue@0.1.0: {} yocto-queue@1.2.1: {} - yoctocolors-cjs@2.1.3: {} - - yoctocolors@2.1.2: {} + yoctocolors-cjs@2.1.2: {} youch-core@0.3.3: dependencies: @@ -48941,30 +44952,20 @@ snapshots: youch@4.1.0-beta.10: dependencies: - '@poppinss/colors': 4.1.5 + '@poppinss/colors': 4.1.6 '@poppinss/dumper': 0.6.5 '@speed-highlight/core': 1.2.14 - cookie: 1.0.2 - youch-core: 0.3.3 - - youch@4.1.0-beta.13: - dependencies: - '@poppinss/colors': 4.1.5 - '@poppinss/dumper': 0.6.5 - '@speed-highlight/core': 1.2.14 - cookie-es: 2.0.0 + cookie: 1.1.1 youch-core: 0.3.3 zeptomatch@2.0.2: dependencies: grammex: 3.1.11 - zimmerframe@1.1.4: {} - - zip-stream@6.0.1: + zip-stream@7.0.5: dependencies: - archiver-utils: 5.0.2 - compress-commons: 6.0.2 + compress-commons: 7.0.1 + normalize-path: 3.0.0 readable-stream: 4.7.0 zod@3.25.57: {} @@ -48973,9 +44974,13 @@ snapshots: zod@4.4.3: {} - zustand@5.0.12(@types/react@19.2.9)(immer@10.1.1)(react@19.2.3)(use-sync-external-store@1.6.0(react@19.2.3)): + zod@4.5.4: {} + + zod@4.6.6: {} + + zustand@5.0.12(@types/react@19.2.9)(immer@10.1.1)(react@19.2.9)(use-sync-external-store@1.6.0(react@19.2.9)): optionalDependencies: '@types/react': 19.2.9 immer: 10.1.1 - react: 19.2.3 - use-sync-external-store: 1.6.0(react@19.2.3) + react: 19.2.9 + use-sync-external-store: 1.6.0(react@19.2.9) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 92d02ee131..c5c9bae1df 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,13 +7,10 @@ trustPolicy: 'no-downgrade' trustPolicyExclude: - 'chokidar@4.0.3' # known to be safe, installed by sass, prisma, netlify... no planned releases in v4, packages is on v5 now - - 'semver@5.7.2' # installed by @nativescript/vite through less and make-dir; 5.7.2 is the final semver v5 release - 'semver@6.3.1' # installed by babel, ecosystem has been on v7 for 7 years now, but babel is horribly out of date, 6.3.1 is the latest v6 and was released 3 years ago - 'undici@6.21.2' # installed by cheerio@1.0.0 -> html-link-extractor@1.0.5 -> markdown-link-extractor@4.0.3, is only 1 year old, v6, v7 and v8 are maintained in parallel - - '@netlify/edge-bundler@14.7.0' # existing Netlify dev transitive flagged by pnpm 11.9 trust downgrade checks - '@platformatic/flame@1.7.0' # trusted publishing failed due to a missing sigstore module in npm, then an established maintainer published it manually - - '@netlify/serverless-functions-api@2.7.1' # existing Netlify dev transitive flagged by pnpm 11.9 trust downgrade checks - - '@netlify/zip-it-and-ship-it@14.1.11' # existing Netlify dev transitive flagged by pnpm 11.9 trust downgrade checks + - '@netlify/serverless-functions-api@2.21.2 || 2.18.0' # Netlify's repo went private Aug 2023, provenance never returned for any version since. Two versions: @netlify/server-dev wants ^2.21.2, @netlify/zip-it-and-ship-it pins an exact 2.18.0 packages: - 'packages/*' @@ -35,28 +32,49 @@ packages: - 'e2e/eslint-plugin-start' catalog: - react: ^19.2.3 - react-dom: ^19.2.3 + '@babel/core': ^7.29.7 + '@babel/types': ^7.29.8 + '@arethetypeswrong/cli': ^0.18.4 + '@eslint-react/eslint-plugin': ^1.26.2 + '@rsbuild/core': ^2.3.1 + '@tanstack/vite-config': 0.5.2 + '@testing-library/jest-dom': ^7.0.1 + '@testing-library/react': ^16.2.0 + '@vitejs/plugin-react': ^6.0.1 + '@vitejs/plugin-vue-jsx': ^4.1.2 + '@vitest/ui': ^5.0.4 + react: ~19.2.9 + react-dom: ~19.2.9 '@types/react': ^19.2.8 '@types/react-dom': ^19.2.3 eslint: ^9.22.0 - vite: ^8.0.14 + eslint-plugin-react-hooks: ^5.1.0 + chokidar: ^5.0.0 + combinate: ^1.1.11 + isbot: ^5.1.22 + jsdom: ^25.0.1 + pathe: ^2.0.3 + publint: ^0.3.16 + redaxios: ^0.5.1 + rimraf: ^6.1.2 + solid-js: 1.9.12 + tinyglobby: ^0.2.17 + vite: ^8.3.4 + vite-plugin-solid: 2.11.10 + vitest: ^5.0.4 + vue: ^3.5.25 + zod: ^4.5.4 '@types/node': 25.0.9 - '@playwright/test': ^1.61.0 - '@tanstack/query-core': ^5.99.0 - '@tanstack/react-query': ^5.99.0 - '@tanstack/solid-query': ^5.99.0 - '@tanstack/vue-query': ^5.99.0 + '@playwright/test': ^1.63.0 + '@tanstack/query-core': ^5.102.0 + '@tanstack/react-query': ^5.102.0 + '@tanstack/solid-query': ^5.102.0 + '@tanstack/vue-query': ^5.102.0 overrides: - 'tanstack-start-example-nativescript>vite': 7.3.6 - '@nativescript/vite@2.0.3>vite': 7.3.6 - 'nativescript@9.0.6>axios': 1.18.1 - 'nativescript@9.0.6>simple-git': 3.36.0 - 'wait-on@9.0.10>axios': 1.18.1 '@types/babel__traverse': '^7.28.0' vite-plugin-dts: 4.2.3 - solid-js: 1.9.12 + solid-js: 'catalog:' react: 'catalog:' react-dom: 'catalog:' '@types/react': 'catalog:' @@ -72,7 +90,6 @@ overrides: '@tanstack/history': 'workspace:*' '@tanstack/router-core': 'workspace:*' '@tanstack/react-router': 'workspace:*' - '@tanstack/react-nativescript-router': 'workspace:*' '@tanstack/router-cli': 'workspace:*' '@tanstack/router-devtools': 'workspace:*' '@tanstack/router-devtools-core': 'workspace:^' @@ -108,15 +125,10 @@ overrides: '@tanstack/eslint-plugin-router': 'workspace:*' '@tanstack/router-utils': 'workspace:*' '@tanstack/start-static-server-functions': 'workspace:*' - '@tanstack/nitro-v2-vite-plugin': 'workspace:*' allowBuilds: # root dependency '@swc/core': true # required for TypeScript compilation - '@nativescript/core': true # required by the NativeScript adapter and example - nativescript: true # official CLI used by the NativeScript example - lmdb: false # optional Vite cache accelerator pulled by @nativescript/vite - msgpackr-extract: false # optional native accelerator used by lmdb nx: true unrs-resolver: false # not directly required for build esbuild: true diff --git a/scripts/benchmarks/bundle-size/build.mjs b/scripts/benchmarks/bundle-size/build.mjs new file mode 100644 index 0000000000..dfb32c923a --- /dev/null +++ b/scripts/benchmarks/bundle-size/build.mjs @@ -0,0 +1,36 @@ +import { spawnSync } from 'node:child_process' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)) + +/** + * Run report generation outside Nx so it also runs after a cache hit. + * @param {string[]} args + * @param {import('./run.mjs').Execute} [execute] + */ +export function build(args, execute = spawnSync) { + /** @type {import('./run.mjs').CommandOptions} */ + const options = { cwd: repoRoot, env: process.env, stdio: 'inherit' } + const result = execute( + process.env.npm_execpath || 'pnpm', + ['exec', 'nx', 'run', '@benchmarks/bundle-size:measure', ...args], + options, + ) + if (result.status !== 0) { + return result.status || 1 + } + const report = execute( + process.execPath, + [fileURLToPath(new URL('./report.mjs', import.meta.url))], + options, + ) + return report.status ?? 1 +} + +if ( + process.argv[1] && + import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href +) { + process.exitCode = build(process.argv.slice(2)) +} diff --git a/scripts/benchmarks/bundle-size/build.test.mjs b/scripts/benchmarks/bundle-size/build.test.mjs new file mode 100644 index 0000000000..779824c35a --- /dev/null +++ b/scripts/benchmarks/bundle-size/build.test.mjs @@ -0,0 +1,51 @@ +import assert from 'node:assert/strict' +import path from 'node:path' +import test from 'node:test' +import { build } from './build.mjs' + +test('generates a fresh report after a successful Nx run, including cache hits', () => { + /** @type {string[][]} */ + const calls = [] + const status = build( + ['--outputStyle=stream', '--skipRemoteCache'], + (_command, args, options) => { + calls.push(args) + assert.equal(options.stdio, 'inherit') + assert.ok(!('shell' in options)) + return { status: 0 } + }, + ) + assert.equal(status, 0) + assert.equal(calls.length, 2) + assert.deepEqual(calls[0], [ + 'exec', + 'nx', + 'run', + '@benchmarks/bundle-size:measure', + '--outputStyle=stream', + '--skipRemoteCache', + ]) + assert.equal(path.basename(calls[1]?.[0] || ''), 'report.mjs') +}) + +test('does not report stale measurements after a failed or interrupted build', () => { + for (const exitCode of [2, null]) { + let calls = 0 + assert.equal( + build([], () => { + calls++ + return { status: exitCode } + }), + exitCode || 1, + ) + assert.equal(calls, 1) + } +}) + +test('propagates report failures', () => { + let calls = 0 + assert.equal( + build([], () => ({ status: ++calls === 1 ? 0 : 3 })), + 3, + ) +}) diff --git a/scripts/benchmarks/bundle-size/compress.mjs b/scripts/benchmarks/bundle-size/compress.mjs new file mode 100644 index 0000000000..f30d8794ca --- /dev/null +++ b/scripts/benchmarks/bundle-size/compress.mjs @@ -0,0 +1,64 @@ +import fs from 'node:fs' +import path from 'node:path' +import { brotliCompressSync, gzipSync } from 'node:zlib' + +function sumSizes(files) { + let rawBytes = 0 + let gzipBytes = 0 + let brotliBytes = 0 + + for (const file of files) { + rawBytes += file.rawBytes + gzipBytes += file.gzipBytes + brotliBytes += file.brotliBytes + } + + return { rawBytes, gzipBytes, brotliBytes, files } +} + +// Keep the cache local to one measurement: rebuilds can reuse filenames. +export function measureFileSizes(baseDir, jsFiles, initialJsFiles, onTiming) { + const measured = new Map() + let gzipMs = 0 + let brotliMs = 0 + + function measureFile(file) { + let sizes = measured.get(file) + if (sizes) { + return sizes + } + + const content = fs.readFileSync(path.join(baseDir, file)) + const gzipStarted = onTiming ? performance.now() : 0 + let gzipBytes + try { + gzipBytes = gzipSync(content).byteLength + } finally { + if (onTiming) { + gzipMs += performance.now() - gzipStarted + } + } + const brotliStarted = onTiming ? performance.now() : 0 + let brotliBytes + try { + brotliBytes = brotliCompressSync(content).byteLength + } finally { + if (onTiming) { + brotliMs += performance.now() - brotliStarted + } + } + + sizes = { file, rawBytes: content.byteLength, gzipBytes, brotliBytes } + measured.set(file, sizes) + return sizes + } + + try { + const sizes = sumSizes(jsFiles.map(measureFile)) + const initialSizes = sumSizes(initialJsFiles.map(measureFile)) + return { sizes, initialSizes } + } finally { + onTiming?.('gzip', gzipMs) + onTiming?.('brotli', brotliMs) + } +} diff --git a/scripts/benchmarks/bundle-size/compress.test.mjs b/scripts/benchmarks/bundle-size/compress.test.mjs new file mode 100644 index 0000000000..a73b93b77c --- /dev/null +++ b/scripts/benchmarks/bundle-size/compress.test.mjs @@ -0,0 +1,179 @@ +import assert from 'node:assert/strict' +import fs from 'node:fs' +import { syncBuiltinESMExports } from 'node:module' +import os from 'node:os' +import path from 'node:path' +import test from 'node:test' +import zlib, { brotliCompressSync, gzipSync } from 'node:zlib' +import { measureFileSizes } from './compress.mjs' + +// Independent reference: compress both lists separately, as the CLI did before. +function legacySizes(baseDir, fileList) { + const result = { rawBytes: 0, gzipBytes: 0, brotliBytes: 0, files: [] } + for (const file of fileList) { + const content = fs.readFileSync(path.join(baseDir, file)) + const sizes = { + file, + rawBytes: content.byteLength, + gzipBytes: gzipSync(content).byteLength, + brotliBytes: brotliCompressSync(content).byteLength, + } + result.rawBytes += sizes.rawBytes + result.gzipBytes += sizes.gzipBytes + result.brotliBytes += sizes.brotliBytes + result.files.push(sizes) + } + return result +} + +function fixture(t) { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'bundle-compress-')) + t.after(() => fs.rmSync(dir, { recursive: true, force: true })) + for (const [file, content] of Object.entries({ + 'entry.js': 'import "./shared.mjs"; console.log("héllo 🌍");\n'.repeat(30), + 'shared.mjs': 'export const shared = "shared chunk";\n'.repeat(100), + 'lazy.js': 'export default "lazy route";\n'.repeat(20), + 'empty.js': '', + })) { + fs.writeFileSync(path.join(dir, file), content) + } + return dir +} + +test('matches legacy per-chunk compression and initial totals exactly', (t) => { + const dir = fixture(t) + const all = ['entry.js', 'shared.mjs', 'lazy.js', 'empty.js'] + for (const initial of [ + [], + ['entry.js'], + ['shared.mjs', 'entry.js'], + all, + ['empty.js'], + ]) { + assert.deepEqual(measureFileSizes(dir, all, initial), { + sizes: legacySizes(dir, all), + initialSizes: legacySizes(dir, initial), + }) + } + assert.deepEqual(measureFileSizes(dir, [], []), { + sizes: legacySizes(dir, []), + initialSizes: legacySizes(dir, []), + }) +}) + +test('preserves list order and multiplicity, including initial-only files', (t) => { + const dir = fixture(t) + const all = ['lazy.js', 'entry.js', 'entry.js'] + const initial = ['shared.mjs', 'entry.js', 'entry.js'] + assert.deepEqual(measureFileSizes(dir, all, initial), { + sizes: legacySizes(dir, all), + initialSizes: legacySizes(dir, initial), + }) +}) + +test('remeasures changed files on subsequent calls and propagates read errors', (t) => { + const dir = fixture(t) + const files = ['entry.js'] + const before = measureFileSizes(dir, files, files) + fs.writeFileSync(path.join(dir, 'entry.js'), 'export default "rebuilt"') + const after = measureFileSizes(dir, files, files) + assert.notDeepEqual(after, before) + assert.deepEqual(after, { + sizes: legacySizes(dir, files), + initialSizes: legacySizes(dir, files), + }) + assert.throws(() => measureFileSizes(dir, files, ['missing.js']), { + code: 'ENOENT', + }) +}) + +test('reports gzip and brotli separately without changing measured output', (t) => { + const dir = fixture(t) + const all = ['entry.js', 'shared.mjs', 'lazy.js'] + const initial = ['entry.js', 'shared.mjs'] + const timings = [] + const result = measureFileSizes(dir, all, initial, (phase, durationMs) => { + timings.push({ phase, durationMs }) + }) + assert.deepEqual(result, measureFileSizes(dir, all, initial)) + assert.deepEqual( + timings.map(({ phase }) => phase), + ['gzip', 'brotli'], + ) + for (const { durationMs } of timings) { + assert.ok(Number.isFinite(durationMs) && durationMs >= 0) + } +}) + +test('reads and compresses each distinct file only once per measurement', (t) => { + const dir = fixture(t) + const all = ['entry.js', 'shared.mjs', 'lazy.js', 'entry.js'] + const initial = ['shared.mjs', 'entry.js', 'empty.js', 'entry.js'] + const expected = { + sizes: legacySizes(dir, all), + initialSizes: legacySizes(dir, initial), + } + const read = t.mock.method(fs, 'readFileSync') + const gzip = t.mock.method(zlib, 'gzipSync') + const brotli = t.mock.method(zlib, 'brotliCompressSync') + syncBuiltinESMExports() + t.after(() => { + t.mock.restoreAll() + syncBuiltinESMExports() + }) + + for (let measurement = 1; measurement <= 2; measurement++) { + assert.deepEqual(measureFileSizes(dir, all, initial), expected) + for (const operation of [read, gzip, brotli]) { + assert.equal(operation.mock.callCount(), 4 * measurement) + } + } +}) + +test('reports completed compression time when a later file cannot be read', (t) => { + const dir = fixture(t) + let now = 10 + t.mock.method(performance, 'now', () => now++) + const timings = [] + assert.throws( + () => + measureFileSizes(dir, ['entry.js', 'missing.js'], [], (...entry) => { + timings.push(entry) + }), + { code: 'ENOENT' }, + ) + assert.deepEqual(timings, [ + ['gzip', 1], + ['brotli', 1], + ]) +}) + +for (const codec of ['gzipSync', 'brotliCompressSync']) { + test(`reports time spent in failed ${codec} and preserves the original exception`, (t) => { + const dir = fixture(t) + const failure = new Error('codec failed') + let now = 20 + t.mock.method(performance, 'now', () => now++) + t.mock.method(zlib, codec, () => { + throw failure + }) + syncBuiltinESMExports() + t.after(() => { + t.mock.restoreAll() + syncBuiltinESMExports() + }) + + const timings = [] + assert.throws( + () => + measureFileSizes(dir, ['entry.js'], [], (...entry) => { + timings.push(entry) + }), + (error) => error === failure, + ) + assert.deepEqual(timings, [ + ['gzip', 1], + ['brotli', codec === 'gzipSync' ? 0 : 1], + ]) + }) +} diff --git a/scripts/benchmarks/bundle-size/diff.mjs b/scripts/benchmarks/bundle-size/diff.mjs index bd698bb9eb..154c43ccd5 100644 --- a/scripts/benchmarks/bundle-size/diff.mjs +++ b/scripts/benchmarks/bundle-size/diff.mjs @@ -13,6 +13,7 @@ const { values } = parseArgs({ default: 'benchmarks/bundle-size/results/current.json', }, id: { type: 'string' }, + 'current-only': { type: 'boolean' }, json: { type: 'boolean' }, }, }) @@ -33,7 +34,9 @@ const baselineById = byId(readCurrent(values.baseline)) const currentById = byId(readCurrent(values.current)) const ids = values.id ? [values.id] - : [...new Set([...baselineById.keys(), ...currentById.keys()])].sort() + : values['current-only'] + ? [...currentById.keys()].sort() + : [...new Set([...baselineById.keys(), ...currentById.keys()])].sort() const rows = ids.map((id) => { const baseline = baselineById.get(id) diff --git a/scripts/benchmarks/bundle-size/measure.mjs b/scripts/benchmarks/bundle-size/measure.mjs index 94d12b39b7..4a990feaf9 100644 --- a/scripts/benchmarks/bundle-size/measure.mjs +++ b/scripts/benchmarks/bundle-size/measure.mjs @@ -7,10 +7,12 @@ import path from 'node:path' import { fileURLToPath, pathToFileURL } from 'node:url' import { parseArgs as parseNodeArgs } from 'node:util' import vm from 'node:vm' -import { brotliCompressSync, gzipSync } from 'node:zlib' -import { execFileSync, execSync } from 'node:child_process' +import { execFileSync } from 'node:child_process' import { build } from 'vite' +import { writeReport } from './report.mjs' +import { measureFileSizes } from './compress.mjs' +import { createTimings } from './timings.mjs' const BENCHMARK_NAME = 'Bundle Size (gzip)' @@ -64,6 +66,14 @@ const SCENARIOS = [ packageName: '@tanstack/react-start', case: 'minimal', }, + { + id: 'react-start.query-integration', + dir: 'react-start-query-integration', + framework: 'react', + packageName: '@tanstack/react-start', + buildProjects: ['@tanstack/react-router-ssr-query'], + case: 'query-integration', + }, { id: 'react-start.deferred-hydration', dir: 'react-start-deferred-hydration', @@ -158,6 +168,8 @@ function parseArgs(argv) { analysis: { type: 'boolean' }, sourcemap: { type: 'boolean' }, 'skip-package-builds': { type: 'boolean' }, + 'measurements-only': { type: 'boolean' }, + timings: { type: 'boolean' }, }, }) @@ -171,6 +183,8 @@ function parseArgs(argv) { analysis: values.analysis === true, sourcemap: values.sourcemap === true, skipPackageBuilds: values['skip-package-builds'] === true, + measurementsOnly: values['measurements-only'] === true, + timings: values.timings === true || process.env.BUNDLE_SIZE_TIMINGS === '1', } } @@ -302,38 +316,6 @@ function collectAllViteJsFiles(manifest) { return [...files].sort() } -function sizesForFiles(baseDir, fileList) { - let rawBytes = 0 - let gzipBytes = 0 - let brotliBytes = 0 - const files = [] - - for (const relativeFile of fileList) { - const fullPath = path.join(baseDir, relativeFile) - const content = fs.readFileSync(fullPath) - const rawByteLength = content.byteLength - const gzipByteLength = gzipSync(content).byteLength - const brotliByteLength = brotliCompressSync(content).byteLength - - rawBytes += rawByteLength - gzipBytes += gzipByteLength - brotliBytes += brotliByteLength - files.push({ - file: relativeFile, - rawBytes: rawByteLength, - gzipBytes: gzipByteLength, - brotliBytes: brotliByteLength, - }) - } - - return { - rawBytes, - gzipBytes, - brotliBytes, - files, - } -} - async function findManifestFiles(rootDir) { const manifestPaths = [] @@ -467,30 +449,16 @@ async function importFromRoot(root, specifier) { return import(pathToFileURL(requireFromRoot.resolve(specifier)).href) } -function getGitStatus() { - try { - return { - branch: execSync('git branch --show-current', { - encoding: 'utf8', - }).trim(), - dirty: - execSync('git status --porcelain', { encoding: 'utf8' }).trim().length > - 0, - } - } catch { - return { - branch: '', - dirty: undefined, - } - } -} - function getPackageBuildProjects(scenarios) { const projects = new Set() for (const scenario of scenarios) { projects.add(scenario.packageName) + for (const project of scenario.buildProjects || []) { + projects.add(project) + } + if (scenario.packageName.endsWith('-router')) { projects.add('@tanstack/router-plugin') } @@ -511,6 +479,7 @@ function buildRequiredPackages({ repoRoot, scenarios, skipPackageBuilds }) { ) const args = [ + 'exec', 'nx', 'run-many', '--target=build', @@ -526,7 +495,7 @@ function buildRequiredPackages({ repoRoot, scenarios, skipPackageBuilds }) { args.push('--skipNxCache') } - execFileSync(process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm', args, { + execFileSync(process.env.npm_execpath || 'pnpm', args, { cwd: repoRoot, stdio: 'inherit', env: process.env, @@ -548,8 +517,6 @@ async function buildViteScenario({ root, outDir, sourcemap }) { build: { outDir, emptyOutDir: true, - target: 'es2022', - minify: 'esbuild', sourcemap: sourcemap ? 'hidden' : false, reportCompressedSize: false, manifest: true, @@ -832,18 +799,6 @@ async function resolveBundleFiles({ outDir, scenario }) { } } -function getCurrentSha(providedSha) { - if (providedSha) { - return providedSha - } - - if (process.env.GITHUB_SHA) { - return process.env.GITHUB_SHA - } - - return execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim() -} - function buildCommitUrl(sha) { const repo = process.env.GITHUB_REPOSITORY @@ -897,6 +852,24 @@ async function appendHistoryFile({ historyPath, measuredAtIso, sha, benches }) { async function main() { const args = parseArgs(process.argv.slice(2)) + const timings = args.timings ? createTimings() : undefined + const finishOverall = timings?.start('overall') + try { + await measure(args, timings) + } finally { + finishOverall?.() + } +} + +async function measure(args, timings) { + if ( + args.measurementsOnly && + (args.sha || args.measuredAt || args.appendHistory) + ) { + throw new Error( + '--measurements-only cannot be combined with report metadata or history options', + ) + } const scriptDir = path.dirname(fileURLToPath(import.meta.url)) const repoRoot = path.resolve(scriptDir, '../../../') @@ -911,14 +884,21 @@ async function main() { const measuredAtIso = args.measuredAt ? toIsoDate(args.measuredAt) : new Date().toISOString() - const sha = getCurrentSha(args.sha) const startedAt = Date.now() const scenarios = filterScenarios(args.scenario) - const packageBuildProjects = buildRequiredPackages({ - repoRoot, - scenarios, - skipPackageBuilds: args.skipPackageBuilds, - }) + const finishPackageBuilds = args.skipPackageBuilds + ? undefined + : timings?.start('package-builds') + let packageBuildProjects + try { + packageBuildProjects = buildRequiredPackages({ + repoRoot, + scenarios, + skipPackageBuilds: args.skipPackageBuilds, + }) + } finally { + finishPackageBuilds?.() + } await fsp.mkdir(resultsDir, { recursive: true }) await fsp.mkdir(distDir, { recursive: true }) @@ -929,18 +909,32 @@ async function main() { const root = path.join(scenariosRoot, scenario.dir) const outDir = path.join(distDir, scenario.outDir || scenario.dir) - await buildScenario({ - root, - outDir, - scenario, - sourcemap: args.sourcemap || args.analysis, - }) + const finishBuild = timings?.start('scenario-build', scenario.id) + try { + await buildScenario({ + root, + outDir, + scenario, + sourcemap: args.sourcemap || args.analysis, + }) + } finally { + finishBuild?.() + } - const bundleInfo = await resolveBundleFiles({ outDir, scenario }) - const sizes = sizesForFiles(bundleInfo.manifestOutDir, bundleInfo.jsFiles) - const initialSizes = sizesForFiles( + const finishManifest = timings?.start('manifest-resolution', scenario.id) + let bundleInfo + try { + bundleInfo = await resolveBundleFiles({ outDir, scenario }) + } finally { + finishManifest?.() + } + const { sizes, initialSizes } = measureFileSizes( bundleInfo.manifestOutDir, + bundleInfo.jsFiles, bundleInfo.initialJsFiles, + timings + ? (phase, durationMs) => timings.record(phase, durationMs, scenario.id) + : undefined, ) const initialFileSet = new Set(bundleInfo.initialJsFiles) const files = sizes.files.map((file) => ({ @@ -970,34 +964,33 @@ async function main() { } if (args.analysis) { - metric.sources = sourceAttributionForFiles( - bundleInfo.manifestOutDir, - bundleInfo.jsFiles, - ) + const finishAnalysis = timings?.start('analysis', scenario.id) + try { + metric.sources = sourceAttributionForFiles( + bundleInfo.manifestOutDir, + bundleInfo.jsFiles, + ) + } finally { + finishAnalysis?.() + } } metrics.push(metric) } const completedAt = Date.now() - const current = { + const measurements = { schemaVersion: 1, benchmarkName: BENCHMARK_NAME, measuredAt: measuredAtIso, - generatedAt: new Date().toISOString(), - sha, status: { state: 'success', - command: `node ${path.relative(repoRoot, fileURLToPath(import.meta.url))}${args.scenario ? ` --scenario ${args.scenario}` : ''}${args.analysis ? ' --analysis' : ''}${args.sourcemap ? ' --sourcemap' : ''}${args.skipPackageBuilds ? ' --skip-package-builds' : ''}`, + command: `node ${path.relative(repoRoot, fileURLToPath(import.meta.url))}${args.scenario ? ` --scenario ${args.scenario}` : ''}${args.analysis ? ' --analysis' : ''}${args.sourcemap ? ' --sourcemap' : ''}${args.timings ? ' --timings' : ''}${args.skipPackageBuilds ? ' --skip-package-builds' : ''}`, scenarioFilter: args.scenario || null, measuredScenarios: scenarios.map((scenario) => scenario.id), packageBuildProjects, skipPackageBuilds: args.skipPackageBuilds, durationMs: completedAt - startedAt, - git: { - sha, - ...getGitStatus(), - }, }, metrics, } @@ -1009,12 +1002,12 @@ async function main() { extra: `raw=${metric.rawBytes}; brotli=${metric.brotliBytes}; initial_gzip=${metric.initialGzipBytes}`, })) - const currentPath = path.join(resultsDir, 'current.json') + const measurementsPath = path.join(resultsDir, 'measurements.json') const benchmarkActionPath = path.join(resultsDir, 'benchmark-action.json') await fsp.writeFile( - currentPath, - JSON.stringify(current, null, 2) + '\n', + measurementsPath, + JSON.stringify(measurements, null, 2) + '\n', 'utf8', ) await fsp.writeFile( @@ -1023,17 +1016,20 @@ async function main() { 'utf8', ) - if (args.appendHistory) { - await appendHistoryFile({ - historyPath: path.resolve(args.appendHistory), - measuredAtIso, - sha, - benches: benchmarkActionRows, - }) + if (!args.measurementsOnly) { + const report = writeReport(resultsDir, { sha: args.sha }) + if (args.appendHistory) { + await appendHistoryFile({ + historyPath: path.resolve(args.appendHistory), + measuredAtIso, + sha: report.sha, + benches: benchmarkActionRows, + }) + } } process.stdout.write( - `Measured ${metrics.length} scenarios. Wrote ${path.relative(repoRoot, currentPath)} and ${path.relative(repoRoot, benchmarkActionPath)}\n`, + `Measured ${metrics.length} scenarios. Wrote ${path.relative(repoRoot, measurementsPath)} and ${path.relative(repoRoot, benchmarkActionPath)}\n`, ) } diff --git a/scripts/benchmarks/bundle-size/pr-report.mjs b/scripts/benchmarks/bundle-size/pr-report.mjs index 8c58563230..eda88d22f0 100644 --- a/scripts/benchmarks/bundle-size/pr-report.mjs +++ b/scripts/benchmarks/bundle-size/pr-report.mjs @@ -10,15 +10,11 @@ const DEFAULT_MARKER = '' const INT_FORMAT = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0, }) -const FIXED_2_FORMAT = new Intl.NumberFormat('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2, -}) -const PERCENT_FORMAT = new Intl.NumberFormat('en-US', { - style: 'percent', - minimumFractionDigits: 2, - maximumFractionDigits: 2, +const FIXED_1_FORMAT = new Intl.NumberFormat('en-US', { + minimumFractionDigits: 1, + maximumFractionDigits: 1, }) +const METRIC_KEYS = ['gzipBytes', 'initialGzipBytes', 'rawBytes', 'brotliBytes'] function parseArgs(argv) { const { values } = parseNodeArgs({ @@ -106,14 +102,14 @@ function formatBytes(bytes, opts = {}) { let value if (absBytes < 1024) { - value = `${INT_FORMAT.format(absBytes)} B` + value = `${INT_FORMAT.format(absBytes)} B` } else { const kib = absBytes / 1024 if (kib < 1024) { - value = `${FIXED_2_FORMAT.format(kib)} KiB` + value = `${FIXED_1_FORMAT.format(kib)} KiB` } else { const mib = kib / 1024 - value = `${FIXED_2_FORMAT.format(mib)} MiB` + value = `${FIXED_1_FORMAT.format(mib)} MiB` } } @@ -126,9 +122,11 @@ function formatDelta(current, baseline) { } const delta = current - baseline - const ratio = baseline === 0 ? 0 : Math.abs(delta / baseline) - const sign = delta > 0 ? '+' : delta < 0 ? '-' : '' - return `${formatBytes(delta, { signed: true })} (${sign}${PERCENT_FORMAT.format(ratio)})` + return formatBytes(delta, { signed: true }) +} + +function formatMetricCell(current, baseline) { + return `${formatBytes(current)}
${formatDelta(current, baseline)}` } function sparkline(values) { @@ -192,6 +190,27 @@ function buildSeriesByScenario(historyEntries) { return map } +function parseBenchmarkExtra(extra) { + if (typeof extra !== 'string') { + return {} + } + + const values = {} + for (const part of extra.split(';')) { + const [key, rawValue] = part.trim().split('=') + const value = Number(rawValue) + if (key && Number.isFinite(value)) { + values[key] = value + } + } + + return { + rawBytes: values.raw, + brotliBytes: values.brotli, + initialGzipBytes: values.initial_gzip, + } +} + function resolveBaselineFromHistory(historyEntries, baseSha) { if (!historyEntries.length) { return { @@ -212,7 +231,10 @@ function resolveBaselineFromHistory(historyEntries, baseSha) { const benchesByName = new Map() for (const bench of baseEntry?.benches || []) { if (typeof bench?.name === 'string' && Number.isFinite(bench?.value)) { - benchesByName.set(bench.name, Number(bench.value)) + benchesByName.set(bench.name, { + gzipBytes: Number(bench.value), + ...parseBenchmarkExtra(bench.extra), + }) } } @@ -228,7 +250,7 @@ function resolveBaselineFromCurrentJson(currentJson) { const benchesByName = new Map() for (const metric of currentJson?.metrics || []) { if (typeof metric?.id === 'string' && Number.isFinite(metric?.gzipBytes)) { - benchesByName.set(metric.id, Number(metric.gzipBytes)) + benchesByName.set(metric.id, metric) } } @@ -272,9 +294,15 @@ async function main() { const rows = [] for (const metric of metrics) { - const baselineValue = baseline.benchesByName.get(metric.id) + const baselineMetric = baseline.benchesByName.get(metric.id) + const hasBaseline = METRIC_KEYS.every((key) => + Number.isFinite(baselineMetric?.[key]), + ) - if (Number.isFinite(baselineValue) && metric.gzipBytes === baselineValue) { + if ( + hasBaseline && + METRIC_KEYS.every((key) => metric[key] === baselineMetric[key]) + ) { continue } @@ -292,12 +320,20 @@ async function main() { rows.push({ id: metric.id, - current: metric.gzipBytes, - raw: metric.rawBytes, - brotli: metric.brotliBytes, - initial: metric.initialGzipBytes, - hasBaseline: Number.isFinite(baselineValue), - deltaCell: formatDelta(metric.gzipBytes, baselineValue), + currentCell: formatMetricCell( + metric.gzipBytes, + baselineMetric?.gzipBytes, + ), + initialCell: formatMetricCell( + metric.initialGzipBytes, + baselineMetric?.initialGzipBytes, + ), + rawCell: formatMetricCell(metric.rawBytes, baselineMetric?.rawBytes), + brotliCell: formatMetricCell( + metric.brotliBytes, + baselineMetric?.brotliBytes, + ), + hasBaseline, trendCell: sparkline(historySeries.slice(-args.trendPoints)), }) } @@ -330,13 +366,13 @@ async function main() { ) lines.push('') lines.push( - '| Scenario | Current (gzip) | Delta vs baseline | Initial gzip | Raw | Brotli | Trend |', + '| Scenario | Current (gzip) | Initial (gzip) | Raw | Brotli | Trend |', ) - lines.push('| --- | ---: | ---: | ---: | ---: | ---: | --- |') + lines.push('| --- | ---: | ---: | ---: | ---: | --- |') for (const row of rows) { lines.push( - `| \`${row.id}\` | ${formatBytes(row.current)} | ${row.deltaCell} | ${formatBytes(row.initial)} | ${formatBytes(row.raw)} | ${formatBytes(row.brotli)} | ${row.trendCell} |`, + `| \`${row.id}\` | ${row.currentCell} | ${row.initialCell} | ${row.rawCell} | ${row.brotliCell} |
${row.trendCell}
|`, ) } diff --git a/scripts/benchmarks/bundle-size/pr-report.test.mjs b/scripts/benchmarks/bundle-size/pr-report.test.mjs index f70081452d..e7e397ec3e 100644 --- a/scripts/benchmarks/bundle-size/pr-report.test.mjs +++ b/scripts/benchmarks/bundle-size/pr-report.test.mjs @@ -9,13 +9,22 @@ import test from 'node:test' const execFileAsync = promisify(execFile) const reportScript = new URL('./pr-report.mjs', import.meta.url) -function metric(id, gzipBytes) { +function metric(id, gzipBytes, overrides = {}) { return { id, gzipBytes, rawBytes: gzipBytes * 3, brotliBytes: gzipBytes - 100, initialGzipBytes: gzipBytes - 10, + ...overrides, + } +} + +function historyBench(value) { + return { + name: value.id, + value: value.gzipBytes, + extra: `raw=${value.rawBytes}; brotli=${value.brotliBytes}; initial_gzip=${value.initialGzipBytes}`, } } @@ -80,8 +89,10 @@ test('renders a concise message when no measured scenario changed', async () => }) test('renders only scenarios that changed against the historical baseline', async () => { + const unchangedMetric = metric('react-router.minimal', 1_000) + const baselineMetric = metric('react-router.full', 1_100) const current = currentJson([ - metric('react-router.minimal', 1_000), + unchangedMetric, metric('react-router.full', 1_200), ]) const history = { @@ -90,8 +101,8 @@ test('renders only scenarios that changed against the historical baseline', asyn { commit: { id: 'baseline-sha' }, benches: [ - { name: 'react-router.minimal', value: 1_000 }, - { name: 'react-router.full', value: 1_100 }, + historyBench(unchangedMetric), + historyBench(baselineMetric), ], }, ], @@ -110,7 +121,12 @@ test('renders only scenarios that changed against the historical baseline', asyn assert.doesNotMatch(report, /`react-router\.minimal`/) assert.match( report, - /\| `react-router\.full` \| 1\.17 KiB \| \+100 B \(\+9\.09%\) \|/, + /\| Scenario \| Current \(gzip\) \| Initial \(gzip\) \| Raw \| Brotli \| Trend \|/, + ) + assert.doesNotMatch(report, /Delta vs baseline|%/) + assert.match( + report, + /\| `react-router\.full` \| 1\.2 KiB
\+100 B \| 1\.2 KiB
\+100 B \| 3\.5 KiB
\+300 B \| 1\.1 KiB
\+100 B \|
▁█<\/pre> \|/,
   )
 })
 
@@ -127,5 +143,22 @@ test('keeps scenarios that do not have baseline data visible', async () => {
     /The following scenarios have bundle-size changes or lack baseline data for comparison:/,
   )
   assert.doesNotMatch(report, /`react-router\.minimal`/)
-  assert.match(report, /\| `new-scenario` \| 900 B \| n\/a \|/)
+  assert.match(
+    report,
+    /\| `new-scenario` \| 900 B
n\/a \| 890 B
n\/a \| 2\.6 KiB
n\/a \| 800 B
n\/a \|/, + ) +}) + +test('renders scenarios when only a secondary metric changed', async () => { + const baselineMetric = metric('react-router.minimal', 1_000) + const current = currentJson([ + metric('react-router.minimal', 1_000, { rawBytes: 3_002 }), + ]) + const baseline = currentJson([baselineMetric]) + const report = await generateReport({ current, baseline }) + + assert.match( + report, + /\| `react-router\.minimal` \| 1,000 B
0 B \| 990 B
0 B \| 2\.9 KiB
\+2 B \| 900 B
0 B \|/, + ) }) diff --git a/scripts/benchmarks/bundle-size/report.mjs b/scripts/benchmarks/bundle-size/report.mjs new file mode 100644 index 0000000000..d5e8e5c029 --- /dev/null +++ b/scripts/benchmarks/bundle-size/report.mjs @@ -0,0 +1,82 @@ +import { execFileSync } from 'node:child_process' +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' +import { parseArgs } from 'node:util' + +const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)) + +function getGitStatus() { + try { + return { + branch: execFileSync('git', ['branch', '--show-current'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim(), + dirty: + execFileSync('git', ['status', '--porcelain'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim().length > 0, + } + } catch { + return { branch: '', dirty: undefined } + } +} + +/** + * Attach the current checkout's metadata after Nx has restored measurements. + * The measurement time and duration still describe the original build. + * @param {string} resultsDir + * @param {{ sha?: string }} [options] + */ +export function writeReport(resultsDir, { sha: providedSha } = {}) { + const measurements = JSON.parse( + fs.readFileSync(path.join(resultsDir, 'measurements.json'), 'utf8'), + ) + const sha = + providedSha || + process.env.GITHUB_SHA || + execFileSync('git', ['rev-parse', 'HEAD'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim() + const report = { + ...measurements, + generatedAt: new Date().toISOString(), + sha, + status: { + ...measurements.status, + git: { sha, ...getGitStatus() }, + }, + } + fs.writeFileSync( + path.join(resultsDir, 'current.json'), + JSON.stringify(report, null, 2) + '\n', + ) + return report +} + +if ( + process.argv[1] && + import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href +) { + try { + const { values } = parseArgs({ + options: { + 'results-dir': { type: 'string' }, + sha: { type: 'string' }, + }, + }) + const resultsDir = values['results-dir'] + ? path.resolve(values['results-dir']) + : path.join(repoRoot, 'benchmarks/bundle-size/results') + writeReport(resultsDir, { sha: values.sha }) + console.log( + `Wrote ${path.relative(repoRoot, path.join(resultsDir, 'current.json'))}`, + ) + } catch (error) { + console.error(error instanceof Error ? error.message : error) + process.exitCode = 1 + } +} diff --git a/scripts/benchmarks/bundle-size/report.test.mjs b/scripts/benchmarks/bundle-size/report.test.mjs new file mode 100644 index 0000000000..5b58fae39c --- /dev/null +++ b/scripts/benchmarks/bundle-size/report.test.mjs @@ -0,0 +1,111 @@ +import assert from 'node:assert/strict' +import { execFileSync, spawnSync } from 'node:child_process' +import fs from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import test from 'node:test' +import { fileURLToPath } from 'node:url' +import { writeReport } from './report.mjs' + +const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)) +const scriptPath = fileURLToPath(new URL('./report.mjs', import.meta.url)) + +/** @param {import('node:test').TestContext} t */ +function fixture(t) { + const root = fs.mkdtempSync(path.join(os.tmpdir(), 'bundle-report-')) + t.after(() => fs.rmSync(root, { recursive: true, force: true })) + const measurements = { + schemaVersion: 1, + benchmarkName: 'Bundle Size (gzip)', + measuredAt: '2026-01-01T00:00:00.000Z', + status: { + state: 'success', + durationMs: 123, + measuredScenarios: ['react-router.minimal'], + }, + metrics: [{ id: 'react-router.minimal', gzipBytes: 100 }], + } + const serialized = JSON.stringify(measurements) + fs.writeFileSync(path.join(root, 'measurements.json'), serialized) + fs.writeFileSync(path.join(root, 'benchmark-action.json'), '[]\n') + return { root, measurements, serialized } +} + +test('refreshes commit metadata without modifying cached measurements or their timestamps', (t) => { + const { root, measurements, serialized } = fixture(t) + writeReport(root, { sha: 'old-commit' }) + const startedAt = Date.now() + const report = writeReport(root, { sha: 'new-commit' }) + assert.equal(report.sha, 'new-commit') + assert.deepEqual(report.status.git, { + sha: 'new-commit', + branch: execFileSync('git', ['branch', '--show-current'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim(), + dirty: + execFileSync('git', ['status', '--porcelain'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim().length > 0, + }) + assert.equal(report.measuredAt, measurements.measuredAt) + assert.equal(report.status.durationMs, measurements.status.durationMs) + assert.deepEqual(report.metrics, measurements.metrics) + assert.ok(Date.parse(report.generatedAt) >= startedAt) + assert.deepEqual( + JSON.parse(fs.readFileSync(path.join(root, 'current.json'), 'utf8')), + report, + ) + assert.equal( + fs.readFileSync(path.join(root, 'measurements.json'), 'utf8'), + serialized, + ) + assert.equal( + fs.readFileSync(path.join(root, 'benchmark-action.json'), 'utf8'), + '[]\n', + ) +}) + +test('CLI uses the current CI SHA, an explicit override, or the checkout SHA', (t) => { + const { root } = fixture(t) + const checkoutSha = execFileSync('git', ['rev-parse', 'HEAD'], { + cwd: repoRoot, + encoding: 'utf8', + }).trim() + /** @type {Array<[string, string[], string]>} */ + const cases = [ + ['ci-commit', [], 'ci-commit'], + ['ci-commit', ['--sha', 'explicit-commit'], 'explicit-commit'], + ['', [], checkoutSha], + ] + for (const [githubSha, args, expected] of cases) { + const result = spawnSync( + process.execPath, + [scriptPath, '--results-dir', root, ...args], + { + env: { ...process.env, GITHUB_SHA: githubSha }, + encoding: 'utf8', + }, + ) + assert.equal(result.status, 0, result.stderr) + const report = JSON.parse( + fs.readFileSync(path.join(root, 'current.json'), 'utf8'), + ) + assert.equal(report.sha, expected) + assert.equal(report.status.git.sha, expected) + } +}) + +test('fails when cached measurements are missing instead of reusing an old report', (t) => { + const { root } = fixture(t) + fs.rmSync(path.join(root, 'measurements.json')) + fs.writeFileSync(path.join(root, 'current.json'), '{"sha":"old-commit"}') + const result = spawnSync( + process.execPath, + [scriptPath, '--results-dir', root], + { encoding: 'utf8' }, + ) + assert.notEqual(result.status, 0) + assert.match(result.stderr, /measurements\.json/) +}) diff --git a/scripts/benchmarks/bundle-size/run.mjs b/scripts/benchmarks/bundle-size/run.mjs new file mode 100644 index 0000000000..a4a0cc73d2 --- /dev/null +++ b/scripts/benchmarks/bundle-size/run.mjs @@ -0,0 +1,255 @@ +#!/usr/bin/env node + +import { spawnSync } from 'node:child_process' +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' +import { parseArgs } from 'node:util' + +const scriptDir = path.dirname(fileURLToPath(import.meta.url)) +const repoRoot = path.resolve(scriptDir, '../../..') + +/** + * @typedef {object} CommandOptions + * @property {string} cwd + * @property {NodeJS.ProcessEnv} env + * @property {'inherit' | ['ignore', number, number]} stdio + * @typedef {(command: string, args: string[], options: CommandOptions) => {status: number | null, error?: Error, signal?: string | null}} Execute + */ + +/** + * @param {string} resultsRoot + * @param {string} name + */ +function namedRunDir(resultsRoot, name) { + if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(name)) { + throw new Error( + 'Run names must start with a letter or digit and contain only letters, digits, hyphens, or underscores.', + ) + } + return path.join(resultsRoot, 'runs', name) +} + +/** + * @param {string[]} argv + * @param {Execute} [execute] + */ +export function run(argv, execute = spawnSync) { + const separator = argv.indexOf('--') + const testArgs = separator === -1 ? [] : argv.slice(separator + 1) + const { values } = parseArgs({ + args: separator === -1 ? argv : argv.slice(0, separator), + allowPositionals: false, + options: { + name: { type: 'string' }, + baseline: { type: 'string' }, + 'test-projects': { type: 'string' }, + scenario: { type: 'string' }, + 'results-dir': { type: 'string' }, + 'dist-dir': { type: 'string' }, + analysis: { type: 'boolean' }, + sourcemap: { type: 'boolean' }, + timings: { type: 'boolean' }, + 'skip-package-builds': { type: 'boolean' }, + help: { type: 'boolean', short: 'h' }, + }, + }) + + if (values.help) { + console.log(`Usage: pnpm benchmark:bundle-size:run [options] [-- test arguments] + + --scenario Comma-separated scenarios; omit for all scenarios + --name Save a named run; existing results are not overwritten + --baseline Compare against a named run or a current.json file + --test-projects Run Nx unit tests before measurement + --results-dir Results root (default: benchmarks/bundle-size/results) + --dist-dir Override the emitted bundle directory + --analysis Include source attribution in current.json + --sourcemap Emit hidden source maps + --timings Record fresh phase timings in measure.log + --skip-package-builds Reuse package builds only when they are unchanged + +Named runs use /runs//current.json. +Without --name, current.json is replaced in the results root. +Logs stay beside current.json; failures print a bounded log tail. +With --scenario, comparisons report only the scenarios measured in this run. +Arguments after -- go to the selected unit tests, not the measurement.`) + return 0 + } + + if (testArgs.length > 0 && !values['test-projects']) { + throw new Error('Test arguments after -- require --test-projects.') + } + if ( + values['test-projects'] !== undefined && + !values['test-projects'].split(',').some((name) => name.trim()) + ) { + throw new Error('--test-projects requires at least one project.') + } + if ( + values.scenario !== undefined && + !values.scenario.split(',').some((name) => name.trim()) + ) { + throw new Error('--scenario requires at least one scenario.') + } + + const resultsRoot = values['results-dir'] + ? path.resolve(values['results-dir']) + : path.join(repoRoot, 'benchmarks/bundle-size/results') + const resultsDir = + values.name === undefined + ? resultsRoot + : namedRunDir(resultsRoot, values.name) + const currentPath = path.join(resultsDir, 'current.json') + let baselinePath + + if (values.name !== undefined && fs.existsSync(currentPath)) { + throw new Error(`Named run already exists: ${values.name}`) + } + if (values.baseline !== undefined) { + baselinePath = fs.realpathSync( + /[/\\]|\.json$/i.test(values.baseline) + ? path.resolve(values.baseline) + : path.join(namedRunDir(resultsRoot, values.baseline), 'current.json'), + ) + const baseline = JSON.parse(fs.readFileSync(baselinePath, 'utf8')) + if (!Array.isArray(baseline.metrics) || baseline.metrics.length === 0) { + throw new Error(`Baseline contains no metrics: ${baselinePath}`) + } + if ( + fs.existsSync(currentPath) && + fs.realpathSync(currentPath) === baselinePath + ) { + throw new Error( + 'The baseline cannot be the current output. Use --name to save it first.', + ) + } + } + + fs.mkdirSync(resultsDir, { recursive: true }) + const env = { + ...process.env, + CI: '1', + NX_DAEMON: 'false', + FORCE_COLOR: '0', + } + + /** + * @param {string} label + * @param {string} command + * @param {string[]} args + */ + function step(label, command, args, logged = true) { + const logPath = path.join(resultsDir, `${label}.log`) + const fd = logged ? fs.openSync(logPath, 'w') : undefined + let result + try { + if (logged) { + console.error(`${label}: ${path.relative(repoRoot, logPath)}`) + } + result = execute(command, args, { + cwd: repoRoot, + env, + stdio: fd === undefined ? 'inherit' : ['ignore', fd, fd], + }) + } finally { + if (fd !== undefined) { + fs.closeSync(fd) + } + } + + if (result.error || result.status !== 0) { + console.error( + `${label} failed: ${result.error?.message || result.signal || `exit ${result.status}`}`, + ) + if (logged) { + const tail = fs + .readFileSync(logPath, 'utf8') + .slice(-8000) + .trimEnd() + .split(/\r?\n/) + .slice(-40) + .join('\n') + if (tail) { + console.error(tail) + } + } + return result.status || 1 + } + return 0 + } + + if (values['test-projects']) { + const status = step('tests', process.env.npm_execpath || 'pnpm', [ + 'exec', + 'nx', + 'run-many', + '--target=test:unit', + `--projects=${values['test-projects']}`, + '--parallel=1', + '--outputStyle=stream', + '--skipRemoteCache', + ...(testArgs.length > 0 ? ['--', ...testArgs] : []), + ]) + if (status !== 0) { + return status + } + } + + const measureArgs = [ + path.join(scriptDir, 'measure.mjs'), + '--results-dir', + resultsDir, + ] + for (const [option, value] of Object.entries({ + scenario: values.scenario, + 'dist-dir': + values['dist-dir'] === undefined + ? undefined + : path.resolve(values['dist-dir']), + })) { + if (value !== undefined) { + measureArgs.push(`--${option}`, value) + } + } + for (const [option, value] of Object.entries({ + analysis: values.analysis, + sourcemap: values.sourcemap, + timings: values.timings, + 'skip-package-builds': values['skip-package-builds'], + })) { + if (value) { + measureArgs.push(`--${option}`) + } + } + + const status = step('measure', process.execPath, measureArgs) + if (status !== 0) { + return status + } + + return step( + 'report', + process.execPath, + [ + path.join(scriptDir, baselinePath ? 'diff.mjs' : 'query.mjs'), + '--current', + currentPath, + ...(baselinePath ? ['--baseline', baselinePath] : []), + ...(baselinePath && values.scenario ? ['--current-only'] : []), + ], + false, + ) +} + +if ( + process.argv[1] && + import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href +) { + try { + process.exitCode = run(process.argv.slice(2)) + } catch (error) { + console.error(error instanceof Error ? error.message : error) + process.exitCode = 1 + } +} diff --git a/scripts/benchmarks/bundle-size/run.test.mjs b/scripts/benchmarks/bundle-size/run.test.mjs new file mode 100644 index 0000000000..335455cb5a --- /dev/null +++ b/scripts/benchmarks/bundle-size/run.test.mjs @@ -0,0 +1,434 @@ +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import fs from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import test from 'node:test' +import { fileURLToPath } from 'node:url' +import { run } from './run.mjs' + +const scriptPath = fileURLToPath(new URL('./run.mjs', import.meta.url)) +const measurePath = fileURLToPath(new URL('./measure.mjs', import.meta.url)) + +/** @param {string} filePath */ +function writeCurrent( + filePath, + gzipBytes = 100, + ids = ['react-router.minimal'], +) { + fs.mkdirSync(path.dirname(filePath), { recursive: true }) + fs.writeFileSync( + filePath, + JSON.stringify({ + metrics: ids.map((id) => ({ + id, + gzipBytes, + initialGzipBytes: gzipBytes, + rawBytes: gzipBytes * 3, + brotliBytes: gzipBytes - 10, + })), + }), + ) +} + +/** @param {import('node:test').TestContext} t */ +function fixture(t, measuredIds = ['react-router.minimal']) { + const root = fs.mkdtempSync(path.join(os.tmpdir(), 'bundle-runner-')) + t.after(() => fs.rmSync(root, { recursive: true, force: true })) + /** @type {Array<{command: string, args: string[], options: import('./run.mjs').CommandOptions}>} */ + const calls = [] + /** @type {string[]} */ + const messages = [] + /** @type {string[]} */ + const reports = [] + t.mock.method( + console, + 'error', + /** @param {string} message */ + (message) => messages.push(message), + ) + + /** @type {import('./run.mjs').Execute} */ + const execute = (command, args, options) => { + calls.push({ command, args, options }) + if (args[0] === measurePath) { + const outputDir = args[args.indexOf('--results-dir') + 1] + assert.ok(outputDir) + writeCurrent(path.join(outputDir, 'current.json'), 90, measuredIds) + } + if (options.stdio !== 'inherit') { + fs.writeSync(options.stdio[1], 'noisy stdout\n') + fs.writeSync(options.stdio[2], 'noisy stderr\n') + return { status: 0 } + } + const result = spawnSync(command, args, { + ...options, + stdio: 'pipe', + encoding: 'utf8', + }) + reports.push(result.stdout) + return result + } + + return { root, calls, messages, reports, execute } +} + +test('runs targeted tests before measurement and saves named results and logs', (t) => { + const { root, calls, messages, reports, execute } = fixture(t) + const status = run( + [ + '--results-dir', + root, + '--name', + 'baseline', + '--scenario', + 'react-router.minimal,react-router.full', + '--test-projects', + '@tanstack/router-core,@tanstack/react-router', + '--', + 'tests/path.test.ts', + 'tests/link.test.tsx', + '-t', + 'links with spaces', + ], + execute, + ) + + assert.equal(status, 0) + assert.equal(calls.length, 3) + const [tests, measure] = calls + assert.ok(tests && measure) + assert.ok(tests.args.includes('--target=test:unit')) + assert.ok(tests.args.includes('--parallel=1')) + assert.ok(tests.args.includes('--skipRemoteCache')) + assert.ok( + tests.args.includes( + '--projects=@tanstack/router-core,@tanstack/react-router', + ), + ) + assert.deepEqual(tests.args.slice(-5), [ + '--', + 'tests/path.test.ts', + 'tests/link.test.tsx', + '-t', + 'links with spaces', + ]) + assert.equal(measure.args[0], measurePath) + assert.ok(measure.args.includes('react-router.minimal,react-router.full')) + assert.ok(!measure.args.includes('--skip-package-builds')) + assert.ok(!measure.args.includes('--timings')) + assert.ok(!measure.args.includes('tests/path.test.ts')) + for (const { options } of calls) { + assert.equal(options.env.CI, '1') + assert.equal(options.env.NX_DAEMON, 'false') + assert.ok(!('shell' in options)) + } + const runDir = path.join(root, 'runs/baseline') + assert.ok(fs.existsSync(path.join(runDir, 'current.json'))) + for (const step of ['tests', 'measure']) { + assert.equal( + fs.readFileSync(path.join(runDir, `${step}.log`), 'utf8'), + 'noisy stdout\nnoisy stderr\n', + ) + } + assert.ok(messages.every((message) => !message.includes('noisy'))) + assert.match(reports.join(''), /react-router\.minimal gzip=90/) +}) + +test('compares a named baseline against current results without changing the baseline', (t) => { + const { root, reports, execute } = fixture(t) + const baseline = path.join(root, 'runs/baseline/current.json') + writeCurrent(baseline) + + assert.equal( + run(['--results-dir', root, '--baseline', 'baseline'], execute), + 0, + ) + assert.match( + reports.join(''), + /react-router\.minimal 100 -> 90 \(-10\) initial=-10 raw=-30 brotli=-10/, + ) + assert.equal( + JSON.parse(fs.readFileSync(baseline, 'utf8')).metrics[0].gzipBytes, + 100, + ) +}) + +test('accepts an external baseline and forwards measurement options', (t) => { + const { root, calls, reports, execute } = fixture(t) + const baseline = path.join(root, 'external baseline.json') + writeCurrent(baseline) + + assert.equal( + run( + [ + '--results-dir', + root, + '--baseline', + baseline, + '--dist-dir', + path.join(root, 'dist with spaces'), + '--analysis', + '--sourcemap', + '--timings', + '--skip-package-builds', + ], + execute, + ), + 0, + ) + assert.deepEqual(calls[0]?.args.slice(3), [ + '--dist-dir', + path.join(root, 'dist with spaces'), + '--analysis', + '--sourcemap', + '--timings', + '--skip-package-builds', + ]) + assert.ok(calls.slice(1).every(({ args }) => !args.includes('--timings'))) + assert.match(reports.join(''), /100 -> 90 \(-10\)/) +}) + +test('targeted comparisons omit unrequested scenarios from a broader baseline', async (t) => { + for (const [ + scenario, + measuredIds, + ] of /** @type {Array<[string, string[]]>} */ ([ + ['react-router.minimal', ['react-router.minimal']], + ['react-router-minimal', ['react-router.minimal']], + [ + ' solid-router.minimal, react-router.minimal ', + ['solid-router.minimal', 'react-router.minimal'], + ], + ])) { + await t.test(scenario, (t) => { + const { root, reports, execute } = fixture(t, measuredIds) + writeCurrent(path.join(root, 'runs/baseline/current.json'), 100, [ + 'react-router.full', + 'react-router.minimal', + 'solid-router.minimal', + ]) + + assert.equal( + run( + [ + '--results-dir', + root, + '--baseline', + 'baseline', + '--scenario', + scenario, + ], + execute, + ), + 0, + ) + assert.equal( + reports.join(''), + [...measuredIds] + .sort() + .map((id) => `${id} 100 -> 90 (-10) initial=-10 raw=-30 brotli=-10\n`) + .join(''), + ) + }) + } +}) + +test('targeted comparisons keep measured scenarios missing from the baseline', (t) => { + const { root, reports, execute } = fixture(t) + writeCurrent(path.join(root, 'runs/baseline/current.json'), 100, [ + 'react-router.full', + ]) + + assert.equal( + run( + [ + '--results-dir', + root, + '--baseline', + 'baseline', + '--scenario', + 'react-router.minimal', + ], + execute, + ), + 0, + ) + assert.equal( + reports.join(''), + 'react-router.minimal n/a -> 90 (n/a) initial=n/a raw=n/a brotli=n/a\n', + ) +}) + +test('unfiltered comparisons retain baseline-only scenarios', (t) => { + const { root, reports, execute } = fixture(t) + writeCurrent(path.join(root, 'runs/baseline/current.json'), 100, [ + 'react-router.full', + ]) + + assert.equal( + run(['--results-dir', root, '--baseline', 'baseline'], execute), + 0, + ) + assert.equal( + reports.join(''), + 'react-router.full 100 -> n/a (n/a) initial=n/a raw=n/a brotli=n/a\n' + + 'react-router.minimal n/a -> 90 (n/a) initial=n/a raw=n/a brotli=n/a\n', + ) +}) + +test('current-only diffs filter JSON output and preserve explicit ID selection', (t) => { + const { root } = fixture(t) + const baseline = path.join(root, 'baseline.json') + const current = path.join(root, 'current.json') + writeCurrent(baseline, 100, ['react-router.full', 'react-router.minimal']) + writeCurrent(current, 90, ['solid-router.minimal', 'react-router.minimal']) + const args = [ + fileURLToPath(new URL('./diff.mjs', import.meta.url)), + '--baseline', + baseline, + '--current', + current, + '--current-only', + '--json', + ] + const result = spawnSync(process.execPath, args, { encoding: 'utf8' }) + assert.equal(result.status, 0, result.stderr) + assert.deepEqual(JSON.parse(result.stdout), [ + { + id: 'react-router.minimal', + baseline: 100, + current: 90, + delta: -10, + initialDelta: -10, + rawDelta: -30, + brotliDelta: -10, + }, + { id: 'solid-router.minimal', current: 90 }, + ]) + + const selected = spawnSync( + process.execPath, + [...args, '--id', 'react-router.full'], + { + encoding: 'utf8', + }, + ) + assert.equal(selected.status, 0, selected.stderr) + assert.deepEqual(JSON.parse(selected.stdout), [ + { id: 'react-router.full', baseline: 100 }, + ]) +}) + +test('stops on test failure, preserves its exit code, and prints only a bounded log tail', (t) => { + const { root, messages } = fixture(t) + let callCount = 0 + const log = `early output\n${'x'.repeat(10_000)}\n${'later output\n'.repeat(60)}last error\n` + const status = run( + ['--results-dir', root, '--test-projects', '@tanstack/react-router'], + (command, args, options) => { + callCount++ + assert.ok(options.stdio !== 'inherit') + fs.writeSync(options.stdio[1], log) + return { status: 42 } + }, + ) + + assert.equal(status, 42) + assert.equal(callCount, 1) + assert.equal(fs.readFileSync(path.join(root, 'tests.log'), 'utf8'), log) + assert.ok(!fs.existsSync(path.join(root, 'measure.log'))) + assert.match(messages.join('\n'), /tests failed: exit 42/) + assert.match(messages.join('\n'), /last error/) + assert.doesNotMatch(messages.join('\n'), /early output|xxx/) + const tail = messages.at(-1) + assert.ok(tail) + assert.ok(tail.split('\n').length <= 40) + assert.ok(tail.length <= 8000) +}) + +test('bounds failure output even when a log contains one very long line', (t) => { + const { root, messages } = fixture(t) + assert.equal( + run(['--results-dir', root], (command, args, options) => { + assert.ok(options.stdio !== 'inherit') + fs.writeSync(options.stdio[1], 'x'.repeat(20_000)) + return { status: 1 } + }), + 1, + ) + assert.equal(messages.at(-1), 'x'.repeat(8000)) +}) + +test('does not report stale results after a failed or interrupted measurement', async (t) => { + for (const result of [ + { status: 17 }, + { status: null, signal: 'SIGTERM' }, + { status: null, error: new Error('spawn failed') }, + ]) { + await t.test( + result.error?.message || result.signal || `exit ${result.status}`, + (t) => { + const { root, messages } = fixture(t) + let callCount = 0 + writeCurrent(path.join(root, 'current.json')) + assert.equal( + run(['--results-dir', root], () => { + callCount++ + return result + }), + result.status || 1, + ) + assert.equal(callCount, 1) + assert.match(messages.join('\n'), /measure failed:/) + }, + ) + } +}) + +test('rejects invalid inputs and protects saved results before running commands', (t) => { + const { root, calls, execute } = fixture(t) + const current = path.join(root, 'current.json') + writeCurrent(current) + writeCurrent(path.join(root, 'runs/baseline/current.json')) + fs.writeFileSync(path.join(root, 'empty.json'), '{"metrics":[]}') + fs.writeFileSync(path.join(root, 'invalid.json'), '{') + /** @type {Array<[string[], RegExp]>} */ + const cases = [ + [['--unknown'], /Unknown option/], + [['--', 'tests/path.test.ts'], /require --test-projects/], + [['--test-projects', ' , '], /at least one project/], + [['--scenario', ' , '], /at least one scenario/], + [['--name', '../escape'], /Run names/], + [['--name', 'baseline'], /Named run already exists/], + [['--baseline', 'missing'], /ENOENT/], + [['--baseline', current], /baseline cannot be the current output/], + [['--baseline', path.join(root, 'empty.json')], /no metrics/], + [['--baseline', path.join(root, 'invalid.json')], /JSON/], + ] + for (const [args, error] of cases) { + assert.throws(() => run(['--results-dir', root, ...args], execute), error) + } + assert.equal(calls.length, 0) + assert.equal( + JSON.parse(fs.readFileSync(current, 'utf8')).metrics[0].gzipBytes, + 100, + ) +}) + +test('reports help and argument errors through the CLI entry point', () => { + const help = spawnSync(process.execPath, [scriptPath, '--help'], { + encoding: 'utf8', + }) + assert.equal(help.status, 0) + assert.match(help.stdout, /Usage: pnpm benchmark:bundle-size:run/) + assert.match( + help.stdout, + /--timings\s+Record fresh phase timings in measure\.log/, + ) + const invalid = spawnSync(process.execPath, [scriptPath, '--unknown'], { + encoding: 'utf8', + }) + assert.equal(invalid.status, 1) + assert.match(invalid.stderr, /Unknown option/) +}) diff --git a/scripts/benchmarks/bundle-size/timings.mjs b/scripts/benchmarks/bundle-size/timings.mjs new file mode 100644 index 0000000000..15d856f96b --- /dev/null +++ b/scripts/benchmarks/bundle-size/timings.mjs @@ -0,0 +1,20 @@ +// Timings are diagnostics only; never include them in cacheable size metrics. +export function createTimings(write = (line) => process.stderr.write(line)) { + function record(phase, durationMs, scenario) { + write( + `[bundle-size:timing] ${JSON.stringify({ + phase, + ...(scenario ? { scenario } : {}), + durationMs: Math.round(durationMs * 1000) / 1000, + })}\n`, + ) + } + + return { + record, + start(phase, scenario) { + const started = performance.now() + return () => record(phase, performance.now() - started, scenario) + }, + } +} diff --git a/scripts/benchmarks/bundle-size/timings.test.mjs b/scripts/benchmarks/bundle-size/timings.test.mjs new file mode 100644 index 0000000000..8d895aadc5 --- /dev/null +++ b/scripts/benchmarks/bundle-size/timings.test.mjs @@ -0,0 +1,35 @@ +import assert from 'node:assert/strict' +import test from 'node:test' +import { createTimings } from './timings.mjs' + +test('emits labelled JSON timing lines with scenario context when supplied', (t) => { + let now = 100 + t.mock.method(performance, 'now', () => now) + const lines = [] + const timings = createTimings((line) => lines.push(line)) + timings.record('gzip', 1.234567, 'react-router.minimal') + const finishOverall = timings.start('overall') + now = 112.345678 + const finishScenario = timings.start('scenario-build', 'react-router.minimal') + now = 123.456789 + finishScenario() + now = 150.123456 + finishOverall() + + const records = lines.map((line) => { + assert.ok(line.startsWith('[bundle-size:timing] ')) + assert.ok(line.endsWith('\n')) + return JSON.parse(line.slice('[bundle-size:timing] '.length)) + }) + assert.deepEqual(records[0], { + phase: 'gzip', + scenario: 'react-router.minimal', + durationMs: 1.235, + }) + assert.deepEqual(records[1], { + phase: 'scenario-build', + scenario: 'react-router.minimal', + durationMs: 11.111, + }) + assert.deepEqual(records[2], { phase: 'overall', durationMs: 50.123 }) +}) diff --git a/scripts/nx/playwright-plugin.md b/scripts/nx/playwright-plugin.md index a9f33bb4c8..665e58be4d 100644 --- a/scripts/nx/playwright-plugin.md +++ b/scripts/nx/playwright-plugin.md @@ -45,7 +45,7 @@ Supported toolchains: For each `{ toolchain, mode }` entry, the plugin generates: -- `build:e2e---` +- `build::` - `test:e2e---` If `shards > 1`, it also generates: @@ -59,7 +59,7 @@ Finally, it generates: ## 3. Environment variables injected by inferred targets -Each inferred `build:e2e:*` and `test:e2e:*` target sets: +Each inferred `build::` and `test:e2e---` target sets: - `MODE=` - `TOOLCHAIN=` @@ -67,25 +67,23 @@ Each inferred `build:e2e:*` and `test:e2e:*` target sets: - `E2E_DIST=dist--` - `E2E_DIST_DIR=dist--` -Each inferred `test:e2e:*` target also sets: - -- `E2E_PORT_KEY=--` -- For shard targets: `E2E_PORT_KEY=---shard--of-` - ## 4. Build behavior and webServer command -Each inferred e2e target depends on the inferred `build:e2e---` -target, which runs: +Each inferred e2e target depends on the inferred `build::` +target. It runs `vite build && tsc --noEmit` or +`rsbuild build && tsc --noEmit`, selecting the toolchain explicitly. Ordinary +package build scripts do not need to know about E2E mocking. -```sh -vite build && tsc --noEmit -``` - -with the mode/toolchain env above. - -This command is intentionally fixed (it does not call `pnpm build`). This avoids -accidentally selecting the wrong build path in projects that include multiple -toolchains. +The React, Solid, and Vue basic examples preload the same MSW handlers in +Nx prerender builds (through mode metadata) and Playwright application servers +with Node's native option: +`NODE_OPTIONS='--import=@tanstack/router-e2e-utils/mock-api'`. +The handlers return canned posts and users at `https://jsonplaceholder.typicode.com` inside +each Node process, including prerendering. No API listener or fixture port is +needed. Playwright starts only the application server. A cached build uses the +same URL when started by a fresh process with the preload enabled. Ordinary +`pnpm dev`, builds, and standalone servers use the public API without MSW. +Application code uses the public URL in both cases; test setup enables mocking. The inferred build target uses standard production inputs and explicit mode- specific outputs (`dist--`). Mode env values are passed through @@ -99,7 +97,7 @@ Good: ```ts webServer: { command: `PORT=${PORT} pnpm start`, - url: baseURL, + wait: appServerReady, } ``` @@ -110,7 +108,7 @@ const distDir = process.env.E2E_DIST_DIR ?? 'dist' webServer: { command: `pnpm preview --outDir ${distDir} --port ${PORT}`, - url: baseURL, + wait: appServerReady, } ``` @@ -119,63 +117,50 @@ Avoid: ```ts webServer: { command: `MODE=spa pnpm build && PORT=${PORT} pnpm start`, - url: baseURL, + wait: appServerReady, } ``` -## 5. Use `E2E_PORT_KEY` for all server ports +## 5. Let each server bind its own port -If your setup uses `getTestServerPort`, `getDummyServerPort`, -`e2eStartDummyServer`, or `e2eStopDummyServer`, use -`process.env.E2E_PORT_KEY` first. +Use port `0` in server commands. The OS chooses a free port while binding the +listening socket. Do not reserve ports, write port files, or restore ports from +Nx outputs. + +Playwright's `webServer.wait` captures the address printed after listening. +It exports named capture groups to subsequent servers and test workers. The +shared `appServerReady` pattern captures `E2E_APP_PORT`; configs read that value +when reloaded in workers to configure `use.baseURL`. ```ts -import { getTestServerPort } from '@tanstack/router-e2e-utils' -import packageJson from './package.json' with { type: 'json' } +import { appServerReady } from '@tanstack/router-e2e-utils' -const e2ePortKey = process.env.E2E_PORT_KEY ?? packageJson.name -const PORT = await getTestServerPort(e2ePortKey) +const baseURL = `http://localhost:${process.env.E2E_APP_PORT ?? 0}` + +// Inside defineConfig: +use: { baseURL }, +webServer: { + command: 'pnpm preview --port 0', + wait: appServerReady, + reuseExistingServer: false, +}, ``` -Dummy server setup/teardown should use the same key: +Canned posts/users requests use `https://jsonplaceholder.typicode.com`. Node builds and +servers preload `@tanstack/router-e2e-utils/mock-api` through `NODE_OPTIONS`. +Browser API suites import `apiTest as test` from the E2E utilities. That fixture +uses the official MSW Playwright adapter with the same handlers. Opt in only +where the API is needed: Playwright routing disables the browser HTTP cache. -```ts -await e2eStartDummyServer(process.env.E2E_PORT_KEY ?? packageJson.name) -await e2eStopDummyServer(process.env.E2E_PORT_KEY ?? packageJson.name) -``` +External-navigation tests use another hostname on the existing app listener, +with a static HTML asset when the test needs a distinct destination document. +No API server, fixture-port environment variable, or build launcher is needed. -## 6. Clean stale port files once per Playwright run +Custom servers must print their actual `server.address().port`, not the +requested port. SPA servers bind their backend first and use its actual port +for proxying. Playwright owns server shutdown. -If the project allocates ports through `@tanstack/router-e2e-utils`, clean stale -`port-*.txt` files before resolving the port. - -Important: do this only in the main Playwright config load. Playwright loads the -config more than once, and unconditional cleanup can remap the port after the -web server has already started. - -```ts -import fs from 'node:fs' -import packageJson from './package.json' with { type: 'json' } - -const e2ePortKey = process.env.E2E_PORT_KEY ?? packageJson.name - -if (process.env.TEST_WORKER_INDEX === undefined) { - for (const portFile of [ - `port-${e2ePortKey}.txt`, - `port-${e2ePortKey}_start.txt`, - `port-${e2ePortKey}-external.txt`, - ]) { - fs.rmSync(portFile, { force: true }) - } -} -``` - -Include the `*_start` file only if your test setup allocates a separate -`START_PORT` key. - -Avoid broad cleanup such as `rm -rf port*.txt` in shared shard runs. - -## 7. Run inferred targets +## 6. Run inferred targets Examples: diff --git a/scripts/nx/playwright-plugin.ts b/scripts/nx/playwright-plugin.ts index d02276d269..ce80933064 100644 --- a/scripts/nx/playwright-plugin.ts +++ b/scripts/nx/playwright-plugin.ts @@ -1,12 +1,12 @@ import { dirname } from 'node:path' import { createNodesFromFiles, readJsonFile } from '@nx/devkit' import type { - CreateNodesContextV2, - CreateNodesV2, + CreateNodes, + CreateNodesContext, TargetConfiguration, } from '@nx/devkit' -export const createNodesV2: CreateNodesV2 = [ +export const createNodes: CreateNodes = [ '**/package.json', async (configFiles, options, context) => { return await createNodesFromFiles( @@ -21,7 +21,7 @@ export const createNodesV2: CreateNodesV2 = [ function createNodesInternal( configFilePath: string, - _context: CreateNodesContextV2, + _context: CreateNodesContext, ) { const projectConfiguration = readJsonFile<{ name?: string @@ -69,7 +69,6 @@ function createNodesInternal( const { targets, targetGroupEntries } = buildShardedTargets( root, - packageName, projectConfiguration.nx.metadata.playwrightShards, ) // Project configuration to be merged into the rest of the Nx configuration @@ -90,10 +89,15 @@ function createNodesInternal( const CI_TARGET_NAME = 'test:e2e' const MODE_TARGET_SEPARATOR = '--' -const TEST_INPUTS: TargetConfiguration['inputs'] = ['default', '^production'] +const TEST_INPUTS: TargetConfiguration['inputs'] = [ + 'default', + 'dependentTaskOutputs', + '^buildProduction', +] const BUILD_INPUTS: TargetConfiguration['inputs'] = [ - 'production', - '^production', + 'buildProduction', + 'dependentTaskOutputs', + '^buildProduction', ] const PLAYWRIGHT_TOOLCHAINS = ['vite', 'rsbuild'] as const @@ -107,6 +111,32 @@ const PLAYWRIGHT_BUILD_COMMANDS: Record = { rsbuild: 'rsbuild build && tsc --noEmit', } +function captureCommandOutput(command: string, outputFile?: string): string { + if (!outputFile) { + return command + } + + if (!/^[a-zA-Z0-9._-]+$/.test(outputFile)) { + throw new Error( + `[Playwright Sharding Plugin] Invalid E2E_BUILD_LOG value: ${outputFile}. ` + + `Expected a filename containing only letters, numbers, dots, dashes, and underscores.`, + ) + } + + const escapedCommand = command.replaceAll("'", "'\\''") + return `bash -o pipefail -c '{ ${escapedCommand}; } 2>&1 | tee ${outputFile}'` +} + +function getTestOutputs( + modeKey: string, + taskKey: string, +): TargetConfiguration['outputs'] { + return [ + `{projectRoot}/test-results/${taskKey}`, + `{projectRoot}/violations.${modeKey}.*.json`, + ] +} + type PlaywrightModeMetadata = { toolchain: PlaywrightToolchain mode: PlaywrightMode @@ -217,7 +247,6 @@ function buildModeTargets( const targetGroup: Array = [] const ciDependsOnTargets: Array<{ target: string - projects: 'self' params: 'forward' }> = [] @@ -231,22 +260,28 @@ function buildModeTargets( const buildTargetName = `build:${modeMetadata.toolchain}:${modeMetadata.mode}${modeMetadata.name ? `:${modeMetadata.name}` : ''}` const shardCount = modeMetadata.shards ?? 1 const distDir = `dist-${modeMetadata.toolchain}-${modeMetadata.mode}${variantPathSuffix}` - const modeEnv = { + const modeKey = `${modeMetadata.toolchain}-${modeMetadata.mode}${variantPathSuffix}` + const modeEnv: Record = { ...modeMetadata.env, MODE: modeMetadata.mode, TOOLCHAIN: modeMetadata.toolchain, E2E_TOOLCHAIN: modeMetadata.toolchain, + E2E_MODE_KEY: modeKey, E2E_DIST: distDir, E2E_DIST_DIR: distDir, } - const modePortKey = `${packageName}-${modeMetadata.toolchain}-${modeMetadata.mode}${variantPathSuffix}` + const buildLog = modeEnv.E2E_BUILD_LOG + const modeTaskKey = `${packageName}-${modeKey}-e2e` const modeDescription = `${modeMetadata.toolchain}/${modeMetadata.mode}${modeMetadata.name ? `/${modeMetadata.name}` : ''}` const modeShardTargets: Array = [] targets[buildTargetName] = { executor: 'nx:run-commands', options: { - command: PLAYWRIGHT_BUILD_COMMANDS[modeMetadata.toolchain], + command: captureCommandOutput( + PLAYWRIGHT_BUILD_COMMANDS[modeMetadata.toolchain], + buildLog, + ), cwd: projectRoot, env: modeEnv, }, @@ -254,7 +289,10 @@ function buildModeTargets( cache: true, inputs: BUILD_INPUTS, dependsOn: ['^build'], - outputs: [`{projectRoot}/${distDir}`], + outputs: [ + `{projectRoot}/${distDir}`, + ...(buildLog ? [`{projectRoot}/${buildLog}`] : []), + ], metadata: { technologies: ['playwright'], description: `Build artifacts for ${modeDescription} e2e tests`, @@ -266,15 +304,14 @@ function buildModeTargets( targets[modeTargetName] = { executor: 'nx:run-commands', options: { - command: 'playwright test --project=chromium', + command: `playwright test --project=chromium --output=test-results/${modeTaskKey}`, cwd: projectRoot, - env: { - ...modeEnv, - E2E_PORT_KEY: modePortKey, - }, + env: modeEnv, }, + parallelism: false, cache: true, inputs: TEST_INPUTS, + outputs: getTestOutputs(modeKey, modeTaskKey), dependsOn: [buildTargetName], metadata: { technologies: ['playwright'], @@ -285,20 +322,19 @@ function buildModeTargets( } else { for (let shardIndex = 1; shardIndex <= shardCount; shardIndex++) { const shardTargetName = `${modeTargetName}${MODE_TARGET_SEPARATOR}shard-${shardIndex}-of-${shardCount}` - const shardPortKey = `${modePortKey}-shard-${shardIndex}-of-${shardCount}` + const shardTaskKey = `${modeTaskKey}-shard-${shardIndex}-of-${shardCount}` targets[shardTargetName] = { executor: 'nx:run-commands', options: { - command: `playwright test --project=chromium --shard=${shardIndex}/${shardCount}`, + command: `playwright test --project=chromium --shard=${shardIndex}/${shardCount} --output=test-results/${shardTaskKey}`, cwd: projectRoot, - env: { - ...modeEnv, - E2E_PORT_KEY: shardPortKey, - }, + env: modeEnv, }, + parallelism: false, cache: true, inputs: TEST_INPUTS, + outputs: getTestOutputs(modeKey, shardTaskKey), dependsOn: [buildTargetName], metadata: { technologies: ['playwright'], @@ -324,7 +360,6 @@ function buildModeTargets( inputs: TEST_INPUTS, dependsOn: modeShardTargets.map((shardTargetName) => ({ target: shardTargetName, - projects: 'self' as const, params: 'forward' as const, })), metadata: { @@ -337,7 +372,6 @@ function buildModeTargets( ciDependsOnTargets.push({ target: modeTargetName, - projects: 'self', params: 'forward', }) } @@ -361,7 +395,6 @@ function buildModeTargets( function buildShardedTargets( projectRoot: string, - packageName: string, shardCount: number, ): { targets: Record @@ -373,17 +406,14 @@ function buildShardedTargets( // Create individual shard targets for (let shardIndex = 1; shardIndex <= shardCount; shardIndex++) { const shardTargetName = `${CI_TARGET_NAME}--shard-${shardIndex}-of-${shardCount}` - const e2ePortKey = `${packageName}-shard-${shardIndex}-of-${shardCount}` targets[shardTargetName] = { executor: 'nx:run-commands', options: { command: `playwright test --project=chromium --shard=${shardIndex}/${shardCount}`, cwd: projectRoot, - env: { - E2E_PORT_KEY: e2ePortKey, - }, }, + parallelism: false, cache: true, inputs: TEST_INPUTS, dependsOn: [`^build`, 'build'], @@ -411,7 +441,6 @@ function buildShardedTargets( inputs: TEST_INPUTS, dependsOn: targetGroup.map((shardTargetName) => ({ target: shardTargetName, - projects: 'self' as const, params: 'forward' as const, })), metadata: { diff --git a/scripts/set-ts-version.js b/scripts/set-ts-version.js index 23e9063a0f..4a6724c4a9 100644 --- a/scripts/set-ts-version.js +++ b/scripts/set-ts-version.js @@ -12,7 +12,10 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url)) const ROOT_PACKAGE_JSON = join(__dirname, '..', 'package.json') const PACKAGES_DIR = join(__dirname, '..', 'packages') -const SUPPORTED_TS_VERSIONS = ['5.4', '5.5', '5.6', '5.7', '5.8', '5.9'] +const SUPPORTED_TS_VERSIONS = ['5.6', '5.7', '5.8', '5.9', '6.0', '7.0'] +const API_COMPAT_TS_VERSION = '6.0' +const API_COMPAT_TS_RANGE = '^6.0.2' +const LATEST_TS_RANGE = '^7.0.2' const LATEST_TS_VERSION = SUPPORTED_TS_VERSIONS[SUPPORTED_TS_VERSIONS.length - 1] @@ -42,7 +45,7 @@ function updatePackageJson(packagePath) { scriptKeys.forEach((key) => { if (key.startsWith('test:types:')) { const script = packageJson.scripts[key] - const match = script.match(/(?:node \S+\/tsc\.js|tsc)(.*)/) + const match = script.match(/(?:node \S+\/tsc\.js|tsc6|tsc)(.*)/) cliArgs[key] = match ? match[1].trim() : '' delete updatedScripts[key] } @@ -65,6 +68,8 @@ function updatePackageJson(packagePath) { if (i === SUPPORTED_TS_VERSIONS.length - 1) { // Use "tsc" directly for the latest version newScripts[scriptKey] = `tsc ${previousLatestArgs}`.trim() + } else if (version === API_COMPAT_TS_VERSION) { + newScripts[scriptKey] = `tsc6 ${cliArgs[scriptKey] || ''}`.trim() } else { const args = cliArgs[scriptKey] || '' newScripts[scriptKey] = @@ -90,8 +95,11 @@ function updateRootPackageJson() { const rootPackageJson = JSON.parse(readFileSync(ROOT_PACKAGE_JSON, 'utf8')) rootPackageJson.devDependencies = rootPackageJson.devDependencies || {} - // Update main TypeScript version - rootPackageJson.devDependencies['typescript'] = `^${LATEST_TS_VERSION}.0` + // TypeScript 7 provides tsc, while TypeScript 6 provides the legacy API. + rootPackageJson.devDependencies['@typescript/native'] = + `npm:typescript@${LATEST_TS_RANGE}` + rootPackageJson.devDependencies['typescript'] = + `npm:@typescript/typescript6@${API_COMPAT_TS_RANGE}` // Remove old TypeScript aliases Object.keys(rootPackageJson.devDependencies).forEach((dep) => { @@ -101,10 +109,12 @@ function updateRootPackageJson() { }) // Add supported TypeScript aliases - SUPPORTED_TS_VERSIONS.slice(0, -1).forEach((version) => { - rootPackageJson.devDependencies[`typescript${version.replace('.', '')}`] = - `npm:typescript@${version}` - }) + SUPPORTED_TS_VERSIONS.slice(0, -1) + .filter((version) => version !== API_COMPAT_TS_VERSION) + .forEach((version) => { + rootPackageJson.devDependencies[`typescript${version.replace('.', '')}`] = + `npm:typescript@${version}` + }) writeFileSync( ROOT_PACKAGE_JSON, diff --git a/scripts/update-example-deps.mjs b/scripts/update-example-deps.mjs index 87289a9e2a..848d125567 100644 --- a/scripts/update-example-deps.mjs +++ b/scripts/update-example-deps.mjs @@ -1,19 +1,39 @@ import fs from 'fs' import path from 'node:path' import { globSync } from 'node:fs' +import { execSync } from 'node:child_process' const rootDir = path.join(import.meta.dirname, '..') -// Build a map of package name -> current version from workspace const packagesDir = path.join(rootDir, 'packages') -const packageMap = Object.fromEntries( +const workspacePackageRanges = Object.fromEntries( globSync('*/package.json', { cwd: packagesDir }).map((p) => { const pkg = JSON.parse(fs.readFileSync(path.join(packagesDir, p), 'utf-8')) - return [pkg.name, pkg.version] + return [pkg.name, `^${pkg.version}`] }), ) -// Update all example package.json files +const catalog = JSON.parse( + execSync('pnpm config get catalog --json', { + cwd: rootDir, + encoding: 'utf-8', + }), +) +const catalogDependencies = ['@tanstack/react-query', 'redaxios', 'vitest'] +const catalogPackageRanges = Object.fromEntries( + catalogDependencies.map((name) => { + const range = catalog[name] + if (!range) { + throw new Error(`Missing catalog entry for ${name}`) + } + return [name, range] + }), +) +const exampleDependencyRanges = { + ...workspacePackageRanges, + ...catalogPackageRanges, +} + const examplesDir = path.join(rootDir, 'examples') const examplePkgPaths = globSync('**/package.json', { cwd: examplesDir, @@ -30,10 +50,13 @@ for (const relPath of examplePkgPaths) { let changed = false for (const depType of ['dependencies', 'devDependencies']) { const deps = pkg[depType] - if (!deps) continue + if (!deps) { + continue + } for (const [name, range] of Object.entries(deps)) { - if (packageMap[name] && range !== `^${packageMap[name]}`) { - deps[name] = `^${packageMap[name]}` + const expectedRange = exampleDependencyRanges[name] + if (expectedRange && range !== expectedRange) { + deps[name] = expectedRange changed = true } } diff --git a/skills/bundle-size-optimization/SKILL.md b/skills/bundle-size-optimization/SKILL.md index d24538be69..1b6b5ebe3a 100644 --- a/skills/bundle-size-optimization/SKILL.md +++ b/skills/bundle-size-optimization/SKILL.md @@ -7,28 +7,47 @@ description: Use when working in this repository on JS bundle size, gzip regress ## Overview -Optimize measured client bundles, not source text. The source of truth is `@benchmarks/bundle-size:build`, `benchmarks/bundle-size/results/current.json`, and emitted JS in `benchmarks/bundle-size/dist/`. +Optimize measured client bundles, not source text. The source of truth is `@benchmarks/bundle-size:measure`, `benchmarks/bundle-size/results/current.json`, and emitted JS in `benchmarks/bundle-size/dist/`. +Use `benchmark:bundle-size:run` for local iterations. It uses the same measurement script and builds the selected packages through Nx. ## Commands -| Need | Command | -| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Full benchmark | `CI=1 NX_DAEMON=false pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache --skipNxCache >/tmp/bundle-size-build.log 2>&1 && pnpm benchmark:bundle-size:query` | -| One scenario | `CI=1 NX_DAEMON=false pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache --skipNxCache -- --scenario react-router.minimal >/tmp/bundle-size-build.log 2>&1 && pnpm benchmark:bundle-size:query --id react-router.minimal` | -| Read result | `pnpm benchmark:bundle-size:query --id react-router.minimal` | -| Compare results | `pnpm benchmark:bundle-size:diff --baseline /tmp/base-current.json --id react-router.minimal` | -| History deltas | `git fetch --quiet origin gh-pages && pnpm benchmark:bundle-size:history --id react-router.minimal --top-deltas 20` | -| Source attribution | `CI=1 NX_DAEMON=false pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache --skipNxCache -- --scenario react-router.minimal --analysis >/tmp/bundle-size-build.log 2>&1 && pnpm benchmark:bundle-size:analyze --id react-router.minimal` | -| Symbol refs | `pnpm ts:symbol-references -- --project packages/router-core/tsconfig.json --file packages/router-core/src/utils.ts --symbol last` | +| Need | Command | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Full benchmark | `pnpm benchmark:bundle-size:run` | +| Save baseline | `pnpm benchmark:bundle-size:run --name baseline --scenario react-router.minimal` | +| Measure and compare | `pnpm benchmark:bundle-size:run --baseline baseline --scenario react-router.minimal` | +| Save a candidate | `pnpm benchmark:bundle-size:run --name candidate --baseline baseline --scenario react-router.minimal` | +| Test, measure, compare | `pnpm benchmark:bundle-size:run --baseline baseline --scenario react-router.minimal --test-projects @tanstack/router-core,@tanstack/react-router -- tests/path.test.ts tests/link.test.tsx` | +| Read result | `pnpm benchmark:bundle-size:query --id react-router.minimal` | +| Compare existing results | `pnpm benchmark:bundle-size:diff --baseline ./baseline.json --id react-router.minimal` | +| History deltas | `git fetch --quiet origin gh-pages && pnpm benchmark:bundle-size:history --id react-router.minimal --top-deltas 20` | +| Collect source attribution | `pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis` | +| Read source attribution | `pnpm benchmark:bundle-size:analyze --id react-router.minimal` | +| Symbol refs | `pnpm ts:symbol-references -- --project packages/router-core/tsconfig.json --file packages/router-core/src/utils.ts --symbol last` | + +Named runs save metrics and logs in `benchmarks/bundle-size/results/runs//`. Existing named results cannot be overwritten. +Without `--name`, runs replace `results/current.json` and the logs for the steps they run. +`--baseline` accepts a run name or a JSON file path. `--results-dir ` changes the results root for the current and named runs. +Emitted bundles still use `dist/` unless `--dist-dir` specifies another directory. +For named results, pass `--current benchmarks/bundle-size/results/runs//current.json` to the query, diff, or analysis tools. ## Rules - Run one Nx command at a time. -- Redirect noisy Nx build output to a log file, then print only `query`, `diff`, or `analyze` output. If the build fails, search/read the log for the error instead of printing the full log. +- Use the runner instead of shell chains for environment variables, redirection, exit codes, log tails, and result queries. +- For agent runs, use `pnpm --silent benchmark:bundle-size:run ...` to omit the package-manager command echo. +- The runner sets `CI=1` and `NX_DAEMON=false`. It saves full output in `tests.log` and `measure.log` beside `current.json`. +- If a step fails, the runner stops and prints at most 40 log lines, limited to 8,000 characters. Read the reported log for more detail. +- Quiet stdout does not indicate an Nx hang. Inspect the reported log for progress before applying the Nx reset/retry guardrail. +- Use `--test-projects` for the packages that changed. Pass unit-test file selectors and flags after `--`. +- The runner does not select tests automatically. Keep type tests, performance benchmarks, and e2e tests separate. +- Keep baseline and candidate scenario selections and measurement flags identical. Use a new `--name` for each retained snapshot. +- Do not add `--skip-package-builds` after package source changes. The default rebuilds through Nx and preserves valid package caches. - Track `gzipBytes` first; also inspect `initialGzipBytes`, `rawBytes`, `brotliBytes`, `jsFiles`, and per-file `files`. - Dist paths use `scenarioDir`/`outDir`, not metric ids: `react-router.minimal` maps to `dist/react-router-minimal/`. - For tiny changes, measure after each candidate; gzip can move opposite raw bytes. -- To compare a base commit, run the same scenario in a separate worktree under `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode` and diff the two `current.json` files. +- To compare a base commit, measure the same scenario in a separate worktree. Pass its saved `current.json` path to `--baseline`. - Use history for prior patterns and baselines, not source attribution. It is commit-level data. - Runtime performance and security may never be sacrificed for bundle size. - Do not stop after the first verified win. Keep iterating through reasonable local, emitted-JS, and algorithmic candidates until measured regressions, readability, or risk rule out the remaining paths. @@ -71,11 +90,11 @@ Before calling an optimization final, prove which exact production hunks should ## Optimization Loop -1. Measure baseline scenario. +1. Measure the baseline scenario with `--name baseline`. 2. Inspect diff, emitted JS, per-file sizes, and analysis sources if needed. 3. Analyze the algorithm before syntax. Identify redundant loops, duplicate branches, repeated scans/slices/lowercasing, allocation-heavy paths, search order, and data-shape choices. 4. Make the smallest behavior-preserving algorithmic edit that removes work or code shape first; use syntax-only edits only after algorithmic candidates are exhausted. -5. Re-measure and keep only proven wins. +5. Re-measure with `--baseline baseline` and keep only proven wins. 6. Run package unit/types, relevant e2e, and `git diff --check`. 7. Run the attribution round, then the post-optimization coverage/perf workflow before finalizing. @@ -128,3 +147,8 @@ Rolldown removes code only when unused and side-effect-free. Property reads may - Skipping behavior or benchmark tests because the change is “only bundle size.” - Skipping hunk-level attribution and keeping changes only because the full candidate improved. - Trading runtime performance, security, readability, or maintainability for bytes. + +## Meta work + +If you need to work on the bundle size measurements / workflow themselves, +read `benchmarks/bundle-size/README.md` diff --git a/tsconfig.json b/tsconfig.json index f3765b8ed3..7228771323 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, - "lib": ["DOM", "DOM.Iterable", "ES2022"], + "lib": ["DOM", "DOM.Iterable", "DOM.AsyncIterable", "ES2022"], "module": "ESNext", "moduleResolution": "Bundler", "noEmit": true,