Skip to content

docs(router): autoCodeSplitting does not split pendingComponent by default - #8593

Open
tedserbinski wants to merge 1 commit into
TanStack:mainfrom
tedserbinski:docs/pending-component-split-default
Open

tedserbinski wants to merge 1 commit into
TanStack:mainfrom
tedserbinski:docs/pending-component-split-default

Conversation

@tedserbinski

@tedserbinski tedserbinski commented Oct 3, 2026 •

Copy link
Copy Markdown

🎯 Changes

Two pages say or imply that autoCodeSplitting splits pendingComponent, but the plugin's default groupings leave it in the route's main chunk:

  • docs/router/guide/code-splitting.md lists "Pending Component" under non-critical configuration, then says autoCodeSplitting splits route files "based on the non-critical route configuration mentioned above".
  • packages/router-core/skills/router-core/code-splitting/SKILL.md lists pendingComponent under "What Gets Split (Non-Critical)".

defaultCodeSplitGroupings in packages/router-plugin/src/core/constants.ts is [['component'], ['errorComponent'], ['notFoundComponent']], and docs/router/guide/automatic-code-splitting.md already documents exactly that. I checked a production build on @tanstack/router-plugin 1.168.40: a route's pendingComponent stays in its route chunk.

This PR changes wording only:

  • code-splitting.md: after the autoCodeSplitting sentence, one paragraph saying the default splits component, errorComponent and notFoundComponent, that pendingComponent stays in the route's main chunk unless a split grouping includes it, and a link to "What gets code split?" in the automatic code-splitting guide.
  • SKILL.md: the list is renamed "What Can Be Split (Non-Critical)", with a note giving the default groupings and how to add pendingComponent (codeSplitGroupings or codeSplittingOptions.defaultBehavior).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request. (docs only)
  • 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.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Clarified that route, error, and not-found components are split into separate chunks by default, while pending components stay in the main chunk unless configured otherwise.
    • Added a link to guidance on automatic code-splitting defaults and customization.

@changeset-bot

changeset-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fa7ea29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
docs/AGENTS.md — auto-discovered
CONTRIBUTING.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/router/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 06a09b36-3cf9-4148-b058-5b52392d2b1f
📥 Commits

Reviewing files that changed from the base of the PR and between 1f0f20a and fa7ea29.

📒 Files selected for processing (2)
  • docs/router/guide/code-splitting.md
  • packages/router-core/skills/router-core/code-splitting/SKILL.md

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


📝 Walkthrough

Walkthrough

The code-splitting documentation now states that component, errorComponent, and notFoundComponent split by default. It also clarifies that pendingComponent stays in the route’s main chunk unless configured for splitting.

Changes

Code-splitting documentation

Layer / File(s) Summary
Document default chunking behavior
docs/router/guide/code-splitting.md, packages/router-core/skills/router-core/code-splitting/SKILL.md
The guide and skill documentation identify the components split by default. They state that pendingComponent stays in the main chunk unless configured through codeSplitGroupings or defaultBehavior. The skill section is now titled “What Can Be Split.”

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: tannerlinsley

Merge Risk: ⚪ Minimal · up to fa7ea

The documentation accurately explains the default chunking and how to split pendingComponent. No actionable merge-blocking risk was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to fa7ea

The change affects 2 systems.

Changed systems: docs, packages/router-core

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — docs (api) was modified; 1 changed file maps to changed impact.
  • observed — packages/router-core (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/router/guide/code-splitting.md: Added the default chunking behavior: component, errorComponent, and notFoundComponent go into separate chunks; pendingComponent stays in the main chunk unless added to a split grouping. The text links to the automatic code-splitting guide for defaults and customization.
  • observed — Modified behavior in packages/router-core/skills/router-core/code-splitting/SKILL.md: Renames the section to “What Can Be Split” and clarifies that pendingComponent is not split by default: the default groups are component, errorComponent, and notFoundComponent; pendingComponent moves to a split group only when configured through codeSplitGroupings or defaultBehavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main documentation change: autoCodeSplitting does not split pendingComponent by default.
Description check ✅ Passed The description explains the changes, their motivation, and the docs-only release impact. It includes all template sections, but leaves the contributing-guide, testing, and AI-understanding checklist …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant