Skip to content

refactor: adopt Strong mode in website and devtools - #2062

Merged
trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/investigate-strong-website-2059
Oct 14, 2026
Merged

trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/investigate-strong-website-2059

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Enable Strong mode for authored website modules through one configuration shared by Vite and the CLI, and convert the website and both devtools packages without changing their public behavior. This is the independent website/devtools portion of #2059; the issue remains open.

Why

The website's compiler settings lived only in Vite, so CLI analysis could not enforce the same policy. Existing render-time ref access, effect-driven derived state, unbranded HTML, and descriptor-based devtools entry points also blocked Strong compilation.

Changes

  • Add website/octane.config.ts, share its compiler options with Start, and remove unused visx dependencies.
  • Convert website components using layout snapshots, linked state, inferred effect dependencies, and producer-side HTML trust. Reuse the router's existing getAssetKeys helper to preserve head asset identity and avoid duplicating unchanged inline styles during navigation.
  • Give the devtools factory a stable compiled component and preserve its public TypeScript entry. Each tab requests the current snapshot after subscribing, including when the application is idle.
  • Add behavior regressions for head ownership, theme initialization, TOC navigation, Lynx lifecycle, Playground startup, and the live devtools panel. Run the browser suite's dev server with NODE_ENV=development so TanStack's event client is active, matching ordinary Vite development. Generated parity/corpus lockfile digests are refreshed by pnpm sync.

Validation

  • Focused website/devtools conformance, SSR, differential, and parity suites: 483 tests across 44 files; after the final fixes, devtools 26/26 and navigation 2/2 passed again.
  • Application/devtools changed-file typechecks, configured core typecheck, and devtools public TypeScript consumer check. Core runtime fixtures are exercised by their test projects rather than the source-only typecheck configuration.
  • TanStack devtools adapted/pristine type lanes, parity inventory validation, and negative controls.
  • Shared-config enforcement test and CLI Strong analysis: zero findings in authored website modules; all shipped devtools modules compile Strong.
  • Paired Chromium checks against main a1330167c42e3edaf50621bea789436cd46f19e4: actual search, benchmark, clipboard, theme/head/title, TOC, Lynx, Playground, and devtools use sites.
  • Full website integration suite: 103/103 passed locally, covering dev SSR, production hydration, SSR smoke, and accessibility; the current-head CI gate passed 104/104 including its documentation-content test.
  • pnpm sync, scoped formatting, source publication, and changeset checks.
  • Repository-wide pnpm format:check, pnpm typecheck, and pnpm test were not run locally; relevant CI results are tracked below.
  • perf-review: no scan candidates or unresolved correctness findings. Matching Vercel builds on Node 24: the complete production static JavaScript collection is 4,410,633 → 4,414,737 gzip bytes (+4,104, +0.093%), summing every emitted JS file including public runtimes; this is not a single-route initial-load measurement. Separately compiled/minified devtools modules grow by 1,762 gzip bytes (not a complete-bundle metric). No performance improvement is claimed. The profiling demo replaces its wall-clock busy wait with bounded deterministic work; Slow remains the top sampled component, with naturally different timing.
  • concise-code: Authored website/package source: 31 files, +280/-207 lines; additional regression coverage is separate. Most other changed files are generated lockfile-digest metadata. Reused router asset keys and existing hook/bridge mechanisms; rejected duplicate key generation, effect state chains, and a new snapshot cache. Independent complexity review completed.
  • Post-merge validation: 29 CLI/config tests passed after incorporating fix(cli): follow a Strong dependency's own imports in Strong reports #2061; the browser-tested website/devtools source is unchanged.
  • Follow-up validation: corrected website dependency-discovery expectations (62/62 dev/prod tests) and added plugin-recreation portal coverage (4/4 factory tests). In the real TanStack browser integration, three recreated plugins retained the exact panel DOM and selected Profiler tab with zero errors. Octane portals intentionally retain raw-function bodies and their stable child slots; no product change was needed for the review concern.
  • Mobile cancellation regression: 3/3 focused browser cases passed after making the test hold the real closing animation until the replacement page commits. Removing the stale-navigation guard only in the served browser module makes this exact case fail with the old section hash, confirming the test detects the defect. Application source is unchanged.
  • Current-head CI: all 30 checks passed on signed head 5bff03b8d3f6daac30a7709bed9c1f65f83c52ba, including all 3 required checks. CI run · paired benchmark run. Production source and the measured bundle are unchanged by the test-only follow-ups.
Component use sites checked against main
Changed surface Actual use sites Behavior checked
Header, DocsSearch, ThemeToggle, SiteHeadContent, root theme script Shared shell on all routes; search also opens from /docs/bindings Keyboard search/navigation, focus and scroll restoration, mobile menu, stored/OS theme, SVG/script execution, stable head assets
use-copy Home hero and React sample, documentation code blocks, package-install commands Exact clipboard text, feedback, repeated-copy timing and cleanup
use-title Docs, benchmarks, Playground, error pages and 404 Titles across navigation and return to home
BenchmarkExplorer / and /benchmarks Initial SSR bars, suite selection, framework toggles and normalization
CoreApiDemo and PortalEventDemo /docs/core-apis State updates, pending transitions, forms, portal placement and delegated events
OnThisPage Documentation and /benchmarks First visible indicator position, scroll/resize, clicks, page changes and A→B→A reset
Go, LynxPreview, DeviceScan, example-data Gallery/swiper on /docs/lynx; Lynx showcase on / Real previews, source highlighting, QR SVG, reload, retained hosts, resizing/fullscreen, no-IntersectionObserver fallback and metadata-only home loading
Playground /playground URL diagnostics before imports finish, compile/run/events, shared-link consent, editor identity/scroll, output selectors and AST inspection
DevtoolsDemo and both devtools packages /devtools; public TanStack host recreation fixture Live state inspection, all four tabs, profiling, Suspense/transition snapshots, close/reopen and recreated-plugin state/DOM preservation

Comparison baseline: a1330167c42e3edaf50621bea789436cd46f19e4. The subsequently merged #2061 changes CLI analysis only. Six paired shell/TOC screenshots were byte-identical; initial TOC placement also passed three independent compositor captures.

Risk / follow-ups

MDX document conversion, router/start/three Strong migration, package declarations, and descriptor-free production output remain separate work under #2059. Transitive dependency reporting was fixed separately in #2061. Passing Strong checks does not establish descriptor-free output.

Paired browser checks also reproduced existing main behavior: search retries cannot recover a browser-cached failed ESM import; theme-color metadata can reset after navigation; Lynx reloads rebuild live previews but report an undefined rejection. These are not introduced by this conversion. Browser evidence uses Playwright Chromium, not a physical device.

Provenance

  • An agent produced this diff (agent-authored)

Origin: Codex task · implementation host com-79386.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Touches devtools rendering lifecycle, document head asset identity, and broad website UI state timing; regressions would show up as lost panel state, stale devtools tabs, or hydration/head mismatches, though coverage is extensive.

Overview
This PR turns on Strong for the Octane website and devtools stack through shared website/octane.config.ts, and refactors those packages so behavior stays the same under the stricter compiler rules.

Octane & TanStack devtools move to Strong templates: the Octane plugin factory returns a stable panel component (preserving tab state across host re-renders and portal remounts), TanStack’s adapter uses keyed @for portals instead of .map, and each Octane panel tab emits refresh after subscribing so idle apps still show current snapshots. The bridge also strips OctaneDevtoolsPanel from reported trees/profiles.

TanStack Router now exports getAssetKeys; the site’s custom SiteHeadContent uses it so filtered head tags keep stable hydration keys without re-emitting unchanged styles on navigation.

Website components are converted to Strong patterns (layout snapshots, linked state, useEffectEvent, trusted HTML for inline SVG/QR/Shiki). Visx is dropped from site deps; devtools packages are included in Vite’s Octane-source transform list. Parity lockfile digests and type-parity rules for Strong devtools templates are refreshed, with expanded unit, integration, and Playwright coverage (head ownership, TOC, theme, Lynx, playground hashes, live devtools demo).

Reviewed by Cursor Bugbot for commit 5bff03b. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent refactor PR: internal restructuring, no behavior change labels Oct 14, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 14, 2026 20:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 0ad7194. Configure here.

Comment thread packages/devtools/src/plugin.tsrx Resolved
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares 74f22dd7c, the merge commit's first parent with 472483df2 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

target operation base ms head ms head/base 95% CI
octane-tsrx run 6.583 5.558 −34.2% −63.7% … −9.6% 🟢 faster
All 20 timed operations (19 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 6.583 5.558 −34.2% −63.7% … −9.6% 🟢 faster
octane-tsrx replace 14.550 11.408 −7.9% −40.3% … −1.7% ⚪ within noise
octane-tsrx add 3.133 3.467 +3.3% −2.3% … +12.1% ⚪ within noise
octane-tsrx update 0.235 0.239 −3.5% −18.6% … +8.3% ⚪ within noise
octane-tsrx select 0.013 0.012 −1.9% −5.8% … +60.3% ⚪ within noise
octane-tsrx swap 0.040 0.043 +3.9% −16.8% … +107.6% ⚪ within noise
octane-tsrx remove 0.027 0.034 −1.4% −11.6% … +8.8% ⚪ within noise
octane-tsrx runlots 41.333 52.233 +3.0% −5.4% … +63.3% ⚪ within noise
octane-tsrx select_lots 0.010 0.010 +0.6% −8.7% … +6.8% ⚪ within noise
octane-tsrx clear 54.033 53.892 −1.4% −8.8% … +4.0% ⚪ within noise
octane-jsx run 8.692 8.575 −2.6% −8.8% … +29.2% ⚪ within noise
octane-jsx replace 12.400 11.867 +5.1% −3.2% … +11.5% ⚪ within noise
octane-jsx add 5.850 7.592 +2.5% −5.4% … +10.5% ⚪ within noise
octane-jsx update 0.492 0.470 −2.3% −11.3% … +15.1% ⚪ within noise
octane-jsx select 0.226 0.223 +0.7% −20.6% … +10.2% ⚪ within noise
octane-jsx swap 0.314 0.290 −0.3% −9.6% … +4.1% ⚪ within noise
octane-jsx remove 0.293 0.281 −1.6% −4.4% … +7.2% ⚪ within noise
octane-jsx runlots 55.633 62.492 +1.1% −18.6% … +66.5% ⚪ within noise
octane-jsx select_lots 3.821 4.742 −0.1% −16.0% … +59.4% ⚪ within noise
octane-jsx clear 62.258 69.250 +4.0% −8.0% … +10.6% ⚪ within noise

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.

@trueadm
trueadm merged commit 525c4d5 into octanejs:main Oct 14, 2026
32 checks passed
trueadm added a commit that referenced this pull request Oct 15, 2026
Brings in #2047-#2051 (Strong literal stabilisation), #2054 (checked
compiled boundaries and a compiled router entry), #2055/#2057 (Strong
rejects descriptor APIs and .tsx/.jsx), #2056/#2060/#2061 (CLI Strong
reports), #2062 (Strong in the website and devtools), #2065 (no
browser-translation DOM accommodations) and Version Packages.

Conflicts, resolved so main's behaviour lands on the redesign's commit model:
- runtime.ts, #2065: setText keeps main's legacy host-only convention and the
  redesign's hydration writeText. The translator recovery is gone from
  renderText/commitText, setRenderText/commitSetText, commitHole,
  childTextHoleUpdate, recordHole and bindSignalChild; removeOnlyChildText
  still removes a committed Text at commit. resetOnlyChildHost and
  PENDING_HOST_TEXTS (which served only the host-only text writes) are deleted.
- compile.js, #2065: text updates call setRenderText(_txt, v), commit
  functions setText(_txt, v), and commitHole takes no host.
- runtime.server.ts, #2054: a compiled-only frame checks its output;
  ordinary frames keep the redesign's returned-value normalization.
- codes.json: main's 344-346 (CompiledContext, CompiledOutlet) keep their
  numbers; the redesign's codes move to 347 (server boundary error), 348
  (hydration protocol skew) and 349 (frontier rehome). Generated tables and
  CLI data are regenerated; docs/ssr.md names #348.

Adaptations:
- compiled-boundaries.test.ts: the server runs no error boundary (React's
  model), so an invalid CompiledOutlet under a catch-only @Try fails
  renderToString with the CompiledOutlet error; the client still shows the
  catch arm.
- scripts/render-writers.mjs drops resetOnlyChildHost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 15, 2026
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]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent refactor PR: internal restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants