Skip to content
Source
Sign inSign up
TanStack/router

refactor(router-plugin): remove `compilerPlugins` and splitter internals from the root entry #8853

MergedSheraff(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/8853/headmerged by Sheraff(GitHub profile, opens in a new tab)

Split out of #8817 to make that PR smaller. The changes here are the same ones #8817 makes to these files, so it should rebase cleanly.

None of what this removes was public API: it was all undocumented internals of the Babel splitter. That's why the changeset is a patch.

Changes

  • codeSplittingOptions.compilerPlugins is removed. It was marked @internal. The built-in framework HMR plugins are still used internally.
  • These names are no longer exported from @tanstack/router-plugin: unpluginRouterCodeSplitterFactory, getObjectPropertyKeyName and the types CodeSplitCompilerPlugin, ReferenceRouteCompilerPlugin, ReferenceRouteCompilerPluginContext and VirtualRouteSplitNodeCompilerPluginContext.
  • Tests: the getObjectPropertyKeyName tests in tests/utils.test.ts are deleted. The function is still used internally and tested through the code-splitter tests.

Nothing in packages/, examples/, e2e/ or docs/ used the removed option or exports. TanStack Start has a separate compilerPlugins option, which this PR doesn't touch.

Validation

@tanstack/router-plugin: test:unit, test:types, test:eslint and test:build pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • Removed access to internal code-splitting options and APIs from the router plugin’s public interface.
    • Custom compiler plugins are no longer included in code-splitting compilation; framework HMR plugins continue to be used when enabled.
    1. 🦋 Changeset detected

      Latest commit: ab3605544a1572b91686a604bf15053a36e086f9

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 7 packages
      NameType
      @tanstack/router-pluginPatch
      @tanstack/router-vite-pluginPatch
      @tanstack/start-plugin-corePatch
      @tanstack/react-start-rscPatch
      @tanstack/react-startPatch
      @tanstack/solid-startPatch
      @tanstack/vue-startPatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-plugin

    3. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Walkthrough

      The router plugin removes codeSplittingOptions.compilerPlugins and selected code-splitter internals from its root exports. The changeset documents the API removals.

      Changes: Router plugin API cleanup

      Layer / File(s)Summary
      Remove configurable compiler plugins
      packages/router-plugin/src/core/config.ts, packages/router-plugin/src/core/router-code-splitter-plugin.ts
      CodeSplittingOptions no longer includes compilerPlugins. Splitter setup includes framework HMR compiler plugins when HMR is enabled, or an empty array otherwise.
      Remove splitter internals from the root entry
      packages/router-plugin/src/index.ts, packages/router-plugin/tests/utils.test.ts, .changeset/router-plugin-remove-splitter-internals.md
      The root entry no longer exports unpluginRouterCodeSplitterFactory, getObjectPropertyKeyName, or four code-splitter plugin types. Tests for getObjectPropertyKeyName are removed. The changeset documents these API removals.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Refactor

      Possibly related PRs

      • TanStack/router#8291: Defines and uses the CodeSplitCompilerPlugin type and compilerPlugins option that this PR removes.
      • TanStack/router#8804: Adds a Bun entry that exposes CodeSplittingOptions, whose contract this PR changes.
      Merge Risk: Minimal · up to ab360

      The release note no longer presents an incomplete list of supported bundler entries. No unresolved merge-blocking issue is established.

      Pre-merge checks: Passed 4 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Docstring CoverageWarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…Write docstrings for the functions missing them to satisfy the coverage threshold.
      Passed Passed checks: 4 passed
      Check nameStatusExplanation
      Title checkPassedThe title names the main change: removing the compilerPlugins option and splitter internals from the @tanstack/router-plugin root entry. The raw summary confirms the option removal and the export …
      Description checkPassedThe description covers the change, its motivation, and the patch-level changeset rationale. It lists the removed option and exports, the deleted tests, and the validation commands that passed. It foll…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the main change: removing the compilerPlugins option and splitter internals from the @tanstack/router-plugin root entry. The raw summary confirms the option removal and the export removals. The title is specific and does not use vague terms. It omits the removed type exports, which is acceptable because the title need not cover every detail.

      Full details: Description check

      Explanation

      The description covers the change, its motivation, and the patch-level changeset rationale. It lists the removed option and exports, the deleted tests, and the validation commands that passed. It follows the template's Changes section. The Checklist and Release Impact sections are not filled in: no boxes are ticked, and the author does not state whether the changeset was generated or whether the AI-authorship disclosure is present. The description does mention Claude Code in its footer, which partly covers the AI disclosure. The missing checklist and release-impact selections are non-critical, so the description is mostly complete.

      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

      Resolution

      Write docstrings for the functions missing them to satisfy the coverage threshold.

      Finishing Touches
      Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      Share

      CodeRabbit Verify

      • Run CodeRabbit Verify to test the changes in this pull request.
      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 91fa43c0171ba4e6ad81268887eb56eff40ab654 and ab3605544a1572b91686a604bf15053a36e086f9.

      Files selected for processing: 1
      • .changeset/router-plugin-remove-splitter-internals.md
      Files skipped from review as they are similar to previous changes: 1
      • .changeset/router-plugin-remove-splitter-internals.md

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

    4. View your CI Pipeline Execution ↗ for commit ab3605544a1572b91686a604bf15053a36e086f9

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded10m 53sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded1m 50sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-11-03 16:27:43 UTC

      • Fix comments: Fix CodeRabbit comments on this PR
      OutdatedResolvedby Sheraff(GitHub profile, opens in a new tab)
      OutdatedResolvedby Sheraff(GitHub profile, opens in a new tab)
    5. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/@tanstack/arktype-adapter@8853

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8853

      @tanstack/eslint-plugin-start

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8853

      @tanstack/history

      npm i https://pkg.pr.new/@tanstack/history@8853

      @tanstack/react-router

      npm i https://pkg.pr.new/@tanstack/react-router@8853

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/@tanstack/react-router-devtools@8853

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8853

      @tanstack/react-start

      npm i https://pkg.pr.new/@tanstack/react-start@8853

      @tanstack/react-start-client

      npm i https://pkg.pr.new/@tanstack/react-start-client@8853

      @tanstack/react-start-rsc

      npm i https://pkg.pr.new/@tanstack/react-start-rsc@8853

      @tanstack/react-start-server

      npm i https://pkg.pr.new/@tanstack/react-start-server@8853

      @tanstack/router-cli

      npm i https://pkg.pr.new/@tanstack/router-cli@8853

      @tanstack/router-core

      npm i https://pkg.pr.new/@tanstack/router-core@8853

      @tanstack/router-devtools

      npm i https://pkg.pr.new/@tanstack/router-devtools@8853

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/@tanstack/router-devtools-core@8853

      @tanstack/router-generator

      npm i https://pkg.pr.new/@tanstack/router-generator@8853

      @tanstack/router-plugin

      npm i https://pkg.pr.new/@tanstack/router-plugin@8853

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8853

      @tanstack/router-utils

      npm i https://pkg.pr.new/@tanstack/router-utils@8853

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8853

      @tanstack/solid-router

      npm i https://pkg.pr.new/@tanstack/solid-router@8853

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8853

      @tanstack/solid-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8853

      @tanstack/solid-start

      npm i https://pkg.pr.new/@tanstack/solid-start@8853

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/@tanstack/solid-start-client@8853

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/@tanstack/solid-start-server@8853

      @tanstack/start-client-core

      npm i https://pkg.pr.new/@tanstack/start-client-core@8853

      @tanstack/start-fn-stubs

      npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8853

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/@tanstack/start-plugin-core@8853

      @tanstack/start-server-core

      npm i https://pkg.pr.new/@tanstack/start-server-core@8853

      @tanstack/start-static-server-functions

      npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8853

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/@tanstack/start-storage-context@8853

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/@tanstack/valibot-adapter@8853

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8853

      @tanstack/vue-router

      npm i https://pkg.pr.new/@tanstack/vue-router@8853

      @tanstack/vue-router-devtools

      npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8853

      @tanstack/vue-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8853

      @tanstack/vue-start

      npm i https://pkg.pr.new/@tanstack/vue-start@8853

      @tanstack/vue-start-client

      npm i https://pkg.pr.new/@tanstack/vue-start-client@8853

      @tanstack/vue-start-server

      npm i https://pkg.pr.new/@tanstack/vue-start-server@8853

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/@tanstack/zod-adapter@8853

      commit: ab36055

    6. 🚀 Changeset Version Preview

      1 package(s) bumped directly, 6 bumped as dependents.

      🟨 Minor bumps

      PackageVersionReason
      @tanstack/router-plugin1.168.48 → 1.169.0Changeset

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/react-start1.169.4 → 1.169.5Dependent
      @tanstack/react-start-rsc0.1.65 → 0.1.66Dependent
      @tanstack/router-vite-plugin1.167.48 → 1.167.49Dependent
      @tanstack/solid-start1.169.4 → 1.169.5Dependent
      @tanstack/start-plugin-core1.171.55 → 1.171.56Dependent
      @tanstack/vue-start1.169.4 → 1.169.5Dependent
    7. Bundle Size Benchmarks

      This pull request does not affect bundle size in any measured scenario.

    8. Merging this PR will improve performance by 2.28%

      2 warnings, 1 note

      :warning: 54 benchmarks are dominated by system calls

      System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

      Learn more about system calls

      See affected benchmarks

      :warning: 3 benchmarks with a significant change ran on different hardware

      Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

      Learn more about Macro Runners

      See affected benchmarks

      :information_source: 20 benchmarks have no flamegraph

      The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

      See affected benchmarks

      ⚡ 2 improved benchmarks ❌ 1 (👁 1) regressed benchmark ✅ 191 untouched benchmarks ⏩ 3 skipped benchmarks1

      Performance Changes

      ModeBenchmarkBASEHEADEfficiency
      ⚡Memorymem client navigation-churn (solid)117.7 KB111 KB+6.09%
      ⚡Memorymem client interrupted-navigations (vue)98.2 KB94.2 KB+4.23%
      👁Memorymem client interrupted-navigations (react)92.2 KB95.2 KB-3.23%

      Tip

      Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


      Comparing router-plugin/remove-splitter-internals (ab36055) with main (94f36c4) Open in CodSpeed

      Footnotes

      1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

    9. Sheraff(GitHub profile, opens in a new tab) changed the title

Sign in to join this conversation.