Fix: enable dev server back in test mode #5181
main fromrefs/pull/5181/head·opened 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.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core
The code is still there: https://github.com/TanStack/router/blob/a3e7d80b3faf4f2b5cf13b85a9bac23ce3eca90c/packages/start-plugin-core/src/dev-server-plugin/plugin.ts#L22-L24
A pity it takes more than half a year to merge 10 LOC PR :(
📝 Walkthrough
Walkthrough#
The dev server plugin's mode-based test gating has been removed. The
isTestflag, mode-based configuration hook, and early return inconfigureServerhave 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.tsRemoved isTestflag initialization, deleted config hook that setisTestbased on mode, and removed early return inconfigureServerthat 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 name Status Explanation Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed The 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 ✅ Passed The 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 ✅ Passed All 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 ✅ Passed No 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.Still a pity it took 9 months to review 10 LOC
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 --modetest, 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.
Is this PR still needed?