Skip to content

fix: restore SSR benchmark builds on Vite 7#6984

Closed
Sheraff wants to merge 1 commit intomainfrom
fix/ssr-benchmark-vite7-detection
Closed

fix: restore SSR benchmark builds on Vite 7#6984
Sheraff wants to merge 1 commit intomainfrom
fix/ssr-benchmark-vite7-detection

Conversation

@Sheraff
Copy link
Contributor

@Sheraff Sheraff commented Mar 19, 2026

Summary

  • fix Start's bundler detection so Vite 7 keeps using rollupOptions instead of incorrectly switching to rolldownOptions
  • restore the SSR benchmark builds that were falling back to missing index.html entry resolution in React, Solid, and Vue
  • add regression tests around Vite 7 vs Vite 8 detection and bundler option lookup

Testing

  • Not run in this workspace (node_modules is not installed)

Summary by CodeRabbit

Release Notes

  • New Features

    • Improved Rolldown detection to use version-based logic for more reliable identification of supported versions.
  • Tests

    • Added comprehensive test coverage for utility functions to ensure proper behavior across different version scenarios and bundler configurations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

The change replaces Rolldown feature detection with a new usesRolldown() utility function that determines support by parsing Vite version strings and checking if the major version is >= 8. Comprehensive test coverage is added for this new function and existing bundler option logic.

Changes

Cohort / File(s) Summary
Version Detection Logic
packages/start-plugin-core/src/utils.ts
Added usesRolldown(viteVersion: string): boolean function that parses the major version from a Vite version string and returns true if >= 8. Updated isRolldown constant to use this function instead of feature detection with 'rolldownVersion' in vite.
Test Coverage
packages/start-plugin-core/tests/utils.test.ts
New test file covering usesRolldown() with scenarios for Vite 7.3.1, 8.0.0, and unknown versions. Also tests getBundlerOptions() to verify it selects rolldownOptions when available, otherwise returns rollupOptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new version check hops into view,
Parsing strings to find what's true,
Rolldown's eight, the tests agree,
Detection grows, simple and free!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: restore SSR benchmark builds on Vite 7' directly addresses the main objective of the PR, which is to fix the bundler detection mechanism so Vite 7 continues to use rollupOptions and restore SSR benchmark builds.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ssr-benchmark-vite7-detection
📝 Coding Plan
  • Generate coding plan for human review comments

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

@nx-cloud
Copy link

nx-cloud bot commented Mar 19, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 1a366e8

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 9m 56s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 30s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-19 16:35:23 UTC

@github-actions
Copy link
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 1a366e8

@github-actions
Copy link
Contributor

Bundle Size Benchmarks

  • Commit: 5accb6f86de3
  • Measured at: 2026-03-19T16:26:15.470Z
  • Baseline source: history:e5d23ecd5c28
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.61 KiB 0 B (0.00%) 276.07 KiB 76.12 KiB ▁▁▁▁▁██████
react-router.full 90.65 KiB 0 B (0.00%) 286.28 KiB 78.68 KiB ▁▁▁▁▁██████
solid-router.minimal 37.14 KiB 0 B (0.00%) 111.38 KiB 33.29 KiB ▁▁▁▁▁██████
solid-router.full 41.36 KiB 0 B (0.00%) 124.18 KiB 37.12 KiB ▁▁▁▁▁██████
vue-router.minimal 52.99 KiB 0 B (0.00%) 151.41 KiB 47.65 KiB ▁▁▁▁▁██████
vue-router.full 57.69 KiB 0 B (0.00%) 166.34 KiB 51.60 KiB ▁▁▁▁▁██████
react-start.minimal 101.99 KiB 0 B (0.00%) 324.08 KiB 88.20 KiB ▁▁▁▁▁██████
react-start.full 105.33 KiB 0 B (0.00%) 333.89 KiB 91.02 KiB ▁▁▁▁▁██████
solid-start.minimal 51.24 KiB 0 B (0.00%) 157.82 KiB 45.28 KiB ▁▁▁▁▁██████
solid-start.full 56.53 KiB 0 B (0.00%) 173.32 KiB 49.72 KiB ▁▁▁▁▁██████

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/start-plugin-core/tests/utils.test.ts (1)

5-17: Good coverage of core version detection scenarios.

The tests cover the primary use cases well. Consider adding a few edge case tests for completeness:

🧪 Optional: Additional edge case tests
   test('defaults to rollup config keys for unknown versions', () => {
     expect(usesRolldown('unknown')).toBe(false)
   })
+
+  test('handles empty version string', () => {
+    expect(usesRolldown('')).toBe(false)
+  })
+
+  test('handles pre-release versions', () => {
+    expect(usesRolldown('8.0.0-beta.1')).toBe(true)
+  })
+
+  test('handles future major versions', () => {
+    expect(usesRolldown('9.0.0')).toBe(true)
+  })
 })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/start-plugin-core/tests/utils.test.ts` around lines 5 - 17, Add
edge-case unit tests for the usesRolldown utility to cover boundary and
non-semver inputs: add tests calling usesRolldown with pre-release/patch
variants like "8.0.0-beta.1" and "7.9.9", with a null/undefined input and an
empty string to ensure defaults, and a malformed semver like "v8" to verify
behavior; update the tests in tests/utils.test.ts around the
describe('usesRolldown', ...) block so the new cases assert the expected boolean
results for each input.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/start-plugin-core/tests/utils.test.ts`:
- Around line 5-17: Add edge-case unit tests for the usesRolldown utility to
cover boundary and non-semver inputs: add tests calling usesRolldown with
pre-release/patch variants like "8.0.0-beta.1" and "7.9.9", with a
null/undefined input and an empty string to ensure defaults, and a malformed
semver like "v8" to verify behavior; update the tests in tests/utils.test.ts
around the describe('usesRolldown', ...) block so the new cases assert the
expected boolean results for each input.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 42dbe3a7-4cb3-44cb-be50-2a22f455e7e2

📥 Commits

Reviewing files that changed from the base of the PR and between 5accb6f and 1a366e8.

📒 Files selected for processing (2)
  • packages/start-plugin-core/src/utils.ts
  • packages/start-plugin-core/tests/utils.test.ts

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a366e85a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* to `build.rolldownOptions`.
*/
export const isRolldown = 'rolldownVersion' in vite
export const isRolldown = usesRolldown(vite.version)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Read the app's Vite version instead of start-plugin-core's copy

usesRolldown(vite.version) still looks up the vite package resolved next to @tanstack/start-plugin-core, not the Vite instance that is actually executing the build. In this repo packages/start-plugin-core is pinned to Vite 8 (packages/start-plugin-core/package.json / pnpm-lock.yaml), while benchmarks/ssr explicitly installs Vite 7.3.1, so the React/Solid/Vue SSR benchmarks this commit is trying to restore will still see 8.x here and keep writing build.rolldownOptions. Under Vite 7 that key is ignored, so plugin.ts falls back to the broken HTML entry resolution path again instead of using the server alias.

Useful? React with 👍 / 👎.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 19, 2026

Merging this PR will not alter performance

✅ 3 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing fix/ssr-benchmark-vite7-detection (1a366e8) with main (e5d23ec)2

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.

  2. No successful run was found on main (5accb6f) during the generation of this report, so e5d23ec was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Sheraff Sheraff closed this Mar 19, 2026
@Sheraff Sheraff deleted the fix/ssr-benchmark-vite7-detection branch March 19, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant