Skip to content

perf(solid-router): move server link shortcut before client setup - #8315

Closed
Sheraff wants to merge 1 commit into
mainfrom
codex/solid-link-early-server
Closed

Sheraff wants to merge 1 commit into
mainfrom
codex/solid-link-early-server

Conversation

@Sheraff

@Sheraff Sheraff commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Follow-up to #8308. Move the existing Solid Link server shortcut ahead of hydration, preloading, intersection-observer setup, active-state calculation, and internal ref allocation. The shortcut passes the caller's ref directly.

This applies to external and blocked links with default styling. URL classification and the shortcut's eligibility conditions stay the same.

Validation: Solid Router unit tests, type checks, and lint through Nx.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Improved server-rendered handling for external and blocked links.
    • These links now render without unnecessary hydration, preloading, active-state behavior, or client-side event handling.
    • Preserves expected link behavior while reducing client-side setup for links that cannot be handled by the router.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T21:14:20.268515Z 8f13440 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 246db4b0-f364-41b5-8004-9cd0d69aafa6

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1871c and 8f13440.

📒 Files selected for processing (2)
  • .changeset/silent-cycles-like.md
  • packages/solid-router/src/link.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

useLinkProps now returns eligible SSR link props before hydration, preload, active-state, and ref setup. A changeset records the patch release for @tanstack/solid-router.

Changes

Solid Router SSR link handling

Layer / File(s) Summary
Early SSR link path
packages/solid-router/src/link.tsx, .changeset/silent-cycles-like.md
useLinkProps now returns static props for eligible external or blocked links before reactive state initialization. The later SSR shortcut and SSR ref registration were removed. A patch changeset was added.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8f134

Eligible Solid Router SSR links now bypass client-only hydration and preload setup earlier, reducing server work without an identified behavior regression. The change is ready to merge.

Suggested reviewers: schiller-manuel

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main performance change: moving the Solid Router server link shortcut before client-side setup.
Description check ✅ Passed The description covers the change, motivation, affected link conditions, validation, checklist status, and changeset. One non-critical checklist item remains unchecked, but the description is otherwis…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/solid-link-early-server

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.

@nx-cloud

nx-cloud Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8f13440

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

☁️ Nx Cloud last updated this comment at 2026-09-09 21:22:22 UTC

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

11 package(s) bumped directly, 15 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/history 1.162.2 → 1.162.3 Changeset
@tanstack/nitro-v2-vite-plugin 1.155.1 → 1.155.2 Changeset
@tanstack/react-router 1.170.33 → 1.170.34 Changeset
@tanstack/router-core 1.171.28 → 1.171.29 Changeset
@tanstack/router-generator 1.167.34 → 1.167.35 Changeset
@tanstack/router-plugin 1.168.36 → 1.168.37 Changeset
@tanstack/router-utils 1.162.2 → 1.162.3 Changeset
@tanstack/solid-router 1.170.31 → 1.170.32 Changeset
@tanstack/start-plugin-core 1.171.40 → 1.171.41 Changeset
@tanstack/start-server-core 1.169.32 → 1.169.33 Changeset
@tanstack/vue-router 1.170.30 → 1.170.31 Changeset
@tanstack/react-start 1.168.50 → 1.168.51 Dependent
@tanstack/react-start-client 1.168.31 → 1.168.32 Dependent
@tanstack/react-start-rsc 0.1.49 → 0.1.50 Dependent
@tanstack/react-start-server 1.167.38 → 1.167.39 Dependent
@tanstack/router-cli 1.167.34 → 1.167.35 Dependent
@tanstack/router-vite-plugin 1.167.36 → 1.167.37 Dependent
@tanstack/solid-start 1.168.48 → 1.168.49 Dependent
@tanstack/solid-start-client 1.168.30 → 1.168.31 Dependent
@tanstack/solid-start-server 1.167.37 → 1.167.38 Dependent
@tanstack/start-client-core 1.170.28 → 1.170.29 Dependent
@tanstack/start-static-server-functions 1.167.33 → 1.167.34 Dependent
@tanstack/start-storage-context 1.167.30 → 1.167.31 Dependent
@tanstack/vue-start 1.168.47 → 1.168.48 Dependent
@tanstack/vue-start-client 1.167.33 → 1.167.34 Dependent
@tanstack/vue-start-server 1.167.37 → 1.167.38 Dependent

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 7d2000aaf5fb
  • Measured at: 2026-09-09T21:16:10.488Z
  • Baseline source: history:9c1871ccc88b
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Initial (gzip) Raw Brotli Trend
solid-router.minimal 33.4 KiB
-7 B
33.3 KiB
-3 B
96.7 KiB
0 B
30.2 KiB
-20 B
▁▁▁▁▂▃▃▃▃▃██
solid-router.full 38.3 KiB
-13 B
38.1 KiB
-13 B
111.4 KiB
0 B
34.5 KiB
+17 B
▁▁▁▁▂▃▃▃▃▃██
solid-start.minimal 46.4 KiB
0 B
46.2 KiB
-2 B
137.9 KiB
0 B
41.2 KiB
+47 B
▁▁▁▁▂▃▃▃▃▃█
solid-start.deferred-hydration 49.4 KiB
+3 B
46.3 KiB
-1 B
145.3 KiB
0 B
44.0 KiB
+32 B
▁▁▁▁▂▂▂▂▂▃██
solid-start.full 51.4 KiB
-7 B
51.3 KiB
-4 B
153.2 KiB
0 B
45.6 KiB
-27 B
▁▁▁▁▂▃▃▃▃▃██

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Sep 9, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 8f13440

@codspeed

codspeed Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 180 untouched benchmarks


Comparing codex/solid-link-early-server (8f13440) with main (9c1871c)

Open in CodSpeed

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