Skip to content

move HydrationScript to HeadContent#7296

Merged
birkskyum merged 3 commits intosolid-router-v2-prefrom
solid-v2-move-hydrationscript-to-headcontent
Apr 30, 2026
Merged

move HydrationScript to HeadContent#7296
birkskyum merged 3 commits intosolid-router-v2-prefrom
solid-v2-move-hydrationscript-to-headcontent

Conversation

@birkskyum
Copy link
Copy Markdown
Member

@birkskyum birkskyum commented Apr 29, 2026

Make solid-start (v2) similar to react start

Before (solid v2)

<html>
      <head>
        <HydrationScript />
        <HeadContent />
      </head>
      <body>

After (solid v2 and react)

<html>
      <head>
        <HeadContent />
      </head>
      <body>
``


@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a8a3482-ed1c-4f40-b145-a59da8e249e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch solid-v2-move-hydrationscript-to-headcontent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Apr 29, 2026

View your CI Pipeline Execution ↗ for commit 307d025

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

☁️ Nx Cloud last updated this comment at 2026-04-30 00:26:31 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

🚀 Changeset Version Preview

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

🟩 Patch bumps

Package Version Reason
@tanstack/solid-router 2.0.0-beta.15 → 2.0.0-beta.16 Changeset
@tanstack/solid-start 2.0.0-beta.16 → 2.0.0-beta.17 Dependent
@tanstack/solid-start-client 2.0.0-beta.15 → 2.0.0-beta.16 Dependent
@tanstack/solid-start-server 2.0.0-beta.15 → 2.0.0-beta.16 Dependent

</head>
<body>
<HeadContent />
<Solid.Suspense>{children}</Solid.Suspense>
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.

This should really be Solid.Loading for v2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Bundle Size Benchmarks

  • Commit: 7fa0f39cabf4
  • Measured at: 2026-04-30T00:26:22.719Z
  • Baseline source: history:7fa0f39cabf4
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.48 KiB +184 B (+0.21%) 275.76 KiB 75.97 KiB ▃▃▃▃▃▃▁▁▁▁▁█
react-router.full 90.78 KiB -23 B (-0.02%) 286.95 KiB 78.95 KiB ▁▁▁▁▁▁█████▁
solid-router.minimal 40.42 KiB +4.87 KiB (+13.70%) 119.08 KiB 36.48 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.full 44.80 KiB +4.52 KiB (+11.23%) 132.81 KiB 40.38 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 53.38 KiB +88 B (+0.16%) 153.07 KiB 47.94 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.full 58.25 KiB -202 B (-0.34%) 168.53 KiB 52.18 KiB ███████████▁
react-start.minimal 102.01 KiB +89 B (+0.09%) 324.00 KiB 88.21 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.full 105.38 KiB +39 B (+0.04%) 334.35 KiB 91.14 KiB ▃▃▃▃▃▃▁▁▁▁▁█
solid-start.minimal 60.93 KiB +11.39 KiB (+22.98%) 185.43 KiB 53.99 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.full 64.76 KiB +9.43 KiB (+17.04%) 196.96 KiB 57.33 KiB ▁▁▁▁▁▁▁▁▁▁▁█

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 307d025

) : (
<Portal mount={document.head}>{content()}</Portal>
<>
<HydrationScript />
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.

do we need in both places? if its already in content?

</head>
<body>
<HeadContent />
<Suspense>{props.children}</Suspense>
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.

Should be Loading in v2

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We merged the duplicate @solidjs/web import statements in HeadContent.tsx into a single import to fix the ESLint import/no-duplicates and import/order violations. When HydrationScript was moved into HeadContent, it was added as a separate import after the existing { Portal, isServer } import from the same package. Consolidating them into import { HydrationScript, Portal, isServer } from '@solidjs/web' resolves both errors.

Tip

We verified this fix by re-running @tanstack/solid-router:test:eslint.

diff --git a/packages/solid-router/src/HeadContent.tsx b/packages/solid-router/src/HeadContent.tsx
index cb12386e46..7b27f4a939 100644
--- a/packages/solid-router/src/HeadContent.tsx
+++ b/packages/solid-router/src/HeadContent.tsx
@@ -1,10 +1,9 @@
 import { For } from 'solid-js'
-import { Portal, isServer } from '@solidjs/web'
+import { HydrationScript, Portal, isServer } from '@solidjs/web'
 import { Asset } from './Asset'
 import { useRouter } from './useRouter'
 import { useTags } from './headContentUtils'
 import type { AssetCrossOriginConfig } from '@tanstack/router-core'
-import { HydrationScript } from '@solidjs/web'
 
 export interface HeadContentProps {
   assetCrossOrigin?: AssetCrossOriginConfig

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally o8LD-W3ic

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 29, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing solid-v2-move-hydrationscript-to-headcontent (307d025) with solid-router-v2-pre (67a9040)

Open in CodSpeed

@birkskyum birkskyum merged commit 67b46d7 into solid-router-v2-pre Apr 30, 2026
18 checks passed
@birkskyum birkskyum deleted the solid-v2-move-hydrationscript-to-headcontent branch April 30, 2026 00:55
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.

2 participants