Skip to content

refactor(solid-router): remove unnecessary setTimeout from Match components#7584

Merged
Sheraff merged 1 commit into
mainfrom
refactor-solid-router-simplify-match-loader-resource
Jun 7, 2026
Merged

refactor(solid-router): remove unnecessary setTimeout from Match components#7584
Sheraff merged 1 commit into
mainfrom
refactor-solid-router-simplify-match-loader-resource

Conversation

@Sheraff

@Sheraff Sheraff commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Optimized route resolution performance by improving internal scheduling mechanisms. Route transitions now occur with reduced latency for better application responsiveness during navigation.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5bba3f43-2be3-4e3d-b278-28520e495803

📥 Commits

Reviewing files that changed from the base of the PR and between 5127d86 and 84e7a05.

📒 Files selected for processing (2)
  • .changeset/proud-clubs-buy.md
  • packages/solid-router/src/Match.tsx

📝 Walkthrough

Walkthrough

This PR removes unnecessary setTimeout calls from the Match component's route-state loaders in solid-router, replacing the macrotask-based delay with microtask-based scheduling via Promise.resolve() in two locations. A changeset entry documents this patch-level optimization.

Changes

Microtask Scheduling Optimization

Layer / File(s) Summary
Match component scheduling update
packages/solid-router/src/Match.tsx
The pending and redirected route-state branches in MatchInner's createResource loaders now yield via await Promise.resolve() instead of await new Promise((r) => setTimeout(r, 0)), switching from macrotask to microtask scheduling before retrieving loadPromise or calling getLoadPromise().
Changeset documentation
.changeset/proud-clubs-buy.md
Changeset entry for @tanstack/solid-router declares a patch version bump and documents the removal of unnecessary setTimeout from Match components.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A scheduler's tale, both wise and quick,
From macro to micro—a timing trick!
No more delays in the setTimeout queue,
Promise.resolve() will see us through! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ 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 accurately describes the main change: removing an unnecessary setTimeout from Match components in solid-router, which is reflected in both the changeset and the code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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 refactor-solid-router-simplify-match-loader-resource

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

@nx-cloud

nx-cloud Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 84e7a05

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

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-07 20:45:29 UTC

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

2 package(s) bumped directly, 7 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.15 → 1.170.16 Changeset
@tanstack/solid-router 1.170.15 → 1.170.16 Changeset
@tanstack/react-start 1.168.25 → 1.168.26 Dependent
@tanstack/react-start-client 1.168.13 → 1.168.14 Dependent
@tanstack/react-start-rsc 0.1.24 → 0.1.25 Dependent
@tanstack/react-start-server 1.167.19 → 1.167.20 Dependent
@tanstack/solid-start 1.168.25 → 1.168.26 Dependent
@tanstack/solid-start-client 1.168.13 → 1.168.14 Dependent
@tanstack/solid-start-server 1.167.19 → 1.167.20 Dependent

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 5cde954cf1ee
  • Measured at: 2026-06-07T20:41:48.188Z
  • Baseline source: history:5127d861aef6
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.25 KiB 0 B (0.00%) 87.11 KiB 273.59 KiB 75.96 KiB ███▂▂▂▂▂▂▁▃
react-router.full 90.98 KiB 0 B (0.00%) 90.84 KiB 285.48 KiB 79.13 KiB ███▇▇▇▇▇▇▁▁
solid-router.minimal 35.48 KiB -11 B (-0.03%) 35.36 KiB 105.86 KiB 32.03 KiB ▃▃▃▆▆▆▆▆▆▆█▁
solid-router.full 40.53 KiB -8 B (-0.02%) 40.41 KiB 121.08 KiB 36.46 KiB ███▄▄▄▄▄▄▄▅▁
vue-router.minimal 52.97 KiB 0 B (0.00%) 52.84 KiB 149.90 KiB 47.62 KiB ███▆▆▆▆▆▆▆▁
vue-router.full 58.96 KiB 0 B (0.00%) 58.83 KiB 168.66 KiB 52.87 KiB ███▁▁▁▁▁▁▁▅
react-start.minimal 101.88 KiB 0 B (0.00%) 101.75 KiB 321.90 KiB 88.14 KiB ▅▅▅▁▁▁▁▁▁▁█
react-start.deferred-hydration 102.62 KiB 0 B (0.00%) 101.77 KiB 323.28 KiB 88.85 KiB ▇▇▇▁▁▁▁▁▁▇█
react-start.full 105.27 KiB 0 B (0.00%) 105.13 KiB 331.84 KiB 91.03 KiB ▃▃▃▃▃████▁▁
react-start.rsbuild.minimal 99.59 KiB 0 B (0.00%) 99.42 KiB 316.35 KiB 85.75 KiB ▅▅▅██████▁▅
react-start.rsbuild.minimal-iife 99.99 KiB 0 B (0.00%) 99.83 KiB 317.29 KiB 86.07 KiB ▄▄▄██████▁▆
react-start.rsbuild.full 102.81 KiB 0 B (0.00%) 102.64 KiB 326.41 KiB 88.40 KiB ▄▄▄▅▅████▁▁
solid-start.minimal 49.60 KiB -8 B (-0.02%) 49.47 KiB 151.93 KiB 43.79 KiB ▁▁▁▇▇▇▇▇▇▇█▂
solid-start.deferred-hydration 52.86 KiB -5 B (-0.01%) 49.53 KiB 159.97 KiB 46.81 KiB ▁▁▁▆▆▆▆▆▆▆█▅
solid-start.full 55.40 KiB -12 B (-0.02%) 55.27 KiB 168.97 KiB 48.80 KiB ▃▃▃▁▁▇▇▇▇▇█▆
vue-start.minimal 71.02 KiB 0 B (0.00%) 70.89 KiB 207.04 KiB 62.93 KiB ▂▂▂▁▁▁▁▁▁▁█
vue-start.full 75.01 KiB 0 B (0.00%) 74.88 KiB 219.68 KiB 66.40 KiB ▂▂▂▁▁▇▇▇▇▇█

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 Jun 7, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 84e7a05

@codspeed-hq

codspeed-hq Bot commented Jun 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing refactor-solid-router-simplify-match-loader-resource (84e7a05) with main (5127d86)

Open in CodSpeed

@Sheraff Sheraff merged commit 41e7a24 into main Jun 7, 2026
20 checks passed
@Sheraff Sheraff deleted the refactor-solid-router-simplify-match-loader-resource branch June 7, 2026 21:05
@github-actions github-actions Bot mentioned this pull request Jun 7, 2026
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