Skip to content

fix(start): preserve dev SSR CSS order#7830

Open
schiller-manuel wants to merge 3 commits into
mainfrom
fix-7794
Open

fix(start): preserve dev SSR CSS order#7830
schiller-manuel wants to merge 3 commits into
mainfrom
fix-7794

Conversation

@schiller-manuel

@schiller-manuel schiller-manuel commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

fixes #7794

Summary by CodeRabbit

  • Bug Fixes

    • Improved development SSR style collection to preserve stable CSS cascade/order.
    • Prevented duplicate collection of imported CSS while still including styles from code-split routes.
    • Ensured imported stylesheet precedence is respected and remains consistent after reloads/invalidation.
  • Tests

    • Expanded end-to-end coverage for dev SSR styles across React, Solid, and Vue, including code-split route styling, CSS import ordering, byte-for-byte reload stability, and @import dependency behavior.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Development SSR CSS collection now uses ordered module-graph traversal, client-side CSS loading, and cached extraction. The change avoids duplicated imports, preserves code-split styles, updates plugin wiring, and adds framework-specific tests for ordering and SSR behavior.

Changes

Development SSR CSS collection

Layer / File(s) Summary
CSS collection and extraction
packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts
Refactors collection around environment-specific loading, deterministic dependency ordering, CSS import filtering, concurrent extraction, and invalidation-aware caching.
Dev middleware integration
packages/start-plugin-core/src/vite/dev-server-plugin/plugin.ts
Uses the new collector contract and client CSS loader while removing the previous CSS-module transform cache wiring.
React SSR fixtures and validation
e2e/react-start/dev-ssr-styles/..., .changeset/fix-dev-ssr-css-order.md
Adds code-split and CSS-import routes with end-to-end checks for cascade order, duplicate imports, and SSR styles.
Solid and Vue SSR fixtures
e2e/solid-start/dev-ssr-styles/..., e2e/vue-start/dev-ssr-styles/..., packages/start-plugin-core/tests/vite/dev-styles.test.ts
Adds Solid and Vue SSR fixtures plus unit coverage for graph traversal, ordering, invalidation, client/server environments, and failed transforms.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant DevStylesMiddleware
  participant collectDevStyles
  participant ViteModuleGraph
  participant ClientDevEnvironment
  Browser->>DevStylesMiddleware: request development styles
  DevStylesMiddleware->>collectDevStyles: pass route entries and CSS loader
  collectDevStyles->>ViteModuleGraph: resolve ordered CSS dependencies
  ViteModuleGraph-->>collectDevStyles: return CSS module nodes
  collectDevStyles->>ClientDevEnvironment: load transformed CSS
  ClientDevEnvironment-->>collectDevStyles: return CSS contents
  collectDevStyles-->>DevStylesMiddleware: return concatenated CSS
  DevStylesMiddleware-->>Browser: serve styles.css
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: preserving dev SSR CSS order for Start.
Linked Issues check ✅ Passed The changes address #7794 by preventing duplicated @import CSS and preserving stylesheet order during development SSR.
Out of Scope Changes check ✅ Passed The added fixtures, tests, and plugin refactor all support the CSS ordering fix and do not show unrelated scope creep.
✨ 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-7794

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

@nx-cloud

nx-cloud Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 77035e4

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

☁️ Nx Cloud last updated this comment at 2026-07-21 05:16:00 UTC

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 4 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/start-plugin-core 1.171.24 → 1.171.25 Changeset
@tanstack/react-start 1.168.32 → 1.168.33 Dependent
@tanstack/react-start-rsc 0.1.31 → 0.1.32 Dependent
@tanstack/solid-start 1.168.32 → 1.168.33 Dependent
@tanstack/vue-start 1.168.31 → 1.168.32 Dependent

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

This pull request does not affect bundle size in any measured scenario.

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7830

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 77035e4

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css`:
- Line 3: In the stylesheet declaration block, add an empty line between the
custom property and the background-color declaration to satisfy Stylelint’s
declaration-empty-line-before rule.

In `@e2e/react-start/dev-ssr-styles/tests/app.spec.ts`:
- Around line 28-47: Update the CSS response collection in the test around the
page response listener and navigation steps so each navigation records its own
stylesheet response. Capture the response associated with the initial page.goto
separately from the response observed after page.reload, then compare those two
navigation-specific promises instead of taking cssBodies.slice(0, 2).

In `@packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts`:
- Around line 161-162: Update the module classification around isCssFile and
resolveModuleDeps to use node.url rather than the fallback fileOrUrl value,
ensuring virtual Vue style-block URLs with CSS query parameters are recognized
as CSS modules. Add a regression test covering a node whose file is the host
.vue path while its url contains the CSS style query.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7b3be4d-0a24-46c3-a998-c1e7c0fb0b9b

📥 Commits

Reviewing files that changed from the base of the PR and between 0b178a7 and 0f55262.

📒 Files selected for processing (13)
  • .changeset/fix-dev-ssr-css-order.md
  • e2e/react-start/dev-ssr-styles/src/components/CodeSplitStyledBox.tsx
  • e2e/react-start/dev-ssr-styles/src/routeTree.gen.ts
  • e2e/react-start/dev-ssr-styles/src/routes/css-import-order.tsx
  • e2e/react-start/dev-ssr-styles/src/routes/index.tsx
  • e2e/react-start/dev-ssr-styles/src/styles/app.css
  • e2e/react-start/dev-ssr-styles/src/styles/code-split-route.module.css
  • e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css
  • e2e/react-start/dev-ssr-styles/src/styles/css-import-order.css
  • e2e/react-start/dev-ssr-styles/tests/app.spec.ts
  • packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts
  • packages/start-plugin-core/src/vite/dev-server-plugin/plugin.ts
  • packages/start-plugin-core/tests/vite/dev-styles.test.ts
💤 Files with no reviewable changes (1)
  • e2e/react-start/dev-ssr-styles/src/styles/app.css

@@ -0,0 +1,5 @@
.css-import-order {
--css-import-base-marker: issue-7794;
background-color: #ffffff;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Stylelint error before merging.

Stylelint reports declaration-empty-line-before on Line 3. Add an empty line between the custom property and background-color.

Proposed fix
 .css-import-order {
   --css-import-base-marker: issue-7794;
+
   background-color: `#ffffff`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
background-color: #ffffff;
.css-import-order {
--css-import-base-marker: issue-7794;
background-color: `#ffffff`;
}
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 3-3: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/react-start/dev-ssr-styles/src/styles/css-import-base.css` at line 3, In
the stylesheet declaration block, add an empty line between the custom property
and the background-color declaration to satisfy Stylelint’s
declaration-empty-line-before rule.

Source: Linters/SAST tools

Comment on lines +28 to +47
const cssBodies: Array<Promise<string>> = []
page.on('response', (response) => {
if (
new URL(response.url()).pathname.endsWith(
'/@tanstack-start/styles.css',
)
) {
cssBodies.push(response.text())
}
})

await page.goto('/css-import-order')
await expect(page.getByTestId('css-import-order')).toBeVisible()
await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(1)

await page.reload()
await expect(page.getByTestId('css-import-order')).toBeVisible()
await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(2)

const [initialCss, reloadedCss] = await Promise.all(cssBodies.slice(0, 2))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Associate each CSS response with its navigation.

The listener may collect multiple stylesheet responses before reload(), so slice(0, 2) can compare two responses from the first navigation and never validate the reload.

Proposed fix
-      const cssBodies: Array<Promise<string>> = []
-      page.on('response', (response) => {
-        if (
-          new URL(response.url()).pathname.endsWith(
-            '/@tanstack-start/styles.css',
-          )
-        ) {
-          cssBodies.push(response.text())
-        }
-      })
+      const isDevStylesResponse = (response: { url(): string }) =>
+        new URL(response.url()).pathname.endsWith(
+          '/@tanstack-start/styles.css',
+        )
 
+      const initialResponsePromise =
+        page.waitForResponse(isDevStylesResponse)
       await page.goto('/css-import-order')
       await expect(page.getByTestId('css-import-order')).toBeVisible()
-      await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(1)
+      const initialCss = await (await initialResponsePromise).text()
 
+      const reloadedResponsePromise =
+        page.waitForResponse(isDevStylesResponse)
       await page.reload()
       await expect(page.getByTestId('css-import-order')).toBeVisible()
-      await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(2)
-
-      const [initialCss, reloadedCss] = await Promise.all(cssBodies.slice(0, 2))
+      const reloadedCss = await (await reloadedResponsePromise).text()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const cssBodies: Array<Promise<string>> = []
page.on('response', (response) => {
if (
new URL(response.url()).pathname.endsWith(
'/@tanstack-start/styles.css',
)
) {
cssBodies.push(response.text())
}
})
await page.goto('/css-import-order')
await expect(page.getByTestId('css-import-order')).toBeVisible()
await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(1)
await page.reload()
await expect(page.getByTestId('css-import-order')).toBeVisible()
await expect.poll(() => cssBodies.length).toBeGreaterThanOrEqual(2)
const [initialCss, reloadedCss] = await Promise.all(cssBodies.slice(0, 2))
const isDevStylesResponse = (response: { url(): string }) =>
new URL(response.url()).pathname.endsWith(
'/@tanstack-start/styles.css',
)
const initialResponsePromise =
page.waitForResponse(isDevStylesResponse)
await page.goto('/css-import-order')
await expect(page.getByTestId('css-import-order')).toBeVisible()
const initialCss = await (await initialResponsePromise).text()
const reloadedResponsePromise =
page.waitForResponse(isDevStylesResponse)
await page.reload()
await expect(page.getByTestId('css-import-order')).toBeVisible()
const reloadedCss = await (await reloadedResponsePromise).text()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/react-start/dev-ssr-styles/tests/app.spec.ts` around lines 28 - 47,
Update the CSS response collection in the test around the page response listener
and navigation steps so each navigation records its own stylesheet response.
Capture the response associated with the initial page.goto separately from the
response observed after page.reload, then compare those two navigation-specific
promises instead of taking cssBodies.slice(0, 2).

Comment thread packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 15, 2026

Copy link
Copy Markdown

Merging this PR will regress 5 benchmarks

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
❌ 5 regressed benchmarks
✅ 169 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server serialization-payload (vue) 3.5 MB 6.1 MB -43.19%
Memory mem server error-paths unmatched (react) 567.3 KB 824.4 KB -31.18%
Memory mem server server-fn-churn (solid) 263 KB 273.8 KB -3.96%
Memory mem server error-paths not-found (react) 267 KB 277.2 KB -3.66%
Simulation ssr control-flow error 500 (react) 62.2 ms 64.3 ms -3.26%
Memory mem server error-paths redirect (vue) 979.9 KB 304.5 KB ×3.2
Memory mem server error-paths not-found (solid) 1,146.2 KB 421.2 KB ×2.7
Memory mem server peak-large-page (react) 2,216.6 KB 954.4 KB ×2.3
Memory mem server serialization-payload (react) 5 MB 3.4 MB +44.64%
Memory mem server streaming-peak chunked (vue) 12.1 MB 11.1 MB +8.86%
Simulation ssr streaming deferred (react) 73.1 ms 70.9 ms +3.03%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix-7794 (77035e4) with main (edf5575)

Open in CodSpeed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/solid-start/dev-ssr-styles/src/styles/code-split-route.module.css`:
- Around line 2-3: In the stylesheet rule containing
--solid-code-split-style-marker, insert an empty line before the
background-color declaration to satisfy the declaration-empty-line-before
Stylelint rule.

In `@e2e/solid-start/dev-ssr-styles/tsconfig.json`:
- Line 21: Update the compilerOptions.types setting in the dev-ssr-styles
tsconfig to include Node ambient types alongside vite/client, or remove the
explicit types allowlist so tests/setup/global.setup.ts receives the process
type from `@types/node`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14108bd2-a34a-4920-8377-03211f98c330

📥 Commits

Reviewing files that changed from the base of the PR and between 0f55262 and 79d9a70.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • e2e/solid-start/dev-ssr-styles/.gitignore
  • e2e/solid-start/dev-ssr-styles/package.json
  • e2e/solid-start/dev-ssr-styles/playwright.config.ts
  • e2e/solid-start/dev-ssr-styles/src/components/CodeSplitStyledBox.tsx
  • e2e/solid-start/dev-ssr-styles/src/router.tsx
  • e2e/solid-start/dev-ssr-styles/src/routes/__root.tsx
  • e2e/solid-start/dev-ssr-styles/src/routes/index.tsx
  • e2e/solid-start/dev-ssr-styles/src/styles/app.css
  • e2e/solid-start/dev-ssr-styles/src/styles/code-split-route.module.css
  • e2e/solid-start/dev-ssr-styles/tests/app.spec.ts
  • e2e/solid-start/dev-ssr-styles/tests/setup/global.setup.ts
  • e2e/solid-start/dev-ssr-styles/tests/setup/global.teardown.ts
  • e2e/solid-start/dev-ssr-styles/tsconfig.json
  • e2e/solid-start/dev-ssr-styles/vite.config.ts
  • e2e/vue-start/dev-ssr-styles/.gitignore
  • e2e/vue-start/dev-ssr-styles/package.json
  • e2e/vue-start/dev-ssr-styles/playwright.config.ts
  • e2e/vue-start/dev-ssr-styles/src/components/SfcStyledBox.vue
  • e2e/vue-start/dev-ssr-styles/src/router.tsx
  • e2e/vue-start/dev-ssr-styles/src/routes/__root.tsx
  • e2e/vue-start/dev-ssr-styles/src/routes/index.tsx
  • e2e/vue-start/dev-ssr-styles/src/styles/app.css
  • e2e/vue-start/dev-ssr-styles/src/vue-shim.d.ts
  • e2e/vue-start/dev-ssr-styles/tests/app.spec.ts
  • e2e/vue-start/dev-ssr-styles/tests/setup/global.setup.ts
  • e2e/vue-start/dev-ssr-styles/tests/setup/global.teardown.ts
  • e2e/vue-start/dev-ssr-styles/tsconfig.json
  • e2e/vue-start/dev-ssr-styles/vite.config.ts
  • packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts
  • packages/start-plugin-core/tests/vite/dev-styles.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/start-plugin-core/src/vite/dev-server-plugin/dev-styles.ts

Comment on lines +2 to +3
--solid-code-split-style-marker: present;
background-color: #3b82f6;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Stylelint violation.

Insert an empty line between the custom property and background-color to satisfy declaration-empty-line-before.

Suggested fix
 .styledBox {
   --solid-code-split-style-marker: present;
+
   background-color: `#3b82f6`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
--solid-code-split-style-marker: present;
background-color: #3b82f6;
--solid-code-split-style-marker: present;
background-color: `#3b82f6`;
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 3-3: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/solid-start/dev-ssr-styles/src/styles/code-split-route.module.css` around
lines 2 - 3, In the stylesheet rule containing --solid-code-split-style-marker,
insert an empty line before the background-color declaration to satisfy the
declaration-empty-line-before Stylelint rule.

Source: Linters/SAST tools

"~/*": ["./src/*"]
},
"noEmit": true,
"types": ["vite/client"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n '"types"|"`@types/node`"|process\.env' \
  e2e/solid-start/dev-ssr-styles/tsconfig.json \
  e2e/solid-start/dev-ssr-styles/package.json \
  e2e/solid-start/dev-ssr-styles/tests/setup/global.setup.ts

Repository: TanStack/router

Length of output: 406


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== tsconfig ==\n'
cat -n e2e/solid-start/dev-ssr-styles/tsconfig.json

printf '\n== package.json ==\n'
cat -n e2e/solid-start/dev-ssr-styles/package.json

printf '\n== setup file ==\n'
cat -n e2e/solid-start/dev-ssr-styles/tests/setup/global.setup.ts

printf '\n== config inheritance search ==\n'
rg -n '"extends"|compilerOptions|types' e2e/solid-start/dev-ssr-styles -g 'tsconfig*.json'

Repository: TanStack/router

Length of output: 2907


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, pathlib
p = pathlib.Path('e2e/solid-start/dev-ssr-styles/tsconfig.json')
data = json.loads(p.read_text())
print('extends:', data.get('extends'))
print('compilerOptions.types:', data.get('compilerOptions', {}).get('types'))
PY

Repository: TanStack/router

Length of output: 206


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Focus on any tsconfig chain that may add node types.
find e2e/solid-start/dev-ssr-styles -name 'tsconfig*.json' -print

Repository: TanStack/router

Length of output: 198


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, pathlib
p = pathlib.Path('e2e/solid-start/dev-ssr-styles/package.json')
data = json.loads(p.read_text())
print('scripts:')
for k,v in data.get('scripts', {}).items():
    print(f'  {k}: {v}')
PY

Repository: TanStack/router

Length of output: 432


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, pathlib
p = pathlib.Path('e2e/solid-start/dev-ssr-styles/tsconfig.json')
data = json.loads(p.read_text())
print(json.dumps(data, indent=2))
PY

Repository: TanStack/router

Length of output: 771


Include Node ambient types here
e2e/solid-start/dev-ssr-styles/tsconfig.json:21 only allows vite/client, so tests/setup/global.setup.ts won’t get process from @types/node even though it’s used at line 12. Add "node" to compilerOptions.types, or remove the explicit allowlist.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/solid-start/dev-ssr-styles/tsconfig.json` at line 21, Update the
compilerOptions.types setting in the dev-ssr-styles tsconfig to include Node
ambient types alongside vite/client, or remove the explicit types allowlist so
tests/setup/global.setup.ts receives the process type from `@types/node`.

@schiller-manuel

Copy link
Copy Markdown
Collaborator Author

depends on vitejs/vite#22968

@tannerlinsley

Copy link
Copy Markdown
Member

@schiller-manuel Gentle ping when you have a chance: I refreshed this onto current main (77035e4). CI is green aside from the bundled-dev import-protection failure tied to vitejs/vite#22968. We’ll leave the upstream follow-up with you—no rush, just wanted to put it back on your radar. Thanks!

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.

@import CSS seems to be duplicated during development SSR

2 participants