Repository navigation
Port TanStack Start in-repo as @octanejs/tanstack-start - #168
Merged
Merged
Conversation
Removes the website's pkg.pr.new URL dependencies, which made pnpm install fail with ERR_PNPM_EXOTIC_SUBDEP whenever any new workspace package was added (pnpm 11 blockExoticSubdeps re-fires when the importer set changes). The protection stays enabled; the root cause is gone. - Vendor the seven packages that exist only on TanStack's unmerged octane PR branch (commit 753f919e) verbatim under packages/tanstack-start/vendor/* as private workspace packages KEEPING their upstream @tanstack/* names — the start compiler and route-tree generator hardcode those import specifiers. URL deps rewritten to workspace:* (vendored siblings) or exact registry versions (the eight remaining @TanStack deps verified byte-identical to their same-numbered npm releases; history's only delta is an internal microtask refactor). - Add @octanejs/tanstack-start, the first-party facade: Node-native .js re-export entries over the vendored octane-start, plus a plugin wrapper that appends the workspace-source optimizeDeps excludes (prebundled dep chunks bypass the start compiler's per-environment stripping and would execute AsyncLocalStorage in the browser). - Switch website to the facade (vite.config plugin import + workspace:* deps); routeTree.gen.ts stays byte-stable. - Regenerate docs/packages.md and the evals user-app corpus (its environment pins the lockfile hash); prettier-ignore vendor/. Gates: pnpm install green with blockExoticSubdeps active; website build + 30/30 ssr-hydration e2e (dev + production preview); full suite 11253 passed; typecheck; format:check. Once merged, examples/harbor (worktree ../octane-harbor) rebases onto this and its pnpm install unblocks. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ed SSR
Frameworks like TanStack Start merge a data stream (<script> tags
materializing as loaders settle) into the render stream by decoding the
byte stream and re-parsing it for safe insertion points, holding the
document tail in bounded text buffers. Octane's streaming engine already
emits tag-complete chunks and knows the document tail at generation time,
so the merge is now first-class:
- StreamInjectionSource { take(), subscribe(notify), done } on
StreamOptions (octane/server). Injected HTML is emitted verbatim, in
push order, each drain as its own transport chunk strictly BETWEEN
renderer chunks — never before the shell. A single serialized write
chain gives out-of-band notify drains and wave-loop writes a total
order; every hook no-ops when the option is absent (measured flat on
the streaming-ssr bench).
- Document renders hold the closing tail (`</body>` + interleaved block
markers + `</html>`, detected once by suffix) and write it last;
injected chunks and streamed Suspense segments land inside <body>. The
stream closes only when rendering is complete AND `done` settles, so
late data scripts are never dropped. `done` rejection and abort route
through the existing degraded terminal path, still emitting the tail.
- Docs: docs/ssr.md section; design + remaining phases in
docs/ssr-stream-injection-plan.md (styles-in-head, auto-doctype, and
moving @octanejs/tanstack-start's vendored stream path onto this API —
the upstream transform currently buffers every post-shell chunk into a
64KiB-capped tail for document renders, so adopting this also restores
out-of-order streaming).
Contract tests: packages/octane/tests/streaming-ssr-injection.test.ts
(8 cases, red before the implementation), green in both the octane and
octane-prod projects; full octane suites 7814 passed; typecheck + format.
Co-Authored-By: Claude Fable 5 <[email protected]>
The global `dist` gitignore silently excluded the vendored packages' dist directories from the port commit — local runs passed off the untracked files, but fresh clones (Vercel, CI) resolved into missing modules. Exempt vendor dist from the ignore and commit the 548 prebuilt files. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
…duction) Conflict: regenerated the evals user-app corpus manifest against the merged lockfile. Co-Authored-By: Claude Fable 5 <[email protected]>
Completes the remaining phases of docs/ssr-stream-injection-plan.md so the website streams through octane's native injection API instead of TanStack's byte-level HTML re-parse: - octane document mode (engages only when a StreamOptions.injection source is present and the shell renders a document): the response leads with <!DOCTYPE html>; renderer-owned leading scoped styles and the hoisted-head buffer fold inside the authored <head> instead of preceding <html>; the held </body></html> tail closes the stream. StreamInjectionSource gains an optional renderComplete() hook — fired exactly once when rendering finishes (success or degraded abort/error) so sources can finalize asynchronous serialization and then settle done. - vendored @tanstack/octane-router renderRouterToStream rewritten onto the native API: serverSsr wires take/subscribe/done/renderComplete (barrier lifts at octane's post-shell subscribe; upstream's serialization timeout preserved), deleting transformStreamWithRouter, relocateLeadingOctaneStylesToHead, and prependDoctype from the stream path. This also restores out-of-order suspense streaming for document renders — the upstream transform buffered every post-shell chunk into a 64KiB-capped tail until both streams ended. - @octanejs/tanstack-start plugin pre-declares the octane-router registry subpaths (router-core/isServer, scroll-restoration-script) so request-time discovery can't trigger vite's mid-session optimize reload under a hydrating page. Evidence: streaming-ssr-injection contract tests extended to 12 cases (both compile modes, incl. doctype/head-folding/renderComplete pins and the no-injection byte-shape control); website ssr-hydration e2e 32/32 on a cold vite cache (dev + production preview) on the native path; full suite 11298 passed (one unrelated deferred-hydration flake under load, 42/42 in isolation); typecheck, format, changeset checks green; streaming-ssr bench flat for the no-injection path. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit acf0cce. Configure here.
…nifest Co-Authored-By: Claude Fable 5 <[email protected]>
The workspace validator requires a status.json for every @octanejs/*-named package it classifies as a framework binding — but status.json also feeds the public bindings catalog (website-mcp globs every one; bindings.json must list exactly the non-private bindings), which a private, unpublished facade must stay out of. The Start facade is a metaframework integration, not a library binding: give it the same SPECIAL_ROLES classification as @octanejs/vite-plugin and regenerate docs/packages.md. Verified the entire CI lint-job step list locally (format, rules, changesets, test markers, parity gaps, react-parity, package inventory, binding parity, bindings-status, lucide, octane build + dist verification) plus the publishable-package pack canaries. Co-Authored-By: Claude Fable 5 <[email protected]>
Bugbot review finding on #168: the abort/error and done-rejection paths wrote the degraded terminal chunk (recovery markers + held document tail) without a final take(), dropping HTML the source queued during its renderComplete finalization — the success path drains, so degraded closes silently lost the serialization remainder. Both fatal paths now unsubscribe FIRST (a notify fired by the finalization would otherwise drain the queue into a chained write that post-abort can only reject), then salvage a direct take() into the terminal write ahead of the recovery markers and the held tail. Two regression tests with verified pre-fix failures pin the salvage on each path. Co-Authored-By: Claude Fable 5 <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
website/package.jsonpinned@tanstack/octane-start(and@tanstack/octane-router) to pkg.pr.new preview URLs whose own dependencies are also URL-resolved. pnpm 11'sblockExoticSubdepsskips deps already in the lockfile but re-fires whenever the workspace importer set changes — so adding any new workspace package failedpnpm installwithERR_PNPM_EXOTIC_SUBDEP(this is what parkedexamples/harbor). This PR removes every URL dependency while keeping the supply-chain protection enabled — and then moves the whole website stream path onto octane's native SSR injection API (#169 + this PR's document mode), deleting TanStack's byte-level HTML re-parse for octane.What
1. TanStack Start ported in-repo
753f919e):octane-router,octane-start,octane-start-client,octane-start-server,router-generator,router-plugin,start-plugin-core— underpackages/tanstack-start/vendor/*as private workspace packages keeping their upstream@tanstack/*names (the start compiler and route-tree generator hardcode those specifiers). URL deps rewritten toworkspace:*/ exact registry versions — the remaining 8@tanstack/*deps were diff-proved byte-identical to their same-numbered npm releases. Prebuilt vendordist/trees are committed via a.gitignoreexemption (the globaldistignore silently dropped them at first — the Vercel deploy failure).@octanejs/tanstack-start— the first-party facade the website consumes: Node-native.jsre-export entries plus a plugin wrapper owning the workspace-sourceoptimizeDepshandling: excludes for the start runtime chain (prebundled chunks bypass the start compiler's per-environment stripping →AsyncLocalStoragein the browser) and includes for octane-router's registry subpaths (request-time discovery of raw-source imports otherwise triggers vite's mid-session optimize full page reload under a hydrating page).@octanejs/tanstack-start/plugin/vite; all deps becomeworkspace:*;routeTree.gen.tsstays byte-stable. Nostatus.jsondeliberately — the repo contract ties it to publishable bindings (README carries the status).2. Streaming document mode in octane + Start on the native injection path
StreamOptions.injectionsource is present and the shell renders a document): the response leads with<!DOCTYPE html>; renderer-owned leading scoped styles and the hoisted-head buffer fold inside the authored<head>; the held</body></html>tail closes the stream only once rendering is complete and the source'sdonesettles.StreamInjectionSourcegains an optionalrenderComplete()hook (fired exactly once — success or degraded abort/error path) so sources can finalize asynchronous serialization. Withoutinjection, streamed output is byte-identical (pinned by a control test, flat on the streaming-ssr bench).renderRouterToStreamrewritten onto the native API:serverSsrwirestake/subscribe/done/renderComplete(script barrier lifts at octane's post-shell subscribe; upstream's serialization timeout preserved), deletingtransformStreamWithRouter,relocateLeadingOctaneStylesToHead, andprependDoctypefrom the stream path. This also restores out-of-order suspense streaming for document renders — the upstream transform entered tail-holding on octane's first chunk and buffered every subsequent chunk into a 64 KiB-capped tail until both streams ended.Testing
pnpm installgreen withblockExoticSubdepsactive; zeropkg.pr.newreferences in any package.json or the lockfile.packages/octane/tests/streaming-ssr-injection.test.ts: 12 contract cases × both compile modes (ordering/chunk boundaries, done-gated close, doctype, head folding, renderComplete on success and abort, no-injection byte-shape control).ssr-hydration.e2e.test.ts: 32/32 on a cold vite cache — real dev server + productionoctane-preview, every route, headless Chromium, on the native injection path.typecheck,format:check,changeset:check,bindings:status:checkgreen. streaming-ssr bench flat for the no-injection path (no regression; no improvement claimed).Notes
examples/harborrebases onto it and itspnpm installunblocks.renderRouterToStreamis the natural artifact to upstream to TanStack (their transform currently disables out-of-order streaming for octane document renders and caps segment volume at 64 KiB).vendor/can be deleted and the facade repointed at registry deps (seepackages/tanstack-start/README.md).🤖 Generated with Claude Code
Note
Medium Risk
Touches core SSR streaming and closes the response only after injection
done, but the no-injection path stays byte-identical and the change is covered by contract and website e2e tests.Overview
Adds streaming SSR document mode in
octanewhenStreamOptions.injectionis set and the shell is a full document: the stream starts with<!DOCTYPE html>, leading scoped styles and the hoisted-head buffer move into the authored<head>, and the closing</body></html>tail is held until rendering finishes and the injection source’sdonesettles.StreamInjectionSourcegains optionalrenderComplete()(once per render, including abort/error) so sources can flush async serialization; degraded closes salvage queued injection HTML after unsubscribe.Introduces
@octanejs/tanstack-start, vendoring the seven PR-only@tanstack/octane-*packages (with committeddist/and gitignore/prettier exceptions) and a Vite plugin wrapper that keeps the Start runtime chain source-served viaoptimizeDepsexcludes/includes. VendoredrenderRouterToStreammerges router data through nativeinjectioninstead oftransformStreamWithRouter/ doctype / style-relocation transforms, restoring out-of-order Suspense chunks for document SSR.Docs, changeset, and eval lockfile hashes are updated; contract tests cover document mode and failure salvage.
Reviewed by Cursor Bugbot for commit 894345b. Bugbot is set up for automated code reviews on this repo. Configure here.