Skip to content
Source
Sign inSign up
TanStack/router

fix: fix output path for spa shell #5682

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5682/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

fixes #5426

Summary by CodeRabbit

  • Improvements

    • Enhanced SPA shell path handling in prerender logic with improved output path resolution for both SPA and non-SPA configurations.
  • Refactor

    • Simplified internal code structure by removing unused code elements for improved maintainability.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core

    2. Caution

      Review failed

      The pull request is closed.

      Walkthrough

      The prerender logic now detects SPA shell paths by comparing the configured output path against the current clean page path. When a path matches the SPA shell, HTML path computation is adjusted accordingly. Commented-out code referencing JSON signature checks has been removed.

      Changes

      Cohort / File(s)Change Summary
      SPA Shell Path Detection in Prerender
      packages/start-plugin-core/src/prerender.ts
      Introduces isSpaShell detection logic to identify when the current path is the SPA shell output path by comparing startConfig.spa.prerender.outputPath with cleanPagePath. When detected, htmlPath is forced to cleanPagePath + '.html' to bypass autoSubfolderIndex behavior. Non-SPA paths retain previous logic using index.html conditionally. Removes commented-out lines referencing JsonSigRx and buffer initialization code.

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~12 minutes

      • Areas requiring attention:
        • Verify the isSpaShell comparison logic correctly identifies SPA shell paths in all configuration scenarios
        • Confirm that forcing htmlPath to cleanPagePath + '.html' for SPA shells resolves the _shell.html generation issue described in the linked issue
        • Ensure non-SPA path behavior remains unchanged and backward compatible

      Suggested reviewers

      • Insik-Han

      Poem

      🐰 A shell once hidden from sight, Now shines bright in the prerender's light, With SPA paths detected with care, The build works—magic in the air! ✨

      ✨ Finishing touches
      • 📝 Generate docstrings
        🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      • Commit unit tests in branch `fix-5426`

      📜 Recent review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between f325d9a754d5e467b7b7afcea492dc5d5cddd912 and 166379ca8d6a6bd1a5a93943295206beb66464dc.

      📒 Files selected for processing (1)
      • packages/start-plugin-core/src/prerender.ts (1 hunks)

      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    3. View your CI Pipeline Execution ↗ for commit 166379ca8d6a6bd1a5a93943295206beb66464dc

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded5m 42sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded17sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-10-29 02:20:01 UTC

    4. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5682

      @tanstack/directive-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5682

      @tanstack/eslint-plugin-router

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

      @tanstack/history

      npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5682

      @tanstack/nitro-v2-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5682

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5682

      @tanstack/react-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5682

      @tanstack/react-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5682

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5682

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-router-ssr-query

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

      @tanstack/solid-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5682

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5682

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5682

      @tanstack/start-client-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5682

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5682

      @tanstack/start-server-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5682

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5682

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5682

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5682

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5682

      commit: 166379c

Sign in to join this conversation.