Skip to content
Source
Sign inSign up
TanStack/router

Fix: enable dev server back in test mode #5181

Closedluixo(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/5181/headopened

Closes https://github.com/TanStack/router/issues/4620#issuecomment-3066012962

This was already open: https://github.com/TanStack/router/pull/4642 I accidentally removed the fork while cleaning up repos in my account.

Summary by CodeRabbit

  • Refactor
    • Simplified dev server plugin configuration by removing test mode-specific conditional logic. The dev server now follows a unified execution path for consistent behavior across all runtime modes.
✏️ Tip: You can customize this high-level summary in your review settings.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core

    2. 📝 Walkthrough

      Walkthrough

      The dev server plugin's mode-based test gating has been removed. The isTest flag, mode-based configuration hook, and early return in configureServer have been deleted, allowing the dev server to run without branching logic regardless of environment mode.

      Changes

      Cohort / File(s)Summary
      Dev Server Plugin Mode Gating Removal
      packages/start-plugin-core/src/dev-server-plugin/plugin.ts
      Removed isTest flag initialization, deleted config hook that set isTest based on mode, and removed early return in configureServer that short-circuited execution in test mode. Server now runs unconditionally.

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~8 minutes

      Poem

      🐰 A gate that blocked the test-mode stream, Has vanished like a forgotten dream— No flags, no checks, no turning back, The dev server's on the beaten track! ✨

      Pre-merge checks and finishing touches

      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title clearly describes the main change: enabling the dev server in test mode, which directly addresses the core issue of the PR.
      Linked Issues check✅ PassedThe changes directly address issue #4620 by removing the isTest flag and mode-based gating that prevented the dev server from running in test mode, fully satisfying the requirement.
      Out of Scope Changes check✅ PassedAll changes are focused on re-enabling the dev server in test mode as specified in the linked issue; no out-of-scope modifications were introduced.
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
      ✨ Finishing touches
      • 📝 Generate docstrings

      📜 Recent review details

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between a3e7d80b3faf4f2b5cf13b85a9bac23ce3eca90c and 043620682c1e8b96a74c0cf832e1f74638c7f5fe.

      📒 Files selected for processing (1)
      • packages/start-plugin-core/src/dev-server-plugin/plugin.ts
      💤 Files with no reviewable changes (1)
      • packages/start-plugin-core/src/dev-server-plugin/plugin.ts

      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    3. Still a pity it took 9 months to review 10 LOC

    4. Thanks again for bringing this back, and sorry this has sat for so long. The issue is still real, but the Start plugin moved substantially since this branch was created, so this version no longer applies cleanly.

      I'm going to keep #4620 open. The fix now needs to be made in the current Vite dev-server plugin, with a regression test for vite dev --mode test, rather than rebasing this older patch through the plugin changes.

      If you'd like to continue the fix, it's definitely welcomed!

Sign in to join this conversation.