Repository navigation
refactor(three): render Canvas as a Strong template - #2080
Merged
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 15, 2026 11:22
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)No changes across 120 measured values. |
6 of 7 tasks
trueadm
added a commit
that referenced
this pull request
Oct 15, 2026
* fix(octane): remove a .tsx Provider's children when they become null (#2076) * fix(octane): remove a .tsx Provider's children when they become null * fix(octane): remove CompiledContext children when they become null * fix(octane): keep CompiledContext's emptied dialect so a rolled-back transition can't duplicate its children * test(website): reload the dev /devtools warm-up once before failing Main a9dfdf7 failed the website integration suite: the dev-SSR beforeAll waited 120 s for the TanStack Devtools trigger on /devtools and skipped all 37 dev-SSR tests. The wait came with #2062 and has failed on main and two branches since, while passing locally on every cold warm-up (~3.9 s). The devtools client mounts after hydration from modules a cold dev server may only discover on that first visit, and Vite recovers with a reload a slow runner can miss. Wait 60 s, log what the first attempt saw, reload once, and fail with the page errors if the trigger still never appears. The devtools tests themselves still assert the trigger and panel on fresh loads. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(three): render Canvas as a Strong template (#2080) * fix(octane): seed nothing for a pending snapshot read instead of throwing (#2077) A server module that reads module signals installs the native read collector as it loads, and every later render in the process then collects its reads for the hydration snapshot. A render that read a pending query through snapshot(), such as an automatically streamed query, completed with a read it could not seed and threw "A completed native server read has no serializable ready value". On main 0bb503f, 28 of the 30 early-independent-intent cases throw once that collector exists, while the same page renders in a server that has loaded no such module. A snapshot renders a pending or failed state as it is, without suspending. The client resolves that state itself, or takes a stream's later delivery, so the read now contributes no seed, which is also no invented ready one. A completed value read of an unready source still throws. The signals-hydration case that pinned the throw now asserts that contract: the pending output renders with no hydration snapshot, adopts the same node, and shows the result once the query resolves. The supplemental native DOM smoke case says the same. The new streamed test loads a module-signal page, renders a pending snapshot under streamed signals, hydrates while the client is still pending, and takes the stream's result without a second fetch. Co-authored-by: Claude Opus 5.5 <[email protected]> * fix(octane): render a server element entry as its component's root, as hydrateRoot does (#2078) * fix(octane): render a server element entry as its component's root, as hydrateRoot does renderToString(<App />), and every other server renderer given an element, rendered the element as a value its root returns (renderEntryValue), which frames the component in a range of its own. hydrateRoot(container, <App />) unwraps an element whose type is a component into the root's body and props, as it does App itself, so the client root has no such range. When App returns a component, a fragment, a Suspense boundary or a template, or renders its children, the server's HTML did not match, and the root rendered on the client with a recoverable error. Each server renderer now reads its entry through renderEntry: a component element renders as that component's root, with the props its descriptor renders it with (descriptorProps, shared with ssrComponentDescriptor), and any other value as before. The two entry forms produce the same HTML, and either hydrates through either hydrateRoot form. root-entry-forms pins every pairing of renderToString and renderToReadableStream, each given App or <App />, with hydrateRoot given App or <App />, for a root that returns host JSX, a template, a component, a fragment, text, null, a Suspense boundary or its children, in dev and prod compiles: 80 of its 256 cases fail before this change. Client bundles are unchanged; the minified server runtime shrinks 234 B raw. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): read a server descriptor's children only after the scoped check A scoped component descriptor's children getter resolves deferred children, so reading it first ran them in the parent's scope before the component entered. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> * test(website): let the generated MDX hot-update test re-write and outwait a slow runner Main 8318702 failed the website integration suite: "hot-updates generated MDX twice while preserving the surrounding interactive page" timed out waiting 20 s for an edit to reach the page. It also failed on perf/runtime-size-redesign; it passes locally every time. Until 1622fa0 the /devtools warm-up flake skipped the whole dev-SSR block, which hid it. Each edit now waits in 15 s rounds, re-writing the file between rounds in case the watcher dropped a write that followed the previous one, for up to 60 s; the test's budget grows to 180 s. The assertions are unchanged: the generated text updates, the sibling counter keeps its state, and no errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): keep an emptied Provider's dialect, and refill it through a frontier (#2043) Clearing an emptied CompiledContext at commit dropped its hooks map, so the empty dialect was lost; it is now kept. A refill's reset opens the scope's frontier like a dialect flip, so its incoming body builds off-document. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Olzhas Alexandrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: domgan-oai <[email protected]>
11 of 12 tasks
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.
Summary
Converts Three's
CanvasDOM boundary to a Strong template for #2059. Uses committed effect events for callbacks and one coherent layout snapshot for event source/target/prefix, preserving async renderer setup, retained scene ownership, resizing and discrete event timing. Optshooks,root,storeandloopinto Strong; their emitted code is unchanged apart from the directive in client/server development/production modes. Includes a patch changeset and strengthens existing lifecycle tests.The actual website audit has zero diagnostics across 98 modules. Three's only remaining dependency boundary is
web/events.ts, whoseflushSyncpreserves synchronous discrete-event behavior. Canvas descriptor factories fall from 2 to 0 on the client and 5 to 0 on the server; this does not claim the whole website is descriptor-free.Validation
pnpm sync.a9dfdf7b539203c00fd7887cd07c3770c6011060; source hashes fixed across builds. Real Chrome WebGL2 on ANGLE Metal: 2 extruded meshes, 3 lights, 2 draw calls and 7,878 triangles. Verified SSR DOM adoption, mouse and emulated-touch capture/rotation plus changed rendered pixels, live reduced-motion changes, canvas identity and drawing-buffer resize, navigation disposal/context loss and fresh renderer on return. Screenshots, videos, traces and JSON receipts retained with the Codex task. No physical-device or deployed-site claim.perf-review: zero scan candidates and no unresolved findings. Canvas render/commit path adds one fixed-shape snapshot record; source/target/prefix changes can require prepaint convergence. No per-frame work, new task poster, forced layout or async hop. Configure dependencies still exclude callbacks/children; resize remains[resize], root cleanup remains mount-lifetime. No speed claim.concise-codeand independent complexity review: shipped source +84/−79 lines, no new modules/exports/options or core runtime changes. Reuses existing primitives. Retaining callback refs fails Strong; a target-only snapshot reconnects through a stale target, demonstrated by the connection regression assertion. The coherent snapshot is the smallest passing design.0c8a779fd: full CI, PR benchmarks, and Bugbot. This includes website integration, Three compatibility, all unit/React-parity/example shards, Chromium integration, lint, types and package publication. Completed CI logs record 54,091 unit tests passed (2 skipped), 105/105 website tests, 616/616 Chromium tests, and publication checks for 123 tarballs (1,187 authored TSRX files). The 51-binding packed-source matrix passed TypeScript 5.9/6/7.1 with and without Node ambient types; existing deferred binding cases remain explicit. Normal hosted dependency installation passed. The final head incorporates main’s test-only warm-up fix; the five runtime files hash-match the paired browser build.Risk / follow-ups
Local frozen install hit the configured registry's HTTP 403 for an unrelated table package. Both checkouts used the same previously installed graph with remapped workspace links and byte-identical localized stores; no firewall bypass or dependency changes. Normal hosted CI dependency installation and the complete validation suite passed.
The successful PR benchmark flags
octane-tsrx select_lots+10.0% (95% CI +8.9% to +11.0%; both displayed medians round to 0.006 ms). All 64 work counters, 93 application-bundle values and 120 public-import values are unchanged. Exact medians are 0.005783→0.006440 ms. The row fixture imports only Octane, and its compiler/runtime, benchmark inputs and dependencies are unchanged; it does not exercise Three. This timing observation is retained without causal attribution or rerunning for a different result; no runtime-speed claim is made.Main and candidate both show pre-existing offscreen/startup reduced-motion frames and Lynx teardown errors. Live preference changes settle correctly; no new request failures or unexpected errors appeared. Unrelated hero interaction can activate the deferred scene before scrolling, so this does not claim strictly scroll-only activation. The homepage uses native DOM drag events; existing Three event tests separately cover immediate discrete-event removal.
The selected binding audit was refreshed. Main advanced only in
/devtoolswarm-up test setup (1622fa02); complete tracked-tree comparison found no changes to the affected runtime/compiler/dependencies, so paired QA retains its fixed base. Router/Start boundaries and recursive Strong declarations/enforcement remain separate #2059 work.Provenance
agent-authored)Codex task · implementation host:
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes Canvas commit timing, async configure callbacks, and DOM event target rebinding—subtle lifecycle behavior with broad Three consumer impact, though covered by expanded tests.
Overview
Converts
@octanejs/threeCanvasto a Strong template (use strong, template markup with@ifforThreeBoundary) and adds the same directive tohooks,loop,root, andstorewithout changing their runtime logic.Callback and event wiring are reworked for Strong rules:
onCreated/onPointerMissedgo throughuseEffectEventinstead of render-time ref cells, so committed props stay fresh without re-running asyncconfigure. Event source, resolved target, and prefix are tracked together viauseLayoutSnapshot, drivingbindCanvasEventsand wrapperpointerEventswhen refs or props change. Canvas layout effects drop explicit dependency arrays in favor of Strong lifetime semantics while keeping async renderer setup and root teardown behavior.Tests assert latest callbacks across pending GL setup, no extra
onCreatedon callback-only updates, pointer-missed freshness, and a singleconnectwhen a ref-backed event target changes. Patch changeset for@octanejs/three.Reviewed by Cursor Bugbot for commit 0c8a779. Bugbot is set up for automated code reviews on this repo. Configure here.