Skip to content

perf(start-client-core): compact private frame decoder result keys - #7978

Merged
Sheraff merged 6 commits into
mainfrom
codex/frame-decoder-compact-result
Aug 7, 2026
Merged

perf(start-client-core): compact private frame decoder result keys#7978
Sheraff merged 6 commits into
mainfrom
codex/frame-decoder-compact-result

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Rename the private createFrameDecoder result keys from getOrCreateStream/jsonChunks to getStream/chunks.
  • Update the sole production consumer and direct decoder tests in lockstep.
  • Keep the existing two-property object shape, function/stream identities, property order, and public exports unchanged.

Bundle impact

Across the full 17-scenario matrix, all 11 Start scenarios improve by 4–12 B gzip and 24 B raw; all six router-only scenarios are byte-identical. Both renames also improve independently on react-start.minimal: getStream saves 6 B gzip / 16 B raw, and chunks saves 1 B gzip / 8 B raw. Brotli is mixed and documented in the evidence report.

Validation

  • start-client-core frame-decoder unit suite: 19 passed
  • TypeScript 5.6, 5.7, 5.8, 5.9, 6.0, and 7.0 matrices passed
  • ESLint passed with no new errors
  • React Start Vite/SSR client-RPC RawStream e2e: 6 passed
  • Full 17-scenario bundle matrix passed
  • Runtime allocation/destructure benchmark found no directional change
  • Five independent bundle, runtime, API, integration, and codegen reviews approved

Detailed artifacts and attribution are recorded in RESULT-optimization-frame-decoder-compact-result.md.

Summary by CodeRabbit

  • Refactor

    • Updated framed response handling with clearer stream and chunk naming.
    • Improved consistency in stream decoding interfaces without changing behavior.
    • Reduced the size of private frame decoder result keys.
  • Tests

    • Updated decoder coverage to use the revised stream and chunk terminology.
    • Existing test behavior and assertions remain unchanged.

@coderabbitai

coderabbitai Bot commented Aug 6, 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 Plus

Run ID: 045851a8-70eb-4673-b830-e1c3eeeb3482

📥 Commits

Reviewing files that changed from the base of the PR and between 7b62859 and b775949.

📒 Files selected for processing (1)
  • .changeset/kind-ghosts-win.md

📝 Walkthrough

Walkthrough

The frame decoder result API now exposes getStream and chunks. Server framed-response handling and decoder tests use the renamed properties. A Changeset records a patch release.

Changes

Frame decoder naming update

Layer / File(s) Summary
Rename decoder result properties
packages/start-client-core/src/client-rpc/frame-decoder.ts
FrameDecoderResult and createFrameDecoder now expose getStream and chunks.
Update response handling and tests
packages/start-client-core/src/client-rpc/serverFnFetcher.ts, packages/start-client-core/tests/frame-decoder.test.ts
Framed-response handling and decoder tests now consume the renamed properties. Aliases preserve existing local test names.
Record patch release
.changeset/kind-ghosts-win.md
The Changeset records a patch release for @tanstack/start-client-core.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 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 clearly and concisely describes the main change: compacting private frame decoder result keys.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/frame-decoder-compact-result

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 Aug 6, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit b775949

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

☁️ Nx Cloud last updated this comment at 2026-08-07 13:08:41 UTC

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟩 Patch bumps

Package Version Reason
@tanstack/start-client-core 1.170.18 → 1.170.19 Changeset
@tanstack/react-start 1.168.39 → 1.168.40 Dependent
@tanstack/react-start-client 1.168.20 → 1.168.21 Dependent
@tanstack/react-start-rsc 0.1.38 → 0.1.39 Dependent
@tanstack/react-start-server 1.167.27 → 1.167.28 Dependent
@tanstack/solid-start 1.168.38 → 1.168.39 Dependent
@tanstack/solid-start-client 1.168.20 → 1.168.21 Dependent
@tanstack/solid-start-server 1.167.27 → 1.167.28 Dependent
@tanstack/start-plugin-core 1.171.30 → 1.171.31 Dependent
@tanstack/start-server-core 1.169.22 → 1.169.23 Dependent
@tanstack/start-static-server-functions 1.167.23 → 1.167.24 Dependent
@tanstack/vue-start 1.168.37 → 1.168.38 Dependent
@tanstack/vue-start-client 1.167.23 → 1.167.24 Dependent
@tanstack/vue-start-server 1.167.27 → 1.167.28 Dependent

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 27a6a68ba55a
  • Measured at: 2026-08-07T12:19:36.068Z
  • Baseline source: history:ea3a665d81cb
  • Dashboard: bundle-size history

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

Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-start.minimal 100.39 KiB -8 B (-0.01%) 100.25 KiB 310.86 KiB 87.16 KiB ██▂▂▂▂▁▁▁▁▁▁
react-start.deferred-hydration 101.13 KiB -9 B (-0.01%) 100.28 KiB 312.23 KiB 87.87 KiB ██▂▂▂▂▁▁▁▁▁▁
react-start.full 103.75 KiB -3 B (-0.00%) 103.61 KiB 320.81 KiB 90.16 KiB ██▂▂▂▂▁▁▁▁▁▁
react-start.rsbuild.minimal 99.98 KiB -8 B (-0.01%) 99.81 KiB 315.35 KiB 86.25 KiB ▁▁████▃▃▃▄▄▄
react-start.rsbuild.minimal-iife 100.39 KiB -9 B (-0.01%) 100.22 KiB 316.28 KiB 86.60 KiB ▁▁████▃▃▃▄▄▄
react-start.rsbuild.full 103.28 KiB -11 B (-0.01%) 103.11 KiB 325.44 KiB 88.92 KiB ▁▁██▇█▃▃▃▄▄▃
solid-start.minimal 47.96 KiB -5 B (-0.01%) 47.83 KiB 140.63 KiB 42.69 KiB ██▂▂▂▂▁▁▁▁▁▁
solid-start.deferred-hydration 51.23 KiB -4 B (-0.01%) 47.89 KiB 148.67 KiB 45.66 KiB ██▂▂▂▂▁▁▁▁▁▁
solid-start.full 53.23 KiB -8 B (-0.01%) 53.11 KiB 156.35 KiB 47.32 KiB ██▂▂▂▂▁▁▁▁▁▁
vue-start.minimal 68.64 KiB -5 B (-0.01%) 68.51 KiB 193.40 KiB 61.10 KiB ██▃▃▂▂▁▁▁▁▁▁
vue-start.full 72.65 KiB -4 B (-0.01%) 72.52 KiB 205.90 KiB 64.57 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 Aug 6, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: b775949

@codspeed-hq

codspeed-hq Bot commented Aug 6, 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 error-paths not-found (vue) 319.4 KB 2,015.4 KB -84.15%
Memory mem client navigation-churn (vue) 1.2 MB 1.3 MB -5.56%
Memory mem server error-paths not-found (react) 255.6 KB 266.3 KB -4.02%
Memory mem server server-fn-churn (react) 265 KB 276.1 KB -4.02%
Memory mem client unique-location-churn (react) 665.1 KB 692.3 KB -3.92%
Memory mem server server-fn-churn (vue) 4,529.1 KB 263.2 KB ×17
Memory mem server error-paths unmatched (solid) 1,807.2 KB 436.3 KB ×4.1
Memory mem server error-paths redirect (solid) 523.7 KB 277.8 KB +88.52%
Memory mem server error-paths redirect (vue) 370 KB 294.2 KB +25.76%
Simulation client-history navigation loop (react) 39.7 ms 35.8 ms +10.95%
Simulation ssr request loop (solid) 155.4 ms 145.6 ms +6.75%

Tip

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


Comparing codex/frame-decoder-compact-result (b775949) with main (995bd97)

Open in CodSpeed

@nx-cloud nx-cloud 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.

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 has identified a possible root cause for your failed CI:

We classified this failure as an environment issue rather than a code change. The test failed with EADDRINUSE on port 32915, meaning another process had already claimed that port before the test's external server could start — unrelated to the PR's internal key renames in @tanstack/start-client-core. No port configuration or test infrastructure was modified by this PR.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


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

@Sheraff
Sheraff marked this pull request as ready for review August 7, 2026 10:00
@Sheraff
Sheraff merged commit 2fbc99f into main Aug 7, 2026
25 of 26 checks passed
@Sheraff
Sheraff deleted the codex/frame-decoder-compact-result branch August 7, 2026 13:18
@github-actions github-actions Bot mentioned this pull request Aug 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